« first day (818 days earlier)      last day (4129 days later) » 

10:00 PM
@CAM Strange code style you have there
I was about to yell Y U NO LIEK BRACES, but then I noticed your CS :)
 
CAM
@PeeHaa thanks...? refactor it and tell me what would be better?
 
user652649
bye good night kids
 
either if () { same line
 
CAM
hmm
 
or
 
CAM
10:02 PM
usually I do
 
@PeeHaa IMHO, useless (in this case).
 
if ()
{
 
Blegh
 
@webarto readability goes down as soon as you start doing that
 
@PeeHaa I'm saying braces or no braces in this case is the same (to me), actually they are just in distracting, braces on new line or after condition is OK.
 
10:03 PM
I think i am gonna go and play some more FTL
and make a tea
 
btw nothing wrong with having those levels in peice of code as far as I can tell. Although it could be refactored to move the ifs to a separate method. Depends on what actually is happening in that method @CAM
@webarto pfeeew :)
 
Anyone else ever have this wonderful little message pop up?
Ran out of opcode space!
You should probably consider writing this huge script into a file!
 
That elseif tree is annoying me a little but my brain is too fried to work out a better way
@Bracketworks What, from PHP?
 
@DaveRandom Yes sir, indeed sir.
 
@DaveRandom switch ftw! :)
 
10:07 PM
Sounds like basically memory_limit (or similar) has run out during compilation. How big is the source code file?
 
@Bracketworks Fun thing is when you try to search on it on lxr.php.net it fails :P
 
@PeeHaa For that you'd have to switch (TRUE) which, while occasionally useful, rarely results in cleaner code than an elseif tree
 
Looks like I may have found a pretty significant bug in closures...
 
10:08 PM
@DaveRandom I disagree
 
@ircmaxell Care to share?
 
Hahaha, the comment preceding
/* we messed up */
 
@Bracketworks /* we messed up */
lol
 
CAM
better??
 
@ircmaxell Does PHPPHP have an opcode limit? :)
 
10:10 PM
@PeeHaa no
 
I should say, I'm doing something stupid; massive preg_replace to generate PHP code, followed by an eval()
 
@webarto wasn't a bug in closures. It was a bug in xdebug
 
@PeeHaa Well sir, I may not agree with what you say but I'll fight to the death for your right to say it.
Seriously though, why?
 
couldn't get the caller right...
 
No production merit, but interesting that this bug cropped up all the same.
 
10:10 PM
fixed it now
 
@Bracketworks that error serves you right :D
 
@Bracketworks WAT
 
1 min ago, by Bracketworks
No production merit, but interesting that this bug cropped up all the same.
;)
You're right it serves me right, but I think for an altogether different reason; that being, hacking out a parser with preg_* in lieu of recursive descent.
 
@DaveRandom I find this easier on the eye: gist.github.com/e70e6f6da2862eaca4c6
BTW wtf happened to gists and why does the indentation defaults to two???
 
what does most users use to write php? I use notepad++ and I wonder what others use
 
10:21 PM
@Happyninja editplus yay
 
CAM
@Happyninja Sublime Text 2
@PeeHaa is this better ? gist.github.com/4514379
 
@CAM Not my code style, but yes much better imho.
 
CAM
@PeeHaa now i am intrigued... what does your style look like ?
 
Evening
Does anyone know good weather API, that preferably supports localization and free of course?
 
@CAM It looks a lot like PSR-2 (scary I know)
 
CAM
10:28 PM
@PeeHaa am I missing white space?
 
is there a easy way to simulate multiple users logon?
 
@PeeHaa I guess, the double indent from the switch -> case -> code bugs me (read: my eyes) a little though
 
Guys I keep getting db error anybody can help me?
 
10:36 PM
post the log sir
 
CAM
@PeeHaa Did not see that
 
@Extelliqent
 
CAM
looks way clean
 
0
Q: Php Mysql Database query error

ExtelliqentBasically, from the form that I made I send customer_name and with this code I pull it and save it to the database along with the time. This code keeps giving me this error: Fatal error: Using $this when not in object context in /home/projectu/public_html/sub/save.php on line 19 Note: 19th ...

Fatal error: Call to a member function query() on a non-object in /home/projectu/public_html/sub/save.php on line 21
 
Darn, I am not up to that level yet. I cannot help you.
 
10:38 PM
@PeeHaa +1, although I can't be doing with opening braces on the next line
 
okay thanks for the try @pangamma
 
@Jocelyn ^^ see? It's happening again.
 
@DaveRandom Yes...it was to be expected. I wonder how many questions about mysql_* we will get everyday when mysql_* functions are officially removed from PHP
 
@Jocelyn We really need to get some seriously good conversion cannonicals set up for the 5.5 release
 
@DaveRandom That what makes it better readable for my eyes :)
 
10:46 PM
is there a easy way to simulate multiple users logon? I would like to monitor server load while different user logon trough the script i'm coding so I can tell if it will be okay or not... but I don't want to simulate a ddos, just asynchronous logon that goes heavier.
 
@PeeHaa I dunno, I like to try and sub the assertions out to sub methods to keep the conditions of the if short and keep the indentation "right". Honestly though, it's one of my least favourite things, readability wise. Neither option is great. But I tend to only use switch(true) when I want to do clever things with unterminated cases, which is definitely not great for readability.
@Happyninja You can (kind of) do it with ab - at least I know you can POST data and set request headers, so you should be able to simulate a simple logon. Honestly though, I'd be surprised if it will tell you anything useful - are you really expecting 10000 people to all attempt to login at the exact same instant?
 
@PeeHaa I can proudly say, that I don't follow PSR-2
Not everything at least
 
@Eugene It's not that I follow PSR-2. It's more like they got it from me :)
 
@DaveRandom I except at least 2,000
 
@PeeHaa )
 
10:55 PM
should I worry?
 
@DaveRandom I agree with the notion about separate methods
 
@Happyninja I would say probably no. 2000 simultaneous request is nothing for a modern web server, unless you PHP code is really terrible and has some ridiculous inefficiency in it somewhere.
 
@PeeHaa "Pieter Hordijk does not follow PSR-2, PSR-2 follows Pieter Hordijk."
 
Not sure that's a good thing though ;)
 
@DaveRandom I'm pretty new to all of this. Is there a way I could monitor my code performance to ensure I do my best?
 
11:05 PM
@NikiC So I compiled PHP with AVX and SSE instructions with icc today. It optimizes portions of the string and regex extensions. Significant improvements gains. I'm thinking about going through and seeing if some of the loops it couldn't vectorize could be rewritten without modifying behavior and have it vectorizable.
If I actually had such patches, would you review them?
Also, a lot of ext/hash and sqlite3 were vectorized as well.
 
@Happyninja It's difficult to monitor performance until you put it under load. Tools like ab are designed to make a very large number of requests in quick succession, that's definitely a good place to start (especially since it's relatively simple as well)
 
@DaveRandom may I ask you a link cause I searched on Google and I'm confused!
 
Programming and system administration is just like investing in stocks. Hope the charts go up, and every now and then scramble when there's a crash.
 
11:21 PM
@DaveRandom thanks you, I appreciate it
 
wondering How does symfony2 Response object know what was past to it. A simple string or html?
return new Response('Hello world!'); or return new Response('<html><body>Hello '.$name.'!</body></html>');
 
What'd be the correct way to match a word boundary or a non word character using RegExr? The following isn't turning out how I'd expect
\W+|\b
 
@Nile full expr, example input and expected result please
 
@DaveRandom That's my full expression. Input: hellos hello goodbye goodbyes. It should match the following:
1) "s" and space following  the "s" in the first word "hellos",
2) the space following "hello"
3) the space following "goodbye"
4) "s" after goodbyes
 
11:30 PM
I believe you got wrong what a word boundary is
 
OK so what are you expecting the matches array to look like?
\b is zero width, it won't match a character, only the boundary between two characters.
@Nile Can you explain what you actually want to do with that string? What do you want to extract from it?
(might be an idea to give some real sample data)
 
@DaveRandom Yeah, give me a quick second.
Basically I'm splitting a paragraph into its words using preg_split. In essence, I'd like "hello, how are you? Hellos and goodbyes. Hello's and goodbye's." to return the following array
array("hello", "how", "are", "you", "hello", "and", "goodbye", "hello", "goodbye");
Notice it ignores spaces, punctuation and plurals (which could be tricky but don't worry about apostrophe s, just "s" for now)
 
Slightly off topic pedantry: isthatpluralizedwithanapostrophe.com
 
lol Dave
 
@Nile OK let me have a think about that for a minute, presumably your sample output is missing an and element just before the end?
 
11:39 PM
I'm not sure?
@DaveRandom Would this work?
[s\W+]+
 
@Nile This'd break on any word with an s in it, not just at the end.
 
ffs,
User removes auto increment field, wonders why function that returns auto increment value starts failing.
 
I'm dying
 
I realize that it's silly to close an answered question, but COME ON
 
11:42 PM
lol, that guy is an actual
 
genius™
 
It's a shame there isn't a tag on the main site we can add to the question.
 
@DaveRandom Thanks -- I also want to exclude the s on plurals, not just possessives. i.e., possessives would get me possessive
 
Apple® Genius™
 
@Nile That's pretty hard to do and get it right every time, there are some words that actually end in an s.
Amusingly, the first one that comes to mind is anus
I'm not sure what that says about me...
 
11:48 PM
@DaveRandom Yeah, I know. I'm not worried about words like that. Though I think this is too complicated for RegEx. I'll do it the old way. Thanks a lot though!
 
Regex is not an appropriate tool for natural language matching just like it's not an appropriate tool for parsing HTML - for the exact same reasons. Natural language is even more irregular and unpredictable than HTML.
 
user1125394
@DaveRandom offtopic you should like erlang "Note: both 'behavior' and 'behaviour' are accepted by the Erlang compiler."
 
That's what I'm talking about! Sticking it to the man!
@igorw That would be iGenius™ surely?
I'm still waiting for those iSuckBalls™ to come out
 
Guys, I was talking to my teacher for web development class at uni and I remember that he said "we don't use SEO anymore". What does that mean?
I might have misheard it
 
SEO doesn't exist. It's a myth.
 
11:55 PM
Dec 15 '12 at 21:02, by DaveRandom
Everyone join hands while we sing the "SEO is a myth and a waste of time" song
3
 
Then what do you use now?
 
HTML5.
 
Nothing.
 
The replacement is called "writing code properly"
 
Sane markup and class names?
Google has some amazing magic now.
 
11:56 PM
right
 
I wrote a forum. Completely custom, from the ground up.
 
@Charles like web master tools?
 
It was able to determine last activity dates and reply counts.
It was just pure and utter magic.
 
@Charles Holy crap, that really is magic
 
@TemporaryNickName Well yes, but no. In general.
 
11:57 PM
that's really funny
 
90% of SEO is getting Google to find you.
 
in other word seo is a way to add-value money on a site
 
@Charles Do you listen to yourself when you speak? :-P
 
The rest is getting links from popular sites relevant to the topic your site is about.
 
11:58 PM
@DaveRandom I am a living, breathing contradiction.
That or I'm a malfunctioning markov chain.
Same diff.
 
Another contradiction
And a weird expression that I never understood
 

« first day (818 days earlier)      last day (4129 days later) »