« first day (2374 days earlier)      last day (2581 days later) » 
00:00 - 13:0013:00 - 00:00

1:00 PM
Pictures?
 
I will let it cover the ground and then make some
 
coolio
Also aren't you used to that shit? Just get on your snowmobile and hunt for food
Or was that @FélixGagnon-Grenier?
 
the flakes are like 5 cent poins
 
Wes
do you usually get snow in april there?
here is normal. once snowed in mid may
 
well ... last year the last snow finished melting around May
 
1:02 PM
I have a relation between two tables, ID is referenced key and member_id is foreign key If I set "on Update" "Cascade" will the whole row be deleted or just member_id will be set to NULL?
 
on update?
 
Wes
i would answer but i don't use that
i don't even use foreign keys... well not those enforced by the dbms...
 
ON UPDATE does not affect deletion, that's what ON DELETE is for
@Wes you probably should try reading: pragprog.com/book/bksqla/sql-antipatterns
 
Wes
@tereško is it pro foreign keys?
 
it is pro "know how to use database"
 
Wes
1:06 PM
i don't think database should contain any logic. it should just hold data
 
foreign keys are there to enforce data integrity
 
@WorkingPig No you look
:P
Your question asks whether on update does a delete
 
@Wes when people start putting logic in SQL, it usually ends up in TRIGGER definitions ... which I see are a terrible idea
 
@tereško Oh god. The horrors I have seen
 
Wes
1:08 PM
i don't need that @tereško it's overkill for me. and i don't corrupt data, i use transactions, etc.
I have just noticed what colour the screen is when previewing a Windows PC on a network from a Mac. Also, dat CRT. https://t.co/kpXxeTCzHb
 
Yeah it's an old funny :)
 
Jay
hey guys long time
 
since there are like 5 Jays currently in the chat, I hope you wont be surprised that nobody recognizes you
 
5?
 
Wes
@Jay are you the one that wears pink latex and plush handcuffs?
no that's @JayIsTooCommon i think
 
1:24 PM
this is a php file converted to json and I've been stuck for hours with a parsing error and I'm sure the problem is in the php file so please just take a look only to see if you find any error
 
@Jay no see
 
Wes
the other day i've spotted a php internals furry. i was slightly disturbed
 
Happy Easter all :)
 
There are furries in the internals group?
 
Wes
nothing too bad. just an adult person, in a plush costume
for the record, i find cosplay in general just as disturbing
 
Anonymous
1:39 PM
@Wes leopard print
 
Wes
/photoshop
 
1:51 PM
http://stackoverflow.com/questions/43437918/how-to-insert-delete-upd‌​ate-multiple-checkbox-to-database
 
Jay
I am the original Jay remember
3
 
I've asked a question about the above pastebin
0
Q: php json encode parse error

RiccardoThis php file verify the id and code a user was emailed with. If the id and code match a confirmation message is shown else an error message is shown. The script is converted to json and the error returned occurs while parsing the json converted php. Last but not least I create an empty array a...

if you want take a look at it
 
@Riccardo people don't want to just debug your code. You should debug it yourself, until you isolate the problem, and then ask a question with a small piece of code to reproduce the error, rather than a bunch of code that does lots of different, irrelevant things.
 
ok, does anyone know, why PHPunit is suddenly attempting to test crap in /vendor ?!
 
2:06 PM
@Danack I've tried to debug it and I failed to find the problem else I wouldn't have asked a question about it
btw thank you for your advice
 
for some retarded reason, it is attempting to run some fucking test on doctrine
 
Wes
2:33 PM
 
https://t.co/LNzAycYiQj
 
Wes
even the preview :o
 
@Wes ?
 
Wes
i can see the pic within twitter
 
2:34 PM
Oh yeah. I blame balpha
 
2:45 PM
fuck, OOP is complicated
in the controller I have this bit of code:
    $identity = $this->signup->createPasswordIdentity(
        $request->get('email'),
        $request->get('password')
    );
but if I need to add some other ways for user to log in (think OpenId/OAuth), this will cause a proliferation of method in the SignUp service
how would you guys approach it?
"fuck it" seems to be a legitimate option
 
Wes
@PeeHaa start in 5 min
beer ready
 
halp?
 
3:08 PM
@tereško interface the signup identity and have a Factory return the correct implementation according to the type of credentials?
 
@tereško I'm sure that using Laravel will solve this problem.
 
Or that yeah ;)
 
well, I was thinking about passing IdentityClass::class as the first parameter, but then I need to pass other variables as an array ... layers of abstraction :(
 
@tereško @FélixGagnon-Grenier's factory solution seems best.
You'll have a fairly ugly switch/case there, but that's factories for you.
 
@MadaraUchiha I will still have to rewrite the factory whenever I add a new type of Identity //cc @FélixGagnon-Grenier
 
3:20 PM
@tereško if that is unacceptable, maybe resort to bypassing the factory and create a type based on the identification. I find this horrible but something like new "Model\Services\Signup\$concreteType"? You would then only have to add the implementation and a new identifier for a new signup option.
I'm have waiving the constructor parameters, be a genius like normally
 
I'm just not sure what to do
all solutions that I look at are flawed in some way
 
@FélixGagnon-Grenier that is not a terrible idea on its own, but in this case it would mean that the class name gets pushed to the HTML for
or aliased based on that form
 
Hmmyeah, that is sub optimal
 
Anonymous
@tereško why stress over now it if you seem to find the solution momentarly, just make your app function first, then after some time has lapsed (or when epiphany strikes back) you can rewrite that part later.
 
3:27 PM
this is the third iteration/use of that code
I am trying to make it a separate lib to simplify the maintenance
 
Anonymous
It's hard enough to code without being depressed let alone go through each line of code without tearing yourself apart.
 
Anonymous
@tereško well in that case, then good luck
 
3:40 PM
sun is shining, snow is snowing
 
rain is raining, fog is fogging
 
in UK that counts as "nice afternoon"
 
I love the smell of fog in the morning. Smells like.. vacations.
 
:D
as a side-note: making an authentication lib is a pain in the ass
 
3:51 PM
I am looking at the usage examples of that codebase, which I am trying to isolate, and they all are fucking bad
it must be really nice to be a "laravel developer"
 
@tereško remember. Divide and conquer.
 
naaah, it's the API that is shit
 
4:23 PM
evenin
 
Wes
4:42 PM
@PeeHaa VAIIIII GINA VAIIIII
 
@Wes seems I missed this one, doesn't seem like that
Results are at 98% and ~51 said "yes"...
 
Wes
@Ekin i didn't understand something. someone wrote that if erdogan wins will stay till ~2030
how is that even possible
 
that assumes he wins the next election as well
in that case he would stay till 2029 I think
 
that's fucked up
 
4:58 PM
not three, can only do two terms, 10 years
but here is the thing...
elections are kinda up to him now...
 
@Ekin yeah 29
evenings o/
 
\o
 
o/
well... it's gone complicated since supreme electoral board accepted ballot papers that don't have its official stamp as valid...
/me goes back to work-work
 
5:19 PM
3 messages moved to Trash
 
Wes
5:37 PM
@Ekin i still have no idea what you guys are voting for
everything i read failed to explain me :\
but erdogan is scary
 
5:55 PM
@Wes I second that emotion
 
@PeeHaa guilty as charged
 
Wes
6:18 PM
 
ahaha
 
Hi guys ! Can someone help me ? I have a question for you about facebook developers api.
 
Wes
@FélixGagnon-Grenier how is
class A{
    private function f1(){ /* ... */ }
    private function f2(){ /* ... */ }
    private function f3(){ /* ... */ }
    private function f4(){ /* ... */ }
    function func($a){
        $a = $this->f1($a);
        $a = $this->f2($a);
        $a = $this->f3($a);
        return $this->f4($a);
    }
}
better than
class A{
     function func($a){
        $a = (function($a){ /* ... */ })($a);
        $a = (function($a){ /* ... */ })($a);
        $a = (function($a){ /* ... */ })($a);
 
@Wes sorry just saw, if you still wonder... this kinda sums up the most scary parts as far as I skimmed
and this is a bit more detailed
/me afk again
 
@Wes well .. the first one is a lot more readable
 
Wes
6:26 PM
there is something wrong with oop
not that that is oop, but that's code we write
 
well, your code is shit
but you probably make a lot more of it than me
 
Wes
a lost?
 
:(
 
Wes
i don't write code at all. i spend all my time thinking how to write code
5
one day i will live under a bridge
5
 
:D
 
Wes
6:32 PM
but i will be happier than i am now
 
@Wes or you could start talking in conferences
 
Wes
"how php ruined my life"
it would be funny if that was a joke but it isn't
it would be acceptable for most of people but i got my life ruined by browsers incompatibilities too
and css in general, dom
internet explorer mainly.
@Ekin you are voting for making dictatorship legal, basically?
 
right...
"democratically" getting rid of "democracy"
/me somehow needs to focus on work
 
Wes
on sunday? :B aw
 
nite all
 
6:44 PM
yeah I didn't do weekend
also slept just 3-4 hours overall I think
 
:( that's bad
 
Wes
:(
gn linus
 
indeed it is bad, nn linus
 
Wes
they have made such a mess with phpstorm 2017
type inference worked decently... now it's all broken
 
6:59 PM
@Wes the first looks better to me because it doesn't look like a typo. I guess actually seeing the function body would also help.
Also, why not just stick with normal oop instead of them anon obfuscating function? ;)
 
Wes
that's my point. private functions and closures are identical. you can't override them. they are effectively hardcoded in the methods that use them
 
bugs.php.net/bug.php?id=74453 - anyone know what they're talking about?
 
@Wes well ... you can at least test private methods, with the magic of reflection
 
Wes
i can call it from different (but still in the same class) places too
also part of the point was the fact that i'm grouping functions in classes and there is no state involved. they should be just functions, not methods
 
<form method = "post" action =
  <?php
	  if(!empty($firstName) && (!empty($lastName))){
	  	echo "update.php";
	  }else{
	    echo "invalid.php";
	  }
  ?> >

how come this always goes to invalid.php? even if I enter values for the first and last name inputs
 
Wes
7:06 PM
...probably
 
in PHP I use anonymous functions only as "lazy constructors"
@Hello because something happens in the rest of the code
have you tried divination with tea leaves?
 
@Danack i guess he is talking about comments which are rendered with a opacity like effect
 
Wes
@Danack not enough contrast on text
 
should I use isset() instead of empty()
 
Wes
@Danack i'm not sure anymore. is he talking of animations?
 
7:12 PM
@staabm Good point. Though it's only the negative scored ones that are dimmed.
 
Wes
Expected \PhpParser\NodeVisitor, got NodeVisitorAbstract
this used to work i'm sure (nodevisitorabstract implements nodevisitor)
 
7:36 PM
@PeeHaa Not really, sorry.
@Trowski @bwoebi Just marked packagist.org/packages/amphp/loop as abandoned, should we add a note to amphp/loop or just purge it completely?
As it doesn't have any releases, I don't see any value in keeping it. If it would have them, I'd keep it for compatibility.
 
7:58 PM
What's the name for when you have a relative URL that starts with // , to mean same schema, domain and port?
 
protocol-relative URL usually
 
ta
 
8:15 PM
@Danack what do you think about RFC?
mornin
 
8:38 PM
@Ekin stay safe, can see this not going well the next few days (hopefully wrong about that) :-/
 
thank you, I doubt you are wrong about that
it kinda already started getting messy
 
I tried reading the news but found it difficult to get any reliably sourced info
 
a lotta people are out on the streets now
dunno how it's going at the moment but certainly that can't end well
 
<3 do what you gotta do, but stay safe :-)
 
8:43 PM
//stackoverflow.com/questions/tagged/php (php)bug Rebuild php to work properly – https://bugs.php.net/bug.php?id=74446 (#74446)
 
ugh
 
That's on you :-P
 
You sure?
Don't remember it being that bad
I still blame you anyway :P
 
@Danack URLs are usually referred to as being "<x> relative", where <x> is the most specific unspecified component, and "specificity" is judged left-to-right, although people tend to talk about "domain relative" when they mean "authority relative". Imagine I have adenoid issues while saying that, it will make it read better.
@PeeHaa links have always been weird, but in your defense I have tried and failed to think of a better way to deal with them
 
tags should just be converted to #tag though
But it looks like that info is lost
 
8:45 PM
I think what's really required is a fucking huge tree of special cases for posts of a certain format
I hate most of those but that one tickled me
 
Anonymous
9:24 PM
Moin
 
Anonymous
!!wotd
 
leporine: of, relating to, or resembling a rabbit or hare.
 
<form method = "post" action =  <?php if(!isset($_POST['firstname']) || (!isset($_POST['lastname']))) { echo "invalid.php";}else{ echo "update.php";}       ?>>
how come this always results in the action being invalid.php?
even if I put values in for the inputs
 
I'm confused on what you're trying to do there
 
@Hello that's not how you do it. Any of it.
 
9:33 PM
The page that you're posting to (update.php) will receive firstname and lastname?
 
yeah
and it should go to invalid.php if they dont enter anything
 
> That's not how this works. That's not how any of this works
 
:(
 
So only the page that it is posted to will be able to access the $_POST variables, so invalid.php or update.php can access them but they're not going to be in the $_POST array until they've been, well, posted
 
@Hello May I suggest you use empty() instead of isset()? Because isset will only check if the post variable exists. This will always return true when you post the form. even if nothing was entered. Empty will also check if there's value inside.
 
9:36 PM
So you will want to use JS to intercept the form submission, and stop it from happening if the text that is (or isn't) typed into the input boxes isn't what is expected
 
show form -> user enters shit -> submit -> check the data
    if OK -> redirect success page
    if FAIL -> redirect back to form with error messages
 
And what @icecub said is true, if it were the code that is on update.php that is checking the $_POST variables.
 
oh yeah..well i didnt know how else to do the condition
 
@kelunik purge it completely once we tag v2.0.0
 
@Hello not actually addressing your question....but you should avoid using negative logic (e.g. no "!$foo || !$bar) and also avoid mixing up html with PHP:
<?php
$action = "invalid.php";
if (isset($_POST['firstname'])) {
    $action = "update.php";
}
if (isset($_POST['lastname'])) {
    $action = "update.php";
}

printf(
    '<form method = "post" action ="%s">',
    $action
);
 
9:41 PM
not sure how that helped in even slightest way ... aside from you showing just another way to mix html with php
 
It's a lot easier to reason about and debug.
 
lol xD
 
@Danack that's highly subjective
hell, I have seen only one other person using using printfin any real code and that was one of those "senior developers", who got the position by not leaving/learning for 10 years in the same company
... I'm probably biased
 
Hmm. Can I actually create a new folder and a new htaccess file inside it with php? Or should I avoid doing that? (ie bad practice)
 
@icecub Just completely avoid using htaccess files.......and in fact Apache if you can.
 
9:48 PM
@icecub the recommended approach would be to have the logic outside the document root and not relay on .htaccess
 
I'm working on a image upload library that creates an upload directory and I want to make sure that directory only allowes local access
 
why would you want for everyone to have unrestricted access for that directory?
 
Unrestricted? I want the folder to only allow localhost to access it. Nothing else needs to be able to go there
 
@icecub Put it outside of your web root.
 
^ that
 
9:52 PM
@Danack Ye I know that. But it's not for me personally. It's supposed to become a library that works for anyone downloading it. What if someone using a VPS wants to use it? I'm fairly sure they can't create folders outside of docroot
 
With a VPS they can - you presumably meant shared hosting?
 
Ye sorry. I ment shared hosting
 
VPS's cost $5 a month.
Just forget about anyone who can't afford that. They won't be able to afford any time installing libraries either.
 
@icecub I would leave that as a configuration option
 
I'll think about it. Perhaps I just include an option to install it within docroot adding a warning about the risks
@tereško Yes, exactly what I just thought about :)
 
9:55 PM
if someone is stupid enough to put it inside document root, it is not your problem anymore
 
True that. Thanks for the advice! :)
 
you can leave a comment recommending not to do that ... just to cover your own ass
 
It'll be free, open source library. I'll cover my ass with some gnu license or something, haha
I got the idea after answering this question: stackoverflow.com/questions/38509334/…
I keep getting a lot of upvotes on it. So I actually think an easy to use library would benefit some ppl
 
< uses only libs with MIT or BSD
GPL is cancer
 
Ah ok. Thanks :)
 
10:09 PM
@icecub the issue with GPL is that, if your code uses one GPL library, it also has to be published as GPL
 
@tereško Ah ok. I'll have a look at both MIT and BSD. See what they're about exactly and then pick the one that fits best.
 
... interesting ... are you telling me that you had looked at GPLv2 and GPLv3 before picking one of those are your "first choice" ?
:P
 
Well I haven't used them before. Never released any script to the public. But I did write a couple of license agreements for some companies so I do knew a few things about them :P
They were Dutch license agreements though. Pretty sure international law will be different
But ye. I'm actually one of those guys that reads license agreements before accepting them. Even though Dutch law invalids any online or software license agreement that doesn't provide a clear option to download and print a copy of it. Which surprisingly most software doesn't.
 
10:24 PM
oh, but GPL is available for reading and printing
 
Ye I know. But Dutch law dictates it must be very clear. Just giving a link to where it can be downloaded or printed inside the license text isn't considdered clear. A button or link above the agreement is
Or underneath. Basicly it just needs to stand out.
 
to release you code under any license, said licence has to be part of your codebase
ya know, the magical LICENCE file, that you see in every package
 
hahaha
 
not sure what is funny about it
 
But ye. That's fine too. Because that way you have the file and you can open it with some text editor to print it
 
10:30 PM
fuck this, I give up
 
@bwoebi Why then? Not now?
 
@kelunik dunno, just felt like the right moment, but I think can be destroyed too right now.
 
@tereško I'm probably misunderstanding you (language difference). "Codebase" sounds like part of your code to me. Like the license has to be inside the code. Then you said the LICENSE file, which made me smile. That's all
 
If @Trowski agree's, one of you can do that.
@bwoebi @Trowski Please wait with tagging v2 until I'm available again. Won't be during the next week.
I think 1st of May is a realistic goal.
 
10:58 PM
ELF is complicated
especially the dynamic linker part
like, going from "this code is executed" to "this code executes a function outside of this binary" to "where is this binary" to "how do I load the binary", etc etc...
the layout of ELF itself is not hard
but understanding the execution... ugh
and the tools you need...
on one side you need some kind of ELF reader
on the other side you need a disassembler
and an hex reader also helps
hem
that was a fun evening either way.
 
11:34 PM
Oh look, a discussion about linker formats:
 
00:00 - 13:0013:00 - 00:00

« first day (2374 days earlier)      last day (2581 days later) »