« first day (2927 days earlier)      last day (2248 days later) » 
00:00 - 21:0021:00 - 00:00

00:07
You'd think Mehdi Sadaghdar would be an ideal candidate for the Darwin awards for the amount of time he hurts himself with various electronics
00:30
Hey guys! I'm working on a laravel+dingo API
On my end it works nice. On the server I get a "route is not bound" logicexpression
anyone with experience on this?
 
1 hour later…
01:55
Is there a PSR for return types in methods? Ex:

private function doSomething():void
{

}
@LucasBustamante not sure if there's a PSR, but I think the general convention is:
private function doSomething() : void
sometimes I see:
private function doSomething(): void
fucking hate it when it gets cold, I can't wear a t-shirt and be warm enough in my apartment. I hate putting on extra layers
Wes
Wes
morn
02:10
I hate including files through PHP
I can never get this shit right
Wes
Wes
?:B
oh
I'm using the wrong constant
but it still doesn't work... Warning: include(): Failed opening '/vagrant/public_html/../includes/footer.php' for inclusion (include_path='.:/usr/share/php') in /vagrant/public_html/index.php on line 46
include __DIR__ . '/../includes/footer.php';
other sections in the file I'm just doing relative paths cause I got sick of trying to make it work and wanted to get stuff done
but I would like to make this work
why the hell is it trying to include the file using the linux directory as the main directory, instead of the Windows directory?
02:25
is it because the php.ini file is installed on the Linux side?
beautiful set_include_path
Tiffany, you might want to take a look at your mapped folders in Vagrant
PHP will use the paths of Vagrant if running inside Vagrant environment, but this isn't a problem if you have your folder mappings right
eg:
C:/dev -> /home/vagrant/dev
if PHP tries to include /home/vagrant/dev/something.php, but will actually load C:/dev/something.php
I recommend homestead box
that's laravel
no
not necessarily
02:28
sorry, I'm in a bad mood tonight
I use it for WordPress
it's NGINX though
that's just as bad
you can use it for whathever you want
let me put it this way, I prefer not to use anything by Taylor Otwell
I'm thinking if I use set_include_path, I should be good
you know you're sugar coating it, right
02:32
how so?
it seems that you're having a mapping problem in your vagrant environment
sorry, I'm going to step away from chat, I don't want to get suspended for getting angry
I'm just in a really pissed off mood right now
allright, have a good one
it's nothing against you, I just can't think rationally right now, and suggestions, while they may be reasonable, just won't go over well with me. Better to step away.
02:47
no problem buddy
 
3 hours later…
Wes
Wes
05:52
i am a bit sorry for the hate taylor otwell gets
Wes
Wes
06:35
@bwoebi will you attempt about making properties part of interfaces now that they are typed? ie abstract int $foo;
 
1 hour later…
07:54
@NikiC is there any harm in using zend_always_inline on almost all functions, and how freely should I use EXPECTED/UNEXPECTED? Should run as fast as it can without a) code that has no effect b) the opposite effect due to poor use
humdinger Informal. a person, thing, action, or statement of remarkable excellence or effect.
08:23
@rtheunissen yes, there is harm (code size and icache/itlb misses)
and we're vastly overusing expected/unexpected
Safe to use "inline" in a few obvious places then, and exp/unexp when it really is an almost-never case?
yeah
Wes
Wes
so i have two git branches

master
    \_____ branch1
                \____________ branch2

basically branch2 depends upon modifications existing in branch1

now i have made a PR for branch1 to be merged, and i want to make also a PR for branch2. if i create a pull request for 2, does it correctly handle the fact that depends on the first pull request?
Both into master?
Then the PR from branch2 to master is not aware of branch1
Wes
Wes
pr into the original forked repo
08:27
There is no link between branches, it's implicit by their common commits
To my understanding anyway
Wes
Wes
ok, so it should just work?
maybe i'll wait that the first one gets merged :B
@Wes branch2 will include the commits of branch1
Well yeah the diff of the second PR will also show the branch1 changes
you'll usually just indicate that and rebase once branch1 is merged
Yup exactly.
Wes
Wes
08:29
ok
git is scary
thanks guys
08:47
@Wes We have a rule in our GitLab that says that a PR can't be merged unless you could fast-forward it.
That's a fancy way of saying you have to always either rebase or merge the upstream to your branch, before your PR can be accepted.
Wes
Wes
i wish i know what that means
i.e. if you wanted to merge branch1 to master, but master advanced while you were working on branch1, you must either git merge master into branch1 first (to catch up), or git rebase master to make it so that your branch is branching off of the current master and not the master you actually branched off of
(think of rebase as cut/paste for an entire branch on top of another)
Wes
Wes
i see
i always do that
Great, then it would be no different in your case with the multiple branches
Wes
Wes
previous 4 commits are the pr number 1
08:51
It's a bit tricky to get the order of things right, if your try to rebase branch2 onto master before branch1 has been merged, it would consider everything from master to branch2 (including all of branch1) in the rebase, and create a bunch of redundant commits.
Wes
Wes
it is likely that sebastian asks changes from pr1
When rebasing, remember that by default the rebase goes back until the latest common commit ancestor.
Wes
Wes
so i will need to rebase branch2
@Wes Until pr1 gets merged, rebase against branch1, because that's where you branched from.
Wes
Wes
yes
08:53
Once pr1 gets merged, rebase against master, because that's where branch1 would be after the merge, and that's where you want to merge back into.
Wes
Wes
Showing with 550 additions and 439 deletions.
looks like a lot, but i just moved stuff :B
@MadaraUchiha make sense, yes
09:07
Hello guys, i wanna ask about markdown editor like StackOverflow, here i want to remove htmlentities but still rendered how to do that ? i.postimg.cc/GmxGZxTf/image.png
09:57
@Wes possibly yes.
Wes
Wes
nice
 
1 hour later…
11:08
Hi Guys. I am a PHP & MySQL developer with 2+ years of experience. Its my first time visiting this PHP group.
I hope I make good friends here and help anyone in anything I am good at, and get help from group memebers.
Wes
Wes
welcome
Thanks. Dear
4
11:30
@wes
Wes
Wes
yes
Do you know if this statement is true?
Numbers like 0.2 do not have exact representations in binary floating point because there are no integer solutions to a*2^b=0.2
Wes
Wes
nope, floats mess with my poor neurons too much. ask @bwoebi :B
Morngins
Wes
Wes
mornorgngs
11:33
Haaahhh morning fuck it's late
11:46
Night all o/
Wes
Wes
\o
12:06
@rtheunissen More or less, yes.
12:30
@rtheunissen what is that?
12:51
Anyone can tell me what is the latest version of Ubuntu that supports PHP 5.2.11 and MySql 5.0.5
I need it for setting up a test environment to migrate age-old code
Wes
Wes
13:06
people keep telling me i should do more artsy stuff - what do you think about php themed t-shirts? like, with jeeves kind of illustrations and stuff? send suggestions
13:57
@rtheunissen aren't you in San Diego? wouldn't it be almost 5am there?
@Wes yes
room 11 shirts
@Wes I think this might be something you'd like twitch.tv/classictetris/videos/all, the final bracket is today
Wes
Wes
i like tetris but not that much :B why do you think i'd watch that? :B
shrug, why not?
Wes
Wes
maybe i said i like tetris in the past but nope, i'd rather hit myself in my nuts than watch something like that :B but i might like to participate to a tetris tournament
why do people watch soccer or other sports?
Wes
Wes
i'd suck hard at it, but i would like it :B
isn't it a strange thing to watch? dunno
14:05
@Wes why?
Wes
Wes
for me it's like people that watches pewdiepie playing videogames rather than actually playing themselves... it's a bit weird
learn a new strategy
Wes
Wes
i suppose because i don't consider it a sport or entertaining
granted, I haven't watched the entire length of the Day 1-2 videos, only portions, but it was fun to watch
If there are some free shirts, count me in. :D
'Day.
 
1 hour later…
15:29
any idea how can I get "100" ? 3v4l.org/bvMBU
:44337553 getting the value of that constant inside <<<HERE
do I need a variable right?
Here is how.
got it thx .
@Shafizadeh For next similar issue, this is what I googled: "php constant in heredoc".
thank you so much .. I actually I wasn't aware <<<HERE is called "heredoc"
That's what I've searched before asking :P
> how to call a contestant in HERE<<< php
Well, then go again through PHP docs. ;)
15:37
:-)
Also I would say that non-accepted answer is one I'd prefer using. Or after reading comment, rather not. On you.
16:02
morns
I crashed a wedding yesterday, it was quite fun :D
16:13
@mega6382 accidentally or on purpose?
I wonder how one crashes a wedding by accident... no, it was on purpose
@Danack My roommate was invited to the wedding of his college friend, and I was about to go out for dinner, and then he told me about the wedding so, I just went to the wedding with him.
Let's be honest, for you it was just bit more celebrating dinner.
Wes
Wes
16:29
\o
@Tiffany yeah was working late on an extension :D
And I'm up again because I realised my float comparison isn't quite right.
@MadaraUchiha Thanks, makes sense to me, just wasn't sure if that's technically correct
17:00
@Tpojka Yeah, I literally just went for the free food :B
Which is not bad thing per se.
my cousin has a wedding next weekend
normally wouldn't go to weddings, but he's like my brother
17:19
I don't mind weddings or any other kind of large gatherings, as long as I don't have to talk to anyone there
lol
@mega6382 "what's your relationship to the lovely couple?" "dunno, I'm just here for the food" /walk past to the food table
hahaha
That's exactly right
I was sitting on a table with some elderly gentlemen, most of them were doctors of various sorts, and seemed to be of close relations of the bride and groom, and they were talking about the lovely couple and the whole time, I was just sitting there looking at my phone, hoping no one notices me.
random javascript question: so defining variable inside a function, use let instead of var right? like function func() { let x = 1; }?
@mega6382 what would you've said if they said something to you?
@Tiffany That I am a friend of the bride from college(which my roommate actually is) :P
17:30
@Tiffany I believe I saw a video of google developers discussing this in great depth, let me see if I can find it.
Which reminds me on:

Doctor: What is bothering you?
Veterinarian: Eh, it's easy that way...
@Tiffany It showed the crazy behavior of defining variables in javascript
oh boy
I always use some of these articles to recall it, I think this one is fine.
my dad wants me to add a sticky nav to his site, I was looking up how to do it, and one of the recommendations is adding a "debounce" function, which provided a link to an article explaining it. Reading the code for the debounce function, I noticed the code's style seemed a little dated, like ES3 type code
17:33
@Tiffany It was mostly about loops, but they also talk about let and var etc. youtube.com/watch?v=Nzokr6Boeaw
@Tpojka @mega6382 thanks
let is block variable even if it is in small block like "if" statement. It will remain there and if you are to declare it there if (true) {let a = false} /*here you don't have it*/ but also you can declare it in any scope and use it in inside scopes. So yes, you should use let instead var mostly.
17:59
@Tiffany You should use, in order of precedence: const, let, then var.
I don't think I've used var in code (i.e. not in REPL or console) in the past 2 years, unless IE support was needed and I didn't have a build-step for whatever reason.
let is block scoped, and is not hoisted. const is exactly like let, only you can't reassign to const.
The loop thing that @mega6382 referred to, is actually a special case of the specs that does quite of a bit of hula-hooping to make it all work.
If you want, I can elaborate on that, it's an interesting topic, but a wee bit long :D
@mega6382 what did I just watch
I think it took me twice as long to watch because I had to keep rewinding to process/understand what they were saying
I mean, I think I get it, but it's just... wtf
Are you familiar with the age-old JS interview question about the variables in the async callback?
and the last one they do where the setTimeout closure part of the for loop statement...
@MadaraUchiha narp
for (var i = 0; i < 10; i++) {
  setTimeout(() => console.log(i), 1000);
}
You're familiar with setTimeout, I hope?
(Don't feel offended if you do, I have no idea how much JS you know 😆)
ish. I had to look it up while I was watching the video cause I wasn't familiar enough with it before.
18:08
setTimeout(fn, ms) says "execute the function fn in ms milliseconds" basically.
Unlike PHP, JS has this "in the background" thing that you can defer execution to later
So what this loop does, is queue up 10 functions to be executed one second later
The naive expected result, is for one second of nothing, then 10 log messages of 0 to 9
@MadaraUchiha one second later after the for loop? inside of the for loop?
ello, mates!
@Tiffany After
setTimeout returns immediately. The function will be executed later.
Try running that in the browser console
What do you get?
22, then after a second, 10
22 is the return value of the loop (used only for debugging purposes), it's the last expression evaluated, a.k.a. the timer ID returned by the last setTimeout
Then 10 you see, you'll notice, has a circled (10) next to it, it's because it was outputted 10 times
18:11
@MadaraUchiha that's what I was thinking
ah
What happens here, is that all 10 of the functions, share the same i
And the i is only evaluated when the functions execute, 1 second later
At that time, i is 10, after having run through the loop completely.
That's because i is hoisted.
The code is equivalent to
var i;
for (i = 0; i < 10; i++) {
  setTimeout(() => console.log(i), 1000);
}
Now reload the page, and execute the same code, but replace the var with a let.
(You'll need to reload, because let is strict about redefining variables)
16, then 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Because now, each iteration gets its own i
and the value of the previous i is copied into the new i, correct?
But it's not clear why that is, at first glance. i is defined outside the loop, at the starting condition of the loop
@Tiffany Yes, that's where the special cases in the ES spec come in, and make it work magically.
When using let, the initialization part of the loop gets its own scope, and the value is copied over from iteration to iteration, it's a proper mess.
18:17
how does that affect performance? creating entirely new variables? is the old i, after its value is copied into the new i, destroyed?
I mean, obviously, an iteration to 10 isn't that much, so performance is negligble
A regular for loop isn't something you normally do anyway
How often do you use a proper for loop in PHP, vs using a foreach loop?
before or after I got the hang of foreach loops? :P
The difference is even more extreme in JS, with the advent of [].map(), [].filter(), etc.
@Tiffany After
Almost any iteration you do in practice is over a collection of some sort
before, 9/10 I used a for loop; after, maybe 1/5 of the time, probably less
I don't think I've used an actual for loop in production code this year
18:23
tw2.php.net SVG images issue – #77043
@Tiffany yeah, i still think the same thing, what did i just watch
@MadaraUchiha Thanks for class. :)
I have seen quite often that trying to write code in js/ts like you would in any other language(even php) will not work out for you at all, you have to be very callback/promise dependent with your code.
19:05
@Wes the tournament is in a VS format, 1v1, best of 3. Interesting to watch how players balance their play when pieces are moving so fast. Plus commentary explaining stuff. I've probably learned more about tetris by listening to the commentators than the amount of games I played. Granted, it all depends on how much you like tetris to begin with :P
20:04
... My dad is using the font HTML tag in his code
also, <br>s galore
@Tiffany I remember using those
when I learned HTML, I learned CSS alongside, so never learned anything about font tags. I knew they were obsolete, so not worth it
20:34
guys, any idea how can I add ga('create', 'UA-XXXXX-Y', 'auto'); inside google tag manager? (I'm trying to do this)
20:52
moin
@Tpojka gmfdi
Well, reading star on the right and the rest is history...
@MadaraUchiha really? I find that at least 30% of the time I end up refactoring linq-esque iteration decorators at least partially into "traditional" loops. My experience is that it's not uncommon to find when you have some O(n) routine for a collection, further down the line you need some other complex operation and it is very hard to use those things to do more than one thing and have the code remain readable
00:00 - 21:0021:00 - 00:00

« first day (2927 days earlier)      last day (2248 days later) »