« first day (2870 days earlier)      last day (2304 days later) » 

00:29
posted on August 24, 2018

New Cyanide and Happiness Comic

Ggg
Ggg
is there shared hosting out there supporting php 7.2.x and libsodium?
00:41
@Ggg why not just use a cheap VPS?
Wes
Wes
always surprises me finding out how bad function overhead is
solution 1 involves array_keys array_values on 2 arrays so 3 copies of the same array
solution 2 involves iterating two arrayiterators on the original array
solution 2 is almost twice as slow as solution 1
that's because foreach($array) is much faster than foreach(new ArrayIterator($array))
if(array_keys($a) !== array_keys($b)){ return FALSE; }
this should make it slower, but it makes faster despite it has to do 2 array copies
because if i do that it avoids 2 iterator iterations :B
bah.
Wes
Wes
00:57
wtf it's fast with reset() key() current() next()
ah it's just arrayiterator that sux horses butt. i just replaced it with a generator and i am back to half the execution time
time to go to bed. gn all
 
1 hour later…
02:32
Guys I need a little help. I'm working on chatbot (for Gitter). The idea is that users can send Javascript code towards the bot and the bot will output the result like a console log. Something like:

User: `console.log(1 + 3);`
Bot: 4
Is there some kind of PHP library that can parse JS code like that and return me the result?
Never mind. I found a question about this with answers. My bad
Ggg
Ggg
@Danack thanks for the advice. It is really cheap, sounds great
 
2 hours later…
:D
morns
 
2 hours later…
07:03
Anyone ever play Gloomhaven?
Heading to bed later.
08:00
embosk to hide or conceal (something, oneself, etc.) with or as if with foliage, greenery, or the like: to embosk oneself within a grape arbor.
 
1 hour later…
09:24
mysql table doesnt have a cloumn of updated time , can i get the rows order by updated time ?
or shall i need to create a column for that ?
09:42
!!dad
I just watched a program about beavers It was the best dam program I've ever seen
10:23
@DaveRandom Nope been a good while
Morngins
mornin'
does anybody know who is behind php-vote.com ?
10:40
@Code4R7 Some french dude iirc
11:00
@PeeHaa thanks, now I know changes are small that the PHP team will look at it...
Look, sure. anything other than severe eye-rolling injuries to come of it? Not so much.
11:27
I don't get the point of php-vote.com... bugs.php.net has a voting system already..
@Srinivas08 best way is to create a timestamp with a Y2K38 limit (or datetime without that limit) column. If you want to add milliseconds make that a timestamp.3 or datetime.3 column. Add CURRENT_TIMESTAMP as the default value and add the ON UPDATE CURRENT_TIMESTAMP and you're done. Drawback: you don't know when rows are deleted.
A table can contain the creation / modification date, it might depend on the engine.
But that date tells you when the structure of the table has changed, eg, not when rows have been deleted.
12:20
Hello
may I ask, why is object oriented programming taught in such that way, that is presented like "a dog barks" a dog has 4 legs, dogs implements barkable, big dogs barks strong, car has engine etc? I never after years used it like that, for me OOP merely servers as containers for separating logic, like 2 levels of separations, objects and functions, not just functions, and merely calling from inside other objects if rarely passing them inside.
You usually dont implement dog, but you have to do some routing, MVC, etc, classical OOP teaching way was some of the most incomprehendable concepts I had to come by.
12:37
@FantomX1 Because some people who didn't understand OOP tried to simplify it and write learning materials for other people who didn't understand OOP.
The true core concept of OOP is message passing. The classes and objects are kind of an aside to that. For more, read up Alan Kay and Smalltalk.
Also, people like to use analogies, even when they're (usually horribly) inaccurate
@Code4R7 yah , i did the same , but no worry about deletion bcos , i am making the status inactive for the post i need to delet , later i am updating the posts ... this was , i am maintaining the id sequences also
12:58
hi , i have a collection of stores in my db , i want to display count of each stores .. eg : store name and entries in it ...
any reference code for it
13:15
@AllenJB haha yeah thanks you nailed a nail on head :)
@bwoebi I don't think I understand the tradeoff you're implying. Monolith vs components? Components assemble into monoliths. The difference is monolith vs descrete services (separate runtimes which communicate over network or other RPC interfaces)
@FantomX1 The hardest part for me to learn OOP was that I was used to procedural languages, including assembly, which people (thay I knew) that only know OOP can hardly relate to. For me OOP is just a way to group code.
OOP isn't just a way to group code tho. That would be "Class Oriented Programming". OOP is an entirely different structure. One where you invert the way you think about conditionals, etc.
Does there exists a language that is only capable of Class Oriented Programming then?
For example, in a class-oriented or procedural world, you think about the logical flow from one "statement" to the next. So an if statement is how you would do things conditionally. But in OOP, it's far more about how objects interact than statements execute. So you typically avoid if statements because you can just about always turn an if into a method call on an object, and have the if decided by specialization of an object
@Code4R7 exactly, albeit cleaner 2-level/dimensional separation, but still just separation with an ability for passing around objects, I think it could be still accomplished by passing an array and name of static function to call, or just call a static function inside instead
@Code4R7 Any language which does not allow for runtime specialization (polymorphism). But most languages do, even if not "OO". For example, it's 100% possible to write OOP in C, but c is a procedural language
@ircmaxell oop has definitelly advantages such as polymorphism over conditionals as you said or another big one coding against interfaces
these are approaches to problems, not things lanugages does for you
IMHO, polymorphism is the only advantage of OOP. All the other things (like inheritance, interfaces, etc) can be done using other methods or may actually take you further from OOP
@ircmaxell well summed up
@pmmaga haha man, that killed me :)
two conference talks I've given on these topics
@Code4R7 Why would anybody look at it either way
I came to the conclusion that the community at large is just stupid
@ircmaxell will give a sight
@PeeHaa I can see where that conclusion is coming from.. but are you really sure that you have taken as much as parameters that you can think of into consideration?
I wouldn't call an entire community at large 'just stupid'...
My first association is that because PHP has a low learning curve and is highly available, there are many developers that are beginners or intermediate. Before they turn pro they're likely to switch to another language like node.
To learn PHP, you don't have to have a master degree in computer science first. Whereas C...
13:31
@Code4R7 I must incline to you, there are some very stupid members and as such, the whole community can be hardly accurately called stupid, and then there are we, and there are my teachers of OOP inhteritance dog extends animal
but I think dog extends animal is too minimalistic. I'd rather see an example where dog extends skeleton, muscles, brain, etc.
@Code4R7 that's it
or class human extends monkey, money
diff is just one char...
I'm afraid that would break polymorphism, but I must say I really don't know anything about polymorphism.
So anti to the entire notion of oop
You don't build a house by making one class hierarchy that contains every room, door knob, window, and bed
The only think I know is that you can use instances of classes as variables to point to grouped code.
13:36
You compose it together. The house is defined by it's exterior. It's rooms are composed in, and can change over time
@Code4R7 :) yes, I cannot even think of what would I resemble analogy to, maybe teaching at medical school how to treat alcoholism with brain electroshocks etc
That's another video I did about composition and Dependency Injection which is 100% relevant here
Yes yes, I use DI in my code already, just pass some pointers to instances of grouped code
@ircmaxell again, very well archetypally said, makes sense
I even have this auto-factory that checks which interface is supported, so that DI happens without me even having to think about it
13:39
@ircmaxell due to your point I know realize when starting with OOP I struggled with that very single reason of grouping everything into single OOP hierarchical pyramid, where I didnt know where to start, where to finish and especially what entry point should be for constructing the pyramid object
@FantomX1 but that is where the fun part begins
@ircmaxell ah its you, you have a new subscriber
at first you don't know, you try, you fail, until It Just Works
@Code4R7 :) yeah one enjoys a lot of fun sleepless nights due to that
and when It Just Works the next problem is that you need to make sure that it keeps working, when it grows, changes..
13:41
@Code4R7 but nice to see, not that I should be that much surprised of, that many has probably underwent quite similar path in logical reasoning then
Also I have a hard time to understand how people 'learn' when they studied computer science. Looks to me as if they have learned how to apply a mathematical formula.
Although I do know people that have done both: a study, and have failed before :)
@Code4R7 The same people on that site are reddit users
Nuff said
All items on there are already discussed at length
But I guess I like to have the freedom to choose, try, and fail until I succeed :)
I must admit that I do that with the help of those who do know what they're talking about...
@Code4R7 yes, thats me, failed partially at both :), usually if you dont fail, you never ever tried, or there is no fail, you just dont succeed or you learn, many unfortunatelly as you told never tried that all and stagnated at a level of not using oop, polymorphism, coding interfaces etc correctly
@Code4R7 than I probably endorse and adore you, the clever one teaches from others not only from own mistakes, I usually wanted to invent own wheel the better way, didnt have a lot of support or time from those who knew and lost much time by that approach
@FantomX1 there is always a bigger fish, someone who knows it better than you do. There was this guy from quirksmode.org or someone related, who wrote about the time that he knew everything there was to know about JS and browsers.
And then his world changed: JS became so incredibly large that he didn't have the time to know it all. So imho it does not matter if you don't know it all, because you just cannot.
The only thing that matters to me is to be able to build whatever I want, the way I want it
even if it is the Wrong Way :)
13:51
@Code4R7 yes, I learnt a lot of from quirksmode.org in times, around 2001,2002 there was much less to know, or better said it was also much less readily approachable just on mere internet and very few people around smalltak knew it, so there was not that much reason to know it in order to compete against competition, it would be like me learning quantum computers when I deal with php oop
I remember learning to write code in the early nineties too, you had to connect with your modem to a BBS to get your info (and the anarchy cookbook for fun) because the library only had books about FORTRAN and that kind of stuff. It was soo outdated...
I remember soldering my own COVOX to get sound out of my LPT port
I remember writing libraries with the Table Assembler for QuickBasic :)
@Code4R7 Haha yep, good old times, nice to bring the memories back sometimes me too I think I will go to cellar to unreveal old books of Microsoft windows 95 administration giving the hope for future career :) and fortran older too as you told
And here we are with a lot of people telling other people what OOP is. Or should be.
Fortunately in this chatroom, most people do know what they're talking about
unfortunatelly there went also some bullshit knowledger along as I learnt every possible optimisation for every quirk of internet explorer 3,4,5 to displays htmls,css, js pages accordingly whereas we know have some pretty good standards and browser cores
poor you!
13:57
yep, thanks, we who remember deserve it :)
IE3... man that seems a century ago...
in this room majority so, thats usually the case the knowledgeable are here often, those many less so /or interested rather not althogh there are few considerable exceptions
its so long ago, that I dont even remember but I think I could have yet catched (that disease) somewhere around 2001 when I was starting with web
what was there yet, do we remember netscape navigator? :)
I do
Whenever I look at Konqueror I still think of Netscape :)
@Code4R7 nevertheless I go to continue with Symfony course as due to IE quirks in the past I might have overslept the oncoming wave of age of frameworks
they somehow managed to revive it partially if I am correct :)
I hate frameworks.. I was looking at Symphony when that company (whats that name..) decided that Symphony 3 would be backwards incompatible with version 2
Then I decided I'd never use Symphony
14:05
hm, I understand your frustration, nor that I wouldnt be very familiar with Yii1,2 but symfony is nowadays fancy so I am going to join the flow
although I havent used frameworks from 2001 to 2015 I guess :) I dont know if I should boast with such a fact
I wrote my own. It did take a long time to write. It is certainly less versatile than Symphony, but at some points it does a better job, like with my own sessions cookie generating code.. it had the same-site attribute before it was implemented in PHP.
On the upside: I didn't have to learn Symphony, while I could learn from it at the same time.
In the sense that I donwloaded Symphony to look how they had done things
But if you have a project that involves multiple people (currently not my league) then it's not that big of a thing to subject to a framework
you have to agree on something so it might as well be an existing one
@Code4R7 ok, but you grasped the principles, good to try on ones own, I also created sort of, non-oop framework, but I am not sure I would be able to reproduce even in a way similar framework to symfony, without having working with frameworks for some time
I just finished the latest part of my framework, with a builder that builds an AR-object out of a database table
It converts columns to my own UString and datetime classes
it does it all in a cached way (unfortunately) so the next target is to have that object generate PHP that can be auto loaded
also the db's information schema is objectified
I don't know if that would be possible in Symphony and how much time it would take me to learn it
and I don't know how fast I could fix bugs in Symphony
I don't like to be dependant on others too much...
But I do know this: if you are going to try to write it all yourself you better enjoy it :)
otherwise: do use a framework by all means
have to go now, cya
@Code4R7 sounds promising :)
thanks :)
14:16
@Code4R7 I will let you know, once I test the symfony, but I just know/think, when you are at a team like me, its better to learn common way of speech eg symfony, so that I can learn more from teammembers
14:28
Hi all
Can someone help me in my problem please?
0
Q: How does the core 'php.ini' directive 'memory_limit' is considered as an 'Environment Variable' in an code example from the PHP Manual?

user2839497I'm using PHP 7.2.8 on my machine that runs on Windows 10 64-bit Operating System. I come across the following code example from PHP Manual having some description : Using environment variables can be used in php.ini as shown below. Example #1 php.ini Environment Variables ; PHP_MEMORY...

@user2839497 You are confusing a few things. What the example wants to show, is that you can use environment variables to set values in the php.ini file
so if you had an environment variable called BANANA
with the value 128M
you could use memory_limit=${BANANA} in your php.ini
@pmmaga : Can I manually define and add my own Environmental Variable in PHP?
I mean add to the predefined array $_ENV
Can I?
@user2839497 that's normally up to the operating system (that's where the env variables come from)
@pmmaga : which means I can't define and add my own environment variable to the $_ENV[]
@pmmaga : Right?
@user2839497 you can. on the start menu search for environment and you'll see an option: edit system environment variables
14:38
@pmmaga : Ok. But still my question remains valid. As in the code example from PHP manual they could have shown some commonly used environment variable rather than showing something imaginary environmental variable which is similar to the core php.ini directive 'memory_limit'
@user2839497 that's not a code example, it's a configuration example. (It's about the php.ini, not about a code file)
and naming your env variable as PHP_MEMORY_LIMIT is a pretty sane choice if that's how you'll use the value
@pmmaga: Ok. But they could have shown some commonly used environment variable rather than defining a new uncommon environment variable similar to the core php.ini variable. Though, you may seem it's sane, newbies to PHP gets confused and they may think of it insane and waste lot of their time in investing about this environment variable.
> commonly used environment variable
like what?
Wes
Wes
\o
that's entirely dependent on your system. the only common one i can think of is PATH which is not very useful for us in this example
yo wesman
Wes
Wes
14:43
yo mago
Why this .htaccess code create an Mixed Content? I do not understand the issue
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]
@pmmaga : Like $_ENV['COMPUTERNAME ']
@user2839497 and linux users would go: wtf is a computername? :P
Whats the proper way for an application to check if an update is available?
@pmmaga : Ok, now I got it
@pmmaga : Would you please answer the question that the code example given in manual is generalized. It's not for environment variables specific to some platform.
@pmmaga : Or in a more appropriate way you think of
14:47
@user2839497 sure, in a couple mins
15:05
@tereško looking to get that pathofexile.gamepedia.com/Oni-Goroshi but tempted to do it on standard league, because reasons. you on incursion?
no
I am playing standard, but in HC mode
right, standard hc could be nice too
I have a lvl 63 shadow on standard though, and would have taken the full skill reset occasion to try a build
15:23
do you have a specific build, or just "I picked what skills I liked at the time"?
15:34
Is it possible to protect from SQL injection in Url using htaccess ?
@tereško it was "what skills I liked at the time", now I think I'll follow one of the frozen blades ones
with the reset, I have 81 skill points available, so I think I can manage a god part of the builds
Wes
Wes
Waterfall vs. Agile vs. Reality
While loop condition causes infinite execution – #76793
15:51
is php dead yet?
@Tiffany something for you ti think about chat.stackoverflow.com/transcript/message/43719900#43719900 :P
... dat moment when I realize I took the two passive skill points bandit reward...
Wes
Wes
what about the pug that growls and barks all the time that lives near me
nobody can love that thing
and he sure doesn't love anyone
16:13
@Wes Small dogs often misbehave because of stupid owners.
When a big dog misbehaves, he's instantly corrected (because otherwise, people will be scared of him), small dogs misbehaving is "cute".
Wes
Wes
pugs are not cute
they are monsters
Pugs are a sad abomination, the result of generations of inbreeding...
Wes
Wes
we are monsters too
16:29
Quick question regarding PHP and PDO with prepared statements with named parameters. If I have two parameters :name and :name_long, will then :name partially overwrite :name_long?
no
@zim
Ok. thx. Cause if you "simulate" (or debug) the query with the following solution, that script replaces :name_long with :name --> stackoverflow.com/questions/2411182/…
17:28
:)
18:20
@PeeHaa It's really important. I just bought this
@ircmaxell I'm talking about having a default wiring available - a default modus operandi, which still allows you to easily override the default if you wish so. For example, Aerys did provide you with a default environment basically, it gave you a config file mode where you'd just have to put your routing definitions in. Now you create an event loop, a local process cluster configuration, a logger, a server, add a handler to it etc.
You have to know about the cluster, how to use it, you need to declare your own logger instance … basically, you now need to know how to wire all the components together instead of just having it working by default. And that's just for the initialization part; now parsing bodies (multipart&www-form-data) is also a separate component, routing is a separate component - all things which are pretty much needed by anything other than a nanoservice.
It gets messy to manage, for beginners, you have to care about the suited version of every single of your components etc. - a lot of things to care of, which ends up being quite annoying for me
it just doesn't feel simple anymore
IMHO, the less different things (without restricting any possibilities or hiding them far away) the user has to know about and care of, the better.
I, as an user, do not want to search for the things which I need. I just want them available and accessible.
18:51
Take a look at "Convention vs Configuration"
that seems like exactly what you're describing
@bwoebi Here's the problem though. It's not simple to set up. But it's incredibly simple to see what's going on and to change things. With Convention ways of doing it, it's simple to setup, but nearly impossible to see what's going on or change things without a lot of time spent with an interactive debugger figuring out what's going on
@ircmaxell There is still the configuration way available though - if you want to change things, it shouldn't be too much overhead (the convention way shall be quite easy to replace I think), but when you want to start with a project, you do typically not want to learn the whole first.
Or am I misguided?
I.e. don't ever have the need to debug - if you reach the limits of what convention is supposed to do, just switch to configuration
19:20
@FélixGagnon-Grenier :)
lol it comes with an app :P
yeah. there's apparently some kind of game that recognizes the vape position
lol
trippy enough :D
Incorrect use of "$keypair" in LibSodium signing functions – #76794
19:44
ello
19:59
@ircmaxell I see the entire premise as dumb. It should be "when convention and when configuration"
and one of the more important factors in the answer is: which one adds less magic?
Wes
Wes
20:23
\o
 
2 hours later…
21:56
@bwoebi that's why I liked the way Ayres worked. But it is rarely so simple
@bwoebi I don't think you are far off. I do think you underestimate how much people will rely on convention, mainly because that's all they think about
@ircmaxell yeah, for sure, if the convention layer gets too heavy, you need to rethink it, and thin the wiring out. Relying too much on convention is pretty much what you describe "nearly impossible to see what's going on".
@ircmaxell the extreme example is here "how to add two numbers with jquery", right? "I have that tool, I need to use it with force" - yeah, it's any easy pitfall, but seriously, these types of people are these who copy the wiring from somewhere else and still don't understand what's going on and are quite lost when they need to dig beneath the code they've written themselves.
@ircmaxell I feel like I have lost that battle - I've tried to express my concerns back then, but I had a hard time articulating it well. It's now a myriad of micropackages, which isn't necessarily bad for reuse (e.g. I agreed splitting cluster (the thing which controls a number of slave processes) out for reuse would be fine), but the convention layer now is completely gone, which obviously is not what I desired.
And there I am, wondering how one does express that well
I'm basically a bit in the middle camp, not pushing for fully opinionated convention to the extreme, nor completely splitting everything out into the smallest nanopackage.
For both ends it's easy to just yell "fully opionionated, super easy to use" and "fully separated, super easy to reuse, full control" - but how to explain "I want to be somewhat optionated and somewhat allow the user his own easy wiring"
22:50
posted on August 25, 2018

New Cyanide and Happiness Comic


« first day (2870 days earlier)      last day (2304 days later) »