« first day (2593 days earlier)      last day (2352 days later) » 

3:00 PM
;)
 
"should" being the operative word
 
@tereško not in our case, with this vendor.
 
@AlmaDo yup, nvidia has had that issue multiple times
 
that's a "minor update" :p
 
3:05 PM
I'm not entirely in-tune with their version number procedures though.
 
@Fabor that sounds like it might be an issue with your phone, but doing a MAC/IP bind in the DHCP config might solve it. If the router/AP have config for "spanning tree protocol" or "STP", enable it and set everything to auto.
if they don't have "auto" settings I can tell you what settings to use, but it depends what options it gives you
 
Alright, will look thanks.
 
spanning tree is a thing that allows you to have redundant loops in the network without packet storms, but it can also help when you have ARP problems, which is what this sounds like
If either box has options for auto-flushing the arp cache and/or "active ARP" is a term I have seen used before, enable those
 
@NikiC Ok, I've updated the implementation to not consume the leading \. Do you think targeting PHP 8.0 would be best, since it will change the output of "\#{$a}" and break regexes like #\#{1,2}#?
 
hmm ... I actually found an answer about MVC, that I liked: stackoverflow.com/a/1712300/727208
6
 
3:18 PM
@tereško It's only taken you... 5 years? :)
 
also, it just happens that every other answer in that post is utter shit
 
@tpunt What exactly are you talking about?
 
> I'm using CodeIgniter, I don't want to make my own MVC framework or something. Just want some tips about it. :)
 
Answer is good but that dude will definitely not understand it.
 
3:24 PM
maybe he did at some point .. it has been 8 years
 
@tpunt I do not think these to be major problems. In particular nobody uses # as delimiter if he uses that character within the regex. Either you learned / as your only delimiter (and obviously escape it then) or you use a delimiter symbol not present in your regex.
 
Wes
@tpunt are you sure we need that. {$var} is not much different from ".$var."
 
@bwoebi Yeah, that's what I'm wondering. It is, however, quite a subtle (and therefore nasty) BC break for those who do have such regular expressions.
 
Wes
the whole interpolation thing is a lie. unless it's stuff like sprintf
 
I may agree waiting until PHP 8 if we use only curly braces. I.e. "{1 + 2}" => 3. But with a # prefix? no.
 
3:30 PM
@bwoebi I think that would definitely cause quite a BC break. Anyway, I'll see what Nikita thinks, update the RFC later today, and hopefully post it to internals later this week.
 
@bwoebi so in other words make any curly brace pair in a string a syntax error?
 
Also, if any internals developers here have some free time to proofread my article, then that would also be great.
 
Wes
@ircmaxell it's madness...
 
having used #{} in ruby, I can definitely say I really like it. Really powerful and yet still expressive and not clunky
 
@ircmaxell Essentially yes. I'm not saying that it's a good idea (given the current existing code) - just saying, if we were to do that, we should probably do that only in a major version. Though it's trivial to detect and fix with an automated program.
 
3:32 PM
even without the existing code. I'm not aware of any language that does that
the only ones I've seen are {$...} or ${...} or #{}...
 
@ircmaxell Well, we're somewhat doing it, just that we only allow variables (and variable-like expressions inside it (i.e. {$f(1 + 2)}is currently valid syntax)
 
/me doesn't care for that in the first place
I'd rather have a unified syntax, and {} are too common to jsut be tht
(IMHO at least)
 
in PHP I would expect that ${...} is a variable-variable
 
Why is the php-fig site still only over http :<
 
@Sean that's a good question to ask them
 
3:38 PM
Pfft, I get the impression asking fig anything is like banging your head against a brick wall
 
@Sean because they are a serious organization that works for the betterment ... ah, who I am kidding - it's because they are incompetent
 
I can't really say that a { is more common in a string than a $ sign though. They way it's going now, you can write a variable as $var, ${var}, {$var} and #{$var} then … An unified syntax would be rather not adding yet another way for outputting a variable in a string inside string interpolation context.
 
can't we just make everything inside {} in a string to be interpolated, unless you escaped the parenthesis
 
@tereško that's what I was talking about.
 
@tereško It will break a lot of code.
 
3:43 PM
yes, hence - 8.0
 
I like js's `string${evaluated}`
 
^ fail :p
 
fu markdown
 
its no use
the markddown has rejected you
 
look again
 
3:44 PM
you cant use ' in a tag. @FélixGagnon-Grenier
 
38 secs ago, by Félix Gagnon-Grenier
fu markdown
 
we're* :D
 
we-are works.
 
fu inglish
 
3:45 PM
@bwoebi To be fair, it would be doable if we used string sigils. Like e"Ans: {1 + 1}". But applying it to heredocs would look a little ugly (e<<<END), and it would also need to be applicable to the execution operator (e`{f()}`).
 
@kelunik ftfy
 
@tereško With strings required to be defined based on PHP_VERSION_ID?
 
@tpunt To avoid the BC break you mean? Meh, that's even worse. Then I prefer #{}
 
@kelunik yes
if that's what it takes
 
@bwoebi Yes, it would have 0 BC impact. We could also introduce other sigils (such as r"..." for compilation-time validation of regular expressions). But anyway, I like the current syntax, so that's the one I intend on proposing.
 
3:48 PM
I can't imagine something worse in language design that does (a) break BC and (b) doesn't even allow one syntax that works on 7.x and 8.0.
 
I fail to see the (b)
 
@kelunik That's the problem I see with {} as well. With #{ it's not a big problem, given that it's two chars which can be converted to "#"."{".
And also probably quite a rare combination of characters
 
@tereško 3v4l.org/3rvWX - Escapes via \ will just render \ on previous versions.
@bwoebi Yes, that's definitely better, but not sure if I'd vote for it.
 
right. And that's why I don't consider that particular one a good idea. It would make it essentially impossible to write a literal { inside a double quoted string. (without a very annoying context switch between single and double quoted strings for every single literal {.
 
@kelunik you are basically complaining that echo "<a href="/test">"; doesnt work
 
3:53 PM
@tereško no.
 
@tereško no.
 
that example is JSON
my example is HTML
 
Yes, but I talk about the escaped { and }, not the escaped ".
 
@tereško He's complaining that "{" will syntax error in one version and not in the other. "\{" will work in both, but have different outputs in both.
 
@bwoebi ah, thanks, not I understand what he was talking about
 
3:56 PM
@tpunt @bwoebi What's the intended use case?
 
@tpunt Yes, #{} is probably the best solution I can think of.
 
lately all the PHP syntax problems are being solved by sprinkling more "magic symbols" in the code :(
 
@kelunik ever had a block of heredoc syntax and were annoyed to have to put every simple expression into a tempvar?
 
< has never even used heredoc
 
@bwoebi Yes, but very rare and probably not worth breaking any existing code.
 
3:59 PM
@kelunik well… that's the number one reason why I'm not using heredoc syntax more often.
 
Really?
not the fact it has a limited use case?
 
Where do you use it that often? HTML? Should use a template engine with auto-escaping. SQL? Should use parameterized queries.
 
@kelunik regexes. Yes, HTML. Putting code into strings. Javascript code with a few variables set.
 
You are doing most of them wrong imo
 
I'm not saying the most things should be done in an ideal world. But given the current world, that's where I'm using them.
 
4:05 PM
But you're proposing a language change to support these use cases, which, as you say yourself, are at least questionable if not wrong?
 
Wes
@PeeHaa but writing regexps without having to double escape stuff is nice
 
@Wes yep
I said limited use cases
Not arguing they aren't there
 
Wes
instead i have 0 use cases for string interpolation :B
 
Breaking working code for limited use cases are meh imo
 
@kelunik And why is that a bad thing? I can't do much about having to use strings in such places. I want to make this as nice as possible though.
 
Wes
4:06 PM
i regret every time i use it.
 
@bwoebi Because it breaks existing code for very limited use cases and makes the wrong thing easier.
 
@kelunik I'm conjecturing the amount of broken code is much much smaller than the benefit it brings.
 
This sounds too much like one of those "it's ugly syntax but it's the best we can do right now and trust me it's going to be awesome" kind of things
 
apart from that I think it also just looks nicer than ".( .... )."
 
You don't need these ().
 
4:10 PM
@kelunik depends on what's in there. If it's an addition then you very much do.
 
Instead, you could also propose to make . optional and make "foo" "bar" work as concat.
 
Ugh, no.
 
Now I am agree with Bob :P
Ugh, no.
 
That looks awkward in C and it's there only nice because allowing preprocessor concat at all
 
Wes
if i did it i would have a native sprintf instead
echo "aaa $ ccc $ eee $" <= "bbb", "ddd", strtoupper("fff");
prints
"aaa bbb ccc ddd eee FFF"
 
4:13 PM
There is a reason we don't like you @Wes
5
<3
 
Wes
...
 
I do not like sprintf.
 
@bwoebi Change the precedence of . to be lower than + and -. ;-)
 
Anonymous
@Wes he's got a point
 
@JayIsTooCommon no he got three points.
 
Anonymous
4:14 PM
nerd
 
Wes
you don't like it just because sprintf sounds a fart in a silent waiting room @bwoebi
 
@DaveRandom My stickers still didn't arrive, but my Hacktoberfest shirt didn't either, so you still got time to be first. :P
 
I just imagine that's a italian saying :D
 
Wes
no that's just how my farts sound
3
sprintfffff
 
:P
 
4:15 PM
@PeeHaa's Echo
 
Wes
aha
have you seen long strings interpolated with ${} ? they are shit (read: just as shit as if it were concatenated with .)
clearly sprintf is a much nicer solution. can go multiline, etc
 
Yep
In those cases I go for sprintf too
There. Now I have agreed with most of you at least once
You're welcome
 
Wes
that or with labels, like
echo "aaa $x ccc" <= ["x" => "xxx"];
 
Sick beats btw PH.
 
@Wes If I'd have to go multiline I use temp vars instead.
 
4:18 PM
Thanks <3
BTW multiline sounds awfully load like you want a template instead
 
@Wes string greater or equal than array? :-P
 
Wes
ignore the syntax. i mean something like that
or
$foo = "";
$foo .= ....;
$foo .= ....;
$foo .= ....;
 
Yeah, got what you mean.
@Wes no.
 
Wes
i do that. not saying that i like it
but it's for sure better than interpolation is my point
now admit it, that you spoke "sprintf" out loud, just to check if it sounds like a legit fart
 
Totally true
 
Wes
4:26 PM
ahaha
 
5:07 PM
yo
 
Yo paul
 
@PeeHaa I pretend 32b PHP doesn't exist, though jsonreader will probably work fine with it anyway (i can't think of a reason it wouldn't, at least not without caffeine); and composer should throw a fit if someone tries to install it on anything < 7
 
night o/
 
@PaulCrovella Yeah guessed as much. But his issue is just weird
Haven't tested it myself yet either, because busy with other stuff
 
Morning.
 
5:14 PM
@PeeHaa nah, not weird, he's exhausting his available resources
 
huh
Tell him to stop trying to use his commodore 64 for it :P
 
e'nin
 
o/
ooooooh
I see what he was doing @PaulCrovella
E_USER_ERROR
Got it
 
to be fair it's something I imagine a lot of people do at first to see what it spits out... just works better on little docs where that, um, works
 
@tereško "...as in an entity represented by a database table..." He doesn't mean that strictly, right?
 
5:19 PM
yeah makes sense to add a nice example, but meh people are allowed to think themselves
But moar docs is always a nice thing to do
 
not sure what to add as an example... i like to keep them small and clear to illustrate a single point
if you come up with something lemme know
 
@bwoebi Any idea why example 4 in the mysql lib returns strings for a * b?
 
@Trowski text protocol
 
@bwoebi Doubles are fine though.
 
If you use prepare() you'll get a proper type. If you use query it's always a string.
 
5:29 PM
Oh… I see. Is there something that could be done about that?
 
No, that's inherent to the protocol.
 
Seems very unintuitive from a user perspective though.
 
@Trowski Actually … the field type is returned with the resultset. You may cast it in user space then.
but it is transferred as string.
 
@bwoebi Maybe we should always use the other protocol then?
 
@bwoebi Well in a manner of speaking everything is. I thought all result sets were handled identically then.
I'm tempted to just prepare all queries to get the correct types.
That's probably not possible though.
 
5:34 PM
@Trowski I mean ASCII text vs. binary format (i.e. doubles are transferred as IEEE 754 with binary protocol)
 
@Trowski Why not?
 
@bwoebi Ah, I see. So we can't force the binary protocol for queries?
 
@Trowski As you say, you'd have to prepare them all to do that.
 
I'd definitely prefer that over different result types.
 
@kelunik I recall some queries not being preparable, such as queries that start/end transactions.
 
5:38 PM
correct, and we cannot determine ahead of time what's actually going to be not preparable without deep query analysis, which I'd really like to avoid.
 
@bwoebi Multiple statements can't be prepared (though that's not a deal breaker IMO).
 
@Trowski also SET statements cannot
Anyway, I wouldn't be opposed to casting the values given the field types
 
@bwoebi I would have to do that in ResultSet?
 
It just never actually turned out to be an issue
 
It just doesn't have enough usage I guess.
 
5:41 PM
@Trowski you'd do that in Processor, similarly like you transform the raw data for binary protocol there too.
 
5:56 PM
@bwoebi MYSQL_TYPE_DECIMAL is a string?
In the binary protocol apparently it is. Wonder if I should cast that?
 
It might be very big I guess.
 
@Trowski a string.
 
Yeah, casting it to a float should probably be left to the user.
 
posted on November 21, 2017 by CommitStrip

 
@Allenph he probably does, because he uses the term in context of ERD
 
6:02 PM
@Trowski A decimal is a number with a field-defined number of digits before and after comma. It's thus of arbitrary precision, something which cannot be accurately represented by a double.
 
@tereško That's an unfortunate name.
 
@Allenph there are a lot of issues with naming
... and every new framework makes it worse
 
@bwoebi Yeah, makes sense.
 
@tereško I don't understand how I'm the only person who seems to think the lack of ability to do joins in ORMs is limiting and produces weird situations. People still like to tell me I've done it wrong if I have to do a join. :p
 
if you use ORM, you have done it wrong :P
 
6:13 PM
Some people here use Doctrine I think.
 
that's their problem
though, I suspect that they actually use the DQL components and not the full ORM
 
SQL is not that bad. I don't know why people keep trying to abstract it.
 
because they are not able to learn it
 
It's harder to learn everyone and their brother's query builder.
 
6:50 PM
@Gordon I can see why building tests first is a better idea -_-
 
Hi,
 
7:08 PM
Hey @Wes do you have time for a wave of Auryn questions? (Really DIC in general. :p)
 
A lot of people familiar with Auryn here so you could probably ask openly.
 
Yeah, but he seems to like it when I annoy him with dumb questions, I don't want to fill up the room with bad, annoying questions.
 
@Allenph Just fill it up.
 
The first question I have is just about the general purpose of a DIC at all. It was my understanding that factory classes/methods were objects/functions specifically created for the purpose of instantiating and injecting dependencies to new class instances. I.E. I shouldn't be calling `new Engine` anywhere really except for factory methods/classes.

It seems to me that the vast majority of the use of a DIC would be a marginal increase in efficiency when creating factories. Attempting to use Auryn as a replacement for factory methods would result in a lot of repeated code...I would have to c
 
7:21 PM
It's not a replacement of factories
 
I know it's not. I'm just failing to see where you would use it because I'm a dummy.
That's my point.
 
I dic just automates the process of injection
Some class requires e.g. a http client. Instead of me manually creating the http client and passing it in I just let the dic do that for me
 
His book makes it a whole lot clearer... Also, what PeeHee said, if you get the whole idea if injecting dependencies - auryn automates it.
 
@Tiffany That's actually what pushed me to go look at Auryn.
In that example you're just setting a reasonable default for the instantiation of a class. But you could just as easily do that in the factory...right?
 
7:29 PM
fkjhdskfjhds NO CARRIER
 
So, what you can do... build a small project without auryn or anything like it, inject all the dependencies manually - you'll fully appreciate it (auryn).
 
Maybe a concrete example @Allenph:
you have a frontcontroller in which you found a route match
Now you need to build your controller and call the action
Normally you would build the controller manually (including injecting the dependencies). And execute the action (by also again passing in the dependencies)
With a DIC you don't have to worry about finding all the dependencies
You simply do $injector->execute()
All dependencies and dependencies of dependencies will be resolved and injected automagically
 
Is there a way to disable laravel from running mysql queries from blade view? So I can ensure all database queries are ran via controller?
I found myself making some errors, like not eager loading certain content and it causes an n+1 issue.
 
See that's the part I've messed up then. I must not understand what a factory is. Because I was under the impression that you would NOT be instantiating the object and manually passing dependencies, rather you would be calling a factory method which had some defaults set and then maybe passing some specific dependencies into the factory method.
 
Factories are a way to prevent tight coupling
 
7:37 PM
I have a meeting.
 
Sorry for you :P
@Darius Tell the idiot who did that he is bad and he should feel bad
Point and laugh for extra effect
 
the idiot who made the mistake? (me) lol or laravel creator
 
And let him put on the hat of shame
@Darius You in this specific case
 
Lol
Guess I'll bedazle it, gonna be with it for a while.
 
The thing is you should not have logic in your "views" / templates
So just don't
 
7:41 PM
It's not logic in views, besides if statements for if($variable->showSection == true) show stuff
 
How are queries not logic?
 
composer remove laravel/laravel
fastest way
 
Templates should be dumb and just present data in some way
@IROEGBU Add fire to be sure :P
 
You shouldn't even have "that much" logic in your controller
> So I can ensure all database queries are ran via controller?
 
What about for sections like, if section is supposed to be visible, show two columns, if not, show one column.
Just use a different view?
partials everywhere?
 
7:43 PM
You can have templates for each section and include what you need in template
 
@Darius Depends. If really simple an if statement is ok
 
But, having if in your template is different from running queries
 
While we're here too, views != templates.
 
Understandable, the part that bugged me about laravel, which is partly my fault, is I ran a query, did a join, then said to make the column result from join as "someResult", and in view I run if($variable->someResult == true), and laravel had an eloquent relation from model for same name, it does the query instead of just outputting the variable.
 
You should try doing it in PHP
 
7:47 PM
I ended up having to replace names, that's all.
 
@Darius Elocunt is a terrible piece of software
In your defense
 
yup.
 
8:02 PM
@Darius maybe you should stop using that abomination ... or at least stop pretending that it is in any way related to mvc
 
Good morning everyone
I haven't been here in a while
 
o/
wb
 
8:18 PM
@PeeHaa I read more about the factory pattern. Makes way more sense now.
 
ty ^^
 
Still one question though...where do we instantiate the DIC configurations? Is it just kind of like routes? I.E. we just kind of...include them willy nilly? Include them in the class definition files?
 
Bootstrap
 
@Allenph Normally, before most of anything else.
 
@Alesana Where have you been?
 
8:21 PM
That seems like it could get messy.
 
Weren't you moving or something?
 
Yeah I have been, actually!
Now I am in Los Angeles
I don't know if I like it
 
oh
:(
 
Haha but I'm glad to be here. Now I just need to find a job
 
Good luck with the job hunt
 
8:23 PM
Thanks
Anything exciting happen while I was gone?
 
Same old same old I guess
 
Sounds about right :p
 
:-)
 
@Allenph why?
 
@tereško Because you're just going to have a bunch of files that are procedurally assigning dependency configurations.
 
8:35 PM
@Allenph this is what the bootstrap for my latest project looks like: gist.github.com/teresko/2b3e41c29f6155d8e9f35c9a4a7ceaf4
 
YAML, huh?
 
lol someone properly removed the most lewd discussion line we had on here. It involved DIC.
 
That does look very neat...but I don't see where you're configuring the DIC for each class?
 
I have 2 queries like this i am getting the right results.
$product= SELECT product_name FROM from products
$category= SELECT category_name FROM from category
 
8:46 PM
FROM from
 
Some of the rows are empty so I want to check if the row is empty then fill category instead
$product_name= _htmlentities($product['product_name']);
$category_name=_htmlentities($category['category_name'])
$contentAdd = $productClass->addContent(array(
'title' => _htmlentities($product['product_name']) ?? _htmlentities($category['category_name']),
'menutitle' => _htmlentities($product['product_name']),isset($product_name) ? $product_name : $category_name,

));
I already have function to add
how can I check if empty then fill category both of the methode are not working
$contentAdd = $productClass->addContent(array(
'title' => _htmlentities($product['product_name']) ?? _htmlentities($category['category_name']),
'menutitle' => isset($product_name) ? $product_name : $category_name,

));
sorry is like this
 
<lurk />
 
The clarity of your code directly impedes my ability to care about a resolution.
 
?? and isset() will only work when the value is NULL. If it is sane, _htmlentities() will always return a string
thus probably you want _htmlentities($product['product_name'] ?? $category['category_name'])
 
You have a typo @DaveRandom
 
8:52 PM
you're a typo
 
You meant to type htmlspecialchars()
 
yeh that is what iam trying if the value is null then add category
 
You're face is a typo
You are
riiiite
I will just leave it there
 
<peehaa face="typo"><beer /></peehaa>
 
the problem is it gives me syntax erron inside array
 
8:53 PM
You're an inanimate f*cking object!
I just watched that film today :)
 
@daverandom
 
@DaveRandom Get out of here with your XML. Them days is over.
 
I have been hand-writing XML today and I think it has sent me a little mad
 
lol
madderder
 
also, ftr, I like XML
I just don't like hand-writing it
 
8:54 PM
You like it more than other formats? :-/
 
@user8124685 syntax error is accompanied by a message telling you what is wrong with it
@Fabor I like it for the thing it was designed for, i.e. transmitting messages with strong semantics
I do not like it for config files
 
yeah I cant use this _htmlentities($product['product_name'] ?? $category['category_name']) inside array
 
or any of the other things that Java developers think it is good for
 
You'd like EDI then
 
@DaveRandom But it's so bulky.
 
8:56 PM
@user8124685 you can, you just did it wrong in some way
@Allenph not a valid concern almost all of the time
there are places where bytes matter, but most of the time it just doesn't
hard drives are almost free and bandwidth is cheap
 
Sure it is. That bulk adds up after a few requests. SOAP requests and responses are big and bandwidth is a concern on the client.
Especially when you make more than one request on a page load.
 
Yeh see that's the problem, you say XML and people think SOAP. SOAP is fucking awful
 
Nod
 
@Allenph that would be the wrong place for XML (probably)
 
@daverandom I am using like this but still it gives me error $contentAdd = $productClass->addContent(array(
'title' => _htmlentities($product['product_name'] ?? $category['category_name']),
));
 
8:59 PM
lol
!!error
I knew that doesn't work, but it should be a thing
 
alias it !!say
 

« first day (2593 days earlier)      last day (2352 days later) »