« first day (2792 days earlier)      last day (2153 days later) » 

6:00 PM
I just got on the JetBrains train this year so I'm still in my first year.
 
@Tiffany for businesses that's totally reasonable IMO, the productivity increase it gives me accounts for drastically more than $200/yr
 
Fare enough :D
 
they had a sale in December 2012, "End of the World" sale, I bought it then, and kept my subscription off/on since now and then, but I've been keeping it now
 
maybe I should see if they have any jobs going in their sales dept, I seem to be doing that job already but not getting paid for it :-P
 
evenin
 
6:04 PM
@DaveRandom @Wes got a t-shirt from them for the bug reports he's put in
 
ffs
 
another pointless thing to want
 
o/
 
Wes
just need pants now \o/
 
I got my SO T shirt though, that's definitely the best freebie I have had, I would guess that 1 in 5 times I wear it out to a place where there are software people I get someone offering to buy it off me (which is weird tbh)
 
@Wes nice
 
@Wes want
I just realised I never got my hacktoberfest 2017 T
 
That is nice
 
you don't buy shit like that, it doesn't count
:-P
 
Wes
i didn't want them to know i am fat so i told them to send me a small size. so i can't wear it
 
:P
 
lol
 
Wes
:B
 
6:09 PM
Hang it on a wall.
 
go to one of the PAX cons, gaming companies will drown you in free t-shirts. I knew someone who would essentially do his t-shirt shopping from going to PAX Prime.
 
lol I just say /X{1,}L/ for every bit of torso clothing
only once has that resulted in something completely ridiculous
 
I always want to buy the shirts that Cisco wears on The Flash.
 
@DaveRandom same
 
and I'm wearing a shirt today from a vendor we use that says Code Ninja
 
6:11 PM
@Ekin do we know any people who work for DO?
 
uh, I don't think I do
 
never refer to yourself as a ninja, when I registered a ninja domain, I actually got more than one message, words to the effect of it's arrogant to call myself a ninja ... even though I am actually a ninja ...
haters gonna hate ...
 
Wait do I need phpunit for xdebug?
 
I definitely "earned" one because I remember doing it by accidentally PR'ing my own repo and then feeling like that was cheating so trawling github for a random issue to fix
 
ninja is my de facto halloween costume
 
6:12 PM
@Alesana no
xdebug is an extension
it needs to be installed on the server
 
Cisco wore this one on an episode I watched- I want one! Mens Haikus are easy Cisco's T-shirt 2XL Asphalt amazon.com/dp/B076S53DQQ/ref=cm_sw_r_cp_api_i_mCSgBbGZ8B8VS?x
 
and if should categorically not be installed on a production web server @Alesana
 
needs is a strong word ...
 
it will nuke performance
 
Ah to debug wtih phpstorm I guess I need it
 
6:13 PM
@JoeWatkins *in order to use it :-P
 
I have it installed on my dev server haha
 
iirc that guide is pretty extensive, up to date and idiot-proof
but not necessarily @PeeHaa proof
 
:D
 
Haha okay I'll keep following it
 
@StatikStasis i.imgur.com/uhDFXm9.jpg written by a child.
 
6:17 PM
lol
 
@DaveRandom actually I just noticed I do know someone who's doing a lot of go and working at DO
 
evenin
 
'nin
 
@Ekin oh huh, would you mind asking them if there's anything they can do about it? failing that I will do the twatter but I don't want to open that box ideally because I feel like it will attract a lot of "me too's" and I don't want to pile a load of shit on their social media team for something so frivolous
 
6:19 PM
#metoo @Ekin
 
I dm'd their twatter at some point and they asked me to email at hacktoberfest@ and I did
to which I think I never got a reply
 
@StatikStasis not related to haiku, but this one is entertaining: I'm So Meta Even This Acronym
 
Hi guys, is there any way to read /var/run/utmp with PHP and output it in a formatted way (like the who command)? I'm struggling with the unpack() function
 
well I'm not fussed enough to create a load of crap about it, so no worries
 
@Danack @bwoebi could any of you tell me if the value is shown correctly on mac safari ? jsfiddle.net/vundkjg2
@DaveRandom It's a social media team. Their job description reads "pile of shit"
 
6:22 PM
@Mehdi yeh looks simple enough and I'm bored, give me 5 mins :-P
 
@DaveRandom thanks!
 
@DaveRandom Your assumption is correct. What's a better way to pass the $db variable to the functions? I know there is usually a problem with global because the variable may not be available, but in this case it always is because the variable is declared before the functions are even included into the page.
 
dependency injection
brb
 
@PeeHaa Not really, almost everyone has unlimited internet on their smartphone here these days. The DVDs that do get sold are pirated game DVDs and porn. But that market's going down as well.
It used to be the case 5 years back though.
 
6:31 PM
@2dsharp kk
 
6:42 PM
@DaveRandom does it really look simple ?
have you read the small print for utmp ?
 
pissing about with endianness
and just trying to make it work on my x86_64 centos 7 box
 
@NikiC This has been a fun little adventure from investigating a Coverity report :D
 
they'll have machine endianness ...
you may be trying to read the wrong structure ...
it's not at all standard ...
 
indeed
 
you could grep for it in libc includes
me thinks ffi is probably a better solution than unpack ...
 
6:46 PM
I will if what I'm doing now doesn't result in something sane
@JoeWatkins what sorry?
I wish array map would just pass the key to the callback, it's so much less useful without that
it could just pass it to the "last" arg
although I have never seen anyone pass more than one array to it anyway
 
I was wondering about that recently actually @DaveRandom.
 
oh I actually don't see a way to do it with ffi ... but how do you intend to read the second structure ?
 
Is there a way to access where the iterator is at from the array?
 
@Allenph I could tell you a whole bunch of stuff about that but for now let's just go with "no"
also Joe/Niki/Bob would be be better placed to explain it anyway
 
Can I have some more brain dump please sir?
 
6:51 PM
not right now, I'm pointlessly implementing something painful that I don't need for a random person on the internet
 
@DaveRandom that's okay, can you like point me in the right direction. Is unpack() the right way to achieve it? anyway I can figure the format I need to pass to the function?
 
@Mehdi :-P I'm not expecting what I'm doing to work for you (unless you are v. lucky) but I think it will help you a lot in terms of understanding what you need to do to make it work for you, hang on nearly done
 
@Allenph for by-ref foreach, somewhat … normal arrays - forget it.
 
tl;dr is: references+CoW is a bitch
 
@DaveRandom that's actually perfect, I'm trying to understand how to do it. Thanks for the help!
 
6:55 PM
but also if you want that info you should use a proper linked list with a proper API anyway
I am less and less keen on using arrays for anything other than actual arrays as time goes on
 
@bwoebi I'm not suggesting anything.
 
I use array_map with multiple arrays.
 
I'm just asking why. Seems to me like the responsibility of the array to know where it's iterator is.
 
It's common when you have data in two arrays that have related data pairwise.
 
In fact this is the case when implementing ArrayAccess.
And I see a bunch of other languages doing it. Our loops look relatively weird compared to others.
 
7:00 PM
array_map(function($x1, $x2) { return $x1 * $x2; }, $array1, array2)
^ Contrived example but this does element-wise multiplication of two arrays.
 
Are you talking to me @LeviMorrison? If so I don't understand what you're getting at.
 
No, just generally responding to this.
What's your goal, @Allenph? I missed that.
 
@DaveRandom I've got you covered :P
 
I'm just wondering why we don't have access to the iterator directly from the array.
Instead we have syntax in the loop definition for providing a reference.
 
@Mehdi sorry got a phone call, gist.github.com/DaveRandom/ce91a672f89526c652ef44a33ad8dc6e is an implementation of the struct as described here
 
7:05 PM
We have iterators so maybe I'm not understanding what you mean.
 
you should check the headers for the distro you are actually going to use this on to make sure it matches
 
@DaveRandom Thanks I'll start reading the code and try figuring it out, sorry for the trouble.
 
no worries, I wouldn't do it if I didn't want to
 
@LeviMorrison foreach($array as $index => $element) instead of foreach($array) and some kind of access to the current location of the iterator as an intrinsic part of the array.
 
@GrumpyCrouton I will answer this in a few mins, got some RL things to deal with
 
7:06 PM
$array->iterator or something.
 
@pmmaga Just noticed you're from Portugal. I have a friend that just got back from there last week. He is getting ready to retire and visited 3 different countries him and his wife wanted to retire in. He previously went to Nicaragua but the civil unrest erupted while he was there. He loved Portugal and is making plans on moving there first of next year.
 
$iterator = new ArrayIterator($array);
iterator_apply($iterator, $func); // ?
 
@pmmaga tbh I don't want more array_whatever() functions that result in O(insane) code, I want something like linq (that isn't horrible like that thing that someone points me at every time I mention this)
 
@StatikStasis I can understand him :P It's a nice place to live in
 
@pmmaga He was introduced to the term cu de Judas while he was there. lol
 
7:10 PM
@DaveRandom The goal of the extension is to keep it O(n)
 
We had a good laugh about the meaning of it when he got back- kind of went around the office for a bit.
 
haha :)
 
@LeviMorrison Still confused. ArrayAccess forces you to keep track of the "array's" current index. Why is that not publicly accessible to regular arrays?
Why does it have to be provided by the loop itself?
It must be in there somewhere. I'm not saying it should be that way, I'm trying to figure out why it is that way.
 
@DaveRandom now read the second record ?
 
@JoeWatkins it's a fixed length, so that's trivial, just wrap it in a loop and substr (or unpack also has an offset arg) although you are correct in that I forgot to include that element in the example
/cc @Mehdi ^
 
7:15 PM
well it's supposed to be ...
 
@pmmaga He visited villa de franca, São Miguel, and Gorreana Tea Plantation. That's the only names I can recall from his conversation about his visit.
 
but you'll notice when you start digging, it actually isn't, the length of the struct defined in man pages is 400 bytes, but the length of the struct as defined by my libc is 384 ..
 
yes but it would have to be a heavily platform-dependent implementation anyway
it's not going to be portable no matter what you do
 
and no where in the file is the number of records ...
well not no matter what you do :)
 
no but you just keep going until you run out of data
 
7:17 PM
@Allenph Huh?
Where in that API does it force you to keep track of the current index?
 
It doesn't...but it has you keep track of it.
 
@JoeWatkins in pure userland, short of lexing the headers to derive the structure, I can't see how it could be
 
@DaveRandom I'm still reading the code and var_dumping around it
 
@DaveRandom well that's what I was thinking of actually, short of help from ffi ...
 
@Allenph Huh? Where?
 
7:19 PM
our api is not very nice for ffi ... I dunno why I keep mentioning it ... but this belongs in that area really ...
 
@LeviMorrison Just kidding. I'm a moron. I've only implemented ArrayAccess one time and didn't look carefully at the API.
 
structs are pretty easy to parse ... so are the simple define directives you need for this sort of thing ...
 
ugh, fucking people are so annoying, brb
 
Never mind. I'm sorry.
I see now. Those iterator objects keep track of it.
 
@DaveRandom people... they're the worst.
@Tiffany have you called the company back since the interview?
!!should I continue to procrastinate today or get something done
 
7:24 PM
You should get something done.
 
sigh...
 
Nothing I'm doing seems to be showing any errors on the 404 pages :/
 
@Allenph you should read stackoverflow.com/a/14854568/889949, although it was written for PHP5 and much of the specific internals stuff has since changed a bit, the general principles still (mostly, afaik) apply
 
Even the built in CakePHP debugging toolbar just doesn't show on missing pages
 
@Alesana another thing you should is grep the codebase and replace every instance of include(_once) with require(_once)
 
7:28 PM
@DaveRandom Thanks.
 
@Alesana what is the response code of these requests, and what is the content length?
 
200, 0 content length
wait
Let me double check the second one
Haha
 
... lol. I just unsubscribed from a unity spammy-ish mailling list and they greet us with a a very passive-aggressive "Thanks! We're flattered. Keep creating!". Not quite sure how I feel.
 
There's no content length in the header
If it were a blank 404 response it would be better but these robots are querying pages that don't exist, they're getting a 200, and then they're like "Well that's not an image/whateverfileI'mlookingfor"
 
@pmmaga sure, for that specific operation. But it doesn't help you with constructs like array_map($f, array_chunk(array_keys($a))), which is the sort of shit that people do all the frickin' time. Even so, linq is about so much more than complexity reduction, it's a really well designed DSL that let's you express massively complex operations as a chain of small individual units.
although also it would suck without short closures
@Alesana what does the browser dev tools tell you though
 
7:35 PM
size is 154 Bytes
 
@Allenph Right, and iterator_apply is pretty general but that's partly why it's not used much.
 
I don't know if that's what we're looking for :P
 
@JoeWatkins is there any sane way you could dynamically deref types like pid_t to find the base int type?
I cannot believe you have got me actually thinking about this insanity :-P
writing an extension would genuinely be less work
 
@LeviMorrison iterator_apply is a really stupid function
 
@NikiC I used to think that but now I see it differently. It's actually beautiful - it just doesn't solve problems in a way that people want to think about them.
 
7:39 PM
@DaveRandom No problem :)
 
And honestly just writing the loop equivalent of iterator_apply is probably better because our closures suck, but that's not really its fault.
 
web@vf5smezv7us4gvelqg4kzq67yq:~$ rsh -V
OpenSSH_6.7p1 Debian-5+deb8u4, OpenSSL 1.0.1t  3 May 2016
welp
there goes the idea of using rsh...
@DaveRandom you may have an idea
I want an unauthenticated rsync between 2 servers on the same LAN
 
@FlorianMargaine why unauthenticated?
tbh I've never done much with rsync but afaik it's basically just stuff on top of an ssh transport, so can't you just do it with key trust?
I'd imagine there's some way to configure sshd to permit anon connections from a specific IP, although I have never looked but I would be surprised if there's no way to do it
 
Because it means creating a fake user to put the key on
Hmmm apparently there's a rsync --server option...
 
OK, why is that problematic?
people (read: I) create users for shit like that all the time
 
7:47 PM
@DaveRandom it means a random user exists for no purpose... I'm not a fan if it's not necessary. This is across a LAN with tightly closed iptables rules. It's pointless.
 
it doesn't exist for no purpose, it exists for this purpose
 
@DaveRandom yeah, linq is nice
 
@DaveRandom yeah, but this purpose isn't necessary
I'll play with rsync --server
looks like it's rsync --daemon
 
8:06 PM
@FlorianMargaine sorry, back up a sec, what are you actually doing such that you are doing something, and what you are doing isn't necessary? :-P
also, the thought occurs that you are connecting to a remote machine, and when you do that all the operations you do on that machine *have to* be done as a local user
you most likely don't want to end up in a scenario where you are doing stuff, unauthenticated, to a remote machine, as root
or (more likely I guess) as nobody, which may not have access to... well, anything really
 
@DaveRandom it's for lxr, nfs is too slow. I'll have 2 containers; one running the indexer, the other running the site. But I need a way to transfer the files between them
 
posted on June 08, 2018

New Cyanide and Happiness Comic

 
@FlorianMargaine nfs is probably to slow for the front-end lucene to read from, I'm not sure but I have a feeling that it won't be such an issue if you do it the other way round and the indexer is running over nfs
 
@DaveRandom nope, it's too slow for ctags
turns out NFS doesn't like it when you run dozens of git log
 
@FlorianMargaine ah, now that's a different problem and you could probably solve that one by having the sources live on the indexer
 
8:13 PM
no, the site needs them too, to render the pages
 
the front end doesn't touch the sources much, because it generates static HTML and caches it
 
yeah, but I still need to sync the files
 
my concern is that weird shit will happen for requests that come in mid-sync
 
I guess you could put a complete second copy and then do an atomic symlink switch, but that would negate the need for rsync anyway
that would also take fucking ages though
 
8:15 PM
wouldn't, you mean?
there are tricks
 
a complete network copy of the entire lucene data and sources after every index?
 
hard links + rsync, for example
 
!!dad
 
@FlorianMargaine actually yeh, you could keep two copies there and then rsync with the idle one
 
Can February March? No, but April May
 
8:17 PM
I think you'd need to do something roughly like cat /var/opengrok/config.xml | nc 127.0.0.1:2020 after the rsync
 
I'm not following you
 
i.e. you have to pipe the config to that weird socket that opengrok uses for config updates
that's how it notifies the front-end that stuff has changed, iirc
 
Yes, the indexer is already using that
Ah, I see what you mean
 
@FlorianMargaine right, but my point is that if you are going to do magic after the indexer has done before the updated data is actually available, you'll need to do it again
(I think)
 
Either way, unauthenticated rsync. :)
 
8:20 PM
I really don't see the issue with creating a user tbh, or using the user that presumably exists for tomcat if you really must
 
It's just a full platform.sh user, with an email and everything
 
OK, but surely you can give it an authorized_keys file?
 
(ssh authentication is managed at a higher layer than the container)
I can add the user to the project, yes
It's just... more pain/overhead
 
@DaveRandom bothering you again, I passed utmp's content to fromPackedData when I var dump the data returned by unpack() I get
array(14) {
'type' =>
int(2)
'pid' =>
int(0)
'line' =>
string(0) ""
'id' =>
string(0) ""
'user' =>
string(0) ""
'host' =>
string(0) ""
'session' =>
int(0)
'tv_sec' =>
int(0)
'tv_usec' =>
int(2074869760)
'ipaddr1' =>
int(442182681)
'ipaddr2' =>
int(234881024)
'ipaddr3' =>
int(0)
'ipaddr4' =>
int(0)
'unused' =>
string(0) ""
}
And I'm not sure how I can turn this into formatted data.
 
@Mehdi OK, what OS/platform are you using?
 
8:24 PM
Ubuntu 16.04LTS
I checked man utmp
It's the same output as the link you posted
 
yeh, really you need to look in the system utmp.h
 
Thanks, I'll check it.
 
@Mehdi if you find the def and throw it in a gist I'll happily take a look at it
 
I used locate to find utmp.h I found two:
/usr/include/utmp.h
/usr/include/x86_64-linux-gnu/bits/utmp.h
I'll compare them with the one in the man page
 
@Mehdi you probably want the .../bits/ one
 
8:31 PM
Yes I'm reading it now. it looks the same as man7.org/linux/man-pages/man5/utmp.5.html so far
same values*
struct utmp
{
short int ut_type; /* Type of login. */
pid_t ut_pid; /* Process ID of login process. */
char ut_line[UT_LINESIZE]; /* Devicename. */
char ut_id[4]; /* Inittab ID. */
char ut_user[UT_NAMESIZE]; /* Username. */
char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
struct exit_status ut_exit; /* Exit status of a process marked
as DEAD_PROCESS. */
/* The ut_session and ut_tv fields must be the same size when compiled
32- and 64-bit. This allows data files and shared memory to be
 
@Mehdi yeh that looks the same. I have just noticed that I omitted the exit_status struct though
moment let me play around with it a bit more, I am starting to actually care a little bit now :-P
 
It's an interesting exercise I found online, posted by a school that is expecting people to know nothing about coding
I find it weird
 
I am weird, I once built DNS protocol implementation in pure PHP, for no particular reason at the time (although it has since proved to be a useful thing)
brb smoke
 
Take your time, I believe that building random things make you understand more. That's the main reason why I'm trying to solve this.
 
8:59 PM
@DaveRandom Wow. Those were problems I did not even think about.
 
@NikiC This is what I came up with. Without basing it on ce, I don't find a way to distinguish the B case from C in the test file. Another way would be to also return empty on functions but I guess that would be a bit too much
 
9:13 PM
Heading home. Have a good weekend, everyone.
 
You too
 
@pmmaga please also test __method inside closure inside method
I think it will currently produce a wrong result
@pmmaga To distinguish the B case we'd have to NULL out the active_op_array when we start compiling a class
But I think your version is also reasonable
Well, "reasonable"
 
9:28 PM
@NikiC As it stands, everything but A looks the same as 3v4l.org/NvXDX
 
@bwoebi I was confused about how some stuff works ... I thought that is __get returns by ref, then get_property_ptr_ptr would return a pointer into the reference, but that's not the case. All the overloaded ops are performed using a __get + __set call, including normal assign ops (3v4l.org/tF82D). So I think the only thing we should change is that the intermediate result is computed on a copy, not on the deref.
 
That case makes no sense at all. __METHOD__ returning the class name? Huh?
My guess is an incomplete impl since it's supposed to do class plus '::' plus method name.
 
That is, we shouldn't change it to directly work on the ref, as we're not doing that anywhere else either (well, apart from array push of course)
 
@pmmaga Notice your conditions to if have the same prefix, meaning you do two of the same checks in both ifs. Here I'd do a nested if.
Unless there is some reason for it to continue down the else/if chain.
 
@LeviMorrison I know, but otherwise I'd have to repeat the else { empty...
either way, currently the op_array can't be NULL
 
9:36 PM
If it can't be null then why is there a check? Just remove the check and assert it instead.
 
What's the cost of ZVAL_EMPTY_STRING(zv);? I bet it is cheap. Nevermind, misread something.
zend_bool has_function_name = op_array && op_array->function_name;
if (has_function_name && op_array->scope && op_array->scope->name) {
        ZVAL_NEW_STR(zv, zend_concat3(ZSTR_VAL(op_array->scope->name), ZSTR_LEN(op_array->scope->name), "::", 2,
        ZSTR_VAL(op_array->function_name), ZSTR_LEN(op_array->function_name)));
} else if (has_function_name && (op_array->fn_flags & ZEND_ACC_CLOSURE || !op_array->scope)) {
        ZVAL_STR_COPY(zv, op_array->function_name);
} else {
        ZVAL_EMPTY_STRING(zv);
Well, maybe int has_function_name since this is C, dunno.
 
@LeviMorrison yeah, that would do as well. is it objectively better in any way?
 
1. The compiler will not miss the optimization.
2. It's clear to the person who is reading the code that prefixes are intended to be the same and not an accident, such as copy/paste.
3. The line lengths are shorter.
$0.02
 
@LeviMorrison I'll buy :)
 
9:49 PM
^_^
 
I've executed this command "git commit --amend" and faced with this:
How can I keep the existing commit message and continue ?
Or, how can I open that with "nano" editor?
 
@Shafizadeh type :wq and enter
 
what does "w" and "q" mean? "w" stands for "write" and "q" stands for "qite' ?
 
w stands for save and q stands for quit
 
ah ok
thx
also, is the name this editor "vi" ?
 
10:00 PM
worked?
vim older name was vi
m means improved, I believe
 
Nope:
 
@Shafizadeh should have used GitKraken as I suggested you some time ago
 
> E492: Not an editor command : qw
 
@Shafizadeh don't add space
 
@tereško I'm at home now .. GitKraken is installed on my computer at work
@mega6382 oh .. w8
 
10:01 PM
@Shafizadeh and wq not qw
 
w - write
q - quit
 
Oh .. Is the order important? Good .. Worked anyway
 
(not sure about the order, TBH)
 
@tereško Be sure .. it is important .. :qw won't work
 
@Shafizadeh its not order or separate commands, it is just 1 full command :q to quit if there are no changes, :q! to quit and ignore changes and :wq to quit and save changes.
etc
 
10:06 PM
ok .. I'm searching or "how can I change default editor in git". I want to set it to "nano". It is much more easy
anyway .. it's too late here
nn
 
@Shafizadeh Its 3AM here, I doubt its more late than that there.
 
go to sleep then :P
 
@Shafizadeh Nano, bro? Really?
 
10:35 PM
(snoring zZz ...) yes, I'm familiar enough with nano
 
Get familiar with vim bro. Whole new world.
 
Ok 😊
 
Incorrect documentation of Phar constants – #76432
 
10:54 PM
Build failure with macOS libldap.dylib – #76433
 
those f*cking undocumented alignment bytes got me for a good hour
well that was a fun waste of an evening, nn :-P
 
11:14 PM
implode sometimes ignores one array item – #76434
 
11:48 PM
!!lxr implode
 
[ /ext/standard/string.c#1290 ] PHP_FUNCTION(implode)
 

« first day (2792 days earlier)      last day (2153 days later) »