« first day (1854 days earlier)      last day (3091 days later) » 

12:44 AM
@NikiC one other issue with using use… it only applies to closures. I had hoped to allow any valid callable.
 
1:03 AM
@Sjon how long are 3v4l links valid for?
 
user895378
@rdlowrey is largely a reference-free zone.
3
 
1:40 AM
morning all
 
1:54 AM
@rdlowrey Rightfully so, good chap.
 
2:31 AM
@bwoebi Did you have an issue with PHP complaining about not being able to find iconv after upgrading to El Capitan?
 
Abe
couldnt sleep - couldnt work. groan
 
2:49 AM
@DaveyShafik I was looking over your Upgrading to PHP 7 book that you published and I had a quick correction: the division operator does not throw DivisionByZeroError when the denominator is zero. It raises a warning and returns either NAN if the number is 0 or INF if the numerator is non-zero.
s/if the number is 0/if the numerator is 0
 
Abe
3:12 AM
Today in Geek History: Happy 25th birthday, World Wide Web! Sir Tim Berners-Lee published his WWW proposal in 1990. https://t.co/Z031nloc0O
 
3:48 AM
Happy Friday all :)
 
4:15 AM
@Abe same here :/
 
Abe
4:41 AM
it's annoying when happens
but i managed to work a bit now
 
good morning
 
Abe
o/
 
Abe
how you doing with the new job? :D
 
morning Orangepill
 
4:45 AM
good morning
 
Abe
writing about programming is so hard (i mean, unless you want to sound dumb) :\
 
Sounding dumb is easy... I do it without even trying
 
Abe
also, i personally dislike reading about obvious things. there must be a better way
i should start a blog with code snippets only in it :D
 
didn't you already do that?
 
Abe
i tried in fact
i have 8 drafts of articles i will never finish :B
 
Anonymous
4:58 AM
@Abe if you want to start a blog, then let me know
 
Abe
i already did, 0 articles published
i published one but i changed my mind about it, so i deleted it :D
 
Anonymous
:)
 
It's been a while, and php 7 is already released?
 
Anonymous
not yet
 
Owh, I've just woke up from a very long hibernate, last time I remember it's v.5.3
 
Anonymous
5:08 AM
that was a long time ago
 
Yes..
 
moing
 
5:21 AM
happy friday!
 
Anonymous
 
5:32 AM
moin
 
Abe
morning! how did you sleep today? :D
 
Anonymous
huh?
 
Anonymous
developers don't sleep
 
5:48 AM
up at 3 again @Abe
 
Abe
@JoeWatkins i woke up at 1am, if that makes you feel better :P
 
did you go back to sleep ?
 
Abe
i don't care as long i don't have meetings with clients etc
nope @JoeWatkins
 
5:56 AM
then yes, your suffering makes me feel a little better ...
 
:p
'morning
Abe, I suspect your hardly human
 
Abe
lol. i'm not suffering. i do what i want
 
I rarely log to not see you there
 
Abe
i sleep when i want to sleep, i work when i want to work
unless clients. but gotta pay bills sometimes
 
buddhism at it's best
 
5:57 AM
:)
Abe i do the same
 
And in fact I put some thought on what you said about how I should not be using mustache @Abe. Do you actually mean I should be able to use an object with a php template in pretty much the same way I can fill the public properties and functions of a view object in a mustache template?
 
Abe
fun fact: i have a client that no matter what time he calls me, he apologizes in advance if he woke me up. he knows me
@FélixGagnon-Grenier correct
php is a good template engine
 
hmmmm.....
I guess I've some work to put on my renderer
 
Abe
<? foreach($this->getData() as $stuff){ ?>
<li><?=h($stuff->getName())?></li>
<? } ?>
 
yeah this I can do
 
Abe
6:03 AM
h() escapes html
 
it's more like the ease of use of

<li>
{{name}} <--! name being am object property -->
</li>
which I'm not really at
 
Abe
i prefer php
 
I've no strong opinion on it
 
Abe
because sometimes you gotta do shit in the template, and you need a proper programming language for that, not mustache
 
yeah, I was somewhat struggling with that today. but managed to do what needed to be programmed before feeding it to mustache
I might not have really complicated use case though
what really strikes me is most of the time, the difficulty I have with any templating "language" is the design is flawed
*the design of my codebase
 
Abe
6:08 AM
for example?
 
I had a loop to be done, which in mustache resolves to

{{#entities}}<li>{{.}}</li>{{/entities}}
which would list a one dimensional array into a list
 
Abe
i have no idea what that does
 
$renderer->render('{{#entities}}<li>{{.}}</li>{{/entities}}',[
    'entities' => [
        'foo',
        'bar',
    ],
]);
 
Abe
entities is a variable or a mustache thing?
 
would produce a list with foo and bar
I struggled because I was transforming a huge spaghetti procedural code towards objects being fed in a mustache template
but as soon as I encapsulated things correctly, it becomes much easier to produce loops and different type of data
 
6:15 AM
Does anyone know how I can make multilanguage laravel 5.1? I did not find usefull package or documentation. I tried kiberzauras but it did not work. Thank you.
 
in any event, I must not be making lots of sense right now. me thinks steam is calling. l8ers
 
Abe
> encapsulated things correctly
how so?
you didn't change your model just to fulfill the template needs, right? :D
 
no :p
it wasn't a model to start with
 
Abe
and what is it then :D
 
one long function, doing everything, from db calls to templating, with hardcoded html within business logic
like, the exact opposite of oop
 
Abe
6:23 AM
lol, i'm not actually understanding you. if that's humor it's a bit too scary :D
 
Can some one explain to me how PHP rounds numbers using round() i did this piece of code:

$sum = (2*pi()) / (rand(5,10)*(0+1)*60*60*1000);
echo $sum.'<br/>';
echo round($sum,5);
and get this result:

2.90888208666E-7
00
why does it round to 00
 
if only it were humor. imagine a html "template", with characters like ~, ^ and | within it to mark breakpoints.
then, imagine exploding this template on those characters and storing it in an array
 
Abe
lol
 
it's not over.
 
Abe
anyway, i'm giving up at understanding... but seems something you can solve by using CQRS
 
6:26 AM
we
well, it's pretty much irrelevant in all, and I've lived to learn better
 
Guys, I have a problem , I try to read a json arrary and when I try to read it using a foreach loop, it gives me the value 0
why is this problem occuring ? any idea ?
 
json decode it
 
nice 'stache
 
its Movember :P
 
i did that
 
Abe
6:27 AM
my 'stache's better
texas special 'stache
 
problem with 'staches is I forget I have it on. Then I start looking people in the eye and speaking seriously.
 
@Dave : Here is my code : pastebin.com/VNGmvpnc
 
should you not check before your line 7 that such data exists
how do you know this $obj->train->days; is legit
you should print $obj
and check it's structure
that might give you a clue on if you decoded properly. and then it might be that your not recieveing valid json data
 
yes it exists properly coz other keys are being decoded properly
only this is causing trouble
 
so name number and classes is fine?
 
6:33 AM
@Dave : Wait i will show u the full code
Here is the full code : PHP code : http://pastebin.com/Xbeg56MK

JSON data : http://pastebin.com/cKEQRj2Y
 
you need to be using is_array
before you access [0]
thats asking for trouble if you don't verify first
 
I see
$train_running_days = $local_obj->train->days[0]->day-code;


echo $train_running_days;
This line was just for checking
and it also resulted in a 0 value
 
print_r($local_obj->train->days)
see if you get an array
 
ok i will do
 
print is much better than echo for checking these things
 
6:39 AM
Oh thanks for the info :)
I get this array
Array ( [0] => stdClass Object ( [runs] => Y [day-code] => SUN ) [1] => stdClass Object ( [runs] => Y [day-code] => MON ) [2] => stdClass Object ( [runs] => Y [day-code] => TUE ) [3] => stdClass Object ( [runs] => Y [day-code] => WED ) [4] => stdClass Object ( [runs] => Y [day-code] => THU ) [5] => stdClass Object ( [runs] => Y [day-code] => FRI ) [6] => stdClass Object ( [runs] => Y [day-code] => SAT ) )
when i try to print the runs value it prints but not day-code
I dont understand where it is going wrong
 
you using for loop on day-code
given you are using for loop on $train_running_days
and according to that day code just has the value SUN
 
$train_running_days = $local_obj->train->days;
I changed the code to this also and it doesnt work either !
 
$train_running_days = $local_obj->train->days[0]->day-code;
not from that ^
 
@Dave I put like that for testing bro !
to test whether the value sun prints
but it also gives 0
 
in your script i don't see you assign it back to ->days
after your echo
pastebin.com/Xbeg56MK line 21 u assign to day-code
but then no line did you put it back to days
 
6:46 AM
ya i tried that too
see here
see the proper code and it doesnt work either !
 
hmm not sure my guess is something odd by your globals
 
globals making the problem ?
I suspect the hyphen in the json might be the problem !
 
@RizwanAhmed good point it might be considering it as an operator
change them to underscrolls
 
@Dave : Okay ;) I will try and let you know !
 
or using ['something-something']
 
6:56 AM
okay :)
 
i think that will prevent the clashing
 
Why would composer do this to me?
http://stackoverflow.com/questions/33687435/laravel-composer-unable-to-register-service-provider
 
@Dave : I tried but I guess I am doign something wrong can u please guide me ?
@Dave See here what I found : stackoverflow.com/questions/13869627/…
@Dave : Brother it worked ! echo 'Passenger &nbsp;'.$trn_running_days->{'day-code'} .'</td>';
this made the trick !
 
7:17 AM
Hrm, what's the difference between a completely black star or a star with white filling? I mean in the stared messages?
 
Abe
white it's pinned messages by room owners
black are messages starred by users
 
ah
Thanks @Abe
 
posted on November 13, 2015 by nlecointre

/* by ryval49100 */

 
I really love your name btw, it makes me chuckle. (Abe = Monkey in danish)
 
Abe
lol. kinda fits
 
7:23 AM
lol, but seriously, I always end up imagining a monkey sitting and coding and then getting angry when it doesn't work.
 
Abe
sounds accurate
:D
 
(just to be sure, am not referring to you but simply your name :P)
 
Abe
no, that's exactly me xD
 
lol xD
Does your salary consist of bananas then? :P
 
Abe
now you are pushing it too much. but yes :D
 
7:26 AM
Sorry ^^
 
ah, friday
 
7:50 AM
Indeed, now I can finally play FO4 all night!
 
@Epodax :/
 
@andho ?
 
Too lazy to buy and download because something wrong with my debit card
 
lul
 
 Could any buddy tell me how to get both indexes of round parenthesis from url?

        $url = 'localhost/melomap_music/singers/details/760/test%20(test)';
        $string = urldecode($url); //localhost/melomap_music/singers/details/760/test (test)
        $pattern = "/.*\(([^)(]*)\)/";
        preg_match_all($pattern, $string, $matches, PREG_OFFSET_CAPTURE);
    print_r($matches);//Array ( [0] => Array ( [0] => localhost/melomap_music/singers/details/760/test (test) [1] => 0 ) [1] => Array ( [0] => test [1] => 50 ) )
 
8:01 AM
good mornings
 
8:17 AM
0
Q: Programming 50% planning and 50% realisation?

AspergerSo 3 months ago I started learning how to program in the front and back end (HTML5, CSS3, Javascript, PHP, MYSQL). I pushed myself to understand the raw language without any help of third party plugins. The result is amazing as this opened the door to understanding the deeper architecture of web ...

Maybe you guys could enlighten me as well : )
 
@Danack until the end of time; or the Internet; or 3v4l, whichever comes first
 
8:41 AM
@Trowski mh, I had that issue with each version upgrade AFAIK… just install everything into /usr/local/ ...
And well… somehow I now need to manually set LD_PROGRAM_FLAGS to include -L/usr/local/lib currently :s
 
HAPPY REBACCA AAAAAALLLLLLLLLL!!11111!
 
Shit.
 
8:59 AM
@rdlowrey indeed… I added 100% of the references…^^ but uhm… could you please admit that they indeed make life easier where I used them? :-P
 
Abe
@PeeHaa just googled chewbacca black friday
results were unsatisfying though
 
9:18 AM
@Abe Really? That sounds like a huge missed opportunity
 
in here
how i use the autoload.php
with spl_autoload_register()
I didn't see that Zend structure have the autoload.php
anywhere ?
 
@JoeWatkins where did phpdbg.com go?
 
@Gordon how can i use autoload.php with spl_autoload_register() in above zend recommend structure ?
 
@underscore I haven't done any ZF in five years
 
can you just look into the structure and tell ?
 
9:38 AM
@underscore I dont know what you got in your autoload.php, but you likely want to require it in your bootstrap or index.php
 
i want to store autoload.php in my structure
i have no clue about where to store it
can you suggest somewhere?
it's not mentioned in the structure guide
 
I think you are concerning yourself too much about that detail. just put it wherever you see fit.
 
ok thanks :)
 
application folder sounds good to me
or project root
 
9:52 AM
@DaveRandom hm, dodging PHPNW probably for the best then, glad to hear you're doing better.
 
@DaveRandom Glad you're better, even though you don't seem to be replying (have you blocked me??)
 
hey guys. What's the recommended way to phpdoc $this in a trait?
 
Don't use traits -> problem solved
 
they do make sense sometimes, at least from what I can tell :)
 
I would use composition instead
 
10:01 AM
posted on November 13, 2015 by nlecointre

/* by MonsieurLeMarquis */

 
and here I go reading again
oh, yeah you're probably right
 
@Gordon let it expire, better to document on php.net ... that's what everyone wanted ...
 
@JoeWatkins but it's not documented yet afaik
 
ah right, that'll be the first thing we fix ...
should link to internal section ...
will stick one up over the weekend ...
 
thanks!
 
10:16 AM
@DaveyShafik You can allow any callable. People who need extra data will either use a closure or a method (which also allows extra data via the object)
 
10:39 AM
@PeeHaa We're weeks away from letsencrypt.
 
Was just reading that \o/
 
> Encryption: SHA1/SHA2
 
@kelunik What's wrong with it?
 
It's just the digest hash, doesn't have anything to do with encryption.
 
Ah yeah I assumed that yeah
Send them a mail to complain :P
Do you people als notice that phpstorm tends to keep the focus when clicking on some other window or is it just me? It happens a lot to me that I edit something, click on my browser and try to refresh only to find out phpstorm still had the focus
Or am I just seeing things?
 
10:52 AM
@PeeHaa I didn't have this.
@PeeHaa Ahh nope, too lazy.
 
@kelunik :P
@kelunik Hmmm maybe I'm just retarded and click miss a lot
 
@PeeHaa this ;) j/k scnr
 
@Gordon Why was I expecting that... :P
 
@PeeHaa experience?
 
Dayum son you're on a roll :D
Let me just put this here:
 
11:03 AM
Guys I am having some problem with decoding a JSON object. I successfully decoded it but when I try to access the elements only NULL values are returned can any one help ?
here is my code :
$train_number = $_POST['train_number'];

$route_jsonurl = 'http://api.railwayapi.com/route/train/'.$train_number.'/apikey/icgif9974/';


$route_json = file_get_contents($route_jsonurl);
$route_obj = json_decode($route_json);



echo $route_obj->train->name;
 
@RizwanAhmed Show the json plox
 
here it is
when i try var dump I get the object details but couldn't read its contents ! It is quite weired !
 
Cannot repro with shared code + example json string
 
can some one plz help me out to solve this:
http://stackoverflow.com/questions/33514840/how-to-draw-a-shape-using-a-piece-of-image-in-php
 
@RizwanAhmed Works for me ™
 
11:08 AM
if u try to put the json in a file and try it works
but from the url it doesn't
 
@AnshulMishra What's wrong with existing answers
 
@PeeHaa I actually need an Image, current answers are good I can use them for now, but can't deliver that solution
 
@PeeHaa : Try using the url It won't work !
 
I am trying to do this with any gd library
 
11:10 AM
@RizwanAhmed Again Works for me ™ :-)
 
@PeeHaa Which url?
 
@PeeHaa Okay I will see !
 
@AnshulMishra ?
 
okay Thanks, I have attached a link in the question with working example that exactly I need
 
You should be able to rewrite the css/js solution to a gd solution
 
11:12 AM
Mornings
 
Yo nullpony o/
 
Hmmm I did not get you
 
Yo \o
 
Well you seem to have a client side solution. Take that approach and do the same on the serverside with gd
 
@PeeHaa It doesnt work when I try to provide the train number dynamically
 
11:14 AM
"It doesnt work" is not a problem description
 
$train_number = $_POST['train_number'];

//$route_jsonurl = 'http://api.railwayapi.com/route/train/'.$train_number.'/apikey/icgif9974/';

$route_json = file_get_contents('http://api.railwayapi.com/route/train/'.$train_number.'/apikey/icgif9974/');
$route_obj = json_decode($route_json);
I tried like this
doesnt work either !
 
Well I have tried a lots of gd library but I am not getting any way to do this with php
 
Lots of gd?
 
I mean the functions of gd libraries
 
i get the train number via post !
 
11:16 AM
In simple words I am unable to catch the logic behind this
 
Anyways later I am on mobile with 2g internet :(
 
@PeeHaa I found out the problem, unecessary space is coming when I include the string in the URL
Rizwan Ahmed
80
$train_number = $_POST['train_number'];

//$route_jsonurl = 'api.railwayapi.com/route/…'.$train_number.'/apikey/icgif9974/';

$route_json = file_get_contents('api.railwayapi.com/route/…'.$train_number.'/apikey/icgif9974/');
it prints like
api.railwayapi.com/route/train 12295 /apikey/icgif9974/
 
Hi all, i am trying to display an image slideshow inside bootstrap modal popup and it is working fine, but if i reduce the browser size the popup is not showing exactly at the centre of the screen. What css should i apply????
 
before and after 12295 space is coming have to remove it any ideas ?
 
Hi all, i am trying to display an image slideshow inside bootstrap modal popup and it is working fine, but if i reduce the browser size the popup is not showing exactly at the centre of the screen. What css should i apply????
 
11:23 AM
Happy friday
 
o/ Happy fridai
 
@PeeHaa : I solved it bro ! Thanks !
 
np bruv
 
any suggestion to the above post??
 
11:31 AM
\o/ found a segfault with anon classes
aw., works with normal classes too :(
 
@Leigh Staph breaking php you asshole!
 
@PeeHaa I found time to tick something off my list, I have this lovely server sitting there doing nothing, and now the CPUs are maxed out with american fuzzy lop
 
@MadaraUchiha Do you need something whitelisted? /cc @PeeHaa
 
@kelunik Nope.
 
@Leigh Oh cool
 
11:34 AM
I get the feeling that active forum users are prioritized.
 
@kelunik I'm still thinking how I am going to handle certificates on my gitpi boxes
@kelunik brb posting rebecca links
 
@PeeHaa Do they have public IPs?
 
Probably not. Is it needed?
 
Yes, no static one, but they have to be publicly accessible.
 
Fuck :(
 
11:36 AM
How should it work otherwise? ;-)
 
Fuck if I know :P You are the expert :D
 
Instead you can use self-signed certificates and add exceptions to the users browser / ca storage.
 
Yes but that sucks
I was totally hoping I could somehow have proper validated certs :(
 
You can as long as the user can forward port 80 or 443 to your GitPis.
 
Damn, mailservers are an enigma to me
 
Anonymous
11:55 AM
why?
 
Anonymous
they are awesome and easy
 
Running Jenkins, trying to get it to email me when a build fails. Trying to sent a test email from Jenkins' settings and it keeps coming back with "Relay Access Denied"
I made a test php file on the server with a mail() call, and that works perfectly fine
 
<?php*1; not a parse error, ok..
 
Anonymous
I thought you meant an all-mail server
 
@Leigh Because it's not an open tag.
 
11:58 AM
@kelunik it is, actually :)
<?php*print 1; also works, (as to other arithmetic symbols)
 
php -r '?><?php*!;' just prints <?php*1;.
 
mine doesn't have a ?> though
 

« first day (1854 days earlier)      last day (3091 days later) »