« first day (927 days earlier)      last day (4024 days later) » 

9:00 PM
But okay, I might buy the "scale" argument, if you are talking seriously big scale. In that case you probably also have people qualified to implement stuff like this :)
 
@NikiC at least one per user
 
@Eugene you're welcome
 
@ircmaxell then store the sessions on some ramdisk (If it is not critical that the session may be lost)
 
hello everybuddy
 
@crypticツ you've forgotten your next entry yesterday :-(
 
9:13 PM
@bwoebi uh huh
and how does that help you when you have literally hundreds of front-end servers?
 
@ircmaxell Then there exists something like memcache; I don't know...
 
different levels
 
But tell me, how many sites do ever reach this scale?
maybe thousand?
 
Doesn't mean it isn't a valid technique
 
@ircmaxell It is a valid technique, depending on the scale.
 
9:16 PM
not really
depending on requirements
 
both, yes.
 
@hakre your bounty is inactive, time to refresh it ?
 
@kaᵠ no it's not inactive. 16 hour grace period.
 
Not directly related, but: Just because something is a requirement, it does not imply that it is a valid technique :)
6
 
ah it's not visible any longer, right?
I will place it then now then. let me check.
@NikiC but if the requirement is also declared as a valid technique per the requirement, this turns out to become schizophrenic at least a little :)
 
9:19 PM
insta-star
 
@bwoebi The Daily @cryptic in solidarity is not printing in support of the strike. Which could be years! =oP
 
:)
 
Another question: how can I access the function table of a method in gdb (php):

p *((zend_function*)((zend_object*)((zend_executor_globals*) (*((void ***) tsrm_ls))[executor_globals_id-1])->objects_store.object_buckets[2].bucket.obj.object)->ce->function_table->pListHead->pListNext->pListNext->pListNext)

is what I've just tried, but this returns some garbage... What would be right?
 
@NikiC I agree in general
@NikiC I actually think using encrypted cookies for sessions is better than the default session mechanism in PHP. And safer...
 
9:21 PM
@NikiC OT: but how did the Zend job offer went? :)
 
@ircmaxell But this has also the disadvantage of more traffic.
 
@ircmaxell Why? (Note: Genuine question, as I don't know the default session mechanism)
 
@hakre right, active period ended, grace is just for you to 'get to the pc'
 
@NikiC: there, some pointies.
@kaᵠ yadda yadda skyfall.
 
@NikiC 1. default session mechanism is based on a token. Which is susceptible to fixation and hijacking
2. The default session mechanism requires server-side garbage collection
3. The default session mechanism requires locks (of some form) to provide consistency
 
9:23 PM
@ircmaxell oh yeah, I experiences that second one
 
4. The default session mechanism encourages "put anything in there you want automatically on the next request"
 
If I remember correctly I once had to dump a server completely because it was not possible to delete a large flood of session files
 
@hakre no new one? or is it Charles's turn?
 
@NikiC yeah. Things like that
I'm not saying you shouldn't use it
 
after that event I switched to storing them in the database
 
9:25 PM
but I am saying that there are enough negatives that alternvatives (like encrypted cookies) are attractive for a number of reasons
 
and only instantiating them if strictly necessary, rather than an indescriminator session_start() at the top ^^
 
@NikiC Yup
 
@kaᵠ Charles is longtime overdue. No clue when he jumps in if at all.
@kaᵠ and you can't get enough ? You wanna a new bounty?
 
@ircmaxell I guess regardless of what system you choose, it always comes down to: Cryptography is hard :)
 
absolutely
 
9:26 PM
@hakre y not :P also, 18 upv more till gold badge for you, 2.8k more views for another one, and 52 (this is the hardest) stars for another one
 
@NikiC incremental deletion with find and xargs can do it :)
 
which is why I suggest in every talk that I do "hire an expert"
 
but only go there via shell. do not ls.
 
@hakre I'm sure I tried that, but it did not work, or at least did not appear to work in a reasonable timeframe
 
@NikiC it feels like as if the computer would not work at all, but indeed it does.
 
9:28 PM
@NikiC twitter got me an answer to how to do it
 
Or I just don't remember ^^
btw, weren't those signed cookies one of the recent rails rce issues that turned up?
 
@kaᵠ oh nice, let's see :)
 
Where OS projects came with a default key and people (obviously :D) did not change it and as such one could tamper with the data and in rails any tampering with anything obviously means RCE
 
@NikiC well, that's not the encryption part's fault
 
9:29 PM
@ircmaxell sure
But you know, the human element is usually the weakest :D
 
of course!
/me is going home
later
 
@tereško That sounds like a subjective opinion. One based on a personal bias towards disliking CakePHP. I think CakePHP is a valid implementation of MVC. What leads you to believe otherwise? — I am John Galt 9 mins ago
ffs , how is any of this related to belief ... when i say that singletons are not a form of dependency injection, it is no a belief
 
@hakre hehe, knew that'll get your attention, just 18 more for the first...
 
@kaᵠ Yes but it seems I somehow screwed it. If I now place a 400 bounty, I think I can not place a 500 bounty any longer.
 
@hakre 200 is enough
 
9:36 PM
I can not place a 200 bounty any longer. Starts always double for the next.
 
hmm
 
e.g. last one was 200, next one is 400, 450 or 500.
 
to the meta/faq?
 
@tereško there is such a thing as MVC client-side?
 
9:38 PM
well .. there is "client-side MVC"
 
Why would someone use that over server-side?
 
> I'm still relatively new to web 2.0, ..
when question starts like this, you know it will be bad
 
I offered him to borrow my Tamagotchi. Nice pick @tereško :)
 
anyway .. there is somewhere a pillow with my name on it. I'm gonna take a nap and start in on that "God Delusion" audiobook that i still haven't got around to
 
questions titled "Best way to ..." or "Best tool to achieve ..." are usually very good candidates for a close-vote.
 
9:43 PM
and are actually interesting questions
 
.. also any question that contain both phrase "new to PHP" and name of any php framework .. those too are a recipe for facepalm
 
@kaᵠ the point is: not all questions should be posted on SO. Some would be much better answered on another website, forum...
 
indeed,
 
@hakre related
 
@Jocelyn somebody cast a unicornify spell on your avatar?
 
9:46 PM
@kaᵠ Yes I suddenly got infected at the beginning of the week. Not sure yet if there is a cure...
 
Sometimes I break my tests to reassure myself that the test code is actually working. It's unnerving sometimes to do drastic refactoring and have no tests break. Need to reassert my faith in my tests (see what I did there?)
 
@hakre , i would actually say that is you have client/server split for MVC triads, then client-side's model layer will treat server-side's MVC as the data source. It becomes the "user" for the server-side's triad
<insert image from wikipedia's page>
 
@tereško You can also split, but if you take a client side MVC like ExtJS, you only bind to JSON or XML endpoints on the server and that's it. It becomes a consumer but not a user in my eyes. The user is always the one who interacts with the system.
But anyway, you normally do not really run a full-blown MVC in the client and additional one on the server.
 
when it comes to the application of MVC pattern for web, the flesh & blood human is never "the user". Usually the user of system is the browser
human just interacts with browser
 
well the user has a conception of the model and that is what enables her to interact with the system.
I do not see it that technological as you might do.
You describe more the bare user-interface here, e.g. that line is the browser.
I move my mouse over something I think it is a button and press the button then via my mouse-button.
 
9:55 PM
that's not how web works
 
@tereško I hope you didn't just enter text into a text-box and pressed enter :)
@igorw Where can I get the DVD?
 
@hakre you might be able to grab a VHS somewhere
 
@hakre yes, and browser handled this interaction , composed a request and sent it to the server
 
@igorw it is not that old, isn't it?
 
Release date(s): December 15, 2007
was only able to find a UK version: amazon.co.uk/Tamagotchi-The-Movie-DVD/dp/B002CYIR2U
 
9:59 PM
anyway , i'm off to bed ... there was some reason, why distinction between whether human or browser as "the user" was important, but i am not at the state to recall it
hell .. i cannot even formulate my existing thoughts
 
@tereško perhaps the users mental model. good night!
@igorw hmm. even they announce lovefilm there, I can't find it on lovefilm: "Ihre Suchanfrage "Tamagotchi " ergab leider keine Treffer.". One reason more to cancel the subscription.
 
@kaᵠ very nice. thank you!
hi @pce! how are you?
 
yw, so yes you can as many as you want, but you'll end up +500 every time, unless @Charles wants to chip in some
 
@kaᵠ spread the rep!
 
pce
10:08 PM
hi @hakre, i'm fine, back on coding and just running out of money (scandinavia is not cheap ;)) - and you?
 
Here's a fun microbenchmark for you: empty loops
 
@pce tired. and tomorrow we need to look out for nazis. they have announced to gather in frankfurt and also in wiesbaden.
@LeviMorrison no foreach?
 
@hakre if you do the math... 500*10=5k (in 10 weeks = 2months and 1 week worth of exposure)
 
@LeviMorrison here are some fun answers for you:
8
A: do-while is the fastest loop in php?

NikiC Micro optimizations are evil. They reduce readability for no measurable performance gain. Even if your application does have loops with millions of iterators (which I doubt) the difference is still negligible. The difference between while / do while is smaller than you say: http://codepad.viper-...

 
wow PHP 5 made loops really slow.
Now let's fork PHP 4 again.
 
10:12 PM
nice @NikiC
I do while sometimes, because it's better that way
 
> The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.
^^ I. Effing. Hate. This.
 
The nice thing about while is that it has the --> operator ^^
 
pce
@hakre nazis are more brainless than one can imagine. are you at the demo?
 
okay, I take that back with PHP 4 forking. PHP 5.4 made it really fast again: 3v4l.org/FdPvW
 
@hakre Foreach will be slower on a empty loop.
It does a bunch of array stuff that isn't needed.
 
10:16 PM
@pce I think I'll go to Wiesbaden because of the current changes. But I will see tomorrow.
@LeviMorrison yes, it will be slow.
 
@NikiC that what operator?
 
@hakre Slow enough for me not to care :]
 
@LeviMorrison but it makes so much fun!
@NikiC: What is faster: foreach over an iterator implementing the iterator interface or an iterator that is a generator?
 
pce
i often use array_walk (instead foreach) and suprised how it runs ;)
 
10:20 PM
@pce it says walk
 
Evening
 
> Output for 4.3.9
Loop type while took -0.600252 seconds
 
^ fail formatting
 
triple fail ^^
 
it's because he went back in time to pick 4.3.9
 
10:22 PM
Guys, is there a way to simulate post request in phpunit(explicitly) test? More distinctly I'm testing functionality behind $_FILES array handling
 
yup, because that's one that did it in NEGATIVE time :)
 
@Eugene cannot really. If there's an is_uploaded_file check, you can only replace the php function via namespaces
And it's ugly :P
 
With optimizations turned on in any C compiler I know of the loops would be completely optimized away.
Yay static analysis!
 
@Ocramius so, no way to do that (not counting ugly approach)
 
@Ocramius yes, only PHP has hidden continuum shifting features. But they can endanger running the server therefore the enabling sequence is a secret.
 
10:25 PM
@Ocramius you still working on Doctrine2 project?
 
@Eugene not in these days
 
@LeviMorrison static is evil :)
 
@hakre I always knew that argument was invalid.
 
@hakre evil is static
@Eugene mock out the validator or upload handler thingy
 
@Ocramius I assumed thou :)
 
10:31 PM
Well people the queen is dead. Long live the king!
evening
 
Now, I know why it is a good feature when an IDE checks for not existing breaks in a switch... It took me two hours to create a simple reproduce case and then four hours to find the seven missing breaks somewhere in the pthreads extension -.-
 
pce
@Ocramius but array_map runs, and sometimes makes code more readable
@PeeHaa埽 holy event in amsterdam, today?
 
@pce Far from holy. And far from amsterdam ;-)
Rotterdam it is :D
 
@hakre These are the only real benchmarks I did: gist.github.com/nikic/2975796 Those suggest that generators are (a good bit) faster
 
@PeeHaa埽 and how did it go ?
 
10:35 PM
But would require further testing to give a more meaningful assesment
 
@HamZaDzCyberDeV Pretty good. Only was in a fight once.
 
:O how's that even possible ?
 
@NikiC I suspected it :)
 
@NikiC Why does the for loop need more jumps than while loop?
 
Drunk people being annoying trying to steal stuff in a bar where a friend of mine works @HamZaDzCyberDeV
I hate drunk idiots
 
10:37 PM
Ah I see ...
 
@HamZaDzCyberDeV lulz @ bitchslap
 
hahhahaha
 
@LeviMorrison because php dumps the code in the exact order it appears, thus requiring additional jumps between the parts
 
@PeeHaa埽 someone should tell him about dom
 
@kaᵠ neh sooner or later somebody will come with a regex solution which works for now...
 
10:42 PM
yeah, it's easy anyway
 
I mostly let people just have their regex solution so they can find out the hard way it kinda sucks
 
@PeeHaa埽 hüha!
@PeeHaa埽 brings me to the idea, can't we paste a regex that makes an endless loop and then offering fake results telling the OP that this works and he must have some strange error?
 
@NikiC Seems like a super-easy optimization unless I'm crazy.
I guess loops really aren't a bottle-neck, so nobody has bothered.
 
the for loop is sometimes slowlier if you move expressions from within the body to the third expression of for.
I never cared really why but you can measure it.
 
@Gordon: what lexer/parser would you use to parse trivial DSL (SQL's WHERE-alike)?
 
10:46 PM
@zerkms preg_replace_callback with named subpattern ;)
 
@hakre: I'm not parsing html :-)
 
@zerkms take a look at @NikiC's phlexy
 
@igorw: it's already in my bookmarks
looking for other alternatives
 
I can also offer a lexer (no grammar for the parser so far) in XDOM: github.com/hakre/XDOM/tree/master/src/XDOM
 
10:53 PM
And there is also preg_replace_callback_offset() which PHP is missing :)
 
@hakre That would be pretty priceless
Some nice redox in there :D
 
OMG, the first answer is there. there is more repetition than questionmark, start and plus ... .
 
pce
@PeeHaa埽 oops rdam, not adam :D
 
@hakre you can do that with callback, since offset can be passed to the callback IIRC
 
@ircmaxell as you can imagine I would like to learn if that would really be possible.
 
pce
11:04 PM
@zerkms sara golemon wrote an extension to parse sql: pecl.php.net/package/pdo_user -> parseSQL (-> blog.golemon.com/2006/05/re2c-is-no-lemon.html )
 
perhaps not
 
Good night everyone !
 
good night to you @HamZaDzCyberDeV
 
@pce: if only I had actual sql :-)
 
pce
11:25 PM
@hakre does your library only need a lex file?
@zerkms maybe hakres lib could fit, do you have an example?
 
@pce yes it somehow fake-parses a lex file :)
one might need to tweak it if the lex file has some arguments.
and I do not think I really support the yylex which can be in a lex file.
 
pce
11:41 PM
@hakre cool, ... take care tomorrow, night!
 
@pce gn8 & thx.
 
pce
@hakre i wish i could be there, too. may the force be with you ;)
 
@pce :)
 

« first day (927 days earlier)      last day (4024 days later) »