« first day (2539 days earlier)      last day (2423 days later) » 

12:08 AM
lol, so I tried doing a factory reset on my phone from android settings. Settings crashed.
I'm doing it the hard way now
 
12:30 AM
/cc @PeeHaa
A good thing to test it with is the € (euro symbol) character
because that is in a different place in all those charsets
also worth noting is that chrome seems to flatly refuse to send form data in UTF-16, which I suppose makes sense because UTF-16 is shit
The _charset_ hidden field thing seems to work nicely, although tbh it's irrelevant if you just specify UTF-8 at the document level
 
1:00 AM
I want to post a json to a url how should i do it?
 
 
1 hour later…
2:26 AM
@OtávioBarreto With ajax.
 
Wes
3:09 AM
hodor
 
3:26 AM
hodor!
I mean shit, spoilers
 
Wes
rip. he lived the best life
@FélixGagnon-Grenier hodor!
 
Wes
96
Q: How was "Hodor" adapted in other languages

Deepak KamatSpoilers for episode 5 of season 6 "The Door". At the end of the episode we got to see how Wylis became Hodor and why all he can say is "Hodor". If you've watched the episode you know that but how was this shown in versions of the episode dubbed in other languages? If the name of character...

 
3:43 AM
Hey can anyone help with this? Really lost on this one.

https://stackoverflow.com/questions/46437797/htaccess-rewrite-with-wordpress-plugin
 
Wes
4:22 AM
i would be fucking angry too if i was that thing
 
@Wes lol yeah
haha that's amazing.
 
@DustinSnider I think I know how to do that...but I doubt it's the best way.
I did something similar when I was white-listing a service to include CSS files from S3 based on a header. That header was created by an .htaccess file.
Using a GET variable is not as good because you may want to re-route requests that are more complex.
 
Wes
@Linus what's that gif of pass by reference that you had?
don't we have a canonical of var references vs object handles? @FélixGagnon-Grenier, anyone
 
4:58 AM
hmmm possibly not
I don't remember learning it from SO either
I can't find any here guide.room11.org/canonical.html
 
@FélixGagnon-Grenier Woah. I'm sure there's some good stuff in there. Thanks.
 
in fact, I remember reading once an articale about scope, reference counts, memory handling and garbage collection that was like the dawn for me. And I can't find it again.
s/once/an awful lot of/
but that precise one was really enlighting.
... which is pretty orthogonal from object handles, but y'know. I get carried away
 
Wes
it's hard to explain because the difference is subtle. and the details are hidden to userland. like. in order to understand the difference you need to understand how variables work internally
i might write the canonical
unless there is one already... can't find it tho
 
these tend to appear exactly ten second after you've asked the canonical
for whatever reason, they don't exist before, they just materialize with three years of age
 
I understand now.
Second comment down.
 
5:07 AM
@Wes which one?
 
Wes
but that's ambiguous too
 
oh that :P
 
@Wes a handle is a pointer to the real object. If a handle is used as an argument to a function it will still be passed by value...the function will receive a copy of the pointer. I can therefore delete the original variable I passed to the function, and the object will have not been removed from memory...just the first handle.
If however I pass it by reference to the function and do the same thing...the variable passed to the function will be null.
 
Wes
for now just forget about & and always use === for comparisons (never ==)
 
@Wes That's lame. Why do I need to type check everything?
 
Wes
5:11 AM
type check?
i blame laravel
 
$hasAStringInIt = "One of many strings could have been here, or it could have been null.";
    if ($hasAStringInIt)
 
Wes
coercion (implicit casting) is globally known as a bad thing. causes mistakes. people don't remember what gets converted to what
php is especially bad (but not as bad as js :P) with that
 
@Wes The only time that kind of thing has rung me up was when I was working with something that could be a Boolean or a string.
 
Wes
like it doesn't fulfill symmetry in equivalence relations
basically $a == $b could give a different result than $b == $a
which is really bad, don't you think?
 
I mean...I guess. But I read everything left right anyways.
I can't think of a situation where you would accidentally switch. I'm sure you're right for reasons I don't understand fully though. I'll just do it.
 
Wes
5:16 AM
if it's equal it shouldn't matter how operands are placed
 
when will ($a == $b) != ($b == $a) ?
 
Wes
i don't remember. nobody can remember and that's the point
it's easier to do explicit casting than remembering how stuff is converted
 
@RonniSkansing
 
Wes
i think andrea knows cases where the symmetry is not respected @RonniSkansing
 
$foo = "I am a non-empty string.";
$bar = true;

($foo == $bar) != ($bar == $foo)
 
Wes
5:18 AM
maybe numeric strings?
 
both are true but yea, well dont use php =p
 
Wes
@Allenph in that case symmetry is respected
but it's still confusing
 
I was just realizing that. That was more of an example of one of the places I've not noticed and it's caused me problems.
 
Wes
it's much easier to read and less error prone with explicit casting and strict comparisons
 
You guys know that php will/cant never be fixed
 
Wes
5:22 AM
just avoid ==, use ===
 
yea I agree, be strict, use types, avoid globals, use descrptive names etc (=
 
Wes
we know php will never be fixed. but languages are just as bad or worse. it's normal
 
I dunno
I think all these langs like Go, Crystal and stuff like Elixir
Is a much better start imo
 
Wes
go doesn't have generics :P
 
Go doesnt need it, it could benefit from it imo, but yea, lets see in 2.0 what gets added. I am not missing them atm
basicly all my own projects have shifted to Go and all work stuff is now c#.net (but that is the workplace choice, because yea that what they do)
but no doubt php is a great moneymaker!
 
5:44 AM
nin
 
.@Twitter is considering #280characters! Or as we say in Germany: 4 words. #Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
3
 
Status code is always forced to 401 when setting the WWW-Authenticate header – #75272
 
5:59 AM
@Wes so did you finish the movie?
 
when i write query for updation error occurs like this:
Parse error: syntax error, unexpected ''.$roww.'' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\phpbb\includes\functions_posting.php on line 2176
 
Wes
nop
 
And this is my query:
$sqlupdate ="UPDATE printtable SET pass='". $_POST['pass'] . "',
printprocess = '" .$vv. "',
printsupply = '" .$v1. "',
printesb = '" .$v2. "',
printwork = '" .$v3. "',
printpri = '" .$v4. "',
printmate = '" .$v5. "'
WHERE post_id = "'.$roww.' AND pid = '.$row1['pid'].';
 
Wes
if i finish this shit i'm doing this morning i will watch it in the afternoon
 
!!canon sqli
 
6:01 AM
2785
Q: How can I prevent SQL injection in PHP?

Andrew G. JohnsonIf user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the us...

 
@abdul ^
 
yes @Gordon
 
---Un---expected much insecure
 
$sqlupdate ="UPDATE printtable SET pass='". $_POST['pass'] . "',
printprocess = '" .$vv. "',
printsupply = '" .$v1. "',
printesb = '" .$v2. "',
printwork = '" .$v3. "',
printpri = '" .$v4. "',
printmate = '" .$v5. "'
WHERE post_id = ".$roww;
It works for me but when i add AND clause it doesnot works @Gordon
 
@abdul use prepared statements
 
6:02 AM
prepared statements means??
 
stop writting insecure queries
http://php.net/manual/en/mysqli.prepare.php
stop using plaintext passwords
 
@abdul check the post above
 
oh
okay @Gordon
 
sup PHP
 
Thank you @Gordon it working...!
 
6:08 AM
@abdul so how does the code look now?
 
@RonniSkansing my query looking like this: $sqlupdate ="UPDATE printtable SET
printprocess = '" .$vv. "',
printsupply = '" .$v1. "',
printesb = '" .$v2. "',
printwork = '" .$v3. "',
printpri = '" .$v4. "',
printmate = '" .$v5. "'
WHERE post_id = '".$roww."' AND pid = '".$row1['pid']."'";
 
so. you did nothing of what we just told you
 
Not like that @Gordon i maked changes into quotes please check that
 
please use prepared statements.
if you dont know what prepared statements are, google it. it's fundamental to know. you cannot continue writing code like the above. you are making the internet insecure and you are putting your client at risk of losing all of their data.
 
okay
 
6:19 AM
@abdul seems like you changed the sql abit, now there is no pass field?
 
@Danack If you read the article, the only reason why they didn't use UUIDs was because they wanted to stay with 64bit for legacy reasons and UUIDs need 128.
And for some reason they want to sort by id instead of tweet date. I guess that's also for legacy reasons because 3rd party applications do that and I guess they had autoinc before
But didn't want to rekindle the discussion. Let's leave it at that :D
moin all o/
 
6:36 AM
heh morning
 
mornin`
 
omornin
 
7:46 AM
If I use the scope resolution operator and store the result in a variable, why does the value of the variable change when I change the scope class?
For instance I have $var = CL::Foo(); // changes property value to "foo"
then if I do CL::Bar(); // changes property value to "bar"
What I want to happen here is that CL::getProp() would return "bar" because it has been changed in the class. But I want $var to stay as "foo" but it would show "bar"
 
wat
 
Wes
wut
also @JustCarty fyi the fact that :: exists in php doesn't mean you are obliged to use it
if you are using it almost for sure you are doing something wrong
 
8:09 AM
mornin
 
Anonymous
morn
 
Anonymous
@Wes self::MY_CONST
 
Wes
also constants are global
if we had enums constants would have no use basically
 
@Wes 7.1 allows private constants, doesnt it?
 
Wes
8:18 AM
@JayIsTooCommon that should be injected configuration :P
 
Anonymous
I was mainly referring to the 'global'
 
In my access.log I have :
192.168.178.127 - - [28/Sep/2017:10:14:46 +0200] "POST /upload.php HTTP/1.1" 200 259 "-" "Mozilla/5.0 (Linux; Android 7.0; SM-G930F Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36"
what is 259 for a code?
I cannot find a status code with that number
 
that's not the status code. 200 is the status code
 
@jublikon 259 is probably the content length.
 
@Wes what should be configurable? the url?
 
8:20 AM
@kelunik thanks
 
@Wes And sets for flags, right?
 
Wes
ok i give you that there is no big difference between private constants and normal fields
it would be much better if we had constant variables
public const $url;
@Gordon in that case is not really important, but i would default to inject stuff rather than hardcode it in
 
huh? you drunk?
 
Wes
constant variable references
 
@Wes it's pointless to make the url configurable because the entire logic depends on the returned json of that particular api.
 
Wes
8:24 AM
that's the actual name, i know it's funny.
 
Never used a js framework (except jquery). where do I start? vue, angular, react?
(with the idea of it being the frontend for an api)
 
@Patrick react
 
Wes
@Gordon what if i add a second service that happens to use the same format of that json.
 
@Wes Would you like doing a frontend project? :P
 
Wes
what project?
 
8:26 AM
Hi, plz can anybody look at this question stackoverflow.com/questions/46463290/…
iam using SQL and php
 
@Wes then you add another constant and put both into an array and fetch from the array
but that decision should be deferred until you actually have that case
 
@Gordon hmm but facebook license problems?
 
> Facebook has decided to change the React license from BSD+Patents to MIT to make it possible for companies to include React in Apache projects, and to avoid uncertain relationship with the open source community.
 
Wes
@Gordon so cram everything into one class till it doesn't leak? :B
 
@Gordon hmm that better. do you have experience with the others? vue looks nice on first glance (even though it's used by laravel :D)
 
Wes
8:33 AM
i don't try to anticipate future functionality, but i try to create required functionality in such a way that can be used freely
 
@Wes I know what was wrong, it was because of return $this rather than returning the value
 
@LovepreetSinghBatth wtf
 
Wes
if i can avoid potential future refactorings i will do it
 
Anonymous
But in this context, I think an injectable configurable would be useless
 
@Wes that's the thing. if you make the url configurable, people will put in different urls than those anticipated by the code, so it cannot be used freely, because changing the url requires changes to the code.
 
8:37 AM
@RonniSkansing What?
 
@Patrick I am not a frontend guy. I had very little hands-on time myself. on my previous job we used angular and it got the job done and the devs liked it. at the current job, we heavily use react and it also gets the job done. so I am basing this solely on that :) might want to get a more qualified opinion elsewhere.
 
moin
 
Wes
@kelunik what project?
 
@Wes I want to revive my chat project, but have zero motivation for building the frontend.
 
\o
 
Wes
8:42 AM
@kelunik i'd rather do the saas thing
 
@Wes You mean daas?
 
Wes
yea daas
if you instructed me a bit on that i could help
the elastic thing left me very confused
 
@kelunik daas? nah, just ass
 
Wes
i could only understand how you grabbed the data using phpparser if i remember correctly
 
@LovepreetSinghBatth that picture is crap
and it not due to "bad luck"
 
Wes
8:49 AM
electronic music suggestions? old stuff preferably, without lyrics also preferably (can't listen to people singing while programming)
 
Is declaring lots of variables bad? Does it affect performance, loading times etc?
I have a validator class but created multiple variables for each type of validation because the class stores restrictions.
Would it be better to do that or have a clear() method and reuse the same one?
 
Write you code to be secure, and readable by humans. Don't worry about any other aspect until you have a problem.
6
certainly "too many variables" is not a valid concern, unless you have so many that your code is no longer readable
 
Anonymous
@JustCarty ^ this is very good advice.
 
@DaveRandom I am trying to teach myself PHP so I don't fully understand which is why I ask a lot of questions. Thank you for that advice. That is one thing that always makes me wonder
 
@Wes not old, but try spotify:artist:5RPzPJCg4ER1LzQkorZ31p
 
8:58 AM
Hello Guys,
I need some help in wordpress + woocommerce https://stackoverflow.com/questions/46189133/how-to-supply-console-logs-data-into-the-woocommerce-cart
 
commit 04ac96e4a30b207ec0113f25fc5dc4f7201859f0 (HEAD -> master)
Author: Chris Wright <daverandom@php.net>
Date:   Thu Sep 28 09:57:46 2017 +0100

    Real initial commit having actually added the files

commit a93207607de9c50df89ea29d03bf67349ab65872
Author: Chris Wright <daverandom@php.net>
Date:   Wed Sep 27 20:53:38 2017 +0100

    initial commit
srsly like 50% of projects I create :-/
 
Wes
i haz no spotify
 
@Wes soundcloud.com/worakls start with Salzburg
 
+1 for Gordon's suggestion
 
9:02 AM
though admittedly Salzburg is much more awesome than the others
but in general, it's nice to code to Worakls
 
Wes
yeah nice
 
@DaveRandom I usually start experimenting without a repo, so my initial commits are bigger
 
Wes
not exactly my mind of electronic music but not bad :P
 
@Gordon sure, me too, generally my initial commit should be a poc. What I mean is I forgot to git add --all, so my initial commit consists of a project skeleton :-P
 
@Wes see if you can find discogs.com/de/Dr%C3%B8n-Parsec/release/55967 in your $whateveryouuseformusiclistening
 
9:13 AM
php_zlib_inflate_filter() can return 0 bytes_consumed incorrectly – #75273
 
Wes
@Gordon i recognize some samples from other music :B
crystal method maybe
does the music ever change or is the same loop repeated forever :B
 
it's very minimal and unobtrusive. It always gets me in a focused coding mood.
 
Wes
9:29 AM
it's a bit too minimal maybe :B i liked the other ones more
 
@Gordon this is true regardless, not only for the song
 
@RonniSkansing i know, my handwriting is very bad, but you can also read the question text, there is no need to look at the pic, plz answer ig you know
 
9:45 AM
hey everyone...looking for some advise here, i have installed laravel framework, but at this point i´m kinda stuck on how to proceed relating the database...i´m used to work with mamp on my mac, but laravel has homestead which seems to be really great, but...should i configure laravel to work with mamp, or should i use homestead?
i see people configuring mamp with laravel, but homestead seems to be more smooth to work, what do you think? has anyone here working with laravel? what should be better to work with?
 
@Japa use homestead. Not having your dev environment match live is a bad idea.
 
@Japa why did you pick laravel?
but whatever you do, mamp is probably the wrong choice
 
@Patrick a friend of mine said that laravel was a good framework and that i should try it, so i went to the laracasts videos and started seeing the videos, and i also though it was great, but do you think it is not?
@Danack thanks for answering
for a person like me(rookie) that is used to create all the .php files by hand, do all the work without no organization, a framework helps a lot
 
10:01 AM
@Japa it can be alright if you know what you are doing, but the docs teach some bad stuff
if you want to become a better programmer overall, I wouldn't recommend it
@Japa or you could learn how to do it properly
And then probably still use a framework, but you can make an educated choice
 
@Patrick really?!?! oh man!..i though the docs was one of the things that was good, even the videos, the tutor explains so well that makes you feel that you can do anything :)
 
@Japa laracasts has some good stuff, but then there are videos like laracasts.com/series/php-bits/episodes/1 that go against everything that we learned as a community in the past decade(s)
It's always good to learn from multiple resources and then compare them
 
@Patrick thank you for the advise patrick, at this moment i clicked on the link you show me, and i´m going to read everything...thanks man!
 
Wes
@Gordon like underworld? i hate sticking to old music but damn new music all suck -__-
prodigy, chemical brothers
 
10:25 AM
!!man chpst
 
[ [chpst [-vP012] -u ] chpst [-vP012] [-u user ] [-U user ] [-b argv0 ] [-e dir ] [-/ root ] [-n inc ] [-l|-L lock ] [-m bytes ] [-d bytes ] [-o n ] [-p n ] [-f bytes ] [-c bytes ] prog
 
Anonymous
wat
 
wat
 
10:42 AM
@Wes it's not the music. you are just getting old :D
 
Wes
true
 
@Jeeves why did that link the -u?
 
@bwoebi It hurt my feelings.
 
@Wes I like some prodigy and chemical brothers, but I am not too familiar beyond the hits.
 
Wes
listen it all. it's got an epic crescendo
 
10:55 AM
yeah, sounds ok
 
@Wes did you ever play en.wikipedia.org/wiki/N2O:_Nitrous_Oxide ? Probably not....damn kids.
 
Wes
nop
but yeah crystal method did a fuckload of soundtracks
even matrix i think
at some point around 1998 ish they were everywhere
@Danack that reminds me i would give a kidney to play wipeout again
which btw had also fantastic music
 
11:54 AM
@Wes I thought you were more into this kind of music
 
Wes
wtf
 
@DaveRandom awesome :)
Mornign
 
12:02 PM
@Tiffany yes, that's well-formed UTF-8
both of them
If they are getting mangled on the way to the database, then something is wrong with your database setup
ofc it's also possible they are getting mangled on the way out of your database
Spoiler alert: just use UTF-8
 
I've set the encoding to UTF-8... maybe UTF-16... but maybe it's the variant of UTF-8 that I"m using?
 
Always use utf-8 bits :P
 
Those zeros and ones need to be represented properly yo
 
12:04 PM
utf8_generai_ci is what I'm using
 
imagine if they succeed in dividing the world like they did wich character sets, but with qbit state
 
wait, blah, that's not encoding
 
That's collation
you need to set the connection charset
with PDO you do it with a DSN param, ext/mysql and mysqli have specific functions/methods
DO NOT use SET NAMES unless you absolutely have to, you need to tell the client lib what you are doing as well as the server
 
I'll work on it tomorrow, something time sensitive came up
 
that's what the first UTF-8 sequence is
@PeeHaa another thing that came out of it is I am surprised how tolerant browsers are of ascii-incompatible charsets at the document level, as long as you declare it in the Content-Type header Chrome FF and Edge were all happy to swallow UTF-32 and big5, including when I started including some literal big5 multi-byte sequences in the doc
 
12:10 PM
@DaveRandom I was thinking about that yesterday when I SAW IT
Browsers are a good characterset normalizer
s/characterset/encoding/
 
things start to get weird when you fuck about with endianness though :-P
 
Native americanism*
 
:P
 
\o
 
o/
 
12:29 PM
(prefix: I know what I'm doing and why I'm doing it and I know it sucks and I don't want a lecture) Has anyone had issues with $injector->share($injector) in auryn? /cc @Danack @PeeHaa
When I just do that, it "doesn't work" in the sense that I don't get the same instance, but when I do ->delegate(Injector::class, function() use($injector) { return $injector; }) it works
 
@DaveRandom OMG DUDE Y U DO IT THAT WAY. IT SUCKS!!!!1
 
yes, yes it does :-P but it is a necessary evil because the alternative is to completely re-architect the whole application startup
and ftr I am only injecting it into a factory object, so the hidden deps are at least ringfenced
 
@DaveRandom no problems - I set that up sharing the injector by default in most projects.
@DaveRandom can you give a simple example of it not working?
 
@Danack trying to come up with a minimal repro now, this application startup has a million layers and the problem is mostly likely in one of them
and ftr yes, I did write it in the first place and yes, I am not currently my favourite person
 
the most obvious stupid bug is that you're trying to create the thing that requires an injector before you're sharing the injector...
 
Wes
12:35 PM
@DaveRandom dude wtf
:P
 
Jul 31 '16 at 20:33, by Danack
$injector->share($injector); //yolo
 
ugh I found it @Danack, the code that does $injector->share($injector) wasn't actually being called :-P
 
Actually, that was even more stupid.
Congrats?
 
\o/
glossing over that quickly, I assume you are coming to nw @Danack?
 
yes. Getting the train at 3 so arriving at 7-ish at the conference.
assuming there is a pre-night social?
 
12:38 PM
I guess so? I am picking pedro up from the airport at ~5
@JayIsTooCommon ?
 
@DaveRandom Nope. I use that in all my projects
Never had issues
 
@PeeHaa yeh turns out I'm dumb
2 mins ago, by DaveRandom
ugh I found it @Danack, the code that does $injector->share($injector) wasn't actually being called :-P
 
:D
Stupid auryn not being able to handle that for you
 
inorite
 
Dammit, we have a hypnotist coming today and I'm going to miss it :(
 
12:40 PM
BTW @DaveRandom the convention is to do it exactly like @Danack shared
 
but on the bright side I'm getting my car fiiiiixed
 
The // yolo is important
 
that must be how I fucked up
 
:P
 
Basically if I have to write more than (new Application)->getMoney() that's too much coding for me
Run it with ./application | bank btw
 
12:50 PM
@DaveRandom yes that's exactly the reason I do it
Also in web projects my dispatcher uses auryn
 
Anonymous
@DaveRandom don't think i'll be going. My date dropped out.
 
Which is built by auryn because of what you just said
I am not a fucking savage composing my own objects
 
I do. I dont need no stinking injector
 
pffff
Weaksauce :)
 
@Gordon you vape brah?
 
12:53 PM
:D
 
@Danack nope, you wonderbra?
 
@Tiffany sure you want to get hypnotised and get all your dark secrets exposed? ^^
 
Wes
lol
who vapes here apart paul and joe?
 
@Naruto you mean we get to see the code she's been working on?
 
@Gordon ofc.. why would anyone think anything else? :P
 
12:57 PM
@Wes I am kinda getting used to it still
 
@Naruto would be interesting, maybe it'll help with my stress
maybe have something done a la Office Space
 
Wes
@Ekin smoking cigs too?
 

« first day (2539 days earlier)      last day (2423 days later) »