« first day (1770 days earlier)      last day (3182 days later) » 

9:01 PM
@bwoebi that would work... I was thinking $val===$match && $counter++;
 
@Orangepill That's not a good interview question
 
@Orangepill that's a conditional statement…
 
Conditional statement is too vague
 
short circuiting is an implicit condition
 
@NikiC I guess "without using an if" would be better
 
9:02 PM
foreach ($arr as $v) { $occ[$v]++; } ?
 
@Orangepill That would be better, yes
 
@NikiC I'm interpreting it as "branch"
 
@bwoebi loop
 
@NikiC yeah, bit a problem in PHP… not sure if foreach is a branch or not ^^
 
@bwoebi foreach is not a conditional statement.
 
9:04 PM
It isn't?
 
@kelunik well… it conditionally runs the loop or not, depending on whether the array is empty…
 
@NikiC good luck with counting array values without conditional / loops.
 
if (count($o) > 0) { doStuff(); }
foreach ($o as $_) { doStuff(); break; }
foreach as a conditional!
 
@kelunik Perfectly possible ... in C
 
yeah I imagine every looping structure has an implicit conditional
 
9:08 PM
@NikiC playing around with jump addresses?
 
label: doStuff(); goto label;
 
@kelunik Or even in PHP. Here would be my idea:
 
@DanLugg got me
that's pretty unconditional
 
@NikiC exception based looping? :-D
 
can you ask questions in here?
 
9:09 PM
$actions = [function() use(&$actions, &$i) { /* recurse */ }, function() { /* abort */ }];
$i = 0;
$actions[$i === count($array)]();
 
Well you just asked one, so
 
@user2713996 You can?
 
Basically something like that. Don't want to flesh it out right now
 
@NikiC Used a built-in function.
 
I think you should be able to do that without any explicit branches
 
9:10 PM
@NikiC though… that's counting an array. (internal function call: count())
 
@kelunik Doesn't matter. Use isset instead
$actions[!isset($array[$i])]()
 
I didn't think about isset
 
or empty
 
$actions = [
    function() use($array, &$actions, &$i) {
        // Do something with $array[$i]
        $actions[!isset($array[++$i])]()
    },
    function() { /* abort */ }
];
$i = 0;
$actions[!isset($array[$i])]();
@Orangepill I just decided that this is a good interview question after all ... if that's the kind of solution you want to see :P
 
/ steps into the room, first link clicked is a rebecca
 
9:17 PM
@marcio In other words: All is as it should be
 
seems so
 
@nikic you know you are the reason there are so many dumb people in the world... there are only so many brain cells to go around.
 
@NikiC I used to survive more than 1 minute in the mine field. That's embarrassing.
@NikiC while you're still here, 2 questions: 1) is it possible to extend the PHPParser on the fly? 2) Will v2 use the TOKEN_PARSE flag?
 
@Orangepill sometimes I really wonder whether it's the number of brain cells… We really ought to understand quantum realms sometime… Then we'll probably know that answer too.
 
@bwoebi yeah it's not number of brain cells... it's how are thoughts are organized I think. There are smart people out there with only half a brain.
 
9:26 PM
Well, I thought that I should maybe ask this on a server related chat, but I can't access it yet, plus it's PHP related probably (my deduction, so it probably is wrong). I installed Laravel and did not touch it at all on Thursday, but my server keeps eating more and more RAM by each passing hour. Is this Laravel related? Or is something leaking? s13.postimg.org/qls8d25hz/graph.png
 
cmon another one 3v4l.org/1bYJv :v
 
@NikiC 3v4l.org/RNsuS#v700rc1 missing semicolon btw. I can't see something that counts anything.
 
@deadsource probably not laravel unless you are running it's packaged web server then it might be.
 
@marcio awesome, no?
 
@bwoebi that's art
 
9:28 PM
@kelunik It doesn't. Just how you do the loop. Add $count += $array[$i] === $value; in place of the dummy comment, then it'll count something
@marcio no and no. I support older versions, so can't use TOKEN_PARSE
 
@NikiC And uses a conditional statement again. ^^
 
@kelunik What conditional statement?
A comparison isn't a conditional statement
 
@Orangepill Apart from Laravel, I installed Composer. But it shouldn't be running in the background (I might be wrong). Also Nginx or MariaDB could be at fault, but I installed them on Wednesday and then the RAM was stable. Hmm...
 
(At least assuming that by conditional statement we mean conditional branch)
 
@NikiC I meant to use the TOKEN_PARSE flag after a "if PHP7" check, not in a BC break way.
 
9:31 PM
@marcio I mean, I support parsing older versions
The current parser can't deal with all older code
 
Ok, It's no big deal anyway.
 
@NikiC yeah, people always think that… don't know why ^^
 
Do you know some fast HTML dom parser?
 
@bwoebi Because most people don't write a lot assembly ^^
That's where the compare and branch separation becomes clear
 
@NikiC Don't remember if I only realized it back then when seeing that you always have first test/cmp and then the j*(mps)
 
9:41 PM
Is it faster to use curl_* in php or exec("curl") or is there any faster solution?
 
How can I remove a while 1 day (24 hours) from this date() string? 2015-08-20 22:41:13
 
what is "Multiplication" in mysql ?
 
@Saja How to do it? or..
 
@LiamHardy UPDATE users SET reputation = reputation + (new.value*7) WHERE id = old.owner;
what should I put instead of * ??
 
(new.value)*7
@Sahad
Sajad *
 
9:44 PM
like this: reputation + (new.value)*7 ?
 
@Sajad yes.
 
@LiamHardy tnx
 
No problem, any time.
 
Last year, I worked on Attendance Management of Employees.
Where, the logs are stored in MySQL Database.
And I forgot the name of the Machine. Do you guys know, which is the machine for Attendance managenemetn and logs are stored in database.
just wondering, if anyone worked on it.. or can name best machine.
well, i found it on google too..
 
@LiamHardy correct, worked correctly.
 
9:47 PM
I am about to give up...I've been trying all day
 
@benlevywebdesign never give up!
 
@LiamHardy care to help?
 
Stupid debugger… When running in the debugger I get SIGPIPE all the time… when I don't, it works -.-
 
@benlevywebdesign whats the problem?
 
@LiamHardy see room.
you can see everything I've tried
 
Abe
10:04 PM
Just had an email from a lady saying her church advised her that her husband was on Ashley Madison via a public search service. WTF?!
 
@troyhunt several, sadly. A radio station cold-called a lady and told her on the air.
 
Abe
omg
 
i just downloaded Ashly Madiion data..
haha
i think, its a Inside job
 
10:37 PM
These things depending on signals are a nightmare to debug with a debugger…
 
Anonymous
10:48 PM
do we have an opposite idiom for "a pat on the back"?
 
11:05 PM
tridiv.com Tridiv is a web-based editor for creating 3D shapes in CSS.
3
 
Anonymous
nice
 
@rlemon lol thanks obama
@Orangepill hahahahah
 
@PeeHaa I've heard you love too help… Well… I need some idiot who tests phpdbg with all weird inputs and reports bugs to me.
 
@bwoebi Considering I gave myself 2 weeks off I am all yours
Also note that Windows will also be involved in the process so yes prepare yourself for weird stuff
 
@PeeHaa Anatol took care of most Windows things… but yeah, might be possible you find something ^^
just don't try pcntl_fork()'ing, that might go bad ^^
 
11:19 PM
:-)\
 
and it has one known bug… need to revisit $this-> watchpoints …
 
I'll be AFK now and I'll ping you tomorrow or the day after that depending on the day I decide to wake up
later @bwoebi
 
@PeeHaa and I'm going to bed…^^ yeah, being in UTC+1 now… but that doesn't make me less tired xD
 
Anonymous
/ me writes an error-mailer script, uploads it to my site ... 6 hours later ... 36 new errors in my inbox
 
Anonymous
no good deed goes unpunished
 
11:29 PM
@PeeHaa are you drunk yet?
I was told you'd be drunk
 
11:43 PM
He's probably sobered up by now...
 

« first day (1770 days earlier)      last day (3182 days later) »