« first day (2524 days earlier)      last day (2424 days later) » 

5:00 PM
value_compare_func - int callback ( mixed $a, mixed $b )
 
@AaronSmith before you paste a lot of code, please use a pastebin or gist
 
What is the reasoning behind the function($a, $b) part, two parameters need to be used
you have usort(array, value_compare_func) and this value_compare_func needs to look like function($a, $b { }
 
@AaronSmith you are comparing two things. You need to be able to inspect both things to compare them
 
I am not fully understanding the two parameters requirement, lets say based on the Example #1 from the usort() php.net page
 
A compare function typically returns whether the value b was greater, lesser, or equal-to the value a
 
5:01 PM
ok so $a is "thing one" and $b is "thing two"?
 
yes
 
ok, thanks!
 
assume that the default sort function looks like this in userland: function($a, $b) { return $a <=> $b; }
 
I was going to continue trying to figure it out by myself, but I kind of assumed that I will not, so I asked here; I am also kind of tired too, at this point, at 4th day of learning
 
that gives you a sort in ascending order typically. So, then, the default sort function of rsort() is function($a, $b) { return $b <=> $a; }
 
5:03 PM
I am on the second round of learning now, after a 21 days break
4th day and I am getting tired already, BUT THE MODEL WORKS, SO THIS IS GREAT!
 
so, @ekin ... how is your visa getting along: theguardian.com/world/2017/sep/11/…
 
holy shit.
 
@FélixGagnon-Grenier I liked it before. But yeah, fuckin' whaaat
 
scary stuff
 
@FélixGagnon-Grenier Usually that comes out of my country, too. This is truly alarming
 
5:10 PM
thanks again!
 
@FélixGagnon-Grenier Close. It's the same php script that has the select and also builds the PHP object. Perhaps Ajax is not the way to go here.
 
@hello You really need to pause, and deconstruct this idea you have that the php script "has the select"
php generates html, sends it to a browser
once there, there is no php involved, no whatever you can do with php
in the browser, the html generated by php is rendered in a page, on which there is a select.
when an option is selected, then you can use AJAX to fire an http request without reloading your page, send it to (generally) another php script, that will then act on the value sent from ajax
 
I will indicate that I am tired, so the question may not be top level, at this point, but - php.net/manual/en/function.usort.php - Example #1; $a is the array, but what is the $b ?
 
@FélixGagnon-Grenier Here is a sample of what I have so far. pastebin.com/KN7j3AzC
 
I mean, it needs to be there based on how the usort() is built, but where is it coming from in this example, or what is becoming the $b ? I cant see that there.
 
5:15 PM
FILE_USE_INCLUDE_PATH: INT instead BOOL. – #75203
 
@Jeeves WTF is FILE_USE_INCLUDE_PATH coming from?
 
@PeeHaa My dishwasher. Where do you work?
 
$b is used within the value_compare_func, the $a array gets compared to this $b, but the $b seems to be non-existent
 
ah
lol
 
@AaronSmith every iteration through the array passes two values. Let me whip you up an example
 
5:19 PM
meh nvm. good luck.
321
Q: What is the difference between client-side and server-side programming?

decezeI have this code: <script type="text/javascript"> var foo = 'bar'; <?php file_put_contents('foo.txt', ' + foo + '); ?> var baz = <?php echo 42; ?>; alert(baz); </script> Why does this not write "bar" into my text file, but alerts "42"? NB: Earlier revisions of t...

 
@AaronSmith check this out: 3v4l.org/G0oaH
 
ok, this should be good enough; I will look at it tomorrow though, thanks again!
I am a beginner
I am going over all these things and learning them, these aspects
but the progress and the quality of progress that I make seem to be very good; the longer I learn the easier everything becomes
I am doing things like reading the whole php.net manual, phpStorm right now, proper learning, no shortucts; like academic level, something like this, specialization
 
@AaronSmith It's like learning most any new language. The more you learn to think idiomatically, the easier it is to pick up new vocab (and more esoteric syntax)
 
!!lxr FILE_USE_INCLUDE_PATH
 
@PeeHaa Nothing went wrong but I couldn't find a suitable definition
 
5:26 PM
A month and a half plus ago I felt like I was breaking through that crust of not-understanding this, I am past that point now
 
@PeeHaa my accent hit again.
 
@AaronSmith You need to give yourself some little projects to do. Learning PHP in a purely academic way is probably going to result in a lot of things not really getting ingrained. Put together little things
 
I am past the crust of not understanding and at the "outer part of the nut", I understand things, I know that I can understand every new example and so on
 
afk standup
 
the more you complete the more "confident" you become
w3resource.com exercises - this is what this example was
I know that people always say, just start coding, build something
but I am strongly convinced that good theoretical edu is a very important part
like I mentioned here several times, this is not like 100 people with shovels who all do more or less the same work
you can take even 10,000 php programmers and test them and arrange them from the best to the worst
theoretical knowledge testing, practical code writing testing, time of completion, things like this
I am not new to Internet, websites, I've been working on sites for over 6 years
Linux admin (two years)
now I move on to programming
I've seen different programs that were written and I think that if edu will be good, the quality of product should be good too
one thing is to learn though and the second is to produce, and even after you produce you need to sell and make $$$
like Germany makes BMW, Audi, Mercedes, Opel
there are EU countries which do not produce
the producing part is what matters here
like USA, they produce too - strong economies
so good theoretical edu and then producing may be two different things
 
5:31 PM
hahahahahahahahaha
AHAHAHHAHAAHHAHAHAHA
 
I am sure there is thousands of theoretical specialists that do not produce something good
 
hahahahahaha
 
theory - produce - sell to make $$$
 
I think you skipped a couple economics lessons
:P
 
three different things
well, the producing aspect is the important part
I mean, it needs to be good, of good quality
countries that produce are economically strong
 
5:32 PM
The only thing the US is good at producing is the money they print
 
USA, Germany are obviously great examples here
 
You have no idea how wrong you are
 
USA is good
it may be going down a little bit
 
You have no clue what you are saying
 
like USA music - 80s and 90s, as an example thrash metal / grunge
nothing like that coming from the USA now
UK is the leader now, music-wise, not the USA anymore, so things don't stay the same
 
5:34 PM
Think I will just do something I thought I already did
BAM. cls / clear
 
the only thing that I can think of is The Chainsmokers (but this may be related to they typs of music that I am interested in)
but the UK is the #1 now
no Metallica, Slayer, Testament, Pearl Jam, Alice In Chains - nothing like this coming out of the USA anymore
I know there is something to the USD, how this currency is set up
and basically people there and in the EU too probably work like 40% of the time for free, pay taxes they don't need to be paying, the money could be going to them
 
like the Federal Reserve; taxes are needed, but this is the part of how the financial system is built
scheme, financial pyramid of some sort
the whole USA, EU
95 or more percent of people works and pays these taxes (federal, state) and this is how the richest get richer and so on
I think this is like 60% of money to the people who work and 40% kind of goes to the richest, and it does not have to be this way
 
@PeeHaa That was liberating, wow
 
I knooooow
 
5:41 PM
Check out my worst_sort() link
It at least runs in constant(ly the worst possible) time!
 
Booooo
PHP_INT_MIN - 1 is missing :P
Clearly it's not worst
 
you're right! Also, I should store the keys of everything I've put into the new array in a second array, and then do *nothing* with it!
 
\o/
 
huh... on my machine at least, (int)(PHP_INT_MIN - 1) === PHP_INT_MIN
overflow, fine, go for it, but underflow? GFY
 
@PeeHaa Your website broke my script. :-(
-- Broken Links -----------------------------------------------
pieterhordijk.compieterhordijk.com/demo (404)
pieterhordijk.com/open-sourcepieterhordijk.com/project/1/opcache (404)
^ @PeeHaa You have broken links on your website.
 
5:53 PM
fixitfixitfixit
 
It'll never be truly worst_sort if I can't get the memory requirements insane (and also break the index association feature which introduces pointless branching to the loop)
actually counting between the extremes of of signed 64 bit integers is probably good enough
 
@kelunik :D
Obviously I never finished my own site :P
I'm a developer :D
 
lol, that universal truth
 
@PeeHaa Amp doesn't have any broken links anymore, at least I can't find any.
 
@kelunik Did you make a service out of it yet? :P
The script that is
 
6:02 PM
@PeeHaa No, but will open source soon. Needs another feature that's still missing.
 
@kelunik Might also be useful for generating sitemaps
if that is still a thing today
 
@PeeHaa at least you started it
 
Several times even :D
 
Mine just redirects to my SO profile.. which to be fair is probably a much better way for me to sell myself than any site I would make, because any site I had to make on my own would be horrid :-P
 
:P
 
6:17 PM
@DaveRandom I made a simple interest comparison calculator. But it's pretty much all JS. Oh, and super ugly. Inside and out.
oh my got I literally have function doOutput() wtf was I thinking?
 
Speaking about never finishing things aerys.pieterhordijk.com :P
 
how complete is it?
> You find yourself in a @TODO: Starting Location
 
Next on the list is / was implementing quests @ npcs
Also multiplayer is bugged
 
> attack playerx
> *you have attacked playerself*
> *you are dead*
 
Nerd game for nerds :P
 
6:26 PM
@Dereleased I have most stupid things like that handled (I think) :P
@Fabor It is :P Nostalgia ftw
 
Find your son yet?
 
He's old enough. It was time for him to stand on his own feet anyway
hehehe
 
syntax for commands should be in the style of some programming language, and change with every location. $this->player->attack(new RainOfFire($this->player), ...$enemies); (reverted to original)
 
lol
That would actually be funny and terrible
Not sure which one more
 
heh
(Fireball self enemy)
 
6:37 PM
@PeeHaa hmm
@PeeHaa where's the source? :-D
 
At the moment hidden far faaar faaaar away from everybody :P
We all know what that means right? :D
 
Wes
\o
 
Hey Wesley o/
 
Wes
hey pieter peehaann
 
Funny fact. Haan is a rooster
Or a cock as you will
 
6:43 PM
cock
 
You're welcome
 
good mornings
 
Morngins @IROEGBU
 
@PeeHaa yes, found it, thanks
 
\o
 
6:44 PM
@bwoebi That was the old even worse implementation
@Ekin o/
 
o/
 
@bwoebi The current one although still bad at least uses v2
 
@PeeHaa uh … I'm looking at the currently running instance?
 
oh :D
Yeah. Didn't know you were on the machine
Sneaky sneaky
I also have an old repo somewhere on the github
Got confused
 
@PeeHaa well, I thought it was that you were hinting at that with far away from everybody
 
6:47 PM
Nope. Mostly hinting at code quality :-)
 
Feature implemented, but code sucks... have to fix a lot of links now.
 
okay, misunderstood then :-P
 
No worries. I blame @DaveRandom
 
… well … unless you have a problem with me reading that source? @PeeHaa
 
Not at all
 
Wes
6:48 PM
@PeeHaa it's totally a cock
:D
 
is there actually a difference between rooster and cock?
 
a continent I expect
like that behavior vs behaviour thing
 
@PeeHaa there needs to be a roost to be a rooster :P
 
:P
 
Player bwoebi is here too!
Sir Tutorius is here!
To the south you see A part of the proving ground.

There is no enemy here to attack.
it's broken
 
Wes
6:50 PM
@PeeHaa yes, one is less funny
 
it literally just told me that bwoebi is there
 
why would you want to attack bwoebi :P
 
@DaveRandom hahahah
 
@Ekin well many reasons, chief among them lolz
 
:-)
 
6:52 PM
TIL "cockerel"
 
I think you can only attack to cats and dogs
 
English is weird
> “Cock” is the Old English word for the male domestic fowl, and it is still the common word here in Britain. “Rooster” is basically a prudish euphemism, rare in this country, but it has become the usual word for this fowl in North America.
 
Just copy and paste "attack" as many times as possible
 
I wanted to ask @DaveRandom to confirm, but I already know which word he uses
 
yes, "chicken"
 
6:54 PM
Wat no
 
they are just fucking chickens.
 
@PeeHaa everything is weird. Also, "cock"... *smirk*
@DaveRandom literally! :P
 
ooooh, matron
 
@salathe hehehe nice one
 
/me goes back to RL
 
6:56 PM
I should probably close engrish.se too before I confuse myself with that weird language
 
you call it what? haantje?
and that isn't weird? :P
 
yes haan(tje)
Which is perfectly sane
Obviously
 
We also use hen in case you are all wondering (which I assume you do)
class Serra extends Ferramenta {
WTF...
I blame you @Wes
Or is it Spanish?
 
Wes
wat
 
7:00 PM
It's Spanish nvm. It's just Italian without the handwaving
 
Wes
it could be italian. but Serra extends Ferramenta doesn't make sense
 
-1
Q: Child class not subscribing the paramater value on construct method

Lucca ClementeSo..I have a parent class "Tool" and one of its childs is the tool "Saw". In the parent class (Tool) the construct method is specified by default within null values paramaters: class Ferramenta { private $id; private $tabela; public function __construct($id = null, $tabela = null) { ...

 
Wes
greenhouse extends hardwareshop
 
One of those I use real life things to explain OOP and make it harder
@Wes hehehehe wat
 
portuguese
maybe
 
7:01 PM
@Ekin Oh. So Spanish without the smell instead :P
 
:p
 
Wes
if there are words ending with -cao it's certainly portuguese
 
Cool
 
Wes
all words in portuguese ends with -cao
 
7:03 PM
@Wes TIL
 
Wes
i'm making that up. ever heard someone speak in portuguese? it's -cao all over the place :B
 
@Wes can't say I have
Closest thing I got was @pmmaga and that was English :P
 
@PeeHaa Did you read the blog post I posted earlier today?
 
As a matter of fact I totally forgot about it
 
Expected that. :P
 
7:06 PM
:D <3
> We can see that the generator runs until there's the first yield.
Sentence feels a bit weird
 
@DaveRandom Still waiting for an answer. :P chat.stackoverflow.com/transcript/message/39121570#39121570
 
hey, it's 400$ of dildo's guy
 
/me likes @kelunik
That sentence I shared before might not some love cc @Danack?
 
Wes
7:22 PM
@FélixGagnon-Grenier legendary
 
@PeeHaa which one?
 
16 mins ago, by PeeHaa
> We can see that the generator runs until there's the first yield.
 
We can see that the generator runs until the first yield.
?
 
:)
 
7:28 PM
Dunno
 
@Wes it takes 300k XP to get to level 4?
 
For some reason I am annoyed by "there's"
I am mildly annoyed by this
Yep. If you find yourself with multiple sub-classes that need to share a behavior (like Cat and Dog have a growFur() method, but Dolphin does not) you'd want a trait. — ceejayoz 1 hour ago
 
I don't know why I pinged Wes there... I guess I assume he'd know
@PeeHaa it takes 300k XP to get to level 4?
 
@Dereleased Oh lol :D yeah about that :P
 
7:31 PM
a general rule of rpgs is current level * factor = next level
except, for some reason, dnd second edition, that were completely metal with their shits
 
@PeeHaa dolphins are mammals too!
 
@Dereleased I still have to come up with names for the next levels. So in order to prevent people from getting at the last level I implemented that glorious fix :D
@salathe :D
 
I wish they'd stop teaching OOP with these cat extends animal examples
 
I am agree
 
level 4: Professional Amateur DJ
 
7:33 PM
I just did something so dumb. I have to work from out of the office today and I forgot to get a copy of my PGP private key and now I need it to access my VPN creds.
Brilliant.
 
@Dereleased :P
 
@FélixGagnon-Grenier Particularly with these zoologically incorrect examples. :P
 
@Allenph Brillant**
 
Also, animals shouldn't be treated like objects!
 
7:34 PM
omg lol
 
I thought PETA was a murican thing
 
@salathe Slow your roll there, kid. I'll treat barnacles like objects all day
 
@Dereleased *clicks ignore button*
@PeeHaa you're PETA, and I'm PETA too :)
 
/me is ignored
 
@salathe hehehehehe
 
Wes
7:36 PM
you know what would be great to have in php 7.3?
 
@PeeHaa dailymail.co.uk/news/article-4174882/… (yes, sorry, the first link was to daily mail)
 
@PeeHaa so if I go back to the training dummy and automate the sending of the attack command, and I get 2 XP per hit, meaning I need to make 150k attacks, and each battle takes on average 3 seconds, I can hit level 4 in 5 days, 5 hours. Let the scripting commence! Oh, I wonder what happens if I log in in 10 browsers?
 
The latter you can't :P
 
Wes
@LeviMorrison i wanted to write the rfc, but this "Deprecate and remove case-insensitive constants" (what a coincidence) made me depressed
 
@FélixGagnon-Grenier yes, it's just a result of the colonial cis white oppression of other-bodied creatures
 
7:40 PM
@Dereleased For everything else but the multiple session if you keep it up it will fatal probably :P
 
@PeeHaa that.
 
Wes
> People who think that case sensitive software is cool are deluding
themselves. When I started working on mainframe computers (UNIVAC and
IBM) in the early 1970s everything was case-insensitive.
 
@kelunik ^^
 
Wes
"this is better because this is how it worked in the past"
how is that even an argument
 
@Wes Sounds like good ol' Lester…
 
@Wes Just answer: "Oh yeah. You fight like a cow!"
 
@Wes you might want to read @Danack's Poes's law link
*starred link
 
Wes
i read it. can't really be amused by it... it's so depressing
 
@tereško lol... / crying
 
Ooh it wasn't Lester. Yay we have another old fart prattling on about the good old days.
 
7:44 PM
lol... quickly hid my beer in a transparent glass bottle as my team supervisor is coming along
 
Wes
> Life was so much easier when using an RTTY as the keyboard and printer.
No one had invented the shift key and the 5 bit character set was easy
to work with.
 
@tereško Thanks for the lecture.
 
@PeeHaa thx
 
Wes
that thread is all nonsense
 
@Wes just go get a beer
 
7:54 PM
Sara may be my new favorite person
 
@Ekin /me sobs uncontrollably
 
posted on September 13, 2017 by CommitStrip

 
is it valid to write return !!$myVar; to return true or false only (regardless of what the variable stores)
 
@JustCarty define valid?
 
@Dereleased Well it works, but is it supposed to? Or does it work and that's great but it isn't supposed?
 
@JustCarty it works because type juggling. How do you feel about type juggling?
 
@Dereleased I'm impartial. In which case, I will use this when needed
 
I honestly don't know the feeling of the room towards it, but I'd tend to just cast to a bool myself -- that's what happens when you do the first logical negation, and then you do a second, which feels like extra steps
return (bool)$var;
 
8:06 PM
@Dereleased Meh, I normally treat !! as if it were a single operator
(In my mind, that is)
 
but all of this is only cool if you accept things like !!"0" === false and (bool)(array)null === true
 
Although, JavaScript has an explicit Boolean() function which I normally opt to use.
 
Bang! Bang! You're boolean!
4
 
@MadaraUchiha is that somehow better than (bool)?
 
I'd expect the compiler (parser?) to convert one to the other anyway
So it holds no importance.
@Dereleased Yes, it's a function
[0, 1, 2].filter(Boolean); // ==> [1, 2]
Filter out falsey values ^
As opposed to .filter(x => !!x) which looks kinda weird
 
8:09 PM
Didn't really address what I asked, though. I was feeling the room on explicit casts to (bool) in PHP vs using superbangs
 
That's fair
In that case, I'm ambivalent :)
 
@JustCarty My formal opinion is, while I do think !! should be obvious, and it's nice for me to be able to carry that syntax between languages with varying levels of support for booleans or the concept of casting, I've had too many people in my career look at a usage of !! and be like "What does that do? OH COOL!", so I prefer the more explicit (bool). Do whatever you want.
 
@kelunik link please... Can't find it on your blog
 
@IROEGBU Not yet published, will do so tomorrow. gist.github.com/kelunik/577aab95a778762c4f52aa82fc88adce
 
@Dereleased And just for some clarification (bool) and (boolean) do the same thing?
 
8:14 PM
> I've had too many people in my career look at a usage of !! and be like
 
@Dereleased I'm going to adopt the (bool) method as opposed to the !! method. On a quick glance, it is more obvious what happens whereas the !! could get confused as !
 
> Stderr: VBoxManage.exe: error: The virtual machine 'BastionRPM' has terminated unexpectedly during startup with exit code -1073741819 (0xc0000005). More details may be available in 'C:\Users\Danack\VirtualBox VMs\BastionRPM\Logs\VBoxHardening.log'
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine
Srsly though......screw windows.
 
@JustCarty they do
 
> ...until there's the first yield
@kelunik I also have a problem with that
"until the first yield is encountered"? "until the first yield"?
 
okay, I have a question, it's a story from a talk, I'm going to paste the transcript in gist, and star the part that I'm confused on.
I get that doing all of the credit card logic inside of the validator is bad, but I don't understand the part about committing the transaction, pulled singleton, pulled service manager. Like did it submit his credit card number in the code, and from then on was used for every future purchase that someone made through that POS?
https://gist.github.com/tiffany-taylor/ef3e0326187d8f2d9371ead6cfe005f7
 
if (Manager::payment($card, 100)->getStatus() !== "success') {
    throw new InvalidCardException;
}
something like this, @Tiffany
 
Pours out gasoline, lights match: externals.io/message/100567
4
 
8:48 PM
> Requires 50%+1 to pass.
 
".. explores its identity"
wat
 
EXTREME_IRONING.GIF
 
@tereško but how would that equal to 10000 dollars in charges?
 
Wes
@Tiffany "spooky" explains it
 
@Tiffany well ... you run tests multiple times
each time someone commit something to the repo, the CI runs all the tests
 
Wes
8:49 PM
ah, lol?
 
some people set it up so that, when you save in your IDE, all the tests are run
it .. all .. adds .. up
@Sara I think I already talked about it some time ago, but PHP should adopt similar system to FreeBSD, where you have an elected "core team" that becomes responsible for the projects direction for .. let's say two years. Make the core team to be some multiple-of-3 number of people, and each new decision requires a 2/3 approval
Oct 13 '14 at 13:21, by tereško
@ircmaxell as I said - any solution, that I can come up with, would require several additions to language itself .. and for it to work, PHP core team would need to have long term plan
 
Honestly these days I'm not sure what kind of governance model works better
I thought Node's was pretty good but evidently, even if you lay down on the ground for people to walk on, people would still complain you're not flat enough.
 
@MadaraUchiha demarchy
 
oooh
okay, I get it now
 
Wes
dictatorships
 
8:57 PM
@tereško FIG has that. Tempting to bring it up as an alternative proposal...
 
... I would not mention FIG in that proposal
it has issues related to too much naval-gazing, probably
 
Wes
i like that python gets things done properly despite the community in part complaining about them
 
@tereško what even would be … the direction of something like PHP?
 
thanks
 

« first day (2524 days earlier)      last day (2424 days later) »