« first day (2422 days earlier)      last day (2540 days later) » 
00:00 - 15:0015:00 - 23:00

12:05 AM
hello guys, i have a web service and i'm working on a android app. My question is, should i send the auth access token to user in header or body? What is the best pratice?
 
 
2 hours later…
1:40 AM
@bwoebi @NikiC If we had generator comprehensions how badly would you still care about short closures?
$generator = (for $xs as $x if $x % 2 yield $x);

$generator = [for $xs as $x if $x % 2 yield $x];
Something like this?
Obviously that won't cover all cases of closures but it covers quite a few common ones.
 
@LeviMorrison a lot
 
@Trowski good point, static is pointless here
@LeviMorrison personally i'd much rather have short closures than comprehensions
@LeviMorrison this code is pretty fugly imo
 
1:58 AM
(for $comics as $comic if in_array($comic['id'], $store) yield $comic['id'] => $comic['name'])

(for $comics as $comic
    if in_array($comic['id'], $store)
        yield $comic['id'] => $comic['name'])
 
shit. that's intense.
some ; wouldn't hurt, between the parts
 
Wes
2:12 AM
LeviMorrison so basically, just make parentheses optional?
foreach($comics as $comic)
    if(in_array($comic['id'], $store))
        yield $comic['id'] => $comic['name'];
and well, make it usable in expressions
fn() =>
    foreach($comics as $comic)
        if(in_array($comic['id'], $store))
            yield $comic['id'] => $comic['name'];
maybe like this
 
2:26 AM
morning
 
Wes
\o
 
o/
again office from today :(
 
Wes
isn't it saturday in india? :B
 
no, i just returned from long vacation's :P so no saturday for me
 
3:17 AM
@Wes It's basically for as an expression, yes.
It changes semantics a bit in that context tho.
@Sara \o
 
Wes
3:53 AM
wouldn't it be enough if done with fn() => foreach() ?
anyway, i'm ok for optional parentheses for if, for etc.
i would love to do for example if !($exp) to negate an expression, as opposed to the ugly
if(!($exp))
not sure how people would react to that
i would write stuff like if($bar) $foo = 2; without {} if people didn't complain about that :B
 
oh shit lol
 
@Wes for is still not an expr
 
I just killed my server with a something modulo hour
guess what happens at midnight
 
Wes
@LeviMorrison
(fn() =>
    foreach($comics as $comic)
        yield $comic->foo();
)()
it's not too bad. perhaps you could do also iife to the short closure syntax, like new class(){}
$out1 = 3;
$out2 = 4;
fn($in1, $in2) => $in1 * $in2 ($out1, $out2);
would that make sense?
equal to:

$out1 = 3;
$out2 = 4;
(fn($in1, $in2) => $in1 * $in2)($out1, $out2);
or something like that
 
 
1 hour later…
5:27 AM
omg. never have I ever felt that dumb... goal: divide a range of ids by 24th so that over a day everyone gets refreshed (like, at each hour, cron job refreshes one 24th of the entities)
actual implementation: id % $hourOfDay === 0 ? refresh : not
 
Wes
eh? @FélixGagnon-Grenier
shouldn't it be $id % 24 === $currentHour ? refresh : not
 
.... yes.
yes indeed, it should
thanks, asshole.
now I really feel dumb
fuck.
 
Wes
it's just luck, because i didn't understand what you wrote :B
 
:P
that's even worse!
haha
 
Wes
you probably need
to adjust the thing for 0
$currentHour should be in the 1-24 format
and $id should start from 1
 
5:36 AM
technically id should in effect start from one. and lol, I got the 0 hour division by 0 error an hour ago, so I patched some dumb boilerplate around it
 
Wes
:B
 
Hwy all
Hey**
 
yo. you can edit your messages.
 
Wes
yo.
actually you probably don't care about 0 as long it gets refreshed
 
I habe a really quick Q
 
5:38 AM
@Wes well, the % 0 gives error, no? or, what do you mean?
 
I'm drunk.. Bye
 
Wes
i mean $id = 0
 
Wes
% 24 should stay like that
 
Wes
5:39 AM
@developerbh ok
 
@Wes that's the actual (improved from your wise insight) stuff pastebin.com/QH1ziCcd
... yes I'm on a php 5.6 production box, sorry
 
Wes
    // not completely convinced hour will always be an int. let's be sure.
    $hour = (int)$hour;
    I love how you gotten rid of the visual debt there :B
 
hahaha
yeah, I'm trying hard :B
 
Wes
you should probably do the math thing in the select... unless it's just few records
 
sql can modulo? yes!
yeah, it's like a few thousand records, so no sweat, but sounds cooler
 
5:56 AM
@Wes shit that's actually waayyy cleaner! pastebin.com/Zmh6xPEd ta!
 
Wes
noice :B
 
:B
on that sucessful note, time for some heroes of might and magic 3
 
Wes
lol
thats old
get age of empires 3 @FélixGagnon-Grenier
 
lol. that's old too :P
ugh, not in sale atm on steam ;)
... funny how, now that I started actually paying for games, I don't realize anymore that torrents exist
 
:)
 
6:15 AM
Hi guys..Is there any way to open illustrator file and write some contents into it..It is possible???
using php??
 
Anonymous
no.
 
Really?
 
Wes
6:47 AM
you can write scripts in illustrator adobe.com/devnet/illustrator/scripting.html
good luck with that :B
 
i already tried that method but instead of that using php can able to generate that ai files??
 
Wes
HELP ME PLEASE. A MAN NEEDS HIS CLIMATE PROTECTED https://t.co/rbPCL2ocI4
 
ya thats good @Wes
 
@hameed define "write some contents"
you could absolutely "write some content" to a file, and then use the current OS commands/scripts to open that file with Illustrator.
 
ya thank you @Stephen
 
7:15 AM
!!dad
 
What do you call a sketchy Italian neighbour hood? The Spaghetto
5
 
7:29 AM
@Jeeves lool
 
@Linus If you could change your name what would you change it to?
 
@Jeeves chuck norris.
 
@Linus Woah! I don't believe you.
 
8:08 AM
posted on June 03, 2017

New Cyanide and Happiness Comic

 
@NikiC sure, but how much? Is it that significant?
@LeviMorrison array mapping ops are just a small part of it… well, depending on your coding style obviously…
 
Is this a right place where i can get help related to something in PHP?
 
@SahilGulati maybe
 
I am getting a very small issue
i am using this $f = fgets(STDIN)
it is working fine
but when i gave a huge input to PHP over cli
it breaks
I am working on HackerEarth where usually we have hug inputs to php
 
define "huge"
 
8:21 AM
okay
i have two digits 90
10000 times
separated by space
like this 90 90 90 90 90 ..... like this.
 
so 30K characters
what error do you get
 
when i input this character to PHP
it takes about 1500 characters approx
rest will be discarded
 
no error?
 
yes no error
thats the problem
here all the inputs got discarded saying this
90: command not found
i am exploding string over spaces thats it and printing it.
 
i think you have an error in your command
 
8:27 AM
you got it wrong
when i input
 
the shell is only passing ~1365 instances of '90' to php
 
Is it so?
 
the rest is being interpreted by the shell after php exits
 
Ohhh..
 
can you show the command you're using to call php
 
8:28 AM
i just use
php /path/to/php/file.php
then i input string to PHP file
 
how do you define the string
 
i mean the same string
which is 90 90 90 90 90 ...
 
where does that string come from
it sounds like there is an issue with how the shell is handling it
 
from standard input
 
are you sure it's just repeated '90 '
standard input is the way the data gets to PHP
 
8:29 AM
yes i have checked it.
 
where does it come from
are you reading a file
etc
are you literally typing "90 " 10K times on the command line
 
no i am doing copy paste
where all 90's are seperated by space
 
i would suggest you create a file
 
i have check them, all are seperated by space.
 
with the contents you want
e.g. 10K '90 ' strings
 
8:32 AM
i know that is perfect
 
and then try php file.php < file.txt
 
and it will work
 
right
 
then the problem isn't php
its a problem with your shell then
 
8:32 AM
here this site issues input to php which i can not handle?
yes i think so, the problem is with my shell..
 
i dont understand
 
anyways,, thanks... i will look into it more deeply
I was saying on that website which i have mentioned above provides input to my php code. and checks whether my code is fine or not.
 
@LeviMorrison Yes. Comprehensions only cover a relatively small part of short closure usage, imho
 
morni
 
o/
 
8:47 AM
so .. there was a gaming survey: roccat.org/en-US/Labs/Gaming-Report
2
 
hi, one question regarding ZEND_MODULE_GLOBALS_ACCESSOR. From what I understand, this is a protection for thread safety only in ZTS enabled PHP. And in an extension, each Request/Response is spawned as a thread. So that would mean, all the variables that are accessed with the GLOBALS_ACCESSOR should be initialized within the RINIT and cleared in RSHUTDOWN and should not be set/unset in MINIT/MSHUTDOWN. Is this assumption correct?
 
i recently played god father 2 :P
 
9:11 AM
@JayIsTooCommon pong
@JayIsTooCommon please read this
 
o/
 
\o yo Fabor
 
9:35 AM
o/
@FélixGagnon-Grenier yeah, been trying to avoid anything else than what Tiffany said
 
Where are you currently @Ekin?
 
Still in Turkey
You?
 
Still Vietnam. How's the temperature?
 
31 degrees today
 
o/
 
9:41 AM
-_-. I thought it'd be hotter there.
 
LazySaturDay
 
it's 12°C outside
 
It was even worse yesterday :-) I think it went up to 34
 
it was under 0 at night
 
We're at 38 now :'(. IE Stay in my AC'd bedroom weather
 
9:42 AM
I'll go outside in a few hours looking for a office chair, suggestions? :)
 
You know when you open the oven door and the heat blasts you in the face... That's what it feels like
@Duikboot I'm always a fan of bucket seat racing office chairs.
 
Yeah, mostly like those.
Gotta invest in your butt.
I've always been tempted by Kneeling Chairs, but it'd only be to rotate between that and a bucket one. My current chair is my bed :-/. No cushion chairs are like the only chairs in Vietnam.
 
Yes, but I have no idea tbh, what could be a good one, :D Such racing chairs are pretty 'heavy' ?
 
Dunno. I wouldn't say so. How often do you plan on lifting it up?
 
9:46 AM
If I have to sit on such kneeling chairs I'll go crazy in 5 minuts :D
 
Consider your own height too. If you're tall then you need proper height for the head/back support and such. Problem is you'll never know till you sit in one for many hours.
 
o/
 
\o
 
Hello PooHaa
!!wotd
 
athleisure: a style of clothing worn as athletic apparel but also suitable for casual, everyday wear.
 
9:52 AM
Sounds like one of those terrible new-age words.
"active wear"
 
/me goes to the beach, laters
 
@Fabor true indeed .
 
@Ekin Enjoy
 
How's the good life @Fabor?
 
Lazy. Good enough. Maybe feeling like I need to earn some money now :P
I miss buying things.
 
9:57 AM
:P
So you have indeed been living the good life :D
 
Yes, I've not a job in the world :P
How are things with you?
You rich enough to hire me to sit around all day yet? :P
 
:-) I would if I could you know that
I am actually looking for a real job myself too
Or a fake job also works :)
 
heh. Well you could make it easier for yourself and move to Asia. Then you just need to find a small job to sustain yourself
 
But that would mean I only will have time to visit people in here once a year like you ;-)
Where are you now btw?
 
Da Nang, Vietnam
heh. I'd be here more often if I was working.
 
10:06 AM
:)
So what have you been doing the last months?
 
Playing video games, basketball and things much less productive.
 
Sounds more fun than working anyway
 
heh. Yes but all play and no work... :) I did setup a company UnderOver
Going legit, try and get a business visa.
 
Nice
 
I need to get back in to things. There's upwork website but it's a struggle to get going.
My goal is still going to be earning ~$1000 PCM @ < 80 hours. I can drop my hourly rate but there's no real history of my work there so need some sort of portfolio I guess
 
10:10 AM
I have used upwork
Mostly for designers
 
Yeah, seems good but I need to get some job history going on it
 
Yeah that helps
 
10:34 AM
just a lame question when user update profile on profile page there is possibility that he does not update anything or update one or 2 thing.So my question does one update whole row every time user click update button or there is different and better approach to that?
 
Build User object -> persist.
 
o/
hello?
 
@Fabor could you elaborate that ,what do you mean by persist?
 
Save to DB. But it's subjective. Look at REST for instance.
 
@Fabor something like this stackoverflow.com/questions/2443324/… ?
 
10:46 AM
Yeah
 
thanks :)
 
@JoeWatkins Why you no on wiki.php.net/rfc/load-ext-by-name?
 
I have 2 git projects (same content in those projects). How do I move changes of one project to the other? I'm using git and IntelliJ
 
Not sure I got the point
Isn't the only thing differing there the extension directory?
 
10:56 AM
Yes afaik
 
Or is this about loading order prefixes?
 
Don't think so
Actually that is a thing
 
11:34 AM
morn
 
hey
 
it 1:36PM and I just woke up
 
Nice :)
I woke up at 12 because it was raining like crazy :P
 
11:52 AM
Which one is correct?
- I'm worried about sth
- I'm worrying about sth
 
sth isn't a word
 
I know, it stands for "something"
 
So you also know neither of those are correct
 
@PeeHaa you mean none of them isn't correct?
 
11:56 AM
@PeeHaa stop being a covfefe
 
@littlepootis :-)
 
@Shafizadeh Both are correct but mean different things. You probably want the first one
 
12:30 PM
dunno, based on the things he usually asks about he probably means "I'm worried about STDs"
 
12:58 PM
@DaveRandom that … wasn't very nice.
 
1:23 PM
but it was funny enough to be above the rude/funny line
May 12 at 11:57, by Danack
@Wes there's a funny to offensive ratio, like the crazy : hot ratio. So long as you're on the good side of the line, you're fine.
 
@Fabor why not just work through a company thats based at home and pay taxes there?
 
1:41 PM
good morning, I'm stuck at work on a Saturday
 
yay why (=
 
major upgrade yesterday-today, my part's complete but supervisor doesn't want anyone to leave until she confirms everything's working
none of what I do is left to test, in fact one of the things I need to test, I need to do from home, but can't leave yet
I guess I'll dink with making a front controller
 
I think a front controller could just a be a index.php (=
 
trying to separate PHP from HTML in this: gist.github.com/tiffany-taylor/3015f4d26aa795236e59c6639e232716
well, in index.php
 
yes I see
there are some small security issues with it, but I guess that is not that important atm?
 
1:49 PM
it'll be behind authentication, and the people using it won't know what dev tools are
 
Why the rot13 in there?
 
sec, let me pull the chat transcript
 
@Tiffany <fpevcg>nyreg(qbphzrag.pbbxvr)</fpevcg>
 
2 days ago, by Tiffany
I wanted to write something for web authors to use so they can create their own links (and stop putting in email addresses on the website because we get a ton of spam). I know they won't email me to ask me to convert it for them, so I figure giving them something to do it will make life easier.
 
Also xss as @RonniSkansing said
Why not hash it?
 
1:52 PM
Because our contact form system was written to use rot13
I didn't write it. @DaveRandom gave me some suggestions on how to hash it, I'll add it to the list of todos
 
oh
kaaaaaay
:P
 
well (= back to the front controller
 
I should keep a separate list of todos for the website separate from my "wish list" todos
four items on it, it's going to grow
 
:-)
 
The code is at least five years old and built on PHP 5.3
 
2:00 PM
Don't worry bout it. Keep haxingzh (=
Doing a refactor of the codebase?
 
I moved the code to a controller, and required it from the config.php, and required the config.php on index.php, but it loads at the top (obviously). What could I write to make it output below the HTML?
@RonniSkansing Slowly, I have to improve myself before I can really do anything good to the code because a lot of it is above my skillset, depending on how much vyvanse/caffeine I've had.
write a method that handles output and call it below HTML?
 
Practice makes perfect
 
indeed it does
 
So I am not sure exactly what you mean by that output html thing
 
I'd argue "practice makes better practice" but that's pedantic
I'll update my gist
 
2:11 PM
Thanks
 
I'm thinking of putting this echo as a separate method that I can call below the HTML, so that the output shows up below the form, instead above of the form
 
I think you should pull the html out of the index file
 
put it in a view, but how do I access it?
 
is this the entirety of the app with one controller?
 
yes
 
2:17 PM
okay
you could make a small switch if thing
look at REQUEST_METHOD and REQUEST_URI
 
!!doc request_method
 
and call different controllers depending on if it's a POST and the url
 
I'm lazy
dammit @Jeeves
 
@Tiffany How did you come in to that conclusion.
 
so you make one controller for spitting out the html
and one for handling the POST request
 
2:18 PM
oh, it's part of $_POST
 
you should look into silex silex.sensiolabs.org, no need to implement that stuff yourself
 
the method and uri thing will tell you /the/uri and if it's a GET, POST, etc
 
@Rovak I'll be integrating this into a site that doesn't use a framework already, I'd rather not add it to the mix
 
@Patrick Hard to find part time remote tbh
 
ah ok
 
2:20 PM
Granted right now I'm just messing around with the code I wrote to see how I can improve it, so I could probably use a framework
I appreciate the suggestion though :)
 
@Tiffany you can find the request_method and uri here php.net/manual/en/reserved.variables.server.php
 
thanks
so in the config, it would do the checking?
 
nope the config would only include configuration
 
our config file is convoluted then
lol
I was using it as an example to write mine
it does autoloading and stuff
 
maybe instead have a bootstrap.php file or etc
which is included by the index.php
 
2:27 PM
mmm, that makes sense
 
The bootstrap includes you config file and for now, the routing (checking method and uri) and dispatching to a controller (calling a method to do something like output the html or handle the post requst)
and if you dont have any config, maybe you do not need the config file for now
 
yeah, I just renamed the config file to bootstrap, I probably won't have any configuration in this
@RonniSkansing could I bother you for an example of how I would use it? I don't want you to write the code for me, but I learn best by seeing examples of how it should work.
 
@Tiffany moment, it will be a very quick naive implementation
 
that'll work
 
@Trowski Improved the parser speed by 13% by inlining the parseSingle method for everything except array responses.
@bwoebi We can do that, but doing that is just wrong. ^^
 
I'm not even really sure what he really wants…
 
Me neither?
 
@bwoebi Running it and automatically having it run in the background, so a fork + disown.
Like atom . just opens Atom and immediately returns.
 
@Tiffany so gist.github.com/RonnieSkansing/04ff676a5c45c084ee99e576e4d8f7ef is a extremely naive implementation that has alot of flaws, but I hope you can catch the direction compared to the code you had or our convo.
 
2:52 PM
@RonniSkansing thanks
 
well, just run a small snippet running in the background which calls aerys then … not sure what we have to do with this. @kelunik
 
I need to find something that explains routing in a more thorough fashion.
 
I'll read it when I get home, I can go home finally
 
00:00 - 15:0015:00 - 23:00

« first day (2422 days earlier)      last day (2540 days later) »