« first day (2434 days earlier)      last day (2739 days later) » 
00:00 - 16:0016:00 - 00:00

16:00
@Feeds Meh, if it's not a power of two it doesn't deserve a party
I need a review on a piece of code
    public function authenticate($userID, $inputPassword) {

        $this->error = self::PASSWORD_WRONG;

        if (!$this->userMapper->contactExists('email', $userID)) {

            $this->error = self::NONEXISTENT_ID;
            return false;
        }

        $hashedPassword = $this->userMapper->getPasswordByID('email', $userID);

        return password_verify($inputPassword, $hashedPassword);
    }
Does that look like good code?
I would throw exceptions instead of returning false
also... $this->error scares the shit out of me.
do you mean like, this is in a controller that acts on these if there are some?
If I check the object's error property after a successful password_verify, it tells me PASSWORD_WRONG? Also, password_needs_rehash
I'm okay with returning false but you have this extra state that isn't very good.
I read somewhere in SO exceptions aren't very good idea
If you don't want exceptions, define something like const AUTH_SUCCESS = 0; and then give everything else numerical codes, and return the const. Then, in calling code, if ( $auth->authenticate(...) != ???::AUTH_SUCCESS ) {
@Andrea Hmm:
enum Result<T, E> {
    Ok(T $ok),
    Error(E $error)
};
@CoderDudeTwodee They should be used in exceptional circumstances. I personally don't feel that an incorrect password is terribly exceptional, but I am not an authority on (a) your codebase, or (b) anything, really.
16:07
final class Ok<T> {
    // ...
}

final class Error<E> {
    // ...
}

type Result = Ok | Error;
But see, you wouldn't probably actually do that for the second.
Would probably use an error class instead of the generic thing that only wraps something else.
I will be getting rid of $this->error
Also unsure if you'd have to do this: type Result<T,E> = Ok<T> | Error<E>;
posted on June 15, 2017 by kelunik

* `Amp\reactor()` has been replaced with `Amp\Loop::set()` and `Amp\Loop::get()`. * `Amp\driver()` has been replaced with `Amp\Loop\Factory::create()`. * `Amp\tick()` no longer exists and doesn't have a replacement. Ticks are an internal detail....

7
@CoderDudeTwodee Very basic changes that I would put into place. Remove $this->error state checking, add password_needs_rehash, etc.
Evening r11
16:15
Not perfect on a lot of fronts, r11 feel free to tear me apart on that one
o/
\0
back in an hour or so
@Saitama you are not freebsd user =)
@Dereleased Thanks for the paste
@FélixGagnon-Grenier there are some what?
16:31
@Dereleased ints don't really convey meaning well...
You won't be able to just use that class without peeking inside/reading additional documentation
Ideally the API should be self explaining
I think the original was better
16:44
What should be a better name for userMapper in here?
Hey everyone :) Anyone here that can land a helping hand with Laravel?
@Charlie Larevil
Why? Why so much hate?
> Support group for those afflicted with PHP. Don't ask to ask, just ask. Username auto complete is tab, not enter. Ignore $room_owner.
WTF @Wes HEEEELP
LOOK AT TWITTER
THEY KEEP TWEAKING THE TEMPLATES
Well. Here we go: I have problem with eloquent model in Laravel. I would like to have a table called districts and another one called users (duhh). One user can have only one district and a district can have more than one user. The problem is that I have a third table translating "1 = New york, 2 = Illinoi, etc..." How would I go into this? The user model has "belongsTo(district::class)" and district model has "hasMany(User::class)"?!
16:54
^ Does Twitter now display one heart for each like?
@kelunik is that new?
@bwoebi Twitter just launched a redesign and it's broken, yes.
Twitter keeps changing everyday.
Haven't gotten that update yet
@kelunik hahahah
16:56
ah, seeing it too now … but just one extra heart
@Feeds oh.
Can't see the extra heart.
@bwoebi Have a look at the IRC chat. ^^
@kelunik yeah, I see :-D
@kelunik hahaha
17:01
posted on June 15, 2017 by kelunik

Initial release.

17:13
@CoderDudeTwodee errors
17:24
!!dad
Have you heard about that new movie Constipation? I guess not, because it hasn't come out yet
God you're such a canadian
> dude... calm down. sorry eh
Awesome thread btw
:P
but anyway, yeah tabs people are sour all over the place. like your mum.
17:39
huh?
Somebody took your... star?
or I hallucinated
Dunno. You been doing salvia this morning?
if only
that shit is really fucked up.
It is :P
user1804599
Bad programmers gonna bad.
17:40
I hated it
yeah, it takes a context, but it can be freaking amazing
user1804599
public function writeSeparator(): void {
  fwrite($this->file, str_repeat('-', 80) . "\n");
}
I felt fucking terrible :D
heh :P
@PeeHaa just for you disq.us/p/1jmnten
heheheh
user1804599
17:52
You can have abstract static methods. Can you have abstract constants?
user1804599
Nevermind I'm a moron.
4
I feel like starring today
user924016
ehm =)
@PeeHaa you're the star today
18:00
Anybody dealt with this startup error on VSCode?: Error spawning PHP: Command failed: php --version
Good. Last thing we need is more phps
Nite all phpians
nite
Guys, do you know what Qadr nights is ?
@BenCoffin Either way sounds like a path issue
18:05
@PeeHaa when i run the command in command prompt, i get: VCRUNTIME140.dll is missing from your computer ( do you think i have the wrong version of PHP on this thing ) ?
I think you didn't install the vc14 runtime
@PeeHaa i didn't see anything about that in here ( marketplace.visualstudio.com/… )
It's not related to vs
It's related to php
See the left side windows.php.net/download
@PeeHaa helpful! thank you! altho their download link is broken.
It is? On the php site?
Or the ms site?
Ah ms changed their links yet again
No idea where the source is of that page though
nvm found it
18:18
@Patrick You compare them to the class constants. if ( $foo->authenticate(...) != FooClass::AUTHENTICATION_SUCCESS ) {. The original also involved class constants, just setting them to a state variable to be checked after a true/false response.
You have the correct link for me by any chance @BenCoffin?
@LeviMorrison That's an idiom in Haskell for some types of things where you need an error value (otherwise you use an optional). Though it uses a more generically-named type, Either, with Left and Right instances.
@CoderDudeTwodee it depends on how you actually use exception
and authentication is a bit tricky
@Andrea I used Rust's naming (but unabbreviated): doc.rust-lang.org/std/result
@BenCoffin I think this is what you want microsoft.com/en-us/download/details.aspx?id=52685
If you can confirm that would be great
18:25
@tereško I forgot to complete that sentence "exceptions aren't very good idea- for authentication"
again, depends on the context
@Dereleased Yes, I might be starting to overuse exceptions, but InvalidUsername, IncorrectPassword and returning true allows for finer grain reaction to logins than true/false cc @CoderDudeTwodee
again, this can probably be achieved in many other ways, I just like the exception one, for now
@PeeHaa ... i'll do that, i need a moment (sorry!)
no worries
the alternative approach ends up with quite excessive state management in the service layer (regarding the exceptions)
18:39
I can absolutely see the appeal of using exceptions to manage it. There is a certain elegance to it, given the machinery built in for you. Let me get you a paste for an alternative, sec
@FélixGagnon-Grenier I suddenly feel less bad for never setting up a comment system for any of my sites.
3
@PeeHaa i'll download & install and see if it fixes the VSCode fault.
kk tnx for the confirmation
I PRed the new url to the site
@PeeHaa ur very proactive!
18:45
You did your part too :)
So this guy complained about Stackoverflow asking him to Google on Quora. I told him that they are right, he spent his entire day making alt accounts, stalking my facebook, sending me "You are virgin, cry" messages and writing "Indian Rapist who supports ISIS" on my images.
Some people are way too dedicated to waste their time. Made 10 accounts today. And also posted this funny shit on Reddit and 4Chan.
...
that's... quite exagerated.
@FélixGagnon-Grenier I got lazy, I can do it if you want, but I also don't advocate returning true/false where more than those two states matter. I advocated for the class constants so you can return multiple states without firing up the exception mechanism or checking an instance member somewhere. /cc @CoderDudeTwodee
@CoderDudeTwodee lolwtf
18:49
fascinating
@PeeHaa the VSCode error went away, but IntelliSense features aren't available
@CoderDudeTwodee so, wait, you don't support ISIS? Do you just have a problem with H. Jon Benjamin's voice, or did you think Frisky Dingo was better, or... ?
@CoderDudeTwodee A rapist virgin, tho, that's pretty impressive
Frisky Dingo was way better.
@CoderDudeTwodee I have faith that folks on 4chan quickly realized what was really happened there and spiderman the shit out of the thread
@BenCoffin Find the setting something like "php binary" or "php executable" and point it to your php
18:51
@Dereleased I do support Isis the pronstar.
lol
(one of) my sisters's named Isis.
@peehaa "php.executablePath": "C:/x/php-7.1.5-nts-Win32-VC14-x64/php.exe",
huh
@FélixGagnon-Grenier sisters's
well, with the (one of) included
18:52
hmmm, right
@BenCoffin Is that path correcy?
@Dereleased Imaginative kids these days. He has been really dedicated to me today.
@PeeHaa yes, it is.
@FélixGagnon-Grenier she might need to change here name to Hecate or something
18:53
@BenCoffin Humor me. And run C:/x/php-7.1.5-nts-Win32-VC14-x64/php.exe -v from the cli
She's presently travaling in France with her bf and child. I... often ask them to come back here.
@Dereleased So could exceptions be a good idea here?
!!lxr proc_get_status
[ /ext/standard/proc_open.c#300 ] PHP_FUNCTION(proc_get_status)
@PeeHaa sure
18:53
@CoderDudeTwodee I hate to take a strong position either way. For me, it's too much machinery and overhead to fire up. But, the only reasonable alternative is a switch/case block and returning some kind of constants (emulating an enum).
@PeeHaa >C:/x/php-7.1.5-nts-Win32-VC14-x64/php.exe -v
PHP 7.1.5 (cli) (built: May 9 2017 19:48:36) ( NTS MSVC14 (Visual C++ 2015) x64
)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
hmmmm
Approach A: you return a bool, but you never really return false cause in those cases you throw an Exception. The check is in a try/catch, which may use an if statement to run the auth, and may not, since it doesn't really matter. All "Incorrect Login" logic is in catch blocks
Does vs throw an error at you?
@CoderDudeTwodee you might have noticed by now that Quora attracts that type of contingent
18:55
@Dereleased I could get behind something like that, but with somewhat better constants (namely, a "value object" ?).
Approach B: you return an int, which doesn't say a lot on its face, but you always return a class constant, and switch/case out the result.
@FélixGagnon-Grenier That's a flavor of Approach B: create an object to act like an enum
@PeeHaa ... sorry ... NOW i get the "Go to definition" feature, suddenly. is it possible it was building an index? VSCode told me nothing of the sort. I just assumed it wasn't functional.
Dunno :)
@PeeHaa well i guess that (as they say) is that.
@FélixGagnon-Grenier I guess you could also make an object for each possible state, but I find that approach to be a bit over the top, just shows you prefer instanceof to ===, but no increase in accuracy since you should be using class constants either way, which prevent punish typos
18:58
@PeeHaa thx for your keen eye, sir.
@tereško LOL he even made an account with the name "Anti Indian". Quora took 5 hours to remove that.
so ... which would be the best QT5 music player ?
@Dereleased I guess I'm gonna go with the enum style.
@CoderDudeTwodee Like I said, I personally prefer it because it requires a lot less overhead to return an int than throw an exception, and as long as you're never writing return 3;, but always using constants, you still get 100% of the readability.
19:02
@Dereleased Some state I like to represent with objects.
@FélixGagnon-Grenier Yeah, if you have complex state it makes sense. I advocate using the simplest approach possible for the problem
if you have two or more independent variables that need to come back, you could either use flags and bitwise math, or use an object with multiple fields. I would recommend the latter in a heartbeat, because more PHP devs will figure it out than flags, would be my guess
@Dereleased I actually stole that from @Danack, an interface like Permission and implementations like LoggedPermissions and AnonymousPermissions that are built with a role. That object is type hinted in the classes that need such information. I find it really useful, even for somewhat simple systems
... and quite simple, actually. It depends strongly on the use of a DIC, however
dont you think you are somewhat overthinking it all
@FélixGagnon-Grenier you don't have to use a DIC: youtube.com/watch?v=mPtX8m6seeU
19:07
I have no idea how I feel about that video. lol.
That was... relevant?
19:38
@tereško doesn't that log defeat password_hash if log is leaked? github.com/teresko/palladium/blob/master/src/Palladium/Service/…
... well, I guess it's mitigated by the fact that it is a failed login, so the password is wrong, but still
if I write drsgon one could try dragon
@FélixGagnon-Grenier well .. it's a tricky bit
buuuuut
you are free to implement your own logging code
I actually think that I should just pass the passwords raw to the logger
oh right, the logger are supplied in userland
@tereško what's the point of logging the md5 of the failed password?
@Danack mostly - me, being lazy in an unrelated project
it's an artifact from older version
I really should fix that for 1.3.0 (when I have set up my linux boot)
@Danack it made it easier for me to write the loggers ... I will be revisiting that idea :D
nah - lazyness is a valid use case.
@FélixGagnon-Grenier the reason why I used MD5 there was, because in that external project I need to detect, when someone is spamming same password in multiple accounts
oh. indeed. that is actually.. pretty valid a reason. it could almost become a feature.
TBH, if you enter a wrong password on any site, you should expect, that it has been logged in plain-text somewhere
I could not bring myself to storing them in plain text
19:50
Also sometimes if you enter the right password, because sometimes people turn on "Log All Requests" bullshit and don't consider the ramifications
@Dereleased unfortunately, using password manager is not a good solution: pcworld.com/article/3184153/security/…
@Dereleased gasps :P
@tereško Aha! My laziness toward getting and using LastPass has paid off! Who's laughing now?!
I currently only have two passwords, that have not been compromised in this way: gmail password and password of my primary SSH key (and those are two separate 20+ symbol passwords)
everything else is vulnerable to leaks
Thanks to the first-initial-last-name debacle at work, I changed my (work) gmail password 4 times in a week, so it is now very long and very unique
19:55
longer than correct horse battery staple
But Randall was right, I have never forgotten it
posted on June 15, 2017 by kelunik

Stable release based on Amp v2.

Wes
Wes
20:17
surprising that "both" are even employed
heheh
Wes
Wes
i was in the tabs team, but conformity is more important :B
they aren't paying me more tho :B
Mixing tabs and spaces is a capital offence
Wes
Wes
20:45
@Wes yes
this is good
more a bit randomized bubbles would be nice
Wes
Wes
bubbles or similar stuff are used (or at least, i use) to give the thing a bit of context. doesn't really matter if they are randomized or not as long they occupy the empty space :B
I like the bubbles
@Wes you are dealing with developers
20:50
:P
larger than average subset of developers will start focusing on recognizing a pattern
Hi guys, need your thought on how to exclude specific div using simple html dom here is the link stackoverflow.com/questions/44574919/…
Wes
Wes
do you prefer it flat or with some shading
cc @kelunik
I liked the shading
+shading
20:54
can you make the border lighter
there is a bit too much of an emphasis on that "wishbone shape"
Wes
Wes
it's just that aliasing doesn't really work at such low res. if i reduce it it looks jagged
@Wes Please also post one with a slightly darker blue
Wes
Wes
this is also flat but with darker blue
@kelunik i've anticipated you :B
@Wes That one still looks darker / more saturated
Wes
Wes
@kelunik eh, it's because it has shadows :B
if i make it darker you won't see the eye anymore
21:01
Can I have a version with shadows but without stripes?
Wes
Wes
i like this
+1
Maybe the trunk a little bit bigger now
(the end of it)
Wes
Wes
nope. i didn't change it :B
It's a request :P
Wes
Wes
but it should look a bit bigger, right
yes. that's going to take a while though :B
21:06
All of the gray spots should actually be color-blindness tests
@Wes I think we'll wait with the release announcement until tomorrow anyway. :P
Wes
Wes
$wes->anxiety++;
Bindto IPv6 works with file_get_contents but fails with stream_socket_client – #74764
user6845426
Are there reasons why one would choose to create a web app in say ASP.NET as opposed to using php... or is it simply preference?
Wes
Wes
21:28
@kelunik yo
still around?
Wes
Wes
trunk stroke
much better, right?
Wes
Wes
and, i wanted to do this since the very beginning:
What's that? A Kiwi?
Wes
Wes
21:30
there are no kiwis where elephants live :B
Anonymous
Nice. What's with the font. Change it pls
Wes
Wes
don't know what bird is that
Anonymous
use Gentona for the font
@Wes But it looks quite fat :P
Anonymous
It's a pelican
Wes
Wes
21:32
it is? i would never have thought it
pelicans are not exotic enough :B
Anonymous
Hmm, the beak looks too short to be a Pelican. :/
Wes
Wes
@kelunik you almost like the idea of the bird, eh
what if i do it properly? :B
Anonymous
Maybe Cattle bird.
@Wes We can have that on the website if there are news. :P
Anonymous
The bird actually adds more life to the log :)
21:35
@Wes It's isn't...
@Wes The face of the right elephpant looks like Bob.
It's called an elephant bird
Because well
^^^^^^
@Wes Yes, very much yes. I finally see an elephant instead of a dolphin or seal.
Wait scratch that
Wes
Wes
> elephant birds' closest living relatives are kiwis
21:36
Not a fan of the bird though… might be cool in certain contexts, but not as the default logo.
Oxpecker
Wes
Wes
@kelunik you almost nailed it...
but please don't do the bird
Pleeease
:)
Wes
Wes
i think the bird can be potentially great and fun
but it's up to you :B
Maybe the bird on a T-shirt where the bird is saying something might be fun… but it shouldn't be a part of the default logo.
21:38
@Wes well, that's what we think about you, too… but does it ever work out?
@Wes As something to put with the logo, yes.
But not as part of the logo.
If you get where I'm coming from on that…
Wes
Wes
@Trowski thanks :B finally someone's happy...
@Wes Of everything I've seen, that is by far my favorite.
QUICK SHIP IT
QUICK
SHIP
IT
!!!!!!!!!1111111oneoeneoneoene
21:41
@Wes Going to sleep now, if you're happy, too, we can release all remaining packages with the new logo tomorrow and announce it.
... also yeah, that logo is nice. it's like, "balanced"
@FélixGagnon-Grenier It just took ages :D
Wes
Wes
do you remember the first one
That one was the best :P
cc @JayIsTooCommon
@Wes nope, but I remember seeing it
... that tabs space discussion really has achieved depressing the shit out of me
... some people press the space key. to indent. to indent their space indented files.
I believe I will change profession.
I can't take this bs.
to think that all the times I mentioned my space preference, I sounded like a space masher freak to tabs people, is even worse than admitting I work with JS and PHP to a c++ programmer.
21:48
@FélixGagnon-Grenier Some advice for you: not all C++ programmers are good
The cattle egret (Bubulcus ibis) is a cosmopolitan species of heron (family Ardeidae) found in the tropics, subtropics and warm temperate zones. It is the only member of the monotypic genus Bubulcus, although some authorities regard two of its subspecies as full species, the western cattle egret and the eastern cattle egret. Despite the similarities in plumage to the egrets of the genus Egretta, it is more closely related to the herons of Ardea. Originally native to parts of Asia, Africa and Europe, it has undergone a rapid expansion in its distribution and successfully colonised much of the rest...
Wes
Wes
i forgot danack is a birds expert :B
Ornithologist
I read heroin
Bit dissapoint now in the bird
Wes
Wes
21:52
@PeeHaa that's the second
Refresh my memory
Wes
Wes
this was the first one
ah right
Also cool
I am totally going to steal one of the first unused ones if I need a logo for something :)
I call dibs on that tron eyed elephpant on the left
Wes
Wes
i.imgur.com/cWBqJz8.png <- second attempt
@Wes That would make a sick wheel
21:59
@Wes Nice idea, remove grumpiness.
@Tpojka You misspelled badassness
Oh, my apology.
I like the weel™ but seems like grumpy toothless.
I am saying about first impression. Trunk is fair and recognised well. Just that prim spiral should start somewhere about 5. ;)
Wes
Wes
/me makes coffee and starts illustrator
22:05
@Wes what you vaping on these days?
Wes
Wes
always the same setup
eleaf istick and obs crius or griffin whatever
i have two tanks, they are basically the same
I meant flavorwise. I know some people have new gear every 45 minutes, but I think most of us change that pretty infrequently
Wes
Wes
yeah my setup is fine. but before that i changed ten batteries and tanks. they all sucked
but these are good. i get plenty of vape, they require low maintenance
they don't leak...
coils for instance can go for 6 months if you brush them when you change the wicks
also i'm not an hardcore vaper anymore... 0 nic. i just keep vaping for the fear of "accidentally" buying cigarettes :B
user image
2
u wot mate?
Wes
Wes
22:20
:B nice
do you actually own birds @Danack ?
@Wes No, and I won't be tedious about it, but I don't think people should own birds as pets.
Wes
Wes
me too. birds are supposed to cover huge distances flying... it's not like cats that sleep all day
:B
 
1 hour later…
user924016
23:30
Birds aare the best
00:00 - 16:0016:00 - 00:00

« first day (2434 days earlier)      last day (2739 days later) »