« first day (2444 days earlier)      last day (2511 days later) » 

12:36 AM
\o
 
 
4 hours later…
4:24 AM
moar drama
When you don't have an answer for the tough questions... https://t.co/aX1OJJFZOj
4
 
5:09 AM
posted on June 25, 2017

New Cyanide and Happiness Comic

 
5:26 AM
@bwoebi you can't do that. people will inevitably spoil immediately after the episode has aired. also a trailer can't spoil anything. got is so crazy that anything can happen
sure you can wait the end of the season, so long you can avoid tv, internet, all media, people, even your grandmother most probably :B
cc @PeeHaa
 
6:27 AM
Mornings
O/
\o
 
6:47 AM
!!dad learn breakup /how do functions break up?/ they stop calling each other!.
 
@Linus Sorry, I don't get that joke, I need name / setup / punchline
@Linus Ha ha ha! Brilliant! I'll save that one about breakup for later!
 
7:10 AM
!!dad
 
Why was the function sad after a successful first call? because He didn’t get a callback.
 
:P
 
$result = $db->sql_query($sql);
$post_data = $db->sql_fetchrow($result);
$testt = array_slice($post_data,86,39);
print_r($testt);exit; when i print the above $testt error occurs like this:
array_slice() expects parameter 1 to be array, boolean given
 
im so borken
 
7:26 AM
@NikiC i've found a short circuit for the robin hood hashing :B i can skip checking any bucket having distance > dib, as they belong to another initial bucket
 
7:51 AM
@WesStark I did it quite successfully last year, and I will this year.
 
i will make sure to spoil you :B
 
@WesStark And I'll make sure to kick you from this room.
 
ahaha
 
Ah, that's OK, I'll guarantee a chat ban that lasts the rest of the season to those spoiling it in rooms with a no spoiler policy, problem solved <3
It would be worth setting up such spoiler policy though (is it OK to talk about the episode 24 hours after? Maybe wait a week? N episodes back?)
 
8:14 AM
Guys, CSRF question
 
mornings
 
I have a backend which is only API, no HTML rendering on the server.
I want to create a "change password" form, and I want to include a CSRF token somehow
 
@MadaraUchiha And where's the issue here?
 
There is an API call "getUserSettings" or some such that returns the frontend data about the user.
 
do you have sessions on the API server?
 
8:16 AM
@tereško Yes
The question is whether it's safe to return the token in another API call, and then plant it into the form's DOM with JS
As opposed to directly rendering the token in the HTML
What are the consequences of such an action?
 
I wouldn't actually use DOM for that - just have it passed as header in your XHR/fetch call
 
@tereško Sure, that's the easy part though
 
but any way you do it, you will have to make a "pre-flight call" to get the token
 
The question of getting it from the server to the client is more important
@tereško Yes, that would be getUserSettings, which is sent anyway
 
as for whether it is safe: it is as safe as any other form of CSRF protection
it is not possible to protect against custom-made-script
it's never a real "protection", just an added layer of inconvenience
 
8:53 AM
small help wanted
logic related pastebin.com/aif6ruZS
 
@FlorianMargaine Your company has a really good search engine ranking. i.imgur.com/u9kaOtu.png
 
@MadaraUchiha can't you just use the origin header?
Also mornigs all
 
@PeeHaa Is it safe enough? Can't be easily forged? Always sent?
 
@RonniSkansing so nice. Let me take a picture ahain of the view
 
@MadaraUchiha Yes. No. Dunno.
 
9:06 AM
@MadaraUchiha always sent afaik and cannot be controlled by scripts
 
The RFC doesn't require it to be sent, but I think it is sent as long as you're on HTTPS.
 
@kelunik What about testing on localhost?
 
Generate a local cert and whitelist it.
But I think "localhost" has exceptions in browsers anyway and is always considered a secure origin by browsers.
 
@kelunik Oh, that's not the question
If localhost doesn't send an Origin header, I can't write server-side code that would allow it
 
9:09 AM
@RonniSkansing ^^^
 
@MadaraUchiha Read HTTPS => secure origin, it only sends it for secure origins IIRC.
And localhost is also considered a secure origin, even if it doesn't have HTTPS.
 
fuuuuck, it's cold outside
 
@tereško I wish
 
it's 13°C here
 
I wish. :D
 
9:14 AM
@tereško It's probably triple that here
 
!!weather Karlsruhe
 
9:25 AM
can one set headers while redirecting ?
 
E_TOO_VAGUE
 
if not then how one can pass access_token in headers ?
 
how are you redirecting, what headers do you need to set?
 
authorization header, after filling username and password and then clicking on submit button i get access token of user so i need to redirect it by js
but then how will i pass that access token
 
just submit the form using ajax
 
9:36 AM
will try thanks :)
one last doubt
where do you store these access token and refresh token?
 
local storage
 
thanks
 
10:05 AM
@WesStark yes...
 
@NikiC mock me, go ahead. i didn't notice i could do that till now :P
 
That is the reason why RH has good lookup performance on non-existing keys at high load
A normal OA table would end up scanning lots of unrelated buckets until it finally hits an empty one
 
are you referring to $dib > $bucket->distance ?
because i'm referring to only comparing for equality when $bucket->distance <= $dib
you can do it in both directions
        if($bucket === NULL || $distance > $bucket->distance){
            return NULL;
        }elseif($bucket->distance <= $distance && equal($key, $bucket->key)){
            return $bucket;
        }
($bucket is either Entry or NULL)
 
yo theon \o
 
10:14 AM
@WesStark The second check is redundant
 
@NikiC it's if()elseif() and else is $dib++
 
The check is still redundant
you doing if (foo()) { } else if (!foo()) {}
Which is equivalent to just if (foo()) {} else {}
 
hm
you have a point :B
@NikiC i want to do something but i've clearly written the wrong way
basically, if i'm probing the hash + dib0 and i end up on a bucket that has distance 2
i can skip checking that key for equality, because it for sure has a different constrained hash code
am i right?
 
@NikiC As long as foo() always returns the same value. :P
 
10:23 AM
o/
 
like, imagine i have a full table of length 4 and it only contains the same hash code, so:
DIB 0 1 2 3
key a b c d
if i lookup for a key that has a different hash code, which initial index is 1, i can skip checking "b" because that belongs to the initial index 0
then i can skip checking c, and d, and "a" as well obviously because that ends the probe sequence
so basically if the existing bucket's dib is greater than the dib i'm currently checking, i can skip calling equal()
i don't know what i'm doing anymore lol
@NikiC ok figured it out
    if($bucket === NULL || $distance > $bucket->distance){
        return NULL;
    }elseif($distance === $bucket->distance && equal($key, $bucket->key)){
        return $bucket;
    }
\o/ thanks for spotting the mistake
 
@WesStark Do you store hashes in buckets?
 
no
 
Usually what you store is the hash and not the distance
 
for what?
 
10:36 AM
Among other things, because you can compare the hash, which is better than comparing the distance
The distance will be the same if the masked hash is the same
While the unmasked hash may be distinct
Additionally it saves you from recomputing the hash if you rehash
 
masked hash = constrained hash code ?
 
Presumably
If your constraint hash code is (hash & mask) or (hash % size)
 
when you say compare the hash, you mean compare the masked one?
 
no, you compare the unmasked one
 
i do that in equal(), it's a short circuit
if they are different returns false immediately
of course i could save a copy in the entry as well, for the rehash. but i would rather not do that
 
10:49 AM
@WesStark that doesn't make sense
 
for immutable objects hopefully the hash will be cached by those objects themselves once it's been calculated, and for mutable objects it's just spl_object_hash() converted to int
 
you should not recompute the hash on every comparison
 
of course
 
objects have no business caching hashes
that's your job
 
i have to disagree :P
 
10:51 AM
@NikiC If PHP had had weak maps (or weak references in general) I would have agreed.
 
how are weak refs related to any of this
 
How will you cache the hashes if not in the object itself without them?
Without causing a memory leak?
 
@MadaraUchiha I think we're talking about different types of caching
 
Possibly.
 
I'm talking about storing hashes in the hashtable
 
10:54 AM
the hashes must (in my design) be cached anyway by default in the objects, as they are fundamental for improving equals() performance
 
Which is something that literally every single HT implementation that I have ever seen does
 
@NikiC Ah, in the context of a PHP extension, not userland?
 
@MadaraUchiha As a general concept, not even PHP specific
 
so i'm not doing that again in the hash table
 
@NikiC Well, if you have a hashtable with a hash -> object reference mapping, how do you prevent a memory leak?
(Or maybe I'm just not understanding the data structure?)
 
10:55 AM
@MadaraUchiha The HT contains the object anyway
At the very least it owns a shared reference
 
yeah hashes are stored in the entry, not associated to the object
you need a weakmap for that
so basically each hash table instance that holds an object, will have its own copy of that object's hash cached
 
Yes, that's correct
Of course you can additionally cache the hash in the object itself, but for the baseline case that's not necessary
And definitely should not be a performance requirement
 
in my case it's definitely redundant, as equal() filters out unequal hash codes already
it's not that i'm sure that all objects will have a cached hash code, but mutable objects will have Z_OBJ_HANDLE_P as hash code, and that's hardly hard to compute (correct me if i'm doing something wrong @NikiC) and immutable objects must cache it once it's generated... it's their fault if they don't do so :B
 
@WesStark spl_object_hash is expensive, yes
And no, it makes no sense to force immutable objects to cache their hash
 
PHP_FUNCTION(objectHandle){
zval *obj;
if(zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE){
return;
}
RETURN_LONG((uint32_t)Z_OBJ_HANDLE_P(obj));
}
 
11:05 AM
They can do it if they like, but it doesn't make sense as a requirement
 
this is what i'm using. it's probably borken
 
You're writing an extension?
Ok, in that case it's cheap, yeah
 
no. it's just that function :B
eventually i will port to C the hash table and stuff that is supposed to be fast
but tbh, it's pretty fast already in php this thing. quite surprising considering how slow it was the chaining hash table
right now the slowest thing is computing the hash codes, but with integers is basically as fast as php arrays
 
11:20 AM
IntlException: Constructor failed – #74811
 
can we do a Jeeves plugin that posts the new threads appearing in the php internals mailing list? not all posts, just the new threads. cc @PeeHaa
with "we" i mean "you" :B
 
@WesStark Shouldn't there be an RSS feed for that somewhere?
Just add it to room feeds
 
dunno if there is
 
@WesStark Yes, you can do that. :P
 
:B
 
11:27 AM
@MadaraUchiha Jeeves is way better than room feeds, we should probably replace feeds with Jeeves entirely.
!!issue Add support for external messages - We should have a mechanism for Jeeves to post messages from other processes. One solution might be Jeeves offering a local HTTP service, but we could also just use BeanstalkD and push messages into a tube and Jeeves fetches and posts them.
 
Does anyone have a suggestion for github.com/amphp/artax/issues/119?
 
11:53 AM
@kelunik does amp have a component for filesystem operations? like fwrite and stuff
 
:37804590 same. it usually from your point of view down to you know what parts
 
ah ok
 
damn i wanted to star that
 
12:02 PM
@Shafizadeh I suggest a google search btw
:D
 
Anonymous
@Ocramius :B
 
Anonymous
What's this whole conf drama going on?
 
No idea about the conf stuff
 
12:31 PM
@Gordon I've already seen a short term in some of your answers on SO. Something like this: "as a side note", "as a bottom line", "under point" or something similar. May please tell me what's that term exactly?
 
"as a side note" == BTW
"the bottom line is" === TL;DR
 
Ah ... I see, thx
 
the term "bottom line" actually comes from bookkeeping, it refer the "total" line in a balance sheet
 
12:47 PM
it means something like "summary". right?
 
  1
+ 2
+ 3
-----  <-- The bottom line
  6
In this context, bottom line is akin to "summary", yes.
 
This is bottom line.....
 
@MadaraUchiha til
 
asadasd – #74813
 
1:00 PM
@Jeeves Solid.
 
@MadaraUchiha Metal Gear.
 
@WesStark Sure. amphp/file.
@MadaraUchiha Added two more sections if you want to give other feedback than highlighting is broken. :P amphp.org/getting-started/tcp-chat
 
Maestro404 – #74814
 
@Jeeves I'm impressed!
 
@pmmaga You should be.
 
1:16 PM
@Jeeves who are you talking to ?
 
@Shafizadeh Myself.
 
@pmmaga And gone.
 
:)
 
Really strange that there aren't more spam reports.
 
Anonymous
1:53 PM
@WesStark this is your calling twitter.com/seldaek/status/878914177410183168
 
Anonymous
2:03 PM
(Red flag has me bored)
 
yeah but so far race was great :D
 
Hi, Doctrine question. Is this command: orm:schema-tool:update --dump-sql changing database or just output forecast?
 
@kelunik does that work for streams?
 
2:27 PM
hello
 
@WesStark that's what amphp/socket is for
 
I am trying to make quick csv insert script to mysql, without any framweorks or so. And it should be simple but it doest not work. Why it might be chooseing wrong user for insert if my script connects as admin:
INSERT into forex.trades(trade_id_by_broker) values('11140326')
INSERT command denied to user ''@'localhost' for table 'trades'
it tries with empty user
 
@WesStark Streaming files? Yes. TCP sockets? No.
@WesStark What are you building?
@bwoebi Could you please review the getting started series? amphp.org/getting-started/tcp-chat
 
Anonymous
@WesStark hahaha! I love this race control
 
what a race lol
the duct tape lol
 
Anonymous
2:33 PM
Hamilton you're fucked but we'll fuck vettel too, don't worry
 
@kelunik yep, reading
 
ok, user '' was not even existing. User 'admin' also was not existting but there was no connecting error.
changed user to root and it works
 
2:45 PM
yo
 
3:09 PM
@bwoebi Finished reading yet? :D
 
3:20 PM
@FélixGagnon-Grenier the canadian kid finished 3rd in the craziest f1 race ever
 
@WesStark fuxyeah :) y craziest?
 
yeah something like a million crashes happened throughout the race :B
 
@kelunik I really would leave the initial amp example (on page 2) without comments, to show off how slick it is, instead of putting him in front of a big wand of comments with little code. Add the comments individually after the example in context of the code.
 
3:25 PM
no :B azerbaijan, lance stroll finished third
almost finished second... overtaken on the line of the last lap
 
3:39 PM
@bwoebi Better now?
 
@kelunik yes, thanks :-)
 
@bwoebi Also read the rest yet?
 
@kelunik nope … going to read page 3 now
 
Evenin
 
4:14 PM
@bwoebi @Trowski What do we do with Amp v1? Go security-support only now?
 
@kelunik bugfix-only, I'd say
At least for a little bit
 
Otherwise I'd just close it.
 
@kelunik yes.
 
@kelunik bug-fix for the next year or so?
 
Bugfix until 2017-12-31 and security fixes until 2018-12-31?
Artax v1 is now unmaintained. github.com/amphp/artax#versioning
@Danack ^
 
4:26 PM
Yeah, that sounds reasonable.
@bwoebi I'd like to apply the same code styles to Aerys as have been applied across all other Amp libs. Do you think you can live with non-group-use statements?
 
I'd like to apply group use to all other libs instead :-(
 
We know what you like, but can you live with?
 
@kelunik Well, sure, I won't die from that … But I'm annoyed by the lack of group use…
 
So just annoyed and no ragesquid insta revert?
 
Group-use is a PITA with PhpStorm. Yes, that's a failing of the IDE, but it's just one more thing I have to think about then.
 
4:36 PM
ragesquid is well on its way to becoming an fine r11 meme.
 
@kelunik Well … there's no point in starting a commit war over anything …
I may be annoyed and show that a bit, but why should I start a commit war?
 
@FélixGagnon-Grenier don't use imgflip.com
Works with GIFs too ^
 
@MadaraUchiha doesnt work Invalid URI "file:///etc///passwd"
=p
 
Yeah well, Node's APIs for accessing files and URLs are different.
Unlike some other language I know
 
5:07 PM
Fuck group use and everybody that uses it
Ohai I mean :p
 
@MadaraUchiha sure! but why, if I may?
@PeeHaa the letters are like, right next to each other
 
:)
@FélixGagnon-Grenier don't trust him
 
never trust ninjas™
 
He's trying to make money from r11 memes
 
5:26 PM
@MadaraUchiha oh. I had total mislook. this is way better meme generator!
 
5:38 PM
@PeeHaa What do you think about throwing for every non-200 status code in Artax?
 
Hi room
 
@kelunik yep
 
is there a public website with upcoming php version (currently, 7.2) upgrading info or any other doc, e.g. sth like next.php.net?
 
NEWS is kinda noisy and incomplete
 
5:42 PM
yeah, and UPGRADING.INTERNALS,
ok, my q is whether object typehint will be in 7.2?
wiki.php.net/rfc/object-typehint targets 7.2 but it's not clear whether it will be or not, and i'm lazy to look thought sources without asking first
 
It will be
 
github.com/php/php-src/pull/2080 is still opened, any ideas when it will be ready to merged?
 
I might fix the remaining issues today myself and merge
 
wow!
 
We have quite a few RFCs for 7.2 that are accepted but not landed yet
Object will make it, but others might not
 
5:46 PM
how could we do object typehint from sources? ZEND_ARG_OBJ_INFO with classname set to NULL?
but classname seems to be stringified, so I'm not sure whether it will do the job
 
no, you use a normal type arginfo
just with IS_OBJECT
 
is ZEND_ARG_TYPE_INFO with type_hint = IS_OBJECT an equivalent of php user-level object typehint?
 
yes
 
ditto =), thx
 
 
1 hour later…
7:06 PM
hey, what do you important guys code with in c? clion?
 
@kelunik if you mean for every error status code I'm fine with it :) (me is peehaa, sorry phone is almost dead)
 
that... is funny.
@Ekin (the real one) moved to NL?
 
@FélixGagnon-Grenier eih… /usr/bin/nano.
 
@bwoebi are you... are you serious?
 
@FélixGagnon-Grenier nope
 
7:09 PM
@FélixGagnon-Grenier yes.
 
brb in a few years reconsidering all of my life
.. not that I am anywhere close to do anything with c.
 
@FélixGagnon-Grenier dunno, for everything navigational I use lxr… and for everything else, a plain text editor is good enough for me.
 
@Ekin basically, yes.
 
@bwoebi yes, but you are a pro ;)
I am but a simple phpharmer
 
@bwoebi You still use nano?
 
7:13 PM
@bwoebi but in any instance, you answered my question, gratie
 
@kelunik yes
@FélixGagnon-Grenier I think others here don't use it though. We have some vim lovers here I think.
 
no vi lovers? ;)
 
I switched to vim earlier this year or last year, don't remember.
 
(still hung up on this huge vi vs vim thing (big at least in my head ))
 
I use nano more often than vi or vim lately (Ekin)
 
7:21 PM
never even used nano before
 
7:35 PM
@FélixGagnon-Grenier vim
vim with ycm and syntastic is pretty good for c
 
@FélixGagnon-Grenier yes
 
for a moment there, I was "bah, that's just your other auto completion thing", but then I was "wait, that's in a console".
does it work even without x-server?
.. just being nity picky here. sry.
 
8:17 PM
when I realize I act exactly like the newbs I so despise when they are so pretentious when @tereško tells them about mvc
 
I'm glad to be a positive influence :P
 
@bwoebi read all of it now? :P
 
@kelunik eih, yeah, just had no comments to add
 
8:47 PM
@bwoebi Ok, fine, thanks.
 
 
1 hour later…
10:12 PM
@JayIsTooCommon Yeah, they have been pulling that up recently as proof of the "hate". Yet they fail to realize that's the result of years of buildup and escalation caused by their outright refusal to work with anyone that has even the slightest criticism of anything they have done
 
10:35 PM
@ircmaxell Well, despite everything, Laravel is very successful
In a battle of audience control, it's the more approachable solution that wins, not the nicest abstraction/API.
(Mostly playing devil's advocate here, I'm well aware that Laravel is crap and that their creators have been less than social about this matter)
 
I don't care about the code
or the API
or who they target
what I care about is that since day 1 they have refused to have any kind of discussion
and instead shut down even the slightest criticism or technical discussion point as "haters gunna hate"
 
 
1 hour later…
11:52 PM
does anyone keep a programming journal? like something they write stuff down to remember for later?
@ircmaxell do they follow PHP-FIG?
or a part of it?
 

« first day (2444 days earlier)      last day (2511 days later) »