« first day (633 days earlier)      last day (4315 days later) » 

5:00 PM
master?
 
Yeah. You set a cookie to change into the prototype.
 
@LeviMorrison ah right:
> // Ugh, cookie handling.
:-)
 
@ircmaxell btw, you also have to add an upgrading notice
 
upgrading notice?
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 81 bytes)
docs take a lot of ram
 
@ircmaxell UPGRADING notice ;)
 
5:09 PM
in docs? for a new function (not changed behavior)?
 
in the src
there is an UPGRADING file ^^
Which outlines the major changes for the version
 
fair enough
 
Added functions are listed in there
 
feeling like a repwhore by answering silly questions
 
@NikiC done
 
5:15 PM
any can give me beginners tutorial of kohana framwork
 
no
kohana is terrible, don't use it
 
Why
 
I would love to hear how terrible it is :)
 
@webarto are you a developer of it?
 
nope, just user
 
5:16 PM
ah
primarily because it doesn't follow the pattern it purports to (HMVC)
 
Any one have the tutorials for beginers ??
 
and hash_pbkdf2 is documented on php.net...
 
busy little bees
@OmeidHerat: I quite like EasyPHP (re: stackoverflow.com/a/11418284/599857)
If you put EasyPHP in, I'll give you an upvote :D
 
> Should have clarified, that this system is going to be used internally. So need a robust solution that will work in production.
 
5:22 PM
@David moar :)
 
Because robust solutions aren't needed externally ?
 
@webarto my apologies, doing some other things
 
no prob
 
based on codeigniter...
 
@Naveed just try to make something, why do you need tutorials?
@David yes and no, v2 was, but v3 is something different, it looks like ZF too...
 
5:24 PM
HAHa :D cauz iwnt to make boil egg
 
@webarto ah...maybe i just haven't seen it in a while. regardless...non-namespaced which is annoying(@Naveed wtf)
 
you should learn to write proper English first :) @Naveed
 
though admittedly they'll likely fix that
 
Simple Dude I am a beginner in this
 
you want to make boil egg?
 
5:25 PM
yeah, problem is that development is slow @David
 
is it?
what do you use it for anyway
 
how boil egg devlement always slows eh friend?
 
what's the updated docs URL again? I thought it was off master, but aparently not
 
Ok friends why ru asking complex questions and showing attitude ?Iam jst asking for tutorials ..
 
Oooh, I went to my.php.net and set alpha=yes. php.net = error 500
 
5:31 PM
@Naveed Because thats what google and php.net/manual are for?
Rep slowly creeping from my edits today, wooh.
 
-2
A: Converting Special Characters with PHP

Omeid HeratUse the str_replace by first removing the " "(space), then "-" and then replacing the & with dash. $title = "Identity & Wayfinding"; $title = strtolower(str_replace(array(" ","-","&"),array("","","-"),$title)); echo $title; // returns: identity-wayfinding Example@viper7.

 
@David I mean't development of Kohana, but I guess anyone who doesn't contribute and complains can STFU... development with Kohana is fast :)
 
@webarto I'm not complaining because I don't use it. I don't use it because I don't like it.
@webarto if you do then that's your choice :D
 
@David I'm complaining :) that wasn't addressed to you
 
5:34 PM
haha oh okay
 
@webarto well, I wrote what he wanted. he wants a slug but your example is SEF url.
I am not that bad at coding, I just answer before reading the quesiton :P
 
ah I see now ... yeah me too TL;DR
 
user895378
I didn't realize you could get rep from edits until I already had too much rep to get rep from edits.
 
you can get rep from edits?
 
5:43 PM
@David 2 points, I suppose.
 
user895378
@David only if you have < 1000 rep
 
oh...well too late
 
user895378
I think it's 1000, anyway
 
w3schools has a for-pay certification program
i'm going to be sick
 
@David I thought about taking the certifications a long time ago.
I so glad I didn't.
 
5:49 PM
I think you'd probably be less likely to get a job if you held a W3schools certification.
 
OH NO!
w3school's PHP quiz asks the following:
15.	What is the correct way to connect to a MySQL database?

	connect_mysql("localhost");
	mysql_connect("localhost");
	dbopen("localhost");
	mysql_open("localhost");
 
user895378
lol
 
user895378
AWESOME.
 
none of the above.
 
Result:

20 of 20
100%

Perfect!!!

Time Spent
2:38
 
user895378
5:52 PM
Oh, now I gotta try it.
 
And most of that time was spent here posting that atrocity question #15
lol
 
lemme go try
what's the link?
 
you should buy certificate from w3schools for $95
 
@LeviMorrison I got a 20/20 in 1:12
but i cheated since you already showed me the hardest question
 
5:55 PM
@David lol
 
user895378
wow I topped out at 1:43 :)
 
user895378
That quiz is totally useless
 
@LeviMorrison none of the above
:-P
 
user895378
How is this a PHP question:
 
user895378
> When using the POST method, variables are displayed in the URL (true/false)
 
5:57 PM
I was wondering that myself
 
@LeviMorrison Neither of them?
 
:( 18/20
 
user895378
And this one is none of the above:
 
user895378
> 11. What is the correct way to include the file "time.inc" ?
 
user895378
because require is a language construct, not a function that needs parentheses.
 
5:59 PM
Their XML has a flat-out wrong questin:
10. XML preserves white spaces

You answered: False
Wrong Answer!
 
1. What does PHP stand for?

You answered: Personal Hypertext Processor
Wrong Answer!

19. In PHP, the die() and exit() functions do the exact same thing.

You answered: False
Wrong Answer!
 
You didn't say WHERE the whitespacs were.
 
user895378
And it's not the correct way, because include is just as valid. It's the most correct of the available options.
 
I feel just awful.
And dirty, I feel dirty
I thought that die() and exit() were different (I thought die allowed a message and exit didn't?)
 
user895378
I had to use my address bar to get to it because I have google hide all search results from w3schools
 
6:00 PM
@EventHorizon void exit ([ string $status ] )
 
ah, I've never looked at the exit function
 
die — Equivalent to exit
it's a language construct
 
whats the point of having 2?
not sure I get it
 
 You should rarely use the die and exit language constructs

    True
That could be a good question.
 
user895378
And if you want to be able to test your code you shouldn't really ever use them ...
 
6:03 PM
Uh oh, now we need to build a PHP quiz for certification on Github
 
user895378
The PHP Chat certification quiz.
 
testing? who wants testing?
 
How much $wood can a $woodchuck $chuck if a $woodchuck could $chuck $wood?

42
 
user895378
Well, the answer to every multiple choice question is obviously "None of the above" (unless 42 is listed as an available choice).
 
6:05 PM
Congratulations you are ready for certification!
Wait we should tell the person the same thing w3schools does "You can be proud of yourself!"
or "Perfect!!"
or "Mega Kill!"
 
@ircmaxell So they both call the same function (from what it looks like), if thats the case why do 2 exist?
backwards compatibility?
 
Look at the comments on die. Yuck.
 
yes, BC..
@LeviMorrison you have access to docs, you can delete the notes...
 
The examples on exit are just as bad.
I need to figure out better examples first.
Or rather example #1 is bad.
 
6:19 PM
I've delete everything from my DB (mysql), but now I'm inserting data again, and the id's (autoincrement) don't start from 0. Is there anyway to reset it? I'm using workbench as a client.
 
@rogcg To my knowledge you have to drop the table.
Disclaimer: I am not a MySQL expert.
 
In SQLSRV you can TRUNCATE the table
 
user895378
@rogcg I think if you use a TRUNCATE statement on the table it resets the autoincrement key ...
 
@LeviMorrison I've dropped the entire DB and recreated it
 
not sure if that applies to MySQL though
 
6:21 PM
isnt there any way via workbench
?
 
user895378
It's called an SQL statement.
 
user895378
No GUI needed.
 
makes code much much cleaner lol @LeviMorrison
 
@webarto SO bad. Just use exceptions . . .
 
6:22 PM
@rdlowrey Was just gonna post that
 
@rdlowrey I wont need delete my table right?
 
user895378
> When fast truncation is used, it resets any AUTO_INCREMENT counter to zero. From MySQL 5.0.13 on, the AUTO_INCREMENT counter is reset to zero by TRUNCATE TABLE, regardless of whether there is a foreign key constraint.
 
ohh it empties it
 
user895378
@rogcg TRUNCATE will empty the data in the table.
 
got it
it's empty anyways
LOL
I have few data, basically
 
6:23 PM
then it wont hurt much
 
user895378
For the record, the star-bar at the right isn't just for you ... it's for everyone.
 
user895378
I doubt my quoted passage from the MySQL manual is of interest to many people ...
 
I was gonna say, thats not really relevant to PHP
ty
 
user895378
thanks :)
 
That was me guys. Practicing my new room owner skills.
 
user895378
6:25 PM
nice
 
@LeviMorrison gj hf
 
ALTER TABLE table AUTO_INCREMENT = 0
will continue if you have rows with AI already
 
user895378
@LeviMorrison Expect to get super-pinged on the reg to unstar things now.
 
@rdlowrey lol
 
play with the auto_increment_increment setting :-P
a good way to troll fellow developers when they run apps on servers...
 
6:27 PM
@ircmaxell Why is my table counting by pi?
 
thanks for your help.
 
auto_increment_increment=100000000 <-- after 40 insertions it will overflow int, and hence throw errors
 
yo dawg, we heard you like auto increments, so we auto incremented your auto increment
 
wrings hands together menacingly
 
By the way, this comment by Leigh was money.
 
6:31 PM
quite
 
user895378
I'm about to write some SQLite data mappers. Are there any "gotchyas" with SQLite if I'm familiar with other RDMBS? Or should I basically be able to wing it and google for help as needed?
 
@rdlowrey Most probably
 
@Neal hahaha, that is awesome
 
@CharlesSprayberry lol
 
6:41 PM
RT @dhemery: Your inner critic doesn't know any more about the thing it's criticizing than you do.
 
What's the PCRE regex to match all newlines? $\R^ something or other...
 
when you say all newlines?
 
I have a question regarding a small script that I made. I am interested in learning the most effective way of doing what I already made, since I am a student. Would this be best asked on stackoverflow or programmers? Or neither? :P
 
define effective
 
Well, the least amount of code and scales well
 
6:47 PM
 
Ah, yes. I knew I saw something like that. Thank you!
 
@ircmaxell I've seen \r?\n, but I recall having seen a (I'm assuming) platform agnostic short-hand of \R, I think..
 
@Bracketworks Yes, it is \R ;)
Though by default it may match more newlines than you'd like ;)
I typically use it with BSR_ANYCRLF
 
Is there function call overhead in PHP?
This answer: stackoverflow.com/a/11419887/561731 seems to imply that there is...
 
@NikiC Just found this stackoverflow.com/a/7836692/409279 :)
Thanks!
 
user895378
6:52 PM
@Neal There is function overhead for calling is_null, but doing === null is going to result in a malloc. is_null is more semantic IMHO and the whole discussion is an unnecessary micro-optimization in the first place.
 
Heh, I really have problems staying concentrated :(
 
@Bracketworks (\r|\n|\r\n) will catch anything
 
@rdlowrey thought so. I usually do is_null, hardly ever use === null
 
@rdlowrey === null will cause a malloc?
 
@Neal yes
@rdlowrey no it won't do a malloc
 
6:53 PM
@ircmaxell for example?
 
9
Q: Why are PHP function calls *so* expensive?

NikiCA function call in PHP is expensive. Here is a small benchmark to test it: // create test string $string = str_repeat('a', 1000); $maxChars = 500; // with function call $start = microtime(true); for ($i = 0; $i < RUNS; ++$i) { strlen($string) <= $maxChars; } echo 'with function call...

 
user895378
Hmm, I must be imagining things.
 
@Neal every function call has overhead (stack push, etc)
 
@ircmaxell are you sure? :P
 
@NikiC well, it will do a malloc, but not at runtime, only at compile time
 
6:55 PM
@ircmaxell doesnt it also depend on using pointers vs references etc?
 
@ircmaxell Thanks :)
 
@ircmaxell For some definitions of "anything"
 
@NikiC of course
@Neal how much overhead depends on a lot of factors. but there is always overhead
 
E.g. it won't match NEL, LS and PS (all of which are matched by \R)
 
6:56 PM
@ircmaxell even for something minor like is_null?
 
codepad.org/RxfNpxNX is_null() vs === null (benchmarking from the hip)
 
yes
 
codepad says === is slower but my box says the opposite
 
@MikeB codepad.viper-7.com/4PMDZj more realistic results
 
6:58 PM
you need to write the benchmark cleaner
 
:)
 
only put the tested item inside the loop, never anything else. And always record end time right after the loop. Otherwise you can get aborations from output buffering or the like
 
good points
 
And make sure to always run at least >1s, otherwise kernel scheduling will mess up the results
 
@MikeB And deciding which one to use based on which one is faster is always going to be a
 
7:01 PM
@GordonM no it's not
 
Though I'll favour the === version for strictness.
 
user895378
@ using equivalency vs. is_null for a gain of half a second over 10,000,000 iterations.
 
I won't. is_null is more semantically correct
 
@ircmaxell wtf?
 
7:02 PM
@NikiC There's no equivalent to 'warming up the java virtual machine' for PHP right?
 
@NikiC for is_null() vs === null it will be a micro-optimization, but deciding based on which is faster isn't always a micro-optimization
@MikeB actually there is
due to memory allocation
 
@Leigh wth
 
@ircmaxell How do you handle that? Is that only for larger/longer profiling?
 
realistically, you can't. I would design the benchmark to try to eliminate as much allocation as possible from the loop
 
7:04 PM
@ircmaxell If you're doing it for performance reasons then what else would it be?
 
which is one reason I try not to use branches in the loop...
@GordonM a valid optimization. If it's a bottleneck, deciding which to use is not a micro-optimization
 
@ircmaxell If it's a bottleneck then it's a valid micro-optimization. But it's still a micro-optimization. :)
 
no, no micro-optimization is ever valid
 
It's still shaving a milisecond or two off a comparison. Of course if you're doing that comparison in a loop that executes a billion times it's still a win.
@ircmaxell Oh, I guess we're going off different definitions of the term then.
To me a microoptimization is doing something to gain a minimal amount of performance, it can be a valid strategy on occasion but it usually isn't, especially if the effort expended on the micro-op is disproportionate.
 
Does anyone use PHP's stream wrapper in production?
 
7:08 PM
@Bracketworks Not I
 
user895378
@Bracketworks I use the awesome vfsStream library for mocking the filesystem in unit tests ... but that's it for me.
 
@Bracketworks I have in the past
 
@rdlowrey That's pretty nifty
 
user895378
@Bracketworks It's really great. It also helps ensure sure you keep your code loosely coupled from file paths. If you can't specify a custom vfs:// file path to test code that interacts with the filesystem you need to refactor the code.
 
@rdlowrey 2nd vfsStream
 
7:14 PM
I had built a wrapper to abstract filesystem access. That way, all code was written against the local filesystem. But for some environments, it would use FTW to interact instead, so it was transparent to the rest of the code
 
user895378
For the record, it's really annoying that I have to type ".exit" and not "exit" to get out of the sqlite command shell.
 
@ircmaxell That's essentially what I tinkered with it in the past for. I also used it as a means to unify config access from return [...] PHP files, allowing descent into the returned (or cached) arrays via /
 
Hmmm I am not sure why I am being downvoted here:
0
A: How to return SQL grouped results with additional property `id`?

NealSo add id, you already selected it: while ($row = mysql_fetch_array($query)) { $group = $row['group']; $name = $row['name']; $id = $row['id']; if (isset($name)) { echo $id . '/' . $group . ': ' . $name . "\n"; } else { echo $id . '/' . $group . "\n"; }...

 
include("proto://path/to/file/map/to/value");
                 \__________/\___________/
                     file        offset
or something like that
 
@Bracketworks not sure I get that
 
7:20 PM
@NikiC equates to $foo = include('path/to/file.php')['map']['to']['value'];
(I don't think you can dereference from include(), but you get the idea)
 
@Bracketworks why in god's name would you do that?
 
@NikiC Toy code
 
@Bracketworks That is indeed a valid reason :D
That's why I'm really proud of this: gist.github.com/3026099
(btw, if you manage to understand the full functionality from looking at the code you're a real genius...)
 
@NikiC However, it was actually quite interesting, unifying the containing array access into the path. I saw some merit in it (although, I'd change the URI structure to use a different delimiter post-filepath)
@NikiC It's µsic to my ears :)
 
What I'm especially proud of is that you can use µ()->this[-1]() to call the previous implementation of the current function :)
 
7:26 PM
@NikiC Neat; I was with you right up until $backtrace = debug_backtrace();, then the tab closed on it's own.
;)
 
yeah, that's exactly what the debug_backtrace part does :P
 
Can someone please help me yell at this OP? stackoverflow.com/q/11420200/561731
...
 
@MikeB lol more like rollback wars lol
 
7:36 PM
@BoltClock -- are you here?
 
what a tosspot
 
:)))))
 
lmao neal
hilarious
 
@Binyamin: This isn't how Stack Overflow works. You can't revise your question with improvements other users have made, and expect additional refinements. Stack Overflow is not Github. — Robert Harvey 3 mins ago
What's the difference between that and creating a new question?
 
7:44 PM
Creating a new, specific question?
 
for every iteration
That's how I read Robert's comment. Please add a new question for every iteration
 
I think the problem was that OP's question... wasn't really a question, but more a stream of concious from his IDE.
 
aye, especially since the first line of his question is
> In future I might want to add more properties.
 
Had he asked a question, he would have probably received a well constructed, elaborate response, and the subsequent iteration would have been in fact, a new question altogether anyway.
 
@MikeB lol
And its gone :-D
 
7:47 PM
Does he get his rep back?
 
Yea...
flag as duplicate.
FLAG
 
No way, Robert wants this
 
any one has ever made anything that inserts dates from the same day as a numer in multiple months, like : every 10th for the next X months (x being a number) ?
 
Headin out, for the love of Poseidon if things get good on that new one screenshot it for me
 
haha
@GiovanniDiToro Run a daily cron checking to see if it falls within that criteria
 
7:50 PM
@NikiC oO
 
I wanned to make something like a form that you input the number of months and the first date
then it just inserts the rest of the dates , same day for the othe "number" months
 
Those new Cintiqs are drool-worthy
 
@MikeB How do I use the cron to store data on the DB? do you know any manuals online that can help me?
 

« first day (633 days earlier)      last day (4315 days later) »