« first day (1257 days earlier)      last day (3916 days later) » 

16:00
> So was informed today that we're moving our application from a custom OOP framework that we've been using in house for a while and refactoring it to cakephp, taking the jquery code to angular JS as well. As someone that's done a few years of the former, but has no experience in cakephp or angular, is there anything that I need to keep an eye out for, and how much of a learning curve, if any, am I looking at? -Some guy
RIP
angular is based on jquery
also, I feel his pain
@Fabien it's a sad day for him..
btw, maybe you have some additional ideas for the "Spot the errors" interview exercise, that I should include
I know that ircmaxell has done some interviewing .. :)
I love that == true touch with all the huge errors around :D
16:03
aslo, as a sidenote, congratulation on the new avatar ... now it doesnt look like "employee of month" picture from some police department. Gives a much better first impression, @ircmaxell
@tereško Are you expecting the interviewee to spot syntax error or stupid errors?
I did not test the code, but there shouldnt be any syntax errors ... I think
I can add them later
@tereško mysql_connect or die, include from a remote location maybe?
@tereško not bad, a bit long, and a bit over-the-top IMHO. But could be an interesting discussion point as there would be a ton to talk about
there is already "include from remote location", if you missed it
16:05
Also, try to add a global somewhere
I coulnd find a place where I need it
maybe I can use it for email
@tereško by "remote" I mean include "http://example.com/template.html"
@SecondRikudo I never thought about that. Good call, thanks
@JacobRaccuia Don't do that for real...
Never, ever do that for real.
We're talking about bad practices here, nothing we say here is a "good call".
@JacobRaccuia , the code that I posted ( gist.github.com/teresko/b1d2e5c05515826c49a3 ) is meant to be as a test exercise for interviewees , for them to spot bad practices
16:08
@SecondRikudo oh
maybe I was being sarcastic
(but I wasn't )
emm .. can I define global in the Mailsend(), or msut it be used in global scope beforehand ?
@tereško perhaps more SQL injection or using templates incorrectly?
templates are used incorrectly
keep in mind that there was "must work on PHP 5.4.0" comment
Yeah, I meant like nesting and etc
echo("<some> ".complex." <html>");
@tereško Just out of interest, you're not looking for interviewees to rewrite it.. just point out all the terrible stuff and other ways of going about it.. right?
16:11
Or assigning an HTML to a variable to be used in a template - although that's very subte
I am looking for interviewees rewrite it better and add some additional comments about the code
Maybe return not a boolean from Mailsend?
@BenjaminGruenbaum yes, I will add that part
@tereško personal experience: that's too much for an interview...
@ircmaxell personal experience: it's perfectly ok for an interviewee not to finish
16:19
@tereško In my experience, it's better to have an easy conversation about what's wrong with that code, why it's wrong, and how you "might" do it better...
@ircmaxell well .. it not for interview exactly, but for the "applying for the job and sending CV" phase
A lot of people talk but can't program :/
@BenjaminGruenbaum not worried about scope, worried about pressure
@tereško ah, phone interview?
16:20
@BenjaminGruenbaum I'd MUCH rather have someone with sound reasoning skills that can't write code, than someone who can write code but can't reason about it
@BenjaminGruenbaum no, job application form
@tereško ah wow, we don't filter that much that early but we do phone interview
this is meant like somethign that you can do in 5 minutes or less
@ircmaxell I'd much rather have a doer who can't explain the difference between bridge and adapter than a thinker who changes abstractions every week. The best is obviously someone who does both but between the two? I'd rather get things done. Senior position is different though.
@tereško oh, too much for 5 minutes or less.
@tereško You suck at writing bad code.
16:23
@SecondRikudo Manga got a bit weird.
@tereško why not give them a simple class to write, maybe with an interface they have to implement?
@BenjaminGruenbaum I'm not talking about "bridge vs adapter", but more reasoning why a particular example is good or bad. And about how to structure code and make it readable
@Fabien tentacles?
That would be normal.
@tereško Here's what I encountered for a quick task, to make e.g. Table::getAuthorId() return table.author_id (assuming mechanism to do that quickly is in place)..
16:26
/**
 * A millisecond scale timer. This counts the number of events
 * that occur in a given time period.
 */
interface Timer {

    /**
      * Record that an event happened
      */
    public function update();

    /**
     * Return the number of updates in the past second
     *
     * @return int The number of updates that happened
     */
    public function updatesInLastSecond();

    /**
     * Return the number of updates in the past minute
     *
     * @return int The number of updates that happened
^^ That's an AWESOME test. As it's really easy to get a simple solution, but it's also really easy to get a PHD in CS to scratch their head with it for a few days, depending on how evil you get...
Ohai @ircmaxell new profile pic! Nice
@ircmaxell how do you get a PHD in CS to scratch their head?
yeah .. looks like good test, but might be too complicated
@BenjaminGruenbaum how would you efficiently implement that at nano-second scale, where the worst-case doesn't take TB of memory...
user895378
16:41
@BenjaminGruenbaum Show them a picture of a Marketing graduate on a yacht? ;)
@tereško public function update() { $this->times[microtime(true)]++; }
@rdlowrey Epic.
@ircmaxell oh .. you meant it that simple ?!
16:53
@tereško that's why it's nice, because it can be tuned down, or up depending on the audience
it's a rabbit hole that you can touch the surface, or go down REALLY deep
It's that Google task?
@webarto Yup
Yup, I remember you said you gave 'em dafuq face.
no, I was never given that one
16:56
His role could've been bigger.
Ok, they've scratched their head then or something :)
Or how fast you've accomplished it.
Sometimes I wish this chat had an "off the record" feature, where certain conversations would remain private.
I have a question,

so I want to split text using php.

I use this code for this:

$ keywords = preg_split ("/ [\ s,] + / ', '03 / 03/2014, 03/03/2014, 03/03/2014);
print_r ($ keywords);

above you see three dates, but I'd like to pick up without me on the submit button to press (first here, so $ _POST ['name'],. does not work because I need it before I post / submit.

I want to get the value from this: <input name="datepicker" class="datepicker" id="from-input" value='' readonly>

Is there a possibility to call before / without the form to post it? Value to
@ircmaxell Even if you anonymize messages someone can figure out who's in question. I think please delete me is only option.
Had the problem, pasted some code.
@webarto I don't worry about that.
more that I don't want certain people finding something I want to discuss
17:00
@averroken Don't understand what you need?
@ircmaxell This chat is mainly broken for anything else than chit-chat and off-topic. So, private means of communication.
@webarto Well, like IRC wouldnt' be searchable (most of the channels anyway)
I did so a form for an application.

but at a certain input field, I have different dates than they should be split. So I'm looking for a way to have the form I gesubmit., the value of the input because I need to stabbing I call back details on this data in a table. within that form those values
before i submit the form the values collect of one input field for splitting
@ircmaxell Less likely to be found anyways, this chat is really highly ranked with Google. It would be nice if they added option for owner to enable "noindex" at least.
@webarto which is why I didn't bring up an email that I received this morning ;-)
17:11
Oh, shoot :)
Found a use case for __get(), but I really would prefer just a load of getters / setters -.-. Decisions decisions...
Generate 'em like e.g. Doctrine/Symfony, if you don't like that.
Just add 100 newlines before start of (g|s)etters :)
@webarto I just don't like using magic __get() or __set() - makes it a lot harder for future devs and also to debug in IDE. Think I might just go with loads of setters / getters.
@NikiC what's the problem with him?
He's Hungarian :P
17:15
@bwoebi He's not a core dev
@NikiC maybe you should be PHP6 RM…
@NikiC and then?
@bwoebi No way
@NikiC why?
@bwoebi He doesn't understand the fine line between reasonable BC and unreasonable BC ^^
@NikiC that'd explain why we have so less BC breaks this version…
17:17
When you guys start programming a new website with a lot of database tables. Do you create them on the fly when you need them or do you first start building the whole database structure?
@bwoebi Not my type of work. No interest in doing packaging etc
@Duikboot On the fly, but think about structure in advance, of course.
Fcourse :)
@NikiC so, which core dev should do it then?
@NikiC then put it to a vote...
17:19
I have nothing against johannes…
@ircmaxell, your tiny avatar picture here looks so unusual, I always need to check the name next to it first…
How about Derick?
(hihihi)
great idea! :-D
Well… with Derick we'd maybe have more unreasonable BC than it's good for PHP
ummm...??? orly?
17:22
Do we hear @ircmaxell volunteering?
(totally learned that from @salathe :D)
for what?
@ircmaxell PHP 6 RM
> PHP6 RM
@ircmaxell you got the joke.
17:25
Nobody wants to be RM ;)
@NikiC plenty of people do, just none that would be good for the role ;-)
@ircmaxell And none of the people who get the job enjoy it ;)
user924016
lol
Rolling On The Floor Laughing My A$$ Off So Hard That Soda Came Out My Nose, And I Wasn't Even Drinking Soda!!!
Funny.
Was just talking to Julien about how shitty the job is ... he's been dealing with Yasuo's session changes recently.
17:27
@NikiC I thought they were for PHP 5.6? (= not Juliens job)
@NikiC they should have never been committed, yet alone anything deeper...
@bwoebi yes. julien is one of the RMs for 5.6
@ircmaxell Yeah, so now they are at least partially reverted
@NikiC I thought he was PHP 5.5 RM (with dsp)… I must have missed something
@bwoebi There are always two RMs for a release
Is !=== real? o.O
or is it just !==?
17:29
@NikiC Derick could be an awesome RM... Nothing gets in until it's written by him.
With one sticking around after the initial period
@NikiC oh, okay
@salathe Warning: You must specify the ini settings foo, bar, baz, (... 200 more) before you can use PHP
@SuhosinPony It's as real as !====
@SuhosinPony Well there's != and !== :)
17:30
@SecondRikudo Someone just told me !=== exists, I've never heard of it
I've always used !==
@bwoebi each RM serves 2 releases. Staggered, so you always have 1 experienced RM, and 1 new RM
@NikiC wait? a warning? I thought it'd be a fatal :-)
@SuhosinPony A simple test is easy...
@SecondRikudo true :P
@bwoebi It's a fatal warning
user924016
17:31
php > var_dump(1 !=== 2);
PHP Parse error: syntax error, unexpected '=' in php shell code on line 1
@ircmaxell that makes sense
@SuhosinPony 1 for loose, 2 for strict.
@SuhosinPony Yup
@NikiC E_FATAL_WARNING … nice!
madara@Dor-PC:~$ php -r "echo 1 !=== 2;"
PHP Parse error:  syntax error, unexpected '=' in Command line code on line 1
17:32
@SecondRikudo that parser is dumb… It's evident that the ! at the beginning is unexpected… left to right token parsing pfffz
*quirks*
1
A: How is crypt($pass, '$2y$09$salt') === crypt($pass, crypt($pass, '$2y$09$salt')) in PHP?

Shankar DamodaranFrom the PHP Manual Caution Using the CRYPT_BLOWFISH algorithm, will result in the str parameter being truncated to a maximum length of 72 characters. This is only a concern if are using the same salt to hash strings with this algorithm that are over 72 bytes in length, as this will res...

@ircmaxell: Can you confirm whether this is the actual cause of the issue?
> I'm ok really confused
:D
@ircmaxell I'm missing something - are OS facilities not allowed?
17:40
I don't think it is correct, but I'm not actually sure. I found a related discussion here but not sure if that's related either.
@webarto Confused about what? :P
@AmalMurali First words in answer you've linked :)
@AmalMurali nope, it's not
@BenjaminGruenbaum use whatever you want
@ircmaxell: Fix formatting. Change that to: [password_hash()](http://php.net/password).
:P
Damn. Someone already edited. I didn't want to spoil your 5 minutes grace period. :/
but I want the results to be accurate. The last second means from this current microsecond, to 1 million microseconds earlier... Not "calendar second"... It's a lot harder than you'd think ;-)
@ircmaxell how many events are assumed?
17:45
@webarto: What about it? "From the PHP manual"?
@BenjaminGruenbaum does it matter? Obviously if you know something specific about the event, you could do things like statistical compression, but let's assume that you don't... It could be 1 per second, or 500 per microsecond...
Question, not Answer.
@ircmaxell of coruse, it makes a huge difference in the approach to take. If it's 500 per microsecond you need to optimize for insertion speed.
A whole different data structure since you need insert to be O(1) and not O(logn) for example, it also has to hold 4.32e+13 elements.
That's 39 terabytes if each element takes 8 bytes.
That's still more than 2 TB of information if every element takes one bit.
Since the resolution is nanosecond, the entropy requires more information than that, it's theoretically impossible to provide a correct implementation of that.
(in under 1TB of information).
*memory
I have nooooooo idea what you've just wrote.
@BenjaminGruenbaum Let's say you need to optimize for memory consumption...
17:51
@ircmaxell in nanosecond resolution?
sure, why not
@BenjaminGruenbaum and that's why it can make a CS PHD scratch their head. Because the general case may be unsolvable, but what constraints can you put in place on either the problem or the sollution to make it solvable in a reasonable way?
The lower bound on the amount of information you need to store is your information entropy - you can't do better. Every two time stamps in nanoseconds in the last day need 13 bits.
Even if you 'cluster' elements together, they're still "too distinct" for it to be possible in less information. You need too many bits.
@ircmaxell I assumed the PHD was in a relevant field :P
@BenjaminGruenbaum even if not, the point was that it can be tuned appropriately
I see why it's an interesting question though :)
It's the requirements that are kind of unreasonable :P
example: if you have a constraint of 1gb of ram, what could you do to actually lessen the impact? Or what if you were allowed to "skew" results by a millisecond? Or what if you were allowed to provide an average, as long as it was statistically significant...
user924016
17:55
price
@BenjaminGruenbaum but that's why it's an awesome question, because it then lets you dive into what would make the requirements reasonable? what additional constraints would you need to apply to make it really reasonable? What engineering techniques could you use
@ircmaxell if it's millisecond you made the problem easy, you can now solve it with an array and a pointer :P
@BenjaminGruenbaum Well, having the discussion is the point of the exercise... Which we had ;-)
Hah :) Fair enough
ok this is really annoying, how do we find the age if I've saved the column using the date type, something like return all rows where age > 21.. I tried few answers but I can't make that work
17:58
You know what, I'm interviewing next week, I'm convinced to give it a try.
programmed. boom \m/
@Mr.Alien WHERE birthday < DATE_SUB(NOW(), INTERVAL 21 YEAR): dev.mysql.com/doc/refman/5.5/en/…
@ircmaxell even that's cool... thanks.. I'll see if that suits my requirements...'ll be adding some conditions as well..
@Fabien hehe. Kittens are always here to make us smile
@ircmaxell I went with this SELECT DATE_FORMAT(FROM_DAYS(DATEDIFF(NOW(), birthdate)), "%Y")+0 AS age
now the issue is am not able to fetch the rows say between 20-30 , I tried SELECT DATE_FORMAT(FROM_DAYS(DATEDIFF(NOW(), birthdate)), "%Y")+0 AS age from tester WHERE age BETWEEN 20 AND 30 but obv it will return age column not found
well, the problem is that requires a full-table-scan
so how do we go, if we want to select the rows say the users between age 10-20, actually I programmed a matrimonial site, and am creating advance search form, everything went pretty well, am just stuck at this part
WHERE birthday BETWEEN DATE_SUB(NOW(), INTERVAL 10 year) AND DATE_SUB(NOW(), INTERVAL 20 year)
I tried that ^^ ... wait, let me check that again
18:20
Hi can anyone tell e=me how do install Apache Hadoop on OpenStack that I have installed following from here ... ilearnstack.com/2013/04/26/…
?
@ircmaxell As I said I tested that, it returns empty set, when I use DATE_FORMAT(FROM_DAYS(DATEDIFF(NOW(), birthdate)), "%Y")+0 it calculates the two rows am having for testing with the ages 5 and 10 so I substituted your 10 and 20 with 5 and 10 respectively,but fails.... pheeew this is so bad..
Do i have to Convertt a date that i stored with NOW() in sql?
WHERE NOW() > stored_dateTime
@EliteGamer No, you don't need to assuming the datatype of the column is set correctly.
hm, for some reason my code is returning 'expired'
all the time, even when i change the <>'s signs
@Mr.Alien try reversing the 5 and 10, so between 10 and 5....
18:25
hehe done that as well
@Mr.Alien convert to unixtime and substract seconds equaling X years you need
i belive cast() should handle this
actually am not getting the logic of how that works, it means return the rows which are x years old... so that should return me the relevant rows...
@SecondRikudo This is what i adding the the Date_Time column DATE_ADD(NOW(), INTERVAL $expirationTime SECOND)and i am comparing it like this: ...AND WHERE expirationTime < NOW(). Basically if the date has passed, then i want to do something...
@CSᵠ bumped, wait I would try something weird
anyway, something along those lines, i used 'between' only
but fed the dates from php
@CSᵠ I did used between as well, but the column is created virtually using AS statement so sql throws me column not found
@Mr.Alien so... what's the problem? what do you need?
Lets go smooth, I have a DATE type column say bday... now, I want the rows/users which are say between 20-30YEARS of age, now I used this query so it throws me a column with the age calculated, but am not able to use BETWEEN there...
18:34
@ircmaxell strange, let me try again
@ircmaxell works works works :D awesome... thanks a lot for your efforts and time, really appreciate it... :D
@CSᵠ thanks you too :)
:-)
and it's efficient if you put an index on birthday
@ircmaxell ya it's already indexed, I usually index columns like username, bdaes. and other boolean columns :) ....
good evening guys.
@ircmaxell also I asked you a question long time back, that how does fb throw an error saying your password is misspelled .. you said they must be storing plain text passwords... (I hope you were trolling) turns out they maintain an array of hashes, may be jumbled up password hashes too.. so if the hash matches, they throw an error
18:43
Can i compare timestamps simple with the > sign in SQL?
@Mr.Alien well, they are then pre-computing the mis-spellings, but that also makes an attackers job MUCH easier...
@EliteGamer yup
@EliteGamer Yup
hm, i dont know what im doing wron then.
Let me make a pastebin showing you what i am doing
I noticed one strange thing in prepared statement today.
Suppose if my prepared statement is something like : "SELECT * from users where id = ?" .... (id is an integer). Now if I enter value of this parameter as "10 or 1=1" , ideally it should not return any results, but it actually return results if "10" is a valid id in the database. How is this possible ? Since prepared statements separate logic of the query from parameters, so shouldn't whole "10 or 1=1" be treated as a parameter instead of just "10", and since there is no id in the database with value "10 or 1=1" so it should not ret
113
A: Does Facebook store plain-text passwords?

Michał ŠrajerLet's hope and assume that facebook stores only hashes of current password (and potentially previous passwords). Here is what they can do: user sets first password to "first" and fb stores hash("first"). later on, users resets password and is asked to provide new password "First2" facebook can...

18:48
@Shivam First off, are you using true or emulated prepared statements?
@SecondRikudo and @ircmaxell Here is what i have: pastebin.com/hKZ26BzP
@Mr.Alien they are only doing it on reset. Not a problem
Second, because it's an integer, the string->integer conversion will notice the 10, then detect that the rest is not a number and truncate it.
I'm using mysqli prepared statements (I guess they are true)
@SecondRikudo but what if I give bind_param("s", $id) ? i.e I bind the parameters as string ?
It's still working,
@ircmaxell I don't use fb anymore, but few years back when I used to login, say the password is 12345, and I wrote 1234 and they used to throw me a warning saying.. yea just like this
ohh haha seems like it was email or the username
18:52
lol
as it was years back, I thought it was throwing an error for password.. never mind :) thanks again... but the hash idea was pretty good
no, it's not (storing mis-spellings would be horrific)
@Shivam Same, the field is of integer type, so the conversion will happen there.
just for access, not if you are comparing the hash with the users old password right?
What am i doing wrong with my sql logic?
18:55
they are "brute-forcing" permutations on the new password, and checking to see if the old one matches any of those permutations. They aren't storing the permutations
my code return that the date has not expired
@ircmaxell ohhh kkk, so it's just on runtime... and btw your password_hash saves me salting the password like we used to do in old days.. so thanks for that, and as a return, I would like to award you some bounty for your hard work, can you just ping me an answer which you would like me to award you the bounty...
@Mr.Alien and @ircmaxell Dont you still need to salt a hashed password?
18:58
I have alswys done that
@EliteGamer yes, but password-hash does it for you
@EliteGamer nope, not after this guy invented password_hash()
let me take a look
@ircmaxell so share some good answer of yours (they all are, will drain my rep)
18:59
hm, nice. I still use sha512 and a hash LOL, ill see about using it in the next project i hve
:-)
@EliteGamer yeah, you don't want to do that
why not? It is not a BIG project
you will need php 5.5^, but he has also programmed compat layer for the same which supports 5.3^
oh
Mr Alien, did you take a look at my SQL i pastebined?
nope, I suck at sql generally apart from CRUD and joins..
19:03
same here, that date comparison i am trying to do does not work out
@EliteGamer ohh wait, I got that
are you doing something like the websites who provide limited downloads per ips?
yea, for some reason, my code is returning that it has not expired...which the date expired 2 days ago hahaa
@Mr.Alien no, not the one with downloads
that might be someone else
@EliteGamer because hash+salt is not enough, you need a slow hash function
like sha512?
19:06
@EliteGamer watch this talk: youtube.com/watch?v=T4NTdRvIrdk
but that's php check for the interval
YEA, I AM USING sql
WITH THE now()
caps ;(
@EliteGamer what is the value stored in the escalationTime column?
2014-03-25 21:20:49
and what time is NOW()?
19:11
not sure
but that is what i got from NOW()
because that date is less than now
HUH? that was yesterday
Yes, but my code does not detect that
the dates are wrong on your server then
I know that it is yesterday, but
i need the server to decide if that date is past
but it does not
@EliteGamer you should always store dates and times as UTC 0
and than add the offsets
19:12
why is that?
If i can use SQL
suppose you have users coming from different timezones
so what I generally do is store the dates and times with utc 0
and when they login, I add or subtract the offset of their local timezone
this way, it's easy if a user visits some other country, he can simply switch the timezone and the records will be shown accordingly
I am actually storing a time like 3600 seconds
that comes from an API call
to refresh an accessToken
so i dont think it maters
but i did not think of that
i have an question answered: http://stackoverflow.com/questions/22670872/how-can-i-make-the-icon-that-goes-before-the-website-title

oops, it's HTML question (not php)
19:18
That is html, not php, and you need a favicon
@averroken thats favicon
^
There are correct answers as well
yes i know
i have that question answered (i see just, there is double post)
Ya so what's the issue
?
i have an answer posted on the same moment as others
so just keep that the way it is, or delete it if you are feeling guilty
I'm hold it, my answer is correct, why deleting?
yea so keep it
hahahaha
19:33
haha... hilarious !
19:46
someone at work just brought this issue to my attention @averroken and I found the solution here: stackoverflow.com/questions/21984543/…
and what was the issue?
I don't know why I linked you. I clicked your link and I went to the wrong tab, so I thought you posted something different. I"m bad at chat. This was the issue: code.google.com/p/chromium/issues/detail?id=336476
I thought that you had the same issue.
@ircmaxell The date was from yesterday
but my code says it has still not passed
I had not a problem with fonts.
Just sometimes that fonts not render the same in different browsers.(but i have not asked question on SO)
user924016
@averroken browser have different default settings on css of specfic elements
user924016
19:56
a easy fix is using a reset sheet
I had used a rest style but it was the same
user924016
did it include setting a default font?
@averroken all fonts render differently in different browsers, just so you know. most seem to look better in Firefox than Chrome ( but that's just me and my bias )
I had not set a default font in de reset.css
user924016
did it help?
19:59
just reset for margins, padding, etc....
user924016
sure
oh, i had downloaded a reset stylesheet from the internet.
user924016
@crypticツ started following any new series?
the site is online, and with some browsers there are still differences in the menu bar.
I think this is caused by plain type, because when I used the default font it was the same in all browsers ....
a minimalistic site
selected by the customer
:15504167
that's a scary website
20:09
it is a website aimed specifically to dentists and dental laboratories.
as target
Yeah, still creepy as hell :P
For the moment, I am also expanding this site with a shop there for parts.
ThW
ThW
Morning
@Ocramius progress :-) youtube.com/watch?v=IoVsFDJMlqs
@bwoebi github.com/php/php-src/commit/18e2b1a Why did you disallow operations on arrays?
hard to implement?
to me it's evening,
in Belgium
20:16
@ThW stop showing me pr0n! :D
ThW
ThW
lol
bye bye
i'm go sleep
au revoir
20:32
why projects fail..

« first day (1257 days earlier)      last day (3916 days later) »