« first day (1125 days earlier)      last day (3833 days later) » 

3:00 PM
Yea, at least most of them go away with a cream.
 
@DanLugg - yeah I read ircmaxell answer and it is fair enough.
always like to take my curiosity here to learn from the experts :D
 
@DanLugg the same is true of VB :)
 
@salathe I dunno about that. Cream, showers, alcohol. I still haven't shaken VB from about 12 years ago.
At least I don't have VBA.
 
@DanLugg unlucky, it's a distant memory for me :)
 
@salathe Well, everytime I open VS, I'm presented with the option to create a VB project. It's like a gruesome flashback.
 
m59
3:04 PM
Strange one. What could be the point?
0
Q: Regexp htaccess not working

SamulIn my website I want to save the MD5 of the user's IP in a cookie named "utm". How can I check, using htaccess, if the MD5 of the real user's IP %{REMOTE_ADDR} is exactly the one in the cookie? I want something like this: RewriteCond %{HTTP_COOKIE}:MD5(%{REMOTE_ADDR}) ^.*utm=([^;]*).*:(?!\1).*$ ...

 
I wish we could -1 comments sometimes. Or at least slap the user with a fish.
 
m59
The guy that encouraged it?
Fish slap is clearly the better choice.
 
@DanLugg slap him with a flag :-)
flagslapping
sounds nice, no?
 
@m59 Actually, my fish-slappery is unrelated to your linked question.
Ban-hammery! Flag-slappery!
 
m59
Oh, I feel like it's applicable there.
Using md5 in htaccess sounds despicable. Just wondering if I'm the crazy one here.
Using md5 AND in htaccess. What in the world.
 
3:08 PM
@ircmaxell Yes there is...
 
3 mins ago, by Dan Lugg
I wish we could -1 comments sometimes. Or at least slap the user with a fish.
For the record ^^ that's directed at you, @Simon_eQ
 
@ircmaxell looool.
 
@m59 There is approximately one legitimate / acceptable use for md5 -- to compare two files and see if they are probably identical.
 
there is another legitimate use of md5
 
3:13 PM
as a filter to identify developers who shouldn't be allowed near any security context of an application
 
LOL, brilliant
 
@ircmaxell Please put that in one chat line so I can star it :(
 
@ircmaxell Wait, I shouldn't use md5 for signatures?!
 
too late to edit
you do realize that the use-case for which md5 is truly broken is signatures
 
@ircmaxell yes ^^
that was the joke
 
3:17 PM
ah ok
 
The only legit use I've ever found for MD5 is putting up MD5sums so people can confirm they've downloaded something correctly.
 
I thought so, but...
@SweetieBelle that's called a signature, and that's the very definition of how md5 is broken.
 
And even there I usually use sha256
 
I can make a modified download which matches the old md5sum quite easily
 
@ircmaxell Really? Interesting.
 
3:18 PM
@ircmaxell I think he didn't mean it as a signature but as an error checking code ^^
 
I should replace my old MD5SUMs with sha256sums then?
 
as in, allow you to catch a random bit flip or something
 
^ This
 
@NikiC it's the same process
one uses a MAC, and the other just a hash
 
md5 is quite okay for that. md5 collisions have to be targeted, they don't just happen randomly
 
3:19 PM
@ircmaxell Should I use sha256 instead then? (is it better)
 
@NikiC TCP has checksums built in for that anyway
@SweetieBelle yes
 
@ircmaxell theoretically. Each packet being correct individually doesn't equate the whole download to be correct (especially in conjunction with something like pause/resume, which really loves to corrupt downloads...)
 
@ircmaxell Have there been cases where a binary executable has been compromised to include malicious behavior, with an MD5 collision?
 
@DanLugg unknown
 
Surely you could manufacture a SHA256 collision too?
 
3:21 PM
I would assume most often it would just brick the file.
 
@SweetieBelle nope
they are theoretically possible. In that the mathematics are there. But nobody has ever found a single collision, yet a way to generate them. yet a way to modify a valid message into a new one with the same hash
 
Whirlpool everything!
 
@SweetieBelle the whole point of sha256 is that you are not able to ^^
 
hashes provide 3 basic protections
1. Pre-image resistance: given h(m), it should be difficult to find m
 
m59
I have no problem about the user seeing the cookie because I use this htaccess only to prevent ddos attack on my pages that have a huge CPU usage. I demand that if the user wants to open those pages he/she must have a cookie setted. This was my first approach. After that I required that the cookie must be set but with the IP. And to make it even more ddos proof I want to save the cookie using the MD5 so I can check it back in the server. I already use Blockdos in my shared server but I want to add this extra layer which works perfectly except the MD5 which would make it amazing! — Samul 1 min ago
 
3:25 PM
2. Collision resistance: given m, it should be difficult to find n such that h(n) == h(m)
 
m59
Wouldn't that make it easier to DoS the site?
 
3. Second collision resistance: it should be hard to find two different messages m and n, such that h(n) == h(m)
in md5, only the first protection is retained (discounting brute-force attempts to find m)
in sha1, the first and second are retained (the third has been broken)
in sha2 (sha256, sha512, etc), all three are still strong
@m59 using a shared server... and concerned about DOS attacks? ?
 
m59
I told him he's DoS'ing himself using htaccess so much LOL.
 
m59
If you delete all of the files on your server, you have a totally secure system.
 
3:37 PM
 
3:48 PM
@ircmaxell He was doing an AMA and the most popular quotes he made the (above) videos for :)
Arnold is a regular on Reddit.
 
ok
 
I'm just waiting for the new higher quality soundboards to be inevitably released.
 
^-- why isn't this closed yet guys? i am very disappoint
 
/me saw that a few days ago and forgot to close as I was on the road
I have google alerts setup on the password api stuff
 
@NikiC LOL... how did that accepted answer get voted up?
 
3:55 PM
Last hour of Thursday, it's like someone cast a demotivate spell on me.
 
@salathe It's the Law of Easy Reputation: All fast answers to trivial questions will receive upvotes.
 
@NikiC unless they are within the "band of negativity". Too poor, and it will get upvotes as people won't understand why it's bad. But too realistic, and it will get upvotes by people who don't know any better
 
Unsure why number of up-votes is trumped by the answer selected by the asker. Typically the person asking the question is the most clueless.
 
@Fabien your first mistake was trying to find logic in the actions of those who find value in those types of questions ;]
 
:P
 
4:26 PM
New Photo: Takeoff http://ift.tt/1hII1tg http://t.co/KY9WGvdupt
 
@ircmaxell I never mentioned an rfc
 
I misread what was proposed
 
where was what proposed ?? I asked to add a few ZEND_API decls ....
 
I misread...
 
ah right
also, why would that put you off ??
 
4:37 PM
I thought it was pulling in the SAPI into core, and I was like "lolwtfbbq, no rfc?"
 
ah ... I c
I don't have the energy for an rfc, but, I don't see any logical reason not to have a debugging platform included ... or at least, one that cannot be contained ... xdebug is fine where it is, this doesn't work outside of /sapi folder ...
 
sure
 
I think Felipe intends to take it that far ...
me however, just to code :)
gdb is vast I use it all the time, but have never really looked at what it can do ...
 
Hey hey
 
when you do help and are presented with 4 lines of text you think oh, pretty simple then ...
noooo not at all .. there are literally a billion things that it does ...
thankfully hardly any of them useful or already implemented and can b executed with eval ... but it is vast ...
hey @RonniSkansing
 
4:43 PM
Soon it will be weekend
 
Tomorrow will be Friday. True story.
 
@DanLugg The best Friday
Last day at my current employer before I start my new job!
 
@cspray Congratulations! But, that begs the question; which seat will you take?
 
@DanLugg Some brief googling leads me to believe this is in reference to some person named "rebecca black". I am unfamiliar with whatever it is you're referring to
;)
 
@cspray Your research has piqued my interest. A dissertation must be proposed.
 
4:50 PM
anyone have an idea why <form action="/en/profile" method="post"> redirects me to home on submit, while regularly visiting domain/en/profile does redirect me to the correct page? I'm using routing, and the form action url should be correct
the same routing structure in the action of a form on another page does work fine
 
Anyone else have trouble convincing themselves of something sometimes? I'm writing something that performs file-comparison; as a last resort it compares the contents. I keep thinking that MD5 will somehow be faster, but it's not precomputed, so the whole file has to be read either way.
My Brain, a dialogue:
Left-side: Use MD5!
Right-side: No, the whole file has to be rea--
Left-side: MD5! MD5! MD5! Hash everything!
Right-side: You've been smoking hash, haven't you...
 
HASH ALL THE THINGS!!!
 
@ircmaxell My assertion is true though, correct? Hashing is just an unnecessary step when byte-by-byte comparison will do.
 
depends
caching a hash is easier than re-reading the file for many comparisons
 
True, it's only a one time comparison in this case.
 
5:01 PM
then no need
 
Does PHP use memcmp for string equality?
 
just in case you can't find it ...
wrap all the things !!!
 
yes, because the C API is too volitile to use directly :-P
if (!retval) {
return (len1 - len2);
 
@ircmaxell Also known as "magic"
 
5:09 PM
shouldn't that be reversed? In that the length check should come before memcmp?
 
2266        Z_LVAL_P(result) = zend_binary_zval_strcmp(s1, s2);
2267        ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(result)));
 
@ircmaxell nope
 
out of the one hundred wrappingz occuring, one is down to the underlying c api ... we just love to wrap all the things ...
 
@NikiC can you explain?
OHHHH
nevermind
I'm an idiot...
 
:D
@ircmaxell Though I'll have to admit that I stared for a few minutes the first time I saw the function ^^ Not really intuitive
 
5:13 PM
I love when C people post links to lxr, I have no idea what's being talked about.
Good morning.
 
morning
 
@ircmaxell What is the reason? I'm sharing your initial confusion.
 
@JoeWatkins Do you like dark colors for IDE/GUI, like e.g. Photoshop.
 
I have two objects of the same class. I want to know which of their attributes are not identical (I need the attribute keys, not values). What's the clean way to find this out?
I can only seem to think of hacky solutions.
 
@SweetieBelle Attributes, as in properties? Are properties being added on the fly?
 
5:18 PM
@DanLugg Yes, properties. No, they're not added on the fly
 
Yea, nevermind the second question; I derped.
 
Imagine you have a Person class, its attributes are fname, lname and dob. I have two Person objects, I want to find out which of their attributes are different.
 
@SweetieBelle Are you adding this comparison function as a method to the class, or is the comparison being performed externally?
 
@webarto yeah, workin on explain.so ?
 
5:19 PM
So: Bob, Dylan, 1960-12-10 vs Bob, Marley, 1965-03-05 should give array("lname", "dob") as output.
 
@JoeWatkins Yeah, following your changes. I've touched phpdbg.com too.
 
@DanLugg I can add it as a class method or do it externally, whichever is cleaner.
 
@SweetieBelle Well, as a method to the class, you'd have access to private properties, so get_object_vars will work fine; then it's just an array comparison.
 
@DanLugg Thanks, will look at get_object_vars.
 
But externally, you'd end up having to user Reflection to make visible all the properties, aggregate them, and then perform comparisons.
 
5:21 PM
@DanLugg I'm able to modify the class, so that's probably the best option.
FWIW the option I came up with was ugly and used reflection. :/
 
Are you asking what are the pros and cons of dating a programmer?
 
About ugliness, I've found this, it works do something useful, but ... foreach ($array as $key => $array[count($array)-1-$key]) $key++;
 
@David I'm not asking (no ?), I'm just linking.
 
hmm those regex crosswords are fun...
 
5:31 PM
@SweetieBelle Something like this?
 
@DanLugg Yes but has to work on 5.3 :P
But thats just new array syntax
 
@DanLugg That looks quite a lot like what I had :P
 
Fight, fight, fight!
 
@SweetieBelle Since you can modify the classes, probably best to do something like this instead, I dunno if you already have that.
 
5:36 PM
@DanLugg Thanks, yeah that's basically what I'm looking for
 
No problemo.
 
@webarto cool, keep me updated :)
 
Will do, just to sober up :) I was hanging out with my friend Jack Daniels.
Being in a perpetual state of thinking you have a cold coming on
Don't ask for ninja/guru/master/hacker if you can't afford to pay one.
 
@SweetieBelle Just for the sake of it; 5.4+ can do this without messy reflection up-front: 3v4l.org/dOTEh
Bind the closure scope to the object and it's like a method.
 
@DanLugg I like that
 
5:42 PM
@NikiC actually, I'm right, if you would short-circuit if the lengths aren't equil, you could avoid the memcmp all together
 
Pity our servers are running 5.2 and 5.3 :/
 
I don't like it @DanLugg
 
Haha! RT @markatextor: How to tell if your dog has been involved in a sex scandal. http://t.co/fxkW2sNHSW
3
 
@ircmaxell Now, I know you wouldn't post NSFW, but I'm still skeptical.
 
@ircmaxell Haha!
 
5:45 PM
@NikiC right now, it will always run memcmp if they are not the same memory address. But you could short-circuit since you know the lengths are different, and hence avoid the comparison all together
 
@ircmaxell nope
consider the case where the lengths are different...
and the prefix of length MIN(len1, len2) is also different
then right now it would return the memcmp for that prefix difference
rather than the length difference
it's a different type of sort
 
right...
for comparison, not for equality
for equality only you could short it
 
yeah sure
but if you short it for comparison it wouldn't be a lexicographical sort anymore
in theoretical informatics we called the length-first one "standard order" (as it's friendlier for isomorphism bijections...), not sure what's the proper term for it
 
right...
 
6:02 PM
wat
 
@NikiC wait what?
Maybe you should.. I don't know, properly benchmark it?
(although, it seems pretty obvious which would be faster)
 
In order to execute a shell command, is it a good way to use exec() or shell_exec()?
i mean, for the future, since safe_mode is gone from 5.4
 
Since views are not supposed to know about the HTTP request and views ask the model for data what is the best way to deal with a simple get request which contains a product ID? The request comes in, the controller extracts the ID, does the view have a setProductId($id) method so the controller can set the ID and then the view can use that when getting the product data? Seems the only way to do it to me
 
6:18 PM
@ircmaxell just bought phpphp.org
 
nice
 
@David "The request comes in, the controller extracts the ID," That sounds at least partly dumb - I would have thought that the routing layer would be the thing that is analysing the request and pulling variables out of it, for the other components to use.
 
@Danack The routing layer breaks up the URI and figures out which controller is being requested and what action/method is being called
It also matches the URI to any custom routes that are setup
 
@David Mine also grabs all the variables from the request and makes them available to the controller and view.
 
@Danack Shouldn't the requested controller action/method extract the required data from the request, then pass whatever data was extract into some method of a service like signup(......) or login(......) or whatever needs to be done
 
6:26 PM
$b AND $c = $b + $c?
 
And views should not even know of such a thing as a request
They only know how to talk to the model
 
@David I don't think so. Why should a controller even know how it was called, or know anything about how to extract data from a URL? It should just be called with just the info it needs to know about to do it's piece of business logic.
 
@David @Danack you know, you're both saying the same thing..
 
@BenjaminGruenbaum No we're not. He's parsing URLs in his controllers. I don't do that.
 
@Danack I'm not parsing URLs in my controllers
 
6:29 PM
I don't think he actually parses URLs and request bodies in the controllers. @David are yoi?
 
@David So what does - "Shouldn't the requested controller action/method extract the required data from the request," mean then?
 
Yeah, that's what I thought. You're saying the same thing but phrasing it differently.
 
i.e. what's it do?
 
@David set the layout to an empty layout and echo/print the id
 
@Danack In a login controller for example in my method I would do $username = $this->request->post('username'); $this->request->post('password'); then pass that data into a service which deals with login
 
6:30 PM
Like - controllers get request information then ""extract"" what to do with that information.
Yeah, that's how I understood what David said too... like I said, you're both saying the same thing.
 
and any GET data like a product ID or whatever will be passed into the method as a parameter
call_user_func_array( array($controller, $route->getMethod()), $route->getParams());
Any left over data after the routing process is passed into the called controller method as parameters
 
@David I like to pass the $request object regardless. It gives you more flexibility in what you can do in your controller.
It also enables you to get some sort of uniform interface for all your methods.
 
@MadaraUchiha All my controllers have the request object passed into it's constructor
 
@David Ah, you mean the URI parameters, yeah.
 
Yeah
@Danack I am pretty sure though views should not know a request even exists
 
@David I never said they should. I also don't think controllers should know about requests - as I said, I extract all the parameters from the request out at the routing layer, and then inject them as needed into the controller. And the same for the view.
 
So rather than calling call_user_func_array( array($controller, $route->getMethod()), $route->getParams()); with the all the params passed in, it looks a lot more like:
 
@Danack What about for a huge registration form would you have your controller method have 15 or 20+ parameters and then one of your services having a register() method with the exact same 15 or 20+ parameters?
 
@David No - I have forms as objects, and have just the form injected as a single parameter. github.com/Danack/Jig/blob/master/example/Controller/…
 
6:42 PM
<3 Code!
15 20 params?
 
@David Despite Ben getting the wrong end of the stick again, This "call_user_func_array( array($controller, $route->getMethod()), $route->getParams());" is not what I do.
 
@Danack Why does the controller have a mapper though? and logic in the controller?
 
@David Long story, short version - I don't have models.
 
:O
 
6:49 PM
@Danack How do you handle all the data without getting lost in it and inconsistencies? I could not imagine dealing with lots of data without domain objects to manage it in a structured way
 
@BenjaminGruenbaum hm? not sure what you mean?
 
has to do with hex values not being encoded correctly
 
Goood almost friday morning people
 
@David "How do you handle all the data without getting lost in it and inconsistencies?" By being able to inject the data validation rules when you go to save something in the DB, rather than having them hard coded in a model.
e.g.from my last project, when an end-user signed up for the service they had to provide a valid email address and mobile phone number. When a sales guy created a demo account to present to a client (and give them the login details at the end of the meeting), they didn't need to provide either an email address or phone number.
So there is a set of rules for end users creating accounts, and a set of rules for sales guys creating accounts. Those sets of rules are defined separately and get applied as appropriate. But they're not really part of a 'model'.
 
7:07 PM
^^ This normalizes a filesystem path.
 
yay christmas trees!
It's missing some StopAllTheNestingExceptions
 
@Danack Should data validation be encapsulated as much as possible in domain objects though? I can remove any specific validation rule for a property or I can remove them all by doing:

$user->removeRuleRequired('emailAddress'):
$user->removeRuleRequired('phoneNumber');

Now they don't have to supply an emailAddress or phoneNumber when I run

$user->validate();

If they do supply some data though it will get validated for size, format etc if that field has rules.

I can take every rule off a field by doing:
I have only every had to use the removeRule*() methods once ever so far
They are just there for flexibility
 
@PeeHaa The worst part of all, is that, FileInfo.FullName returns the fully qualified path. Path.GetFullPath() returns the fully qualified path. They don't use the same code. At all.
 
hehehehehe. VB6 is back!
 
4 hours ago, by Dan Lugg
@ircmaxell I said VB, not VD. (though they aren't dissimilar)
 
7:12 PM
@David That's certainly a valid way of doing it. You just asked how I avoid having unmanageable data without a 'fat' model; I'm not saying that mine is the One True Way - it's just what works for me.
 
@DanLugg lol
 
@PeeHaa Serious though, it's so damn frustrating; I don't know whether I should use one or the other, and I'm definitely skeptical about using both, in the event they each handle edge cases differently.
Like what the actual serious fuck?
 
@David Also, I'm not following a strict MVC pattern - you could argue that my routing layer is acting as the 'Controller' in my application (i.e. deciding what code to call and then what View to display), and what is in my 'Controller' directory is actually a 'Service layer'. But they're really just names, and not really important.
 
Why would a foreach with reference get stuck on one particular iterator and overwrite it over the next one?
 
don't use references
 
7:18 PM
@AshwinMukhija It's referencing itself?
 
I need to prepare some data in the loop
 
@Danack It is just hard for me to understand fully unless I saw it all together
 
Which is why I'm using references
foreach($teams as &$team) { $team['var'] = doSomeComputation() }
 
@ircmaxell Don't ever use them?
 
don't use references
if you find a problem which you think you need references to solve, you've already done something wrong and should stop
 
7:21 PM
@ircmaxell Alternative?
 
actually edit the item directly?
actually don't edit the item at all
mutability is bad
references make things worse
 
@AshwinMukhija Some background please? What are you trying to do?
Please note I asked What and not How.
 
@ircmaxell What about if you ask the model layer for the last 10 registered users in array format and all the values of type string need to be escaped/secured for the template
 
that's exactly why you don't want references
 
Fetch data from database, compute additional params, save the data back into the database.
 
7:23 PM
because your registered users should only be escaped for the template, not for the rest of the application
so you actually want to copy the data as you're modifying it
 
@ircmaxell and then you do the same except this time you get 100 orders. If you don't use references and recursive function you would have to do all the escaping manually wouldn't you?
 
Wouldn't that be memory intensive if I keep making copies at every step?
Even if I overwrite the original entry
 
No
because the memory scale you're talking about is trivial
don't prematurely optimize
copying 1kb of strings is not the end of the world, and is trivial to do
 
@AshwinMukhija how many users are you intending to process at once?
 
Write correct code, then optimize later if you need to. It's far easier to optimize correct code than it is to correct optimized code
14
 
7:25 PM
All of them. Because I need cumulative data. It's a market share calculation so I need to compute data based on all users' entries
At a time I would have about 100-150 teams playing
 
why not do it all in the DB?
 
Because there are validations to be done
I tried writing a procedure, but it was bad.
 
ok, whatever, I'm off ot home
later
 
Later, and thanks
 
7:45 PM
Ads created by developers are not shiny
28
Q: Open Source Advertising - Sidebar - 2H 2013

Grace NoteIt's yet again time once again to again yet support your favorite open source project through our Free Vote-Based Advertising for Open Source Projects. We are clearing the leaderboards to start the second half of 2013. Here is your chance to create a Free Vote-Based Advertisement for an Open Sou...

 
Typography sucks in all examples...
Not that I can do better.
 
Me neither like at all, but c'mon you get the opportunity to be blocked by thousands and thousands of users. At least do something fancy or get somebody to do it for you
 
Yes, at least that's not expensive but it means much.
I don't fancy Careers.SE for not importing recommendations from LinkedIn, IMHO that's important too.
And not sure why everyone requires PDF, they get outdated pretty fast, and it's pointless to have them in "database".
 
8:27 PM
le wild @rdlowrey appears
 
Howdy @rdlowrey
 
8:50 PM
nn
 

« first day (1125 days earlier)      last day (3833 days later) »