« first day (1726 days earlier)      last day (3213 days later) » 

12:17 AM
@VeeeneX Doctrine
 
@bwoebi VMs are so 2010, use Docker man :)
 
that's a vm…
 
Sorta kinda
It's a container
Think of Docker like you would a user management system, but for your operating system. It basically allows your to share a VM across multiple, isolated, containers. So it's not exactly like virtualization, but an even higher level of abstraction on top of virtualization software. Instead of running 12 virtual machines, you can run 1 virtual machine that look just like 12 virtual machines.
They share the file system, cpu, ram, and all other system resources, but they're isolated by the kernel.
It's basically just a more efficient way of doing virtualization, but it's got some other cool benefits as well, which makes spinning VMs up and down much easier than only using something like VirtualBox, for example.
 
12:47 AM
hello
I want a help from you
How do I find the realpath() function in the PHP source code?
 
@Sherif meh, freezing/unfreezing just takes like 3 seconds anyway…
 
@bwoebi Yea, but it's the whole configuration and setup that's the real mess. Plus when you want to spin up a dozen VMs on a laptop that only has so much ram and disk space... :/
It's like version source control for your VM
@RowAraujo lxr.php.net
or grep
 
I need to do a function equal to realpath in PHP and wanted to look at the code to copy your code.
 
Why copy? Why not just use realpath?
 
12:59 AM
It's for a job in college.
I need to know how to make a realpath function only using string functions.
 
The job is to see if you can copy and paste code?
 
Oh, you just want to mimic realpath in PHP, you mean?
 
no
 
Well I doubt looking at the C code is going to help you much then.
 
1:01 AM
Create an equal to realpath
 
realpath also relies on realpath cache
Which is basically just wrapper over a bunch of macros
heh
Yea just check if the destination is valid, that's all.
 
in php documentation exists a similar function in comments
 
So for example __DIR__ + <relative path> is_readable
OK
 
similar:
function normalizePath($path)
{
    $parts = array();// Array to build a new path from the good parts
    $path = str_replace('\\', '/', $path);// Replace backslashes with forwardslashes
    $path = preg_replace('/\/+/', '/', $path);// Combine multiple slashes into a single slash
    $segments = explode('/', $path);// Collect path segments
    $test = '';// Initialize testing variable
    foreach($segments as $segment)
    {
        if($segment != '.')
        {
            $test = array_pop($parts);
 
Yea, no need to paste it in here.
I have the Internet.
 
1:03 AM
lol... sorry
hahaha
but it is incomplete
 
So complete it.
I'm not sure what your question is at this point. You have a place to start. Next stop, Brainville
 
im trying
How to detect the standard disk unit for php is run on windows?
like this echo realpath('/windows/system32'); -> "C:\WINDOWS\System32"
 
You don't care if it's windows or not. You just care about the absolute path relative to the given path.
So get_cwd or __DIR__, for example.
 
hmm
 
Returns the numeric value of the code point as a nonnegative integer.
If the code point does not have a numeric value, then -1 is returned.
If the code point has a numeric value that cannot be represented as a nonnegative integer (for example, a fractional value), then -2 is returned.
 
1:14 AM
@RonaldUlyssesSwanson I guess it's broken
Or someone just did a bad job of documenting its behavior.
 
-12345 doesn't look accidental :P
 
Well according to this reviews.facebook.net/D30573 it says nothing about integers: * @return float - The numeric value or IntlChar::NO_NUMERIC_VALUE
 
that constant is not defined
 
And IntlChar::NO_NUMERIC_VALUE is undefined, so whatever the fuck that is.
 
1:19 AM
Where did you get that information anyway?
 
Job I'm considering lists Drupal. What do you guys think of it? Not sure I want to work with it
 
the doc? on the icu website, but it's the java documentation
 
@RonaldUlyssesSwanson Ahh, you're looking at ICU.
Wait is that specifically just the Java implementation or is that in the ICU spec?
 
icu spec of the java icu implementation
 
1:22 AM
bleah, ICU is so friggin massive.
 
but i'm also looking at the c one
U_NO_NUMERIC_VALUE ((double)-123456789.)
Special value that is returned by u_getNumericValue when no numeric value is defined for a code point.
sounds like the value is legit
but the constant is not there
 
Ah, yeah Java doing it's own thing as always
 
better than -123456789 tho :P
> For characters with the Bidi_Mirrored property, implementations sometimes need a "poor man's" mapping to another Unicode character
ahahaha
gotta love icu's documentation
 
ICU is like bigger than PHP itself. Implementing all of ICU down to the T would be a nightmare.
 
i believe lot of it is just data
because it contains also the names of the characters, which are 1,114,112
not counting of all their props/classification
 
1:30 AM
Y_U_NO_NUMERIC_VALUE
 
lol
 
What's the PHP 7 easter egg?
aww man it's gone :/
 
I guess I'm reading up on Drupal 8
 
2:09 AM
hi guys
question, i wanna retrieve username and password from database which is hashed
SELECT * FROM tbl WHERE username = '$user' && password ='$pass'
if ($user == md5($pass)){
is this correct?
 
firstly, don't use md5, look at password_hash and password_verify php functions
then ask again :P
 
hmm, i forgot how i made this before, :/ back to square one :D
 
@JimSteven That would entail that you are storing the password in your database in plain text.
And yea, SQL injection, md5, no explicit fields selected.... There is no shortage of things wrong with that code.
 
i'm trying to understand if there's a way to iterate over all characters matching a block/category/binaryproperty but it doesn't seem possible
 
You're even comparing that the $user is equivalent the md5 sum of their password.
 
2:18 AM
hmm
 
There's just so many things wrong there that I can't even begin to imagine what could be correct.
 
i stored the password in database using md5, nvm the sql injection this will only be used internally
i just want to compare the username and password when the user inputs it in the textbox
 
There's just nothing right with what you said. There's simply too much wrong to ignore here.
 
hhahah okay okay
let me change my question or rephrase it one more time
 
I'm about to translate PHP language specification to portuguese. Anybody to help?
 
2:21 AM
@MarceloCamargo Do I have to know Portuguese?
 
Well, I believe, so. :/
 
Then I guess not :/
 
1.) user registers username and password, the password is hashed using md5 and was stored in the database
2.) user will now login, inputs username and password, upon clicking submit, it will verify if the username and password matches, how can i match a hashed password to the username
 
@JimSteven You don't. You select the user name and compare the stored hash to the hash of the plain text password provided by the user at the time of submission.
 
i wish i knew C
 
2:23 AM
Now all you have to do is get the other 697 things right.
3
@RonaldUlyssesSwanson learnxinyminutes.com/docs/c
 
okay i'll try
 
Dude K&R is literally like one chapter of the Java spec.
 
lol, that's pretentious :D
 
2:24 AM
Let's see what modesty gets you
 
I find that diving into the deep end is the only way to learn. Anything else is just a lesson in futility.
 
true
looks like even the java api doesn't have proper filtered iterators. you can only iterate over the totality of the 1m code points
 
hmmm, Java doesn't have something, shocker...
 
2:29 AM
Last time I looked at Java it made a hazzlenut, extra whip, no foam, non fat, latte and handed me a warm buttermilk brownie.
 
Which was wierd, because all I did was throw a QuenchRuntimeInterfaceDiureticExceptionException.
 
i would have guessed tea, not milk
 
@RonaldUlyssesSwanson Isn't it a bit ironic for a programming language called Java to make you tea?
 
2:31 AM
What is this the British version of Java?
J2E4B
 
actually, there's also the java tea :D
 
Java Extraordinarily Enterprised For Brits
 
 
2 hours later…
4:59 AM
How to get the current directory of a php script? DIR gives me the correct path on localhost but on the webserver I get something like 'www.xyz.com/home/myuser/public_html/'
That's the absolute path prefixed by website url
 
that is the correct path, with respect to the file system
or rather
it should be!
/home/myuser/public_html
 
Yeah I know, but why am I getting the website url with that?
 
if you need the current location, \dirname($_SERVER['PHP_SELF']);
how are you using it?
as a hyperlink?
 
Yeah
 
that's why
 
5:01 AM
hi, simple question here
 
trying to create a hyperlink using javascript
 
your browser interprets <a href="/home/myuser/..."> as a link to http://currentdomain.com/home/myuser/...
you can safely just prefix it with / and be done with it then
 
$query = "SELECT * FROM [master].[dbo].[userTbl] WHERE [username] = '$user' AND [password] = '$pass';
$result = sqlsrv_query($conn,$query);
$num = sqlsrv_num_rows($result);
if($num==1){
echo "Success";}
else{
echo "Invalid username/password";}
I TRIED TO input the correct username and password, still it echoes invalid username
 
check out what $_SERVER offers
 
Thanks
 
5:02 AM
np
do be careful though
13
Q: PHP_SELF and XSS

McRonaldI've found an article claiming that $_SERVER['PHP_SELF'] is vulnerable to XSS. I'm not sure if I have understood it correctly, but I'm almost sure that it's wrong. How can this be vulnerable to XSS attacks!? <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <!-- form contents --

etc
 
5:24 AM
which framework should I learn to make the code neat and understandable ?
Also to add professionalism in my work.
 
hey guys, scroll up a bit, and take a look at my post, feel free to comment :)))
 
5:48 AM
Morning guys
I have a php page called:
http://localhost:81/ogygafsf/public/cheque_paid.php?id=2
It has a form which updates the existing record
But my question is, whenever the form is submitted, I want the page to reload
But when it finishes reloading the query string is removed from the url
and it becomes
http://localhost:81/ogygafsf/public/cheque_paid.php
Which causes some errors on the page
I'm trying to use:
header("Location: $_SERVER['REQUEST_URI']
But it also removes the query string
Any ideas ?
 
<form action="cheque_paid.php?id=<?php echo $_GET['id']; ?>" >
 
As far as I know, the action attribute is the path where the form data is submitted
Am I correct ?
 
yes, is your form being submitted to same page or different page?
 
It is being submitted to different page for processing
In short, I want the same page to reload when the form is submitted while maintaining the query string in the url
 
5:57 AM
okay, then send a hidden input to that page containing the id from cheque_paid.php
when form has been submitted, header('cheque_paid.php?id='. $_POST['id']);
 
morning
 
6:14 AM
@RonaldUlyssesSwanson I wonder how long it took to render that
I don't think he got em all
 
yeah, it's partial :P
 
It's like looking at a country from 40K feet
 
An SVG would have been a lot more useful
At least then you could play with it in html5
 
6:46 AM
@varunsinghal I tried to do it. but it still removes the query string
 
hrm, would you say "Saved changes" or "Changes saved" ?
 
Changes saved, Saved changes reads too close to Save changes for me
 
Saved
Sounds like a daemon with a hoarding problem.
 
7:03 AM
Morning
Question, when a website is finished where do you store the backup? And do you have specific naming conventions for storing it locally?
Still no one here a Laravel fan btw? :D
 
@Duikboot Off-site, a backup is ALWAYS stored off-site, prefferedly multiple places. - And I guess naming after it what you are backing up, and then append it with the date of backup?
@CᴴᵁᴮᴮʸNᴵᴺᴶᴬ true.
 
7:19 AM
Ofcourse off-site :)
 
a different hard disk on a different machine
 
That's currently the location where I store it.
 
friends which is best web site to learn Drupal?
 
holy friggin black magic!
dbg is saying insane things!
 
yay, holy shiny "new" PHP bug ?
 
7:34 AM
@AlmaDo new?
What's new about that?
 
@AlmaDo no, very old
there even is a highly upvoted answer from someone in this room explaining it, iirc
 
You just discovered references. Congratulations.
 
nothing, PHP is fucked up in so many ways that there's hard to find something new. This one is just ingenious
 
guys, i just subscribed to the internals list. how do i write to it, now? :P never ever used newsgroups
 
It's not a bug either. It's defined behavior.
 
7:36 AM
what is "defined behavior" ?
 
References
 
I mean, to screw only last element ? (:
 
@RonaldUlyssesSwanson send a mail to internals@lists.php.net
 
You're just learning about them for the first time. That's all.
 
ty @FlorianMargaine
 
7:36 AM
@Sherif ??
 
Once you understand how references work none of that will surprise you.
It's when you don't that you are surprised by things like that in PHP.
It's not very obvious, I get it. But that really is well defined behavior.
Now, whether or not it's desired behavior, is a totally different thing :)
My solution is just don't bother using references in PHP. You don't need them.
They're far more trouble than they're worth and there is always a better alternative.
 
except when using legacy frameworks that pass arrays everywhere, you need references
my life sucks :(
 
@FlorianMargaine No you don't. Why do you think you need them?
Passing an array to a function doesn't invoke a deep copy of the array. Unless you invoke COW.
The only thing copied is the hashtable, but even then a reference could actually invoke COW inadvertently ;)
 
@Sherif he's talking about objects, I guess
 
@AlmaDo Well you certainly and absolutely don't ever need a reference for objects
 
7:43 AM
is it just me or is google slow today?
 
Objects are more referencey than references
 
morning btw :)
 
@Sherif yes. he's talking that objects are references as they are.. isn't it? (:
@Naruto it's probably because of PHP influence
 
@AlmaDo I didn't see him mention objects at all in that sentence, did you?
 
@Sherif no. I tried to guess that "need" means
 
7:45 AM
And why on earth would you guess that he meant objects, knowing that objects don't require pass-by-reference behavior?
Sounds like a horrible inference.
 
forget it
 
Trying to.
 
you just pissed me off (:
Back to work
 
I pissed your what off?
Dude, don't get pissed off at me because you said something stupid. Go get pissed off at yourself or learn to deal with it.
heh
 
(: just fyi, first time I really removed phrases from someone in the chat for myself (aka ignored). Eh, day started badly and for the first time old good room11 failed for me :\
 
7:55 AM
@AlmaDo any workaround? ^^
 
You know informing people that you are ignoring them is passive aggressive behavior. It just means you are the asshole and you're misdirecting your anger towards someone else.
 
Why are you pressing the issue? Just sounds like you're trying to wind him up now.
 
my first post on internals! news.php.net/php.internals/87068 i feel like last year when i used the potty for the first time
 
@RonaldUlyssesSwanson is there any reason for this?
@RonaldUlyssesSwanson does it have any advantage?
 
well, diapers are unconfortable
:P
 
7:58 AM
@RonaldUlyssesSwanson advantage that would make the BC break worth it
 
backwards compatibility
 
intlchar was implemented for the first time less than a week ago
in php7
 
@Fabor Not at all. I'm trying to set him straight. People need to learn to deal with others in a world where everyone has a voice on the Internet. You're not going to like what everyone has to say, but that doesn't mean you have any more of a right to speak. If you don't like what someone is saying, fine. That doesn't mean you need to devolve to passive aggressive behavior.
 
ah, ignore me then.
 
7:59 AM
And stopping at passive aggressive would've met that point, but you pushed it to call him an asshole.
 
@Fabor yeah, he just likes to always have the last word.
 
still, maintaining compatibility with icu api could be better. i don't know
 
@Fabor No, I related passive aggressive misdirection to the trait of being an asshole. There's a difference. Don't conflate things. This is exactly the kind of group think behavior that passive aggressiveness creates.
@FlorianMargaine's last comment is a perfect example of that.
 
@Sherif you know, when many people have issues with you, maybe you should question your own behavior
 
Sherif, you need to work on your personable skills a little bit. Otherwise no matter what your intent is they won't listen. No point being right if no one cares what you say.
 
8:04 AM
The point isn't to be right. I'm not always going to be right. I'm not infallible. The point is to be a realist.
 
Realist !== insulting
 
Agreed. Though an insult can be quite subjective in a medium where so much is left up to interpretation.
You realize the irony of telling me that I'm insulting someone could be perceived as an insult, right?
So by definition you are still a part of the problem.
See, I can chose ad hominems too, to win my argument, but I'm not actually trying to win at anything.
Think about it.
 
@FlorianMargaine do you understand this -> mandellia.fr/images/detailed/20101211162433_npo_2_ssz_A.jpg
 
@ziGi yes, I do
 
Ouate de phoque
 
8:08 AM
be good kids
 
In a society where good behavior can be conflated for bad behavior and vice versa, there is no sense in trying to advice others to simply "be good" unless you are defining the parameters of good within the confines of your advice. Otherwise, you're just a hypocrite.
 
Agree to disagree @Sherif. Let's move on.
 
@Sherif why are you always contradicting people, can you give me a reasonable explanation?
Sounds a bit like cavil to me.
 
@ziGi Not always. There are many times when I'm quite agreeable. However, I chose not to agree for the mere pleasantries of being agreeable. Instead I'd rather adhere to my principles no matter how disagreeable they may be to others.
 
@Sherif sounds great, but sometime it seems like you are arguing for things that are not really useful or relevant in my opinion, but it is your life, eh.
 
8:14 AM
@ziGi If they aren't useful or relevant to you, you can always just simply ignore them. I don't force you to agree with me. I just explain my point. If you wish to converse about it I'm more than happy to do so. Otherwise, how can I ever expect to learn from the other view point?
If I don't challenge opposing thoughts I can't reasonably draw my own conclusions.
It's just that not everyone thinks it's OK to hold two opposing ideas in a single thought. I find it quite intellectually stimulating.
 
@Sherif ok, actually I agree with you on this one quite strongly. It just seems that you get too much into details and seems a bit petty.
I am not sure if that's the correct word
 
I though this was the php room not the philosophical room :D
 
I can't understand how may see it that way. Though I try not to focus on what emotions others will draw from my thoughts. Only what I can understand (facts). It's not easy to decipher other people's emotions, especially on the Internet :)
I find that emotions actually tend to cloud my judgement a great deal. Perhaps that's why some people don't like what I have to say, as it tends to be quite void of emotional content.
 
Yes people are complicated in general because of emotions. But actually emotions help you remember quite a lot.
You can read an article about it if you are interested
 
I'm sure emotions have a great many benefits. I just don't find them easy to understand as they are so sporadic in meaning. I take what I can carry :)
 
8:19 AM
@Sherif sure, I understand
I hope I haven't offended you, I am not trying to change you, I am telling you my impression
Since it can bring some turmoil to the room, that is the main reason I started discussing it at all.
 
moin
 
Not offended at all. Like I said, I try not to read into other people's emotions on the Internet.
For all I know the person on the other end is really just a really sophisticated Turing-complete AI program.
 
morning
 
@Sherif good stuff, good stuff. I am back to work though. Have to figure out how to make the deployment server fix permissions on windows
Here's some food for the thought
 
Anonymous
monin o/
 
8:22 AM
\o
 
I think that link might be broken. It just takes me back to the home page.
 
@Sherif interesting, thanks
 
Oh wait, I guess I have popup blocker on or something.
 
yeah
the website is a bit strange, I think it's made for tablets or something
@Sherif one last question, have you worked at Google?
 
@ziGi No, why do you ask?
 
8:25 AM
aren't you googleguy?
 
Sure, does a nickname automatically imply your employer though?
Actually has nothing to do with Google the company.
 
binguy
 
Hello!
 
nope, but if i were google i would hire you. it sounded legit to think that :P @Sherif
 
With this summer heat kicking in, here is a dual purpose USB fan for us to enjoy.
 
8:28 AM
@Sherif cause I checked your GitHub repo and website and your name is srgoogleguy and you seem smart, so I assumed it.
 
@RonaldUlyssesSwanson If I was a multi-billion dollar conglomerate you would hire me?
 
~$10/£10
 
@ziGi Ah, gotchya.
 
@Fabor Thanks, I'm feeling more cooled down now <3
 
@Sherif not immediately but you seem interesting as a person. You tend to show analytical skills so I guess you have some nice qualities that shouldn't be ignored
 
8:29 AM
@Sherif i would hire you despite you are an irritating a** xD my english is not very good, you should know that by now
 
@RonaldUlyssesSwanson he's not that irritating, he's just questioning everything as a good programmer should do
 
Anonymous
he got a ban from me for being teresko 2.0
 
I suppose it doesn't help that there are too many references on the Internet between me and Google
 
@samaYo haha what's wrong with teresko?
@Sherif haha you want to work there subconsciously, admit it :D
 
Anonymous
8:32 AM
you haven't been here long enough ..
 
Old-school @tereško had no filter.
4
 
@samaYo means that you ignored him?
 
@samaYo I've been for a bit over a year
 
Then he got a job where working required patience or turning insane. :P
 
@ziGi Not at all really. It would have been fun maybe 10 years ago, but Google is way too corporate for me.
 
8:32 AM
@Fabor I've noticed a tendency of programmers to be direct
 
@ziGi Yes, there's a few common and sometimes unlikable traits developers carry.
 
@Fabor Isn't that just "a job"?
 
somehow there's a correlation
 
@DaveRandom lol
 
I think it's called professional deformation and you start applying your job in real life.
For example over-analyzing everything and thinking about all the possible outcomes and how to handle them.
 
8:34 AM
Working with people you don't like is good. It gives you diversification in thought. Working with people who all think alike, gives you mediocrity.
 
Anonymous
@RonaldUlyssesSwanson yeah ... can't be near conceited picklepuffers
 
You should work with people don't like. You don't have to like them to work with them. You just have to be able to respect them.
Truth is you're not going to like half the people in this industry anyway, but many of them are super smart and there's a lot you could stand to learn from them.
 
@Sherif diversification in thought is not necessarily with people you don't like. You can have differing opinions and be friends
 
Yeah but the way you handle it is the difference between PHP internals and civilised conversation.
 
*doesn't like @Sherif*
 
8:36 AM
@Sherif I like the people in the industry, I hate it when they think they are the best and don't accept your opinion, unless someone older than them tells them the same, those are the worst vindictive a-holes I've seen, because they fuck up the workflow and add technical debt to the software. Especially if you start questioning them and they start shouting etc.
 
@FlorianMargaine You can, but typically two people with opposing thoughts don't tend to be birds of the same feather ;)
 
I ordered that clock-usb fan... Damn how could I not?
 
@salathe *doesn't like anyone*
 
@DaveRandom New TV show BTW. Just started airing (2 episodes in) "Mr. Robot" Trailer
 
Example, I tried to convince my colleague for 6 months that we should go the DDD way for the new modules and not just Data oriented approach/CRUD since it will bring value. He disagreed with me and told me that I should stop listening to people on the internet and stop reading stupid blogs. After 6 months, my boss hired a software architect who said the same as me and we applied it.
 
8:40 AM
@ziGi Funny thing is as engineers we tend to think that just because we have used logic and proven things with facts that we will convince others. In reality, convincing people requires passion, not logic.
 
@Sherif I totally agree, that's why Jobs was so successful
 
It's easier to get people to fall in love with your passion than it is to get them to fall in love with your idea.
 
you have to be passionate and inspiring and to know how to talk to them
 
@Fabor interesting, will check it out
 
@ziGi Yup, he was a hell of a diva
 
8:42 AM
@Sherif haha still is, just in a different company
 
Huh?
 
yeah
:D
 
What are you talking about?
 
he decided to quit and go do C#
oh, shit, sorry I got confused
 
C#? he's in hell?
 
8:43 AM
Jobs was a diva, I agree, that's the way
 
@ziGi he was right tho when he said that you should stop reading stupid blogs. most of the information about advanced programming is just crap. and it's even worse when it's about php
 
@RonaldUlyssesSwanson explain yourself Ron
 
For a minute there I thought you'd resurrected the man.
 
Hahaha, wow, that's be great, unfortunately I don't cast 4th level spells from Heroes III
 
@ziGi did you find informing yourself about DDD easily? because the more i learn about it, the more i realize that everything i've read in the past in random php blogs was just junk
 
8:46 AM
@RonaldUlyssesSwanson I've read only books, not blogs, so I have no opinion on that
 
If you ever get a chance you should read the book Becoming Steve Jobs, BTW.
Excellent read.
 
i didn't mention books :P only blogs
 

« first day (1726 days earlier)      last day (3213 days later) »