« first day (2562 days earlier)      last day (2389 days later) » 
01:00 - 15:0015:00 - 00:00

1:18 AM
yo
 
Wes
\o
(yes i'm not sleeping yet)
for some reason i started porting a hhvm parser to php 7. i am already regretting it
 
o/
@tereško fuck they nerfed stellaris's traditions
no more cheap stations.
 
Wes
1:54 AM
@ircmaxell i'm writing this, can it be useful? :B
    // other literals not available, must be defined in a variable
    "intLit":                   regex(/*...*/), // e.g. 42
    "floatLit":                 regex(/*...*/), // e.g. 42. or .42 or 42.42
    "boolLit":                  regex(/*...*/), // TRUE or FALSE

    "variable":                 regex(/*...*/), // same as a PHP variable, including the leading $

    "predicate_function":       alt(str("exact"), str("gt"), str("gte"), str("lt"), str("lte"), nam("variable")),
 
Wes
2:25 AM
    "verify_arg_wo_offset":         nam("predicate"),
    "verify_arg_w_offset":          seq(str("at "), nam("intLit"), str(" "), nam("verify_arg_wo_offset")),
    "verify_arg":                   alt(nam("verify_arg_w_offset"), nam("verify_arg_wo_offset")),
    "verify_args":                  alt(nam("verify_arg"), seq(nam("verify_arg"), str(", "), nam("verify_args"))),

    "verify_args_optionally":       alt(str("()"), seq(str("("), nam("verify_args"), str(")"))),

    "verify_call_begin":            seq(nam("variable"), nam("verify_args_optionally"), str(" was called")),
time to go to bed
actually good night
 
3:12 AM
Good morning
!!dad
 
What lies at the bottom of the ocean and twitches? A nervous wreck
 
I have a question.
I am now looking for new job,and almost all my previous work as freelancer are dead.So now what work should i put in cv?
I don't even have a single os projects on github to mention.
 
 
2 hours later…
5:01 AM
posted on October 21, 2017

New Cyanide and Happiness Comic

 
5:44 AM
@Linus I suggest to do more activities on SO and try to earn lots of reputations. It's a good thing, specially for you, since you don't have any work sample to mention in interviews. I personally was hired because of the number of my reputation on SO.
 
:) ok thanks i will give try to that.
 
 
1 hour later…
7:05 AM
mornings
 
@Wes yes that's a known issue which I am going to address today
it's an irritatingly complex problem to deal with, both because SE does a slightly weird thing with them and Twitter's API around external video is... weird
 
Anonymous
Yings
 
7:21 AM
lacist
 
7:32 AM
morning above 3 :P
 
7:52 AM
mornings ^
 
morns ^
 
 
2 hours later…
9:41 AM
@Linus last time I looked for a new job, all I had to do was give a link to my SO profile :D
 
@tereško :) you are talented one,and my SO profile doesn't have any answer which is worth mentioning.
 
10:24 AM
@tereško you can rent your SO account to him. You need to just change your avatar and nickname ..
 
....
 
10:41 AM
@PeeHaa remind gordon to file the number_format bug
 
 
1 hour later…
Wes
11:50 AM
\o
 
12:11 PM
mornign
 
Wes
o/
 
Anonymous
!!wotd
 
ducky Informal. fine; excellent; wonderful.
 
Wes
you are so ducky today @jay
i mean except your face
 
Anonymous
oh stop it you flirt.
 
Anonymous
12:25 PM
right. Fuck you.
 
Wes
boom.
ahahahha
<3
 
Anonymous
weekend working sucks
 
Wes
actual work? like, in office?
 
Anonymous
aye
 
Wes
:( deadline?
 
Anonymous
12:32 PM
Indeed. Agreed to a bonus if I hit it
 
Wes
not too bad then
 
1:00 PM
hmm ... I should ready do something productive
 
Wes
videogames? :B
 
naah
I need to figure out a safe-ish way to do authentication for async API
something that, if stole, does not provide an untraceable and quasi-permanent access
my "palladium" thing does not play well in async environments
 
Wes
dunno what that is :B but i'm the one that would still store passwords as md5 if i didn't read in here that is wrong
 
\o
Still do, keep trying to throttle the uppers to give me time to change it but they're not budging
It's very frustrating.
 
user1928251
1:18 PM
hi
 
user1928251
i need some help
 
evenings o/
 
user1928251
could you help me
 
user1928251
?
 
Anonymous
!!welcome AndreiClaudiu
 
1:19 PM
Welcome @AndreiClaudiu, please read the Chat Guidelines
 
just post your question, if somebody wants to help they will
 
user1928251
hi
 
user1928251
i guess they don't
 
user1928251
i got -2 votes
 
user1928251
when i use cookies in php i get an error
 
user1928251
1:21 PM
Notice: Undefined offset: 3 in C:\xampp\htdocs\shopremix\includes\header_menu.php on line 21
 
user1928251
this is because i exploded cookie values
 
post the code probably?
 
user1928251
but the var_dump of $_COOKIE is a strange array
 
That question looks right
[1]=> string(49) "Pantofi Ecoflex sport,RON,150.33,901.98,m,black,6"
 
user1928251
this is how i set cookie
 
user1928251
1:23 PM
setcookie($product_id, $product_name.",".$the_coin.",".$price.",".$total_price.",".$size.",".$color.","‌​.$quantity, time() + (86400 * 30), "/");
 
Because $product_id is the key.
 
user1928251
right
 
user1928251
look what i get
 
user1928251
of var dump
 
So what's the code in header_menu.php, lines 0-30?
 
user1928251
1:24 PM
array(2) { ["PHPSESSID"]=> string(26) "r2qunjc3hrdhrhd2tlm2j6hgdm" [2]=> string(33) "pantofi Saren,RON,150,600,l,red,4" }
 
user1928251
this is
 
user1928251
<!-- BEGIN HEADER -->
<div class="header">
<div class="container">

<a class="site-logo" href="index.php<?php echo $lang = isset($_GET['lang']) ? '?lang='.$_GET['lang'] : ''; ?><?php echo $coin = isset($_GET['coin']) ? isset($_GET['lang']) ? '&coin='.$_GET['coin'] : '?coin='.$_GET['coin'] : ''?>"><img src="assets/corporate/img/logos/logo-shop-remix.png" alt="All you need!"></a>

<a href="javascript:void(0);" class="mobi-toggler"><i class="fa fa-bars"></i></a>

<!-- BEGIN CART -->
<div class="top-cart-block">
 
you didn't actually read the guidelines
... oh well, off to the ignore list
 
user1928251
?
 
The guidelines show you how to format / share code (use gist basically)
 
user1928251
1:26 PM
ok
 
So your first key in $_COOKIE is the php session ID.
 
user1928251
yes
 
When you're running foreach($_COOKIE as $key=>$val) { the first iteration will be "PHPSESSID" => "somerandomstring"
 
user1928251
it should be an integer
 
user1928251
correct
 
1:27 PM
$piece = explode(",", $val); Will then be [0 => 'somerandomstring']
 
user1928251
it should be n integer
 
user1928251
right
 
$t_cost += $piece[3]; Will then trigger an undefined offset, because [3] doesn't exist.
 
user1928251
ooo wait
 
user1928251
first things first
 
user1928251
1:28 PM
when i set a cookie
 
user1928251
it works i get the correct values
 
user1928251
but when no cookie is set i get this error
 
user1928251
now go on
 
user1928251
because [3] doesn't exist.
 
user1928251
correct
 
1:28 PM
Yeah, because it only generates a notice
 
user1928251
right
 
Your script continues to run when it runs into notices, so it hits your second key/value (the one you set) and that works
 
user1928251
correct
 
user1928251
works but i still get the notice like before
 
user1928251
not at the seted one
 
1:30 PM
Yo my peeps, I have a question about calling certain functions inside of classes... Is it bad practice to call them without initiating the class? For example: class::function
Or should i first $class = new class; and then $class->function()
 
user1928251
i have no class
 
user1928251
just plain php
 
user1928251
control structures
 
user1928251
if else foreach
 
I mean I'm not really sure what you're doing because it's such an odd way to do it, but you'll want to write a check which skips cookie keys that aren't those products
 
user1928251
1:32 PM
no i don't know classes
 
@AndreiClaudiu not you man. I was asking about myself
Sorry about that
 
user1928251
aaa ok
 
Does anyone know?
 
user1928251
another notice about this
 
user1928251
it worked until
 
user1928251
1:34 PM
i made some link modifications
 
user1928251
and the modification is
 
user1928251
<?php echo $lang = isset($_GET['lang']) ? '?lang='.$_GET['lang'] : ''; ?><?php echo $coin = isset($_GET['coin']) ? isset($_GET['lang']) ? '&coin='.$_GET['coin'] : '?coin='.$_GET['coin'] : ''?>
 
user1928251
i dont know let see on explorer
 
user1928251
ie
 
For example you could prefix your product key with 'product_' . $productid and then in your loop you could write something stupid like if(strpos($key, 'product_') !== 0) { continue; }
 
1:35 PM
@Samuel you can only call static functions as class::function_name
to call a method on a function its required to instantiate the class first,
 
user1928251
ok
 
You can do, (new ClassName)->function_name(), to make it a one liner.
 
user1928251
product_id is a variable
 
user1928251
an interger
 
If this is a cart feature
 
user1928251
1:38 PM
anyway it doesnt work
 
user1928251
yes
 
I'd recommend you use $_SESSION instead
 
user1928251
made from scratch
 
So your data isn't exposed and editable by the client
 
user1928251
ooo
 
1:39 PM
It also means you don't run into data length limits like cookies do
 
user1928251
but the session values
 
What you would do is use a single session key and store all products in that key
 
user1928251
how do i set them how do they look?
 
user1928251
give me an briefly example
 
user1928251
short
 
1:40 PM
<?php
session_start();
$_SESSION['key'] = 'hello world';
echo $_SESSION['key']; // 'hello world'
 
user1928251
ok
 
user1928251
my products are based on id of the databse
 
user1928251
base
 
Yup.
 
user1928251
and they must cointain an array
 
user1928251
1:42 PM
with quantity price etc
 
user1928251
i could do that to a session
 
user1928251
and after explode the values
 
user1928251
?
 
Yup. Even better, use a data format / transport language like JSON
I'll write up a brief example.
 
user1928251
or can session contain array
 
user1928251
1:43 PM
ok
 
user1928251
i haven't worked with jsom
 
@AndreiClaudiu session can contain anything that can be serialize()d
it can contain arrays, and any object that is serializable
pretty much anything except a resource (i.e. anything with self-contained state)
 
Oh yeah I forgot sessions auto seriali[sz]e
 
user1928251
oo so serialize is...
 
user1928251
ok i got it
 
user1928251
1:45 PM
they dont lose any data right? wrong?
 
They will only allow you to store things that can be restored without losing data
 
user1928251
ok i got it
 
user1928251
looping through
 
user1928251
session[$key]
 
user1928251
using loops right
 
user1928251
1:46 PM
?
 
user1928251
because i need them all in a list
 
fundamentally, $_SESSION is just a magic variable in which you can store whatever you like. So if you make it an array, you can use it just like any other array
 
user1928251
i got it
 
but dont store unneccesary stuff in it
 
^ good point
 
although don't store prices as floats :-P
 
^ Yes
 
user1928251
great i got
 
user1928251
i thought setting an session for each product
 
user1928251
or it's a bad practice
 
user1928251
1:49 PM
?
 
you can only have one session
it's an array, so you can store as many products in it as you like
 
user1928251
and for the logged users
 
user1928251
?
 
but probably don't do that tbh
 
user1928251
and for the logged users
?
 
1:50 PM
well
 
If you set a session key for each product, you'll run into trouble later when other things want to use sessions.
 
session is unique to each users when it comes to products you'd be better off using a database
 
user1928251
session [exaple user]
 
It's easier to use one key where you know that key will only ever hold products / cart items
 
user1928251
got it
 
user1928251
1:51 PM
sure
 
@AndreiClaudiu a session represents, in general, a specific browser on a specific device
so each "user" will have their own session
 
user1928251
and if i want to unset an array from a session?
 
user1928251
??
 
unset($_SESSION['key'])
 
user1928251
ok
 
user1928251
1:52 PM
got it thanks about that sean great idea
 
user1928251
with sessions
 
user1928251
can i give a qualicative
 
ezy1978
 
o7
 
ffs
 
1:53 PM
uh oh
 
user1928251
?
 
@DaveRandom lol dat password
 
flight number
chat != google
 
user1928251
anyway thanks
 
is that easyjet?
 
1:54 PM
yeh, corfu -> man via, apparently, venice for shits/gigs
 
lol
I forgot was corfu east or west?
 
it's pretty much the closest point of greece to italy
 
ah
k
Can you throw a rock towards @Wes for me?
 
my sister in law is coming
 
@DaveRandom eeeeew
:P sorry
So immature
 
1:57 PM
you don't know the half of it
 
:D
!!should I first build an irc client or server?
 
You should first build an irc client.
 
I won't :P
 
Frontend is da best
 
I'm pretty certain you should do neither of those things :-P
 
1:59 PM
@DaveRandom I already started on the server couple months ago. Following the rfcs as close as I could
I ended up with a server that didn't work \o/
 
like, I'm all in favour of that sort of thing but seriously IRC is properly useless
 
i somehow have two microsoft software development kits
 
Wes
how are you planning to test the irc client or server :B @PeeHaa
 
if you truly need IRC integration.
 
2:00 PM
Oh here you go @DaveRandom, the stack from a few days ago
 
Wes
aren't there better protocols these days than irc though?
 
@Wes presumably by connecting to random channels and just posting "sorry, got d/c" every 5 minutes
you know, the regular way people use IRC
 
@Danack Not so much need for integration. More like an itch I have been wanted to scrtach
:P
 
@Sean ty
looking now
 
@Wes Yes by using it
 
2:01 PM
> PHP Notice: Undefined variable: handler in S:\projects\jeeves\vendor\room11\stack-chat\src\Room\Connector.php on line 48
 
Is it normal for yielding / generators to just eat exceptions?
 
wat
 
Wes
:B
 
@Sean The issue is when you don't yield the promise (or register an error callback)
 
oh that's just me with bad try / catch
 
Wes
2:01 PM
unrelated, does anyone know what yield break; means in hhvm?
 
        } catch (\Exception $e) {
            echo (string) $e;
        }
        yield websocket($handler, $handshake);
 
@Wes Same as return in php I would guess
 
@Wes 'To abort a generator sequence, use "yield break".'
 
Wes
oh
 
@Wes ooooh wait
ha
:-)
 
Wes
2:04 PM
rofl
 
Sorry I am slow today
 
Anonymous
> today
 
Wes
he was silent observing waiting for burn opportunities ^
 
:P
@JayIsTooCommon Go back to work bitch
:D
 
Anonymous
finneee
 
2:05 PM
<3
 
en.reddit.com/r/lolphp/comments/77kssu/… - I like how people are reduced to complaining about how PHP doesn't work correctly based on it not being a completely different language.
 
Wes
@PeeHaa there's something that might interest you doing for the test thingy and that is almost completely unrelated to the things i did so far. a language for the assertions that is not as shit as the fluent api. i am writing the grammar :B
 
@Wes That means writing a parser for it?
 
Am I on the wrong track here? restoreRooms is called outside the amp loop, following the stack up it just returns promises, doesn't yield
 
I see :)
 
2:08 PM
@Sean so how do I repro this, just with invalid credentials?
 
@DaveRandom Aye
 
Wes
i was hoping to use ircmaxell's but seems harder to understand
 
k, give me 10 mins I will try it
I will find the problem and then I will try and explain it to you @Sean, because right now I'm not seeing any issues :-P
 
Excellent, that would be helpful :p
 
2:09 PM
@Sean you ever work with async/await in JS or C#?
 
Dabbled with it in JS but not enough to know much
 
imo it's waaaaaaaay easier to understand the generator hack in PHP if you understand the async/await pattern properly
since all PHP is really doing is using generators to emulate async/await
yield === await
 
I've read the blog ports by NikkiC
if that helps
 
but you don't have to mark the function async in PHP
 
I roughly know what it is and how amphp roughly does it
 
2:11 PM
tbh I only really understood that post after I understood async/await
but that's just me
 
I did have to read it about 10 times
 
@ToukaXKaneki that, in a way, is the root of the problem
with async/await, you are explicitly declaring what you want to do
without it, the async is implicit and the code becomes a lot harder to read
I especially like it in C# where you have the explicitness of exactly 3 possibilities:
 
true, indeed. I find async in JS much nicer solely because there are language constructs of asynchronous things
 
async Task foo() <-- foo has an asyncronous body and returns a task that can be awaited
async void foo() <-- foo is an async entry point, crucially any unhandled exceptions in there will crash the program
 
With amphp, if you call resolve before the loop will it start on the loop or before it?
 
2:14 PM
Task foo() <-- foo returns a task, but is not itself asynchronous
they are 3 distinct scenarios, and it's hard to distinguish between them when reading PHP
and I personally think it makes PHP async code harder to understand
 
Wes
@PeeHaa actually we should first decide if string based assertions are better than fluent
right now fluent is getting messy
it could be probably improved though...
 
@Sean moment, let me go make some tea
 
Hahah
marks as spam
 
Anonymous
@ToukaXKaneki I don't think that's supposed to be a question
 
2:17 PM
Same
 
Wes
what a spammer @ToukaXKaneki marcio is a pro, don't piss him off please :B
 
Anonymous
> much harder to get right
 
That changed the meaning of the sentence
 
Wes
kids these days so annoying
 
Anonymous
I'm going for a wee.
 
I do wonder how many sub packages are only used in one package.
 
Wes
i see php is slowly turning into npm projects
 
yep
 
I'm burning a DVD
I feel so old-school
 
2:26 PM
retrodave
 
that's so '00s
 
I'm also somewhat surprised to discover that I still own blank DVDs
@Sean firstly, I cannot repro the swallowed exception. For me it does at least get error output
although somewhere there is an unwatched promise
 
Wes
@DaveRandom you should recycle it. it's mostly plastic
 
configure options – #75411
 
Wes
:B
 
2:29 PM
@Wes composer show -i -t for extra effect :P
 
Wes
lol
 
bizzare
 
btw, is putting ketchup on a pizza, a bad thing?
 
Wes
yes
 
:( it didn't taste all that bad tbh
 
Wes
2:41 PM
 
OK @Sean I found it
 
evening room
 
not really sure how to sanely deal with it
/cc @PeeHaa
that promise isn't watched
and it does on my system
is it possible you did something weird with your STDERR that swallowed the output @Sean?
/me has to go to the airport
bbiab
 
[2017-10-21 14:42:41] Listening on tcp://0.0.0.0:1337
PHP Notice: Undefined offset: 8 in S:\projects\jeeves\vendor\amphp\dns\lib\DefaultResolver.php on line 632
Huh.
Cleaned vendor and reinstalled
 
01:00 - 15:0015:00 - 00:00

« first day (2562 days earlier)      last day (2389 days later) »