« first day (2392 days earlier)      last day (2572 days later) » 

12:00 AM
Thank you Danack!
I chose time4vps.eu, they are cheap as hell, and found good reviews
4EUR/mo per 2GB RAM VPS, nice ha?
 
Yeah, so.....DigitalOcean are meant to be good.
 
I'll keep DigitalOcean in my memos, thank you very much
 
 
2 hours later…
1:53 AM
!!? gevent
 
Search for "gevent" (https://www.google.com/search?q=gevent&lr=lang_en)
• What is gevent? — gevent 1.2.2dev0 documentation - gevent is inspired by eventlet but features more consistent API, simpler implementation and better… (http://www.gevent.org/)
• gevent 1.2.1 : Python Package Index - gevent is inspired by eventlet but features more consistent API, simpler implementation and better… (https://pypi.python.org/pypi/gevent)
• Just a little Python: Introduction to Gevent - 23 jul. 2012 - In a previous post, I described how to build a web chat server with socket.io and ge… (http://blog.python
 
Wes
2:14 AM
python? are you cheating on php? :B
 
2:25 AM
lol
 
Bah. Php is so perverted it doesn't even count as cheating.
 
2:49 AM
how would I implement a sort by clicking the links?
do I have to use $_GET, or header()?
 
3:42 AM
Mornings
 
Wes
3:53 AM
@Hello <a href="?sortby=az">sort</a>, then $_GET['sortby'] === "az"
i've left you a message @Saitama
 
:O
 
@Wes saw it. was quite beautiful indeed
 
Wes
ahaha
explain to me what the hell is that
is that an actual manga/anime or something
wtf. i can't unsee it
that's like a museum. with adult persons in it.
i don't want to live on this planet anymore :B
 
im confused on how to sort the file by first index..would I have to make like a multidimensional array or somethin
 
3:56 AM
O_o
OwO
 
Wes
@Hello you don't sort the file, only how you display it
 
ohhh
 
4:12 AM
hmmm
as long as i place the code for sorting the file above the code used to display the comments, it should be okay? @Wes
 
Wes
yes
 
I guess the only problem im having is how to sort by the first index of each line in a file
I keep making foreach loops to go through the file but it probably wont work..
 
4:34 AM
hello I have 2002 error in my wamp and cannot access mysql.what to do?
 
remove it
morning all
 
Henlo
 
@Linus what I have to remove?
 
wamp if you have 2002 errors there .
 
then what next
HOw I run the server
 
4:49 AM
set up a virtual machine install LAMP there...
 
ok
 
5:09 AM
Morning
o/
 
\o
 
henlo
 
is there any way we can set the default value of the column, coming from another Query , while inserting that row?
 
5:24 AM
@Sadiq Don't pass that column name & value in insert query
 
@Akshay What else can i do... I don't like triggers. They are a night mare in long run. Atleast in cases i have confronted so far
 
5:55 AM
if(isset($_GET['sortby'])){
	if($_GET['sortby'] === "az") {
		$sortFile = file("comments.txt");
		sort($sortFile, SORT_NATURAL);
	}
}

<a href = "?sortby=az">Sort Comments A-Z (by name)</a><br>
how come this doesn't work? :(
well..it sorts the array properly but for some reason it doesnt update the display
 
6:24 AM
Do namespaces of classes need to have the same name as the directory path? PHPMailer seems to have be using League\OAuth2.
 
no. it's just a convention and your autoloader is likely mapping namespaces to folders
 
@Gordon So I can do a namespace League\OAuth2\Client\Provider even if I am in MyProject/src/Lib/?
 
yes, of course. namespaces are completely independent of any underlying filesystem
 
@Gordon composer won't create a fuss about it, I guess?
 
like I said: it's a convention that \Foo\Bar\Baz also maps to foo/bar/baz
 
6:31 AM
Remove the need to specify version number in the configure option – #74537
 
@Gordon Alright thanks!
 
Mornings
 
Morning
 
Gmorning
 
6:52 AM
 
what's poppin
 
Hey guys I'm developing a CMS and as a newbie in PHP I have a whole bunch of questions about good and feasible practice.

A little one : What is the best way to store a user_id variable on connexion ? Shall I use $_SESSION $_COOKIE or define(USER_ID) (can I use this)
 
> Hey guys I'm developing a CMS and as a newbie in PHP
High aspirations eh ;)
 
Don't really have the choice, its a school project
Which by the way determine if I'm passing my year or not
 
> Queen Elizabeth’s entire staff called to ‘highly unusual’ emergency meeting at Buckingham Palace
 
7:06 AM
morning
 
99% sure she passed
 
This says otherwise, but still nobody knows
 
O_O
then...aliens!
 
morning kids
 
may the 4th be with you
 
7:11 AM
@Baldráni session
the cookies are sent to the borwser and can be altered
 
@tereško And there is no "defining" global variable in this case ?
 
not sure what you mean by that
 
He did a magic trick to a monkey. The reaction was priceless 😂 https://t.co/VzRMFjbhWE
Random humorous tweet with clickbait title ^
 
Link can I use "define("USER_ID",$_POST['user_id']")
Or is it bad practice
Or is it even not possible ?
 
@Baldráni i'd argue it's not a constant when it's coming from an external input
 
7:14 AM
@Baldráni it won't survive till the next request
 
Okay so definitely $_SESSION and thanks for the little explication I was miss judging define()
 
if you want to share information between multiple requests, the simplest option to use session
 
Should i override an method from an composer package that is undoubtedly resource wasteful in SQL queries (duplicates) or should i take my time to create an patch?
 
Morngin
 
use-after-free bug – #74539
 
mornan
 
@Raldo94 can you link to that code?
 
7:41 AM
How fucking niche can you get? I think Junk Email people are running out of ideas
 
lol
that's hilarious
 
An laravel package for role and permissions

https://github.com/Zizaco/entrust/

Method
https://github.com/Zizaco/entrust/blob/master/src/Entrust/Traits/EntrustUserTrait.php#L90

If multiple roles where to be checked at once, it loops
 
if(Cache::getStore()
I'm out
 
ugh, another crappy laravel lib
 
@Jimbo you seen my ping yesterday?
 
7:45 AM
@PeeHaa I didn't know what your first draft was linking to
 
@Jimbo You didn't see the deleted message above it?
 
@Jimbo no space behind if, ugh!
 
Either way blog.{mydomain}. Don't share it yet please. Need to finish it first
 
@PeeHaa Nope
I don't know what {mydomain} is
 
:P
 
7:48 AM
@PeeHaa Cool blog
 
pieterhordijk.com
 
Okay you can delete now
 
I don't mind google knowing my main domain. Just not the blog yet until I finish it
 
@PeeHaa Is it meant to stop at "execution back into a linear one again."
?
Or is my page not loading?
 
@PeeHaa Wat? echo request_async just prints async? :D
 
7:50 AM
It just stops there until I generate the next post
@kelunik ?
 
Cool, yield it asap :P and make it flow
Gimme an hour and I'l' read it
 
@PeeHaa The bottom example just prints something between line 2 and 3, but doesn't echo anything for echo async_request("https://httpbin.org/ip");
 
use-after-free bug – #74540
 
@Jimbo It's a raw draft right now, but it should give you the gist
@kelunik ?
It echo's the output of the call
Unless you broke it already
 
The animation showing the comparison is super useful btw
 
7:52 AM
@PeeHaa Yes, but that doesn't work with async_request. It doesn't magically defer that echo.
 
@kelunik I know
Please read the actual text
> The next example written in pseudocode leverages non-blocking
 
@PeeHaa I'm just looking at examples, because that's what people look at :P
 
Well I am not going to help people who only look at examples
They can go to laracast :D
 
If it's pseudo code, make it look like that :P
 
I think it's clear this way to explain the flow of execution
I could add some italic text underneath it I guess
 
7:56 AM
The flow of execution is clear, yes. I also want to build something like that as part of github.com/amphp/amp/issues/108
@PeeHaa Just add // pseudo code as comment.
 
@kelunik Oh cool. Yeah that should help people
@kelunik Good one. tnx
 
Anonymous
mornin
 
hey kid
 
@PeeHaa I'm just not sure how. Modelling the complete event loop will be too complex to explain things.
 
moin
 
7:58 AM
@kelunik I think a great post on exactly how an event loop works (or set of posts) would be amazing
 
@kelunik I am struggling myself with that too and I can just make it easy / only handle the top level
It's not exactly 1:1, but it's useful
 
1:1 in PHP :thumbs-up:
Also, I'll watch that
 
If someone has time to routinely issue lengthy critiques of other's code online, they are not at a level of success you want to emulate. 💡
 
What the fuck?
 
@Gordon Yup, he totally emulates success.
 
8:00 AM
@Gordon He expects it short instead? "Your code sucks and it should feel bad"
 
I have no problem admitting that laravel is succesful.
 
BTW I really like the blue info dots @kelunik
 
Nope
Successful at marketing
 
@Gordon emm ... so .. no community-driven code reviews?
 
I have said it before and I will say it again: if I can make a lot of money with something crap I would totally do it
 
Anonymous
8:02 AM
the replies are pathetic. It's like a bunch of school girls trying to be sassy.
 
Anonymous
too early.
 
@Jimbo and apparently at commercialising
 
Anonymous
!!wotd
 
@PeeHaa Thanks, borrowed them from SO docs.
 
coruscant: sparkling or gleaming; scintillating; coruscating.
 
8:02 AM
And I would call it an success even
 
Coruscant is from star wars isn't it?
 
but yeah, it shows his attitude. anyone criticizing others, regardless how valid, is a failure apparently.
 
@Gordon s/others/him
 
others, including him
 
He's really the donald trump of PHP
And I don't want to get personal, but he has a MASSIVE bald head
 
8:05 AM
@Jimbo Just that he didn't get elected.
 
halp
how should I rename this: findEmailIdentityByIdentifier($email)
 
@tereško hire a developer
6
 
the "Identifier" part in particular
 
@Gordon Well, I'm sure this is going to end well and not be controversial at all.
 
@tereško ById()?
Id = identifier
 
8:07 AM
@tereško What's an "email identity"?
 
@tereško findIdentityByEmail?
 
^
 
findIdByEmail($email)
 
EmailIdentity is the class name of what is being returned
 
I have no clue what that is
 
8:08 AM
"identifier" in this case is meant "email address" and not "id"
 
@tereško Yeh but I mean what does it represent in the "real world"? That name doesn't really tell me anything about what methods/props that would have
 
If it were C++, I'd have just called it find().
 
emmm ... why would it matter what methods the returned object has?
 
It's weird having to mention the return type and argument type in the function name.
 
8:10 AM
@tereško FYI I usually expect validate methods to return either true or false. github.com/teresko/palladium/blob/master/src/Palladium/Entity/…
 
@tereško because it feels like that might be the thing that's wrongly named, and it should possibly be something like findEmailContactByAddress(string $emailAddress) or something
 
@tereško SHIFT + F6
 
However that looks like it's a login record?
moment looking at the wider context
 
because it is
 
Anonymous
@littlepootis it's not the argument type
 
8:12 AM
Shouldn't that actually more be PasswordAuthentication instead of EmailIdentity?
 
and what then?
 
Most of that class works just fine with usernames, not only emails.
 
7 mins ago, by tereško
how should I rename this: findEmailIdentityByIdentifier($email)
 
7 mins ago, by Gordon
@tereško hire a developer
:D
 
R.P
Also depends where You are putting the function. If Something that handles EmailIdentity then I believe findByEmail would be sufficient.
 
8:14 AM
@Gordon that really isnt an appropriate response. I am not asking "how to make login"
 
I don't like that naming (EmailIdentifier) but I have no better suggestion so I think findEmailIdentityByEmailAddress() or just ...ByAddress() for the method
 
Anonymous
 
@tereško well, what do you intend to convey in the name?
 
@JayIsTooCommon and now look at the context
 
Anonymous
:D
 
8:15 AM
@tereško If every authentication method just has a single "finder", just name it findEmailIdentity(...).
 
@DaveRandom yeah, that's what I have been leaning towards too
 
Anonymous
@tereško what's with the yoda conditions? do you find them more readable?
 
@tereško What class does this belong to?
 
@JayIsTooCommon no, I find them less vulnerable to stupid typos (and I try to use the whenever I remember)
 
this -> the method you're trying to name
 
8:16 AM
6 mins ago, by kelunik
@DaveRandom https://github.com/teresko/palladium/blob/master/src/Palladium/Entity/EmailIdent‌​ity.php
 
@kelunik findByEmail
 
@tereško I get what you are doing with the generic identifier property in the base but I think that in general when you are referring to a concrete impl you should refer to things that work with that property by what it actually contains (so EmailAddress, CookieValue, UserName, TelephoneNumber whatever)
 
which is why I am looking to rename the API
the "identifier" bit is just an artifact from the first iteration, then I attempted to make all those types to work with a single class
 
@tereško What's the purpose of github.com/teresko/palladium/blob/master/src/Palladium/Contract/…? Will it be completely gone after the refactoring?
 
morninigs
 
8:19 AM
@kelunik the purpose of it is to link identities to external user accounts. And, no, it will not be removed.
 
Actually I think you could maybe drop the first Email, findIdentityByEmailAddress() is less of a mouthful and the fact that you are search by EmailAddress implies the type of Identifier that will be returned
 
@tereško thats an useless interface. if you need an Id, typehint for an id, not an object with getId...
 
^ that
 
@Patrick now, there you might be correct
 
must be my lucky day :D
 
8:23 AM
@DaveRandom I really cant drop it, since it would communicate, taht the base class is being returned
 
mornins
 
R.P
@DaveRandom why "EmailAddress" instead of "Email"?
 
@tereško how about using a value object for your identifier instead of a string?
 
@R.P They are different things
 
@tereško In which class does that method exist?
 
8:24 AM
It's the different between the contents of an envelope and the text written on the envelope
 
@kelunik here
@Patrick that would just add pointless complexity (especially if the HasId is being replaced by int)
 
@tereško Any reason to have one class instead of one for each identifier type?
 
Wrong reflection on session_start() – #74541
 
e.g. cookies could be stored in Redis while passwords are stored in some SQL storage.
 
@tereško and setters are evil. Immutable objects are better
 
8:27 AM
@kelunik because the logic in each of them is different. Cookie key does not require the same amount of hashing as password, since cookie has a limited lifetime
@Patrick sorry. Not drinking the DDD kool-aid
 
@tereško setters are not oop. nothing to do with ddd. tell dont ask
 
please, stop bikeshedding
 
@tereško Please reread. I just suggested to split Search into one retriever for each identifier type instead of having 5 or so methods on Search, have 5 classes with one method each.
 
@kelunik that makes it a nightmare for DI
 
@R.P An "email" is a message
 
8:29 AM
Sorry for jumping in your discussion, just one quick question: Does anyone have good resources on proper session management in php? Or could anyone tell me if this guide is still up to date: http://blog.teamtreehouse.com/how-to-create-bulletproof-sessions ?
The php page feels a little bit like chaos (http://php.net/manual/en/features.session.security.management.php)
 
Ugh god fucking damnit
 
@tereško It allows you to just DI the types you actually support.
 
@Haini yes that page is fucked up. The person who wrote it is an idiot
The person who should have rewritten it by now is lazy
 
@PeeHaa: You mean the php manual? :P
 
Anonymous
Can he not have his Karma revoked for docs?
 
8:31 AM
@Haini Yes
@JayIsTooCommon yes please
 
Anonymous
first few paragraphs are already appalling
 
@PeeHaa: Well that kinda sucks.. Because - where do you look if you can't look in the manual?
 
@JayIsTooCommon yes please
 
@kelunik I see your point, but in practice it always create a huge mess. I probably could move it all to actually be repositories, though.
 
And also his php-src karma, he should just file PRs.
 
8:33 AM
@Haini In general the docs should be fine, but there is a certain person in the docs team who is just a moron. It's on my list somewhere to fix it, but it's a shit job
 
Anonymous
@Haini the manual is open source, it's not all written by the same person. 9 x 10, docs will be accurate
 
@tereško What's the difference of repositories and my suggestion?
 
Anyway the treehouse thing looks fine at first glance
 
@kelunik repositories would be used by other services
basically, they would be dependencies of a service
 
@PeeHaa @JayIsTooCommon: I know that many people contribute and most of the times I am quite happy with them :) I was pretty unsure about how reliable the contents of the linked manual were, that's why I asked here - good to get an answer from someone who knows the topic already! Thanks for your time :-)
 
Anonymous
8:35 AM
@littlepootis are angular questions alright in 17?
 
@kelunik the problem is that I am not entirely sure how it would affect the resulting API (and I am currently quite satisfied with the existing API ... aside from few artifacts in the naming, that I am attempting to fix)
 
@JayIsTooCommon yep
 
so, in conclusion, what I am taking from all of this is findEmailIdentityByEmailAddress(string $emailAddress) and "remove the HasId"
 
ormin
 
\o
 
8:42 AM
jojoe
 
\o
 
Anonymous
jomo
 
@kelunik no, that would be expected, if method was called isValid()
 
@tereško Validation shouldn't use exceptions if possible.
 
8:44 AM
@kelunik the problem was finding a different way to communicate the exact error
 
@tereško right, you can use string|null or such for error returning
 
but it is a gnarly part of the code, that I have been looking at
 
@tereško the problem is that your object can even be invalid in the first place
 
@Patrick please, stop
stop oppressing my objects
 
@tereško or if you don't want strings, why not just return integer constants?
just like plain old C does it … 0 == success, anything else == failure
 
8:47 AM
@tereško Yes, it's unfortunately the same thing in every validation library. Some return an array of errors, so an empty array is every thing is fine. => Just the opposite in boolean logic. Some return an object that has isValid and getErrors. => Makes it easy to use directly in if and always returns true then. Some return true / false and just remember the errors until the next validation happens and expose them with getErrors => Ugly, but I think it's the best of those.
 
@bwoebi there is actually a deeper issue in that code bit - the validation rules are hardcoded right now (which is why I am going to look at that bit of code later)
 
@tereško you would avoid all those stupid problems if you would listen. Why are you so stuck in your old ways?
 
@tereško Is that necessarily problematic?
 
Use an EmailAddress value object/dont use setters and you won't have to validate
 
@bwoebi <insert vague hand motion> ... it feels wrong
 
8:48 AM
uh. okay.
 
@bwoebi Same issue there, it's unintuitive as (bool) 0 === false and (bool) non-0 === true.
 
@kelunik that's why you compare it against the constant, explicitly
and don't write == 0
because that doesn't tell you anything
 
@bwoebi It's easy to forget and just write if ($x->validate(...)).
 
^ that's one of thing, that exceptions kinda solve (though, it would still require return true; at the end)
 
Good APIs don't allow you to make mistakes like that so easily.
 
8:51 AM
@kelunik I haven't seen this being a problem in my C code where that pattern is really ubiquitous. So, no.
 
@bwoebi Yes, because every C API works that way.
 
@kelunik not really.
half does, half doesn't
 
heh .. a strange thing I keep encountering
whenever I remove parts of code, my overall test coverage drops, because parts that I remove are usually covered
 
Anonymous
!!rfcs
 
There are no RFCs in voting. Sorry, but we can't have nice things.
 
8:55 AM
@Patrick I will think about it, but it probably wont be applicable, if I want the "validation" to be configurable.
 
@kelunik note that I have different expectations towards validate() and isValid() - the latter obviously tells you I want a boolean, the former is not giving me any particular expectations and wants me to see the return type
 
Anonymous
^
 
@bwoebi Just go with assertValid and go with exceptions :P
 
^
 
@bwoebi I see validate() as "procedure" (think - pascal)
 
8:57 AM
@tereško You mean like a void function?
 
@bwoebi I expect it to be validate(): void
 
@bwoebi yes
 
Anonymous
@PeeHaa this. Validate tells me it's doing something to my arg, not just checking.
 
FYI, in pascal, functions that were not returning anything, had a separate keyword: procedure
 
@tereško (I know)
 

« first day (2392 days earlier)      last day (2572 days later) »