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

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

New Cyanide and Happiness Comic

05:26
@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
06:27
Mornings
O/
\o
06:47
!!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!
07:10
!!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
07:26
@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
07:51
@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?)
08:14
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?
08:16
@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
08:53
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.
09:06
@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
09:09
@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
09:14
@tereško It's probably triple that here
!!weather Karlsruhe
09:25
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
09:36
will try thanks :)
one last doubt
where do you store these access token and refresh token?
local storage
thanks
10:05
@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)
user924016
morn
yo theon \o
10:14
@WesStark The second check is redundant
user924016
\o
@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
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?
Usually what you store is the hash and not the distance
for what?
10:36
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
@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
@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
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
@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
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
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
11:27
@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
@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
damn i wanted to star that
12:02
@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
@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
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
13:00
@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.
13:16
@Jeeves who are you talking to ?
@Shafizadeh Myself.
@pmmaga And gone.
Really strange that there aren't more spam reports.
Anonymous
13:53
@WesStark this is your calling twitter.com/seldaek/status/878914177410183168
Anonymous
14:03
(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?
14:27
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
14:33
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
15:09
@bwoebi Finished reading yet? :D
15:20
@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.
15:25
no :B azerbaijan, lance stroll finished third
almost finished second... overtaken on the line of the last lap
15:39
@bwoebi Better now?
@kelunik yes, thanks :-)
@bwoebi Also read the rest yet?
@kelunik nope … going to read page 3 now
Evenin
16:14
@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 ^
16:26
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.
16:36
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 ^
user924016
@MadaraUchiha doesnt work Invalid URI "file:///etc///passwd"
user924016
=p
Yeah well, Node's APIs for accessing files and URLs are different.
Unlike some other language I know
17:07
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
17:26
@MadaraUchiha oh. I had total mislook. this is way better meme generator!
17:38
@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
17:42
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
17:46
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…
19:06
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
19:09
@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?
19:13
@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)
19:21
never even used nano before
19:35
@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.
20:17
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
20:47
@bwoebi Ok, fine, thanks.
 
1 hour later…
22:12
@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
22:35
@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…
23:52
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 (2730 days later) »