« first day (881 days earlier)      last day (4053 days later) » 

2:00 PM
Rage too. Avarage can't be good
 
number don't lie! ;-)
 
@sehe Not sure I get it. The stats you linked imply that PHP is used about twice as much
 
i need a different job
 
which obviously can be interpreted as not a significant difference as it is the same order of magnitude
 
@NikiC No, the stats PeeHaa linked to. Then he mentions he gets the numbers from langpop. I proceed to paste the screenshot of that same site showing that PHP and C++ are probably within a 2% margin at the very very top end of the popularity spectrum. Q.E.D.
 
2:01 PM
@tereško You and me both buddy.
 
@sehe I think you missed the fact that it's a logarithmic chart ;)
Look at the numbers in the boxes, not the positions
 
@sehe Aaaah I see what you are saying. They are both popular, but PHP people are smarter. Well no argument there :P
:)
 
As I said, it's the same order of magnitude (that's why they are close in the log chart), but they are not really close. In a non-log chart PHP would be very far away from C++ ;)
 
@Bracketworks my days are spent in frustration about the idiocy of other =/
 
@NikiC Good point. Hardly of big influence though. Also, now that I've given the axis a first look (hehe) are they counting questions asked on SO?! What a figure :)
@NikiC Same if you increase the plot density :)
 
2:05 PM
@sehe In any case, nothing to get defensive over ;) I don't think the data is really meaningful and in any case it's not a comparison that makes any sense ;9
 
xD wzzamapoint
 
Can I get a little love?
0
A: Something wrong with the quotations

DaveRandomFirst, an important note on file uploads in general: The type and name keys are unsafe to use. This is because they are defined by the client, and they are a potential mechanism for injecting malicious code into your site. Consider what would happen if I set the file name to ../../../../../index....

 
@tereško tis the life of every developer: sphotos-f.ak.fbcdn.net/hphotos-ak-snc7/…
 
I wouldn't normally ask but the other two answers don't answer the question and are verging on dangerous
 
I'm going to start PascalCasing my methods.
 
2:14 PM
@smassey that's how is see my coworkers =/
 
@DaveRandom answer appreciated :)
 
@Bracketworks camelCase ftw. Y U NO LISTEN?????
 
@DaveRandom You suck.
 
@DaveRandom BecauseOfTooMuchCSharp
 
underscores or gtfo my codebase: under_scores
 
2:15 PM
@webarto You suck.
 
my life sucks
 
s/l/w/
 
@DaveRandom No, *You* suck.
 
@webarto @DaveRandom you BOTH suck
 
At lest I can typ
 
2:16 PM
@tereško That's a lie.
:D
 
@DaveRandom I'm still working on that
 
$☂ = 1; // i have 1 umbrella
 
@Bracketworks That's awesome.
 
19
Q: Exotic names for methods, constants, variables and fields - Bug or Feature?

Gordonafter some confusion in the comments to Is it safe to have 1 letter class names in PHP, e.g A, B, C I thought I make into a question. According to the PHP manual, a valid class name should match against [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*. But apparently, this is not enforced, nor does i...

Thanks to unkie Gord.
If you were a wholesale umbrella company, I don't think you could get much more semantic than that.
 
$count = isset($_GET["count"]) ? $_GET["count"] : $db->query("select count(*) from icon_info")->fetch()[0];
 
2:21 PM
Meanwhile in Hungary.
 
@webarto you have not seen the codebase , that i have to work with , or the code that my coworkers produce
the "new code" that gets added to the codebase is almost universally worse then the existing one
 
28
A: Exotic names for methods, constants, variables and fields - Bug or Feature?

ArtefactoThis question starts to mention class names in the title, but then goes on to an example that includes exotic names for methods, constants, variables, and fields. There are actually different rules for these. Let's start with the case insensitive ones. Case-insensitive identifiers (class and fun...

why can't the whole lang just be case-sensitive
 
every single one of them thinks that copy-paste is the primary development method
 
@tereško It'd be so easy to write a script to fix their code for them.
 
:\ ... well, they suck, not your file life.
 
2:25 PM
@tereško it actually is the primary development method given the average php dev
 
a.) Try to reason with them b.) Try to reason with them c.) Quit
 
@webarto As you do...
 
hmm
what could be a possible reason for PHP being frikking slow (windows box) in case of un-catched exceptions?
 
one of them was tasked to lend me a hand: the task was to style the output, that user sees in the popup
 
by slow I mean a magnitude of 10
 
2:28 PM
what i got in result was a span in table in span in div in table in span layout, with inline css
 
@Ocramius Are you sure that is the problem? Are you fiddling with database?
@tereško if it works, that it's good :D try to talk to them, seriously.
 
@Bracketworks uncle to unkie ... gordon to gord ? :P
 
@webarto I'm pretty sure that's it. Either PHP is dumping a debug backtrace somewhere or I don't really know :)
hmm... maybe xdebug
 
@Ocramius XDebug it :)
 
@webarto just fyi, <?php throw new \Exception(); takes 100ms O_o
 
2:31 PM
@webarto oh , and it was all generated all over the controller class by concatenating html
 
@tereško you don't understand ART
 
Only thing that was slow for me is if you try to connect to localhost versus 127.0.0.1 (for db).
 
lolwut ?
 
@tereško :(
 
> $paymentsTimetableArr = preg_split('/;/', $paymentsTimetable);
.. for fak sake
 
2:32 PM
lol
 
@webarto do you know reason ??.. it happed with me too
 
i would explode() if i saw that
 
@smassey Yeah I would explode too of somebody in my team did that
 
@webarto That should be faster on *nix, and it shouldn't be meaningfully slower on Win unless your DNS is set up really badly
 
@NullPointer I'm not sure but I think --skip-networking solves it, I have changed it to 127.0.0.1 and it's all good.
 
2:35 PM
ewwwww
 
2000 called.
 
$info = new Info($helptext);`
 
function createRow4MoreInfo($name, $value) {
    $html = '';

    $html .=  '<tr id="">';
    if ($value == '') {
        $html .=  '<td style="" colspan="2" class="form-field-data">';
    } else {
        $html .=  '<th style="width: 30%;text-align:left;" id="" class="form-field-title">'. $name .':</th>';
    $html .=  '<td style="float:left" class="form-field-data">';
    }
    $html .=  '<div id="">';
    $html .=  '<div class="ceil-row">';
    $html .=  '<div class="form-ceil-wrapper-title">';
thisis from what's left of my "cotnroller"
 
Bahahahahaaa, yeah, time to jet pack away
 
2:37 PM
@tereško I'm surprised there is no global.
 
@tereško and now please refactor the HTML code of the whole site ;)
 
@DaveRandom It's on default installation, not sure what I have to setup.
 
@hakre that's basically what i was told to do .. withing 2 hours or less
 
@tereško well, fire-up the output buffer and do post-processing.
 
@webarto Nothing then. The only reason it would get screwed is if you deleted localhost from the hosts file, or I suppose if your HDD was dying and really slow to access
 
2:39 PM
treat for you all
 
enjoy.
 
@hakre lolz, let's add a few more layers of indirection and be sure to make simpler for the next flock of features
 
@smassey well you can also use it for static analysis before refactoring ;)
but anyway, here, HTML has been used obviously as a method to pass data as objects into the view layer.
Therefore hooking into these objects seems fair for refactoring ;)
 
[15:39:36.362] GET dev.net [HTTP/1.1 200 OK 2364ms]
[15:40:15.804] GET dev.net [HTTP/1.1 200 OK 312ms]
@DaveRandom with localhost and 127.0.0.1
 
2:42 PM
apparently i need to tone my comments down
// hi there XSS. What're you doing here? It'd be a shame if $_GET["offset"] was linked to an interesting page about fishing.
 
> localhost name resolution is handled within DNS itself.
@DaveRandom from hosts, dunno what that means.
 
@webarto What version of windows?
There's pretty obviously something failing to happen that has a 2 second timeout.
What DB driver are you using as well, MySQLi?
 
@DaveRandom Windows 7 (and 8), related, maybe: serverfault.com/questions/4689/…
 
@webarto thankyou :)
 
@DaveRandom PDO MySQL or mysql_*, same thing.
 
2:47 PM
@webarto Have a look in php.ini and see if mysql.default_socket has a value, and in fact generally just comment it out and see what happens
@webarto and pdo_mysql.default_socket as well
 
@DaveRandom disabled for mysql, pdo, mysqli, and negative, Sir.
 
@webarto Wait, I know what the problem is. Either enable MySQL to run on IPv6 (you probably want ::ffff:127.0.0.1 as the bind address, possibly :: if you allow connections from remote machines) or disable IPv6 on that Windows instance if you are not using it. I recommend option 1.
Yay multiping
When you query localhost, it goes IPv6 first and then falls back to IPv4. But MySQL is only listening on IPv4 loopback, so you have to wait 1 timeout cycle before the fallback kicks in.
 
@DaveRandom whoa very informative ..:P
 
3:03 PM
4
A: Connecting to MySQL from PHP is extremely slow

pQdCan it be that your mysql tries to run rev-dns query whenever you connect? try adding to my.cnf, section mysqld: skip-name-resolve.

Correct answer is in fact not correct.
 
@webarto Dave comment is rather more appropriate
 
bind-address=::1
@DaveRandom
You should answer it ;)
 
@webarto That's IPv6 only.
 
i wish i have rep to dv those answer
 
OK people so ive just come from Javascript room, basically i really needed to use websockets (socket.io) and ive tried to understand how to use node.js but if i use it it officially has completely F**cked my project up so i have been told about Ratchet (socketo.me), so with this do i use wamp, ratchet & socet.io for cross browser websockets or is there more to it?
 
3:06 PM
I would set it to ::ffff:127.0.0.1 if I were you, that allows both IPv4 and IPv6
 
It's still slow that way, because:
	127.0.0.1       localhost
	::1             localhost
 
PLB
I hope that one day every IE developer will be burned in the hell. :)
 
@webarto and after removing 2nd line ?
 
@NullPointer yeah, it's fast, but IPv4 (only) is used.
 
@PLB and IE users?
 
PLB
3:10 PM
@iroegbu The are already in hell.
 
@PLB lol
 
@DaveRandom I've set ::ffff:127.0.0.1 and added it to hosts file, it's slow... reminder, both lines in hosts are commented out by default.
 
hahaha
and Firefox users?
 
@webarto No you wouldn't want to modify the hosts file, just change the mysql bind address
So did ::1 make it work fast or not?
 
@DaveRandom Yes it did. ::ffff:127.0.0.1 is fast if you have only 127.0.0.1 localhost in hosts, which is all wtf to me.
mmmmmultiping
What a brilliant solution :D
Not.
 
3:15 PM
@webarto You can get rid of all the localhost stuff from the hosts file. Turns out Win7 has built the resolution of the localhost into the name resolver since Win7 (never discovered this until today), so putting entries for it in the hosts file will only confuse it
@webarto lolwut, where's that?
14
A: Windows 7: "localhost name resolution is handled within DNS itself". Why?

Sean EarpI checked with a developer on the Windows team, and the actual answer is much more innocuous than the other answers to this post :) At some point in the future, as the world transitions from IPV4 to IPV6, IPV4 will be eventually be disabled/uninstalled by companies that want to simplfy network m...

 
@webarto that is what i did :P
 
I wish I could just go back to win7
 
@DaveRandom I removed entries and removed bind-address, and it's slow by default when localhost. Just saying. I just used IP, and that's it. /cc @NullPointer :P
 
@webarto Not the best solution, but he's the only one that touched on the root cause
 
This is the solution :P
 
3:23 PM
Whats the best solution for websockets? i cant use nodejs that means i have to change server hosting...ect
 
200LOC controller :( bleh
 
I just realized that this is from Godfather :D /cc @ircmaxell
 
@DaveRandom I'm interested in real solution :) If you figure out one, make question/answer. It will get you rep for sure :P
 
3:25 PM
@webarto babab boo bi bo bo bi ba bo bi ba ba bo ba bi :P
 
Yeah, everyone can speak Italian :D
 
@webarto do you understand that :P
no offense(kidding) Italian languages is looks like derived from b**bs :D
 
OK THEN THANKS !
 
@Connor NO WORRIES MA BRIZZLE
Eurgh, I hate coding for IE9. It's CRAP. If they ever go webkit, like Opera, it'd be amazing
 
@webarto what?
 
3:35 PM
@webarto webarto.com ?
 
@ircmaxell funny talk in Family Guy is a scene from The Godfather. Italy + Godfather = ircmaxell, etc.
@NullPointer f* it :P
 
@webarto huh? O_o
 
Hello guys :)
 
@Ocramius What?
 
@webarto wat?
 
3:37 PM
@webarto f* it(it=== webarto) grrr i am not g*y :P:P get anyone else :P
 
LOL
 
eih
 
Ok, recess.
 
@HamZaDzCyberDeV hiya
 
0
A: PHP to EasyPHP MySQL server 1 second connection

DaveRandomIf you are having this problem and using a version of Windows from before Windows 7, this is not the answer to your problem. Why is this happening? The cause of this problem is IPv4 vs IPv6. When you use a host name instead of an IP address, the MySQL client first runs an AAAA (IPv6) host look...

 
3:41 PM
It's beautiful, Dave [edit: comma added]
 
Anonymous
hmm...
 
So i cant use websockets unless i have dedicated hosting according to hostgator is that right?
 
@Connor vps ?
and dot try hostgrator its like godaddy
 
I need some clarification, when i was answering this question http://stackoverflow.com/a/15436169/1401975 i got it to work, but i was wondering how to escape the characters from the results. I checked out: http://stackoverflow.com/questions/3512471/non-capturing-group
basicaly i have: preg_match_all('/(?:#)[0-9][0-9](?:#)/', '#32##54##33#', $arr);
print_r($arr)
 
@Connor is there such thing as non-dedicated hosting? :O
 
3:42 PM
Results: Array
(
[0] => Array
(
[0] => #32#
[1] => #54#
[2] => #33#
)

)
but i want it:
Array
(
[0] => Array
(
[0] => 32
[1] => 54
[2] => 33
)

)
 
-1 no jquery whatsoever! — PeeHaa 1 min ago
lol
 
@NullPointer how to match but not save "#" from the results ?
 
@HamZaDzCyberDeV you can remove # by str_replace ?
 
Anonymous
@Ocramius yes. Shared Hosting, its uptime guarantee is 99% ;p
 
@NullPointer yep i know, but i was wondering if we can ignore it within regex ?
 
user1125394
3:49 PM
needs simple code to send shit over a tcp socket localhost:6777
 
user1125394
should not be hard
 
@PHPNooB I heard legends of users dissatisfied by their 100k EUR expenses in application development used to workaround 10 EUR monthly VPS costs.
 
@Gordon deleted an answer?
0
A: Group array keys into number ranges, possible?

ircmaxellThis sounds like a perfect case of map-reduce. Map step: turn each age into one of the 4 ranges. Reduce step: turn the range into a result array of ranges. Let's try it out: $map = function($age) { if ($age <= 18) { return '<= 18'; } elseif ($age <= 26) { ret...

 
@NullPointer thx, i got it now, i had to enclose [0-9][0-9] in parenthesis:
preg_match_all('/(?:#)[0-9][0-9](?:#)/', '#32##54##33#', $arr); ->>>
preg_match_all('/(?:#)([0-9][0-9])(?:#)/', '#32##54##33#', $arr);
 
3:55 PM
@HamZaDzCyberDeV yw but i haven't done anything :D
 
@ircmaxell i solved that with regex :)
 
Hey @ircmaxell, just wondering why you chose to use if / else instead of switch in that?
 
@Jimbo what would the switch look like?
 
@ircmaxell switch($age) { case <=18: return '<=18'; break; etc...
Educate me :P
 
that won't do what you think it will do ;-)
 
3:57 PM
@Jimbo switch only uses '==', what you're doing is like case == <= 18
 
Oh cool, didn't realise that, just did a quick search for an explanation, I see :)
 
how do I omit numerical values from mysql query result
SELECT DISTINCT foo FROM table
 
Why does this work then? codepad.viper-7.com/wIP7mi
 
where foo isn't numerical
 
4:02 PM
@iroegbu maybe this will help ? stackoverflow.com/questions/75704/…
 
@Jimbo what is second class honor's degree or is there class in honor's degree ?
 
@NullPointer Okay so, a 'first' is the top, then you have a two one (2:1) [upper second class honours], then two two (2:2) [lower second class honours], then a third
 
@Jimbo No, don't abuse switch statements
 
@ircmaxell :D
 
4:05 PM
switch is ok in this-> codepad.viper-7.com/6dChUJ ??
 
@NullPointer lol
 
@NullPointer works, and ok are very different things ;-)
 
user1125394
small question: I've a running tcp server, the code codepad.viper-7.com/LbNEnq is working, but on chrome the page is never ending loading
 
user1125394
the result is printed, but the page never end loading
 
@Ocramius do you know, was QueryBuilder::expr()->innerJoin(... removed?
 
4:08 PM
damn i just posted damn foolish switch program
 
/me has a new rant target
God damnit what were those drupal people thinking :(
 
I believe it was something along the lines of $$$
 
@NullPointer haha
 
Or possibly "Kerching!"
 
@PeeHaa I do that rant daily
 
user1125394
4:10 PM
codepad.viper-7.com/LbNEnq, it says Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\index.php on line 48
 
user1125394
o right, my server does'nt send anything back
 
@crl We can't see the code because it is being executed and never ending. Pastebin please.
Also you seem to have broken viper7. Well done.
 
LOL, I thought it was down just for me
 
mee too
just waiting to see :P
 
@ircmaxell :-(
 
4:14 PM
@HamZaDzCyberDeV thanks SELECT DISTINCT foo FROM table WHERE foo NOT REGEXP '^-?[0-9]+$'
 
night guys ..:)
 
Good night @NullPointer
 
@iroegbu That will be sloooooooooow.
 
improve please
 
@crl I can see your code now, socket_read() is a blocking function, you need to base your loop on socket_select() in order to be able to break out of it when there is no data left to read on the connection, or set the socket to non-blocking mode, probably not recommended for what you are doing.
 
4:24 PM
@DaveRandom I should just check for string?
 
@iroegbu Well, that depends. What is the data being stored in the column? Why do you have this mix of strings and numerics in one column, and what is the purpose of this query?
 
@ircmaxell :] Thanks.
 
(What I'm getting at is: your database design may be, and probably is, wrong if you have this requirement)
 
@DaveRandom I didn't build the database... marital status is the string, I just realized that some of the values are numerics
 
@LeviMorrison I won't ask any deeper details ;-)
 
4:27 PM
I want to fetch strings and let the person that messed up the db to fix it
 
@ircmaxell yes, because it was quite similar to the highest voted. its funny that yours got upvotes when the array_walk doesnt btw. its basically the same thing
 
@iroegbu Oh OK, so this is a pretty temporary thing anyway?
 
@DaveRandom it sure is... I don't really know the correct values (marital status) woulda changed em
 
4:29 PM
Hey @webarto, I haven't done any unit testing before but I took a look at "Codeception" you forked on Github - and it looks really cool / interesting / simple! What do you think of it?
 
was here // Example - $qb->expr()->innerJoin('u.Group', 'g', Expr\Join::WITH,
 
@Gordon one uses references and single iteration. The other doesn't and does double iteration...
to each their own
 
@iroegbu OK, well since you seem to be looking for integers and MySQL will automatically convert ints and strings in comparisons WHERE foo != CAST(foo AS SIGNED) might be a little better, but probably not in any meaningful way unless the table is huge, and if it's a temp fix it probably doesn't matter. It might be worth just doing a quick benchmark of the execution time though, since it would only take a few minutes.
 
@Jimbo Hey, I use PHPUnit for unit testing, and Codeception for acceptance test, it's good for me because I can easily modify the code to get what I precisely want, and it uses Symfony components etc. I don't use PHAR, I extracted it, so I can modify the code. I used PHP webserver for acceptance tests so e.g. Travis CI integration is really simple and fast.
I have tried other acceptance software for PHP so I can't say anything more.
 
@iroegbu I have to say though, it sounds like marital status should be an int column and an FK to a marital statuses table, it would make it nice and easy/quick when indexed
 
4:34 PM
@webarto Ahh okay, I wasn't even aware of anything called an "acceptance test" tbh - seeing as I haven't even touched unit testing yet. Thanks :)
 
@Eugene patch plz I'd say
@ircmaxell can you tag your randomlib or isn't it stable yet?
 
it's not stable yet
 
@DaveRandom that's what I woulda done... but that can't be the case... it's not my db to change :(
 
@ircmaxell why not use array_count_values for the reduce?
 
@hakre because I want map-reduce.
 
@ircmaxell on an array that is in memory in total? maybe better use the array func from within core.
 
I've come to the conclusion that W3C must be behind w3schools. That's how hard they fail at standards...
@hakre point wasn't that it's more efficient or whatever. Just the conceptual approach (making the problem into a map-reduce problem...
 
@ircmaxell yes, map reduce is nice.
 
@ircmaxell gotcha
 

« first day (881 days earlier)      last day (4053 days later) »