« first day (2772 days earlier)      last day (2180 days later) » 

12:20 AM
A schema file needs to match to the documentation, or does the documentation need to match the schema file? I ran the JSON schema 07 draft file against itself, and it says it's wrong about itself. =o\
 
12:47 AM
!!should I stick with ubuntu or switch to debian
 
You should switch to debian.
 
1:05 AM
Anyone have a wordpress cloud host you like? I have a client that gets spikes of 70k visitors on his e-commerce website which causes his dedicated server to die .. :\
 
1:32 AM
@Wes \o
 
1:54 AM
0
Q: Symfony 4 - Different entity Subquery within Repository, inner join max ID of each group

DariusI can't get $this->createQueryBuilder(); to work for another entity because it's inside the repository already. So I wrote it out by hand. But now, I can't find a way to get it to join. Seems so simple.. :( Examples like this : Symfony2 subquery within Doctrine entity manager run the queries i...

 
 
1 hour later…
3:04 AM
mornin
 
 
2 hours later…
4:36 AM
@DaveRandom good example. thx
@Linus o/
 
5:10 AM
@Shafizadeh \o
 
 
1 hour later…
6:23 AM
@bwoebi ... you wanted a way to weakly hook into the destructor of an object ...
<?php
class Target {
	public function __destruct() {
		echo "in destructor\n";
	}
}

$inspector = new Inspector\InspectorMethod(Target::class, "__destruct");

$hook = new class($inspector->getEntryInstruction()) extends Inspector\InspectorBreakPoint {
	public function hit(Inspector\InspectorFrame $frame) {
		echo "in target frame ...\n";
	}
};

$target = new Target();
?>
if the destructor exists ...
<?php
class Target {}

$definition = new Componere\Definition(Target::class);
$definition->addMethod("__destruct", new Componere\Method(function(){
	echo "in destructor\n";
}));
$definition->register();

$inspector = new Inspector\InspectorMethod(Target::class, "__destruct");

$hook = new class($inspector->getEntryInstruction()) extends Inspector\InspectorBreakPoint {
	public function hit(Inspector\InspectorFrame $frame) {
		echo "in target frame ...\n";
	}
};

$target = new Target();
?>
if it does not ...
 
7:00 AM
@JoeWatkins I - haha :-D I meant within php-src without additional extensions
but I admit, it looks nice
 
mornin
 
Wes
7:41 AM
 
I'm designing the database of a company which hast two kind of users: "Individuals" and "Legal entities". Not sure those two terms are valid in English. Anyway the first one means "regular users" and the second one means "the ones who own a company".
Do I need to have two users' table? Or should I keep both in the same table?
You know, the attributes are (a bit) different.
 
8:12 AM
why were you complicating it?
is having "company accounts" really part of minimum-viable-product?
 
moming
 
and how a profile of legal entity differ from an individual?
 
@tereško at least, legal entity profiles need to have a company id while individuals don't.
@tereško and yes, now I believe I was making it complex and vague for myself.
 
what's "company ID" ?
a number? a name? a foreign key to a different table?
do you intend to do something else with that list of companies later?
 
a FK
 
8:27 AM
so you "profiles" table (which should be separate from your "users" table) would have two additional field: an integer type column and a company_id column for key to `"companies" table
 
emm, actually ECOs are legal entity (who have a company). They have staff, some documents about their company. But individual are end users.
 
if, after loading the users profile, you see the that the type column contained value Profile::TYPE_COMPANY then you do another SQL call that populates the Company instance
 
@tereško reasonable.
 
anyway ... I'm, off to the city, need to shop and probably eat
 
@tereško actually I understand what should I do. thx
 
Wes
8:58 AM
@LeviMorrison sorry, too different timezones :( wanted to ask you, when you get a reference to a generic function, e.g.
function bar<K>(K $x): K{}
when exactly are the type parameters argumented?
- on reference creation $myBar = bar<X>; $myBar();
- on call time $myBar = bar; $myBar<X>();
- or both possible
 
@Wes On call time wouldn't make too much sense, no?
 
Wes
well, could be both useful
user image
2
@tereško
 
9:47 AM
Internet makes me sad
 
10:18 AM
LOL
 
10:45 AM
Why do you believe "user" and "profile" tables cannot be one table? @tereško
 
Because a user has a profile and a profile belongs to a user. But a profile is not a user.
but since this is usually a 1:1 relation you could merge the tables for pragmatic reasons
 
@Gordon you mean adding profile table columns to the users table. right?
 
This is ridiculous -__- I can't figure out how to create and render a simple form that validates and connects two entities in symfony 4.
 
@Shafizadeh yes, by merge the tables I mean adding the columns of the profile table to the users table. However, I agree with @tereško that keeping them apart is the better option.
 
@Gordon keeping them apart causes one more join in the query ..! Why you guys love low-performance?
 
10:56 AM
Whenever I use "CollectionType" and setup the "PostType" class inside it, i end up rendering empty field, so i create a post but don't persist it in controller so the field shows up. But I hate having to see the textarea name be "post_0" etc..
 
@Shafizadeh by keeping it all in a single table you do not improve the performance
 
@tereško why would you say that? a select query is faster or a select query joining with another table?
 
you actually either lower it (because you are sendding around a lot more data between application and database), or you make the SQL logic in the php side more complicated
@Shafizadeh you are not doing SELECT id FROM thing , you are fetching multiple columns
 
I do, so?
 
.. hell, it's likely that you are selecting all of them
 
11:03 AM
@tereško I never use asterisk in the select statement
 
also, having one table containing two separate "things" will cause additional table-locks
 
noted that what you're saying is what I read somewhere else too. You believe that's how relational databases work.
!!wiki table-locks
 
it's not a matter of belief
I know how table-level and row-level locks work
 
ok, I rely on your experience and keep those tables apart. (but still I have feel really bad when I want to get user's details then I have to do a join)
 
for fuck sake, STOP WITH THE FUCKING MICRO-OPTIMIZATION
you are making the code more shit
 
11:07 AM
ok
 
you keep on trying to solve problem that you do have and might never have
 
If I was at this royal wedding- they would definitely get me on camera picking my nose.
 
@tereško why you only care about one day? (or one month? or atmost one year?) ..! Dataset is keeping longer, longer and longer ..! Why you don't care about that?
yes, profile can be into another table, and it is neat and clean .. but for how many users? 10? 100? hum? what about 100,000 users?
 
@Shafizadeh ya know when it might become a problem? When you have over 1'000'000'000 entries in that table (and only because you are using MySQL, that problem can then be simply fixed by migrating to a better database, like PostgreSQL)
 
@StatikStasis I am surprised about her wedding dress. It's very high necked. I would have thought she'd wear something more revealing.
 
11:11 AM
@Gordon How much do you think that dress cost?
Probably more than my vehicle.
 
But it's pretty. Very humble and modest if you ignore the trail
 
so ... @Shafizadeh what is your estimated timeline for reaching 1 billion registered users (which is the case you are currently trying to optimize for)
 
@tereško how PostgreSQL works? Does it has a user interface like phpmyadmin ?
 
@StatikStasis Kate's was 250k GBP as far as I can tell from googling it. Her's will probably be somewhat less, but still crazy expensive
 
@Shafizadeh you do not need to worry about it
 
11:14 AM
Incredible.
 
if you want to play with PostgreSQL, launch this project and try it out in the next
 
@tereško my brain works either 0 or 1 ..! if I want to write code, it should be working forever .. not it is ok for now ..!
@tereško ... in the next version of this project ..! That's my only and ever project
 
@Shafizadeh that's a mindset of an idealistic junior developer ... or maybe an unpaid intern
 
Mornings
 
also probably it's good to know, there is a popular website in Iran which requested to have a API of us. His website is the translation of ISI and IEEE articles in Persian .. and they want to add a Q&A extension to their website.
 
11:19 AM
Morning!
 
@Shafizadeh first you need to get it running
then you can start thinking about adding an API
 
@PeeHaa Fixed and did another pull request last night.
 
because "API" and "Website" are two separate applications
 
@tereško I can do that by running git pull origin master in my server. But lemme make it perfect first before launching
 
Nice
Let me try to fix my internet here so I can check on my desktop
 
11:20 AM
@Shafizadeh you can't make it perfect. Just "make it work"
 
it works since last year
but there are lots of working projects which even haven't get alexa rank yet. So, you should make a great thing and then launch it
 
Teresko, mind taking a look?
https://pastebin.com/ikqwiN0p - Controller
https://pastebin.com/LYuR818S - ForumThreadType.php
https://pastebin.com/wzZRyFgW - ForumPostType.php

I have a OneToMany and ManyToOne relationship on Threads to Posts. I just want a simple text input and a textarea. Instead, using collectiontype in threadtype for posts gives me the option/forces me to have textareas with names of "post_0", and I keep having to do new Post(); in controller prior to creating the form to output a textarea inside the form.
and if I make it a plain textarea inside ThreadType, it won't listen to "required" when I set "mapped"=>false. Otherwise it asks for "getContent", which there is no function for that.. it's under Post.. :(
 
I like this guy.
 
@StatikStasis You're talking about the wedding I'm assuming. Which guy? I have the tv on too.
 
The priest/minister speaking. He's not boring.
Most of the time they're very monotone in these settings.
We could have done my wedding 3 times already in the same amount of time.
 
11:34 AM
yep. Plus they really hyped the wedding over the top here in the US. I had the TV off all week because it annoyed me.
Doesn't really feel royal either..
 
for richer or poorer... poorer... pfft
Yeah I'm in the US too. Today is the first day I have read or listened to anything about it.
 
can you please tell me if I am on right way of learning MVC reading this tutorial? github.com/PatrickLouys/no-framework-tutorial
 
802
A: How should a model be structured in MVC?

tereško Disclaimer: the following is a description of how I understand MVC-like patterns in the context of PHP-based web applications. All the external links that are used in the content are there to explain terms and concepts, and not to imply my own credibility on the subject. The first thing that...

 
@BoteaFlorin you could have picked a worse tutorial. keep going with this one.
 
@BoteaFlorin that tutorial has nothing to do with mvc though
Nor should that be your goal
 
11:47 AM
I want to learn mvc, but the existence of laravel or other frameworks is discouraging me...
 
That floor looks like my bathroom tile in our guest bath.
A royal choice it would seem! =D
 
I mean, all frameworks have a pre-made app structure...I tried to take a look at Laravel and the code thread is over me...
 
I'd like a suit like Beckham's.
 
Get an online course from udemy or something, really good ones on youtube to get started with. If you can't follow directions from there, then don't bother programming, it only gets worse.
 
Don't confuse a pre made structure with mvc
 
11:52 AM
LOL! He wanted some sugar. She wasn't having any of it.
 
It's not a synonym
 
He is rocking that Cello.
I bet he has been playing that song over and over since he was booked.
 
@PeeHaa but I don't
 
Wes
> royal wedding live streaming
what the shit
 
@Wes Isn't technology great!
 
Wes
11:58 AM
true
 
The long drive in the cameras must have switched over a dozen times as they captured the bride and queen's car coming in. Crazy long line of people. All I could think about was all the coordinating and the media director somewhere in their ears saying "Camera 5 standby... camera 5 up!"
I don't ever keep up with this stuff- rare occasion.
My kids would not be able to sit still this long.
My country tis of thee! I love this song!
=D
Did anyone else lose volume?
 
Wes
> royal wedding full coverage
 
Had to reload.
 
Wes
what's up with the father of the bride
 
lol- who is that woman yelling?
 
Wes
12:07 PM
is that the song from the lion king
 
lol
You hear that lady yelling?
 
Wes
yes
 
ye-ye-ye-ye
 
Wes
this stuff is so weird in 2018
he should have married a kardashian
 
Time to go shag the misses Harry.
 
Wes
12:10 PM
he should have married a cardassian
 
Oh God no. lol
 
Wes
is this when scar murders the lion king?
i have seen this movie
 
lol
Queen is like - back to Buckingham and away from all these commoners.
Who is the old guy with her?
 
Wes
ah the prince. i love his gaffes
her husband
 
So... does that make him The King?
 
Wes
12:13 PM
prince of edimburgh or whatever it's spelled
nope
 
Why not?
 
Wes
not idea why, but he is just a duke/prince
!!? why isn't prince philip the king
 
Crazy how big this event is.
Entire country dresses up.
Arm has to be tired.
Harry knows what's up- very selective with his waves. Meghan waving the entire time.
 
12:29 PM
!!docs yield from
!!version
@PeeHaa ^
 
Jeeves crash?
 
Wes
even the horses are pretentious over the peasants
 
Gosh that would suck. Waiting for carriage to pass and some guy in the front holds up a big sign blocking your view.
@Wes lol- yeah they are!
The horses know they're the common rabble.
 
Hi
Hi i have one question anyone help me here ?
 
Still on same issue -__- stackoverflow.com/questions/50325538/… made a bounty if anyone wants some points.
 
12:36 PM
Wow... so when they eat- once the queen stops eating everyone has to stop eating. I would be downing the food.
Well... that's enough wedding stuff for me. Back to reality.
 
well on the up side, it is at least a nice day for ritual sacrifice to the gods of tabloid media
 
@DaveRandom When is it not?
 
well this is England, so like 99.7% of the time
we get 1 week of summer a year if we're lucky, usually in late spring
 
Oh- you're actually meaning the weather. I was thinking from the perspective of the media- it's always a good day for them. But yes- the weather looked lovely there today.
 
I'm not sure what the cause/effect relationship is between that fact and the English propensity for discussing the weather as if it is a genuine conversation topic
it's possible that the ancient britons migrated here specifically because the weather justified how often they wanted to talk about it
 
12:50 PM
lol
Dave- you were only 3 hours away- you didn't want to join the festivities and stand outside as they rode by?
 
whatever, the tl;dr is the the english are mostly twats and royal weddings can do a very special kind of fucking off reserved only for a select number of things
 
We have lots of twats here too. It's universal.
 
Wes
Huge fan of Harry saying “I’m shitting it” in front of every country in the fucking world. https://t.co/nvdgjDZuSj
 
@StatikStasis Queen Elizabeth wanted it to be clear that she was regnant (aka in charge), and so didn't allow him to take the title 'King'.
 
@Danack Ah- that makes sense. She must love chess. The king is stationary while the queen has all the power.
 
1:00 PM
How do you add a "jsfiddle" to an answer?
 
@PeeHaa we have a command for that now.
!!mvc
.....we had a command for that.
 
I think he is down.
Not responding in playground either.
 
!!dad
o/
 
1:19 PM
He's obviously busy watching the wedding
 
Sorry @Danack my internet is broken atm so I can't fix it :(
 
What's wrong with it?
 
I've never seen Jeeves and Prince Harry at the same time......
3
 
:p
 
user1804599
lol monarchies in 2018
 
user1804599
1:28 PM
speaking of terrible things, I need to route based on HTTP method and request URI
 
Wes
⚡️ Dark Stock Photos weekend challenge: send me your strangest, darkest, funniest stock photos and I’ll retweet the most fucked up ones. They gotta be REALLY weird to make the cut, though. ⚡️
 
user1804599
1:48 PM
s/darkest/dankest/
 
2:05 PM
omnifarious of all forms, varieties, or kinds.
 
!!mvc
 
How to do MVC: 1. Take any three things, ANY 2. Call them Model, View and Controller 3. Draw some arrows between them Done!
2
 
Thanks for the extra pr
Can I ask one more thing of you? :)
 
2:10 PM
I see that the actual reason it always response with 42 is that that pattern is broken (my fault)
Can you change that pattern too so that it becomes: (?:What is|What\'s) your favorite color and push to the same pr that is ready?
 
3 messages moved to Trash
 
Sorry
Wait
wrong copy pasta
(?:What is|What\'s the meaning of life) -> (?:What is|What\'s) the meaning of life
You could the same for your pattern btw
So that it matches both "What's your ..." and "What is your"
 
Oh ok- I thought you had asked me to shorten it yesterday which is why I left it off.
One sec.
 
Yeah I didn't realize what the actual issue was yesterday. Which was that I actually already fucked it up loooooong before you touched any of it :D
Nice moment to let you fix my mistakes and delegate it :P
 
2:15 PM
Yeah, police here in India are getting pretty witty.
You can find meme's like that all over.
 
@PeeHaa Done.
 
You sure? ;-)
It should be (?:What is|What\'s) your favorite color :P
 
ah crap
 
:)
And can you do the same for the meaning of life pattern?
That would be awesome
 
@PeeHaa ok... now it should really be done.
 
2:28 PM
Awesome!
!!uptime
 
╔══════════════════════════════════╗
║ [23 seconds] without an accident ║
║   since [2018-05-19 14:28:03]    ║
╚══════════════════════════════════╝
 
Thanks and gratz on your first? contributions \o/
 
Awesome!
 
I must have spent an hour talking to Jeeves one day this week trying to break him.
 
user1804599
2:30 PM
 
user1804599
Getting there!
 
:P
@rightfold cough Dr. Frankenstein cough
@rightfold What project is it dare I ask? :)
 
user1804599
> ASDF is an open-source multi-user ledger application. You can use ASDF with friends and colleagues to keep track of outstanding payments.
 
2:47 PM
Watching her Ex get married i.imgur.com/DJhWEcg.png
 
@rightfold cool:)
 
user1804599
Used to be an SPA.
 
user1804599
Then I realised I didn't have to be a moron.
 
:P
 
user1804599
I really like COBOL.
 
Wes
2:59 PM
 
@wes Where is that
 
ohhhhh
 
Wes
so people hired mariachis to follow him wherever he goes aha
 
@Wes I think in other languages it's at reference time.
But in PHP we don't really have "references" to functions like that.
We have strings.
 
3:38 PM
Crazy guy.
lol
 
user1804599
@Wes In languages with so-called "higher rank types", such as Haskell and TypeScript, they can appear in values that are passed around.
 
user1804599
For example, this function takes another function that returns either the first or second element of a tuple:
 
user1804599
f :: (forall a. (a, a) -> a) -> Int
f g = g (1, 2)
 
Wes
why is haskell so weird
 
user1804599
You can't pass it any other function. For example, you can't pass it a function that returns the first tuple element but incremented. Because that's not defined "for all a".
 
Wes
3:45 PM
i don't get that :B
what would that be in typescript?
 
user1804599
function f(g: <A>(a: [A, A]) => A): number {
    return g([1, 2]);
}
 
user1804599
I can do these:
 
user1804599
f(a => a[0]);
f(a => a[1]);
 
user1804599
I cannot do this:
 
user1804599
f(a => a[0] + 1);
 
user1804599
3:48 PM
Because a => a[0] + 1 takes a number, but I have to pass a function that works on all types, not just numbers.
 
user1804599
There are only two functions that do that, given the type: a => a[0] and a => a[1]. Any other function would not be a function (would have side effects or not return) or have the wrong type.
 
Wes
not familiar with that syntax at all sorry
<A>(a: [A, A]) is this a tuple where 0 is A and 1 is A ?
 
user1804599
[A, A] is indeed such a tuple type.
 
Wes
and <A> is the type variable
 
user1804599
(a: [A, A]) => A is a type of a function that takes a tuple and returns an A.
 
user1804599
3:52 PM
<A>T, for some type T, is a type with a type variable A.
 
user1804599
So, function id<T>(a: T) => T { return a; } would be of type <T>(a: T) => T.
 
Wes
is "a" the parameter name? why is it needed in the type declaration?
 
user1804599
Yeah. Because TypeScript is stoopid.
 
Wes
eheh
 
user1804599
It has no significance, it just has to be there.
 
user1804599
3:54 PM
(a: number) => number and (b: number) => number are the same type.
 
user1804599
Are you familiar with generics in Java?
 
Wes
yes, but more c#
 
user1804599
In C#, you can do this:
 
user1804599
interface TakeTuple {
    A TakeTuple<A>(Tuple<A, A> tuple);
}
 
Wes
yep, now i get it
 
user1804599
3:56 PM
So, in C#/Java, you can do this with methods.
 
user1804599
In Haskell/TypeScript, you can do it on any type.
 
user1804599
Another interesting example: you cannot pass a non-empty array to this function: function f(a: <A>A[]).
 
user1804599
If you have a non-empty array, it always has some concrete element type.
 
Wes
typescript is confusing
haskell is weird
 
user1804599
3:59 PM
I like programming in COBOL and PHP.
 
Wes
lol
 
user1804599
I wrote this PHP class to generate request handlers that call into COBOL programs.
 
Wes
Function1Arg<A><Tuple2<A, A>, A>
 
user1804599
It takes an array of strings in the constructor. Then, when a request comes in, it reads those from the query string or the request body, and passes them as arguments to the COBOL program.
 
What browser do you guys use? I'm wondering if there are any obscure ones I'm not aware of that are being adopted.
 
Wes
4:02 PM
that in my generics would be
class<A> extends Closure1<Tuple2<A, A>, A>{}
 
user1804599
@StatikStasis GNU IceCat.
 
ok, just to doublecheck: there is no way for count($x) to return null
right?
 
@rightfold Interesting- thank you. I will check it out.
 
Wes
interface Closure1<in ArgType1, out ReturnType>{ function __invoke(ArgType1): ReturnType; }

class<A> extends Closure1<Tuple2<A, A>, A> $var = ...;
that would be an actual type declaration
i am clueless again
 
Wes
4:28 PM
@tereško correct
 
5:01 PM
:42606225 Have you been to talk to your doctor about your OCD yet?
 
Wes
damn i missed it
 
!!uptime
 
╔════════════════════════════════════════════════╗
║ [7 minutes and 35 seconds] without an accident ║
║          since [2018-05-19 17:04:17]           ║
╚════════════════════════════════════════════════╝
 
@tereško You know, sometimes SO suggests some wrong tags while you're asking the question. And people blindly choose them.
 
I don't think it was automate
it's more likely that it's another dumb fuck convinced that "pretty urls" are the same as "mvc"
 
yeah it can be a possible guess :P
 
(yes, I am seriously irritated today, because I am rewriting a crap I wrote about 18 months ago)
 
In general rewriting is an annoying thing.
 
6:13 PM
it was a terrible idea when I wrote it, but it was a solution for even worse clusterfuck
and the clusterfuck is still there .. I'm just trying to get rid of a dependency on an old library of mine, which I want to purge from a project
 
:-)
you love two words, fuck and shit :-)
 
did I mention that I am fucking pissed off ?
 
no :-) but it's obvious :P
 
I don't even have the option to blame someone else ...
 
This too shall pass. (however not sure if you know what it means)
 
6:20 PM
we have a similar saying in latvian .. roughly translated:
> when the next shitstorm comes, you will forget about this one
 
:D
good one
 
@tereško just blame an alter ego of yourself which you don't associate with anymore
 
@bwoebi you mean he blame "the young Teresko (which currently isn't young anymore)" ?
 
@Shafizadeh it's a bit more subtle than that, but that too
 
ah :-)
 
6:28 PM
^ basically this
 
Wes
6:48 PM
there was a crash on the motorway. of course all the idiots decided to stop to help/have a look, suddenly
so they almost caused more crashes
a guy was even walking randomly on the motorway like no car at 100km/h was passing
 
 
1 hour later…
Anonymous
7:51 PM
Is there an app for github on android?
 
8:19 PM
@samayo I was looking yesterday on iOS and didn’t see an official one.
Not sure about Android.
 
user1804599
9:20 PM
Started working on a COBOL compiler with the goal to generate PHP code.
 
user1804599
Rewritable gotos are going to be fun to translate.
 
11:19 PM
posted on May 19, 2018

New Cyanide and Happiness Comic

 

« first day (2772 days earlier)      last day (2180 days later) »