« first day (1559 days earlier)      last day (3392 days later) » 

12:01 AM
@AndreaFaulds function set(array $keys) { return array_combine($keys, array_fill(0, count($keys), NULL)); }
 
@bwoebi that's the way to do it
 
@bwoebi Yeah, but I can't use that as a constant :(
 
@AndreaFaulds use define()?
 
@bwoebi Class constant.
 
@AndreaFaulds That's what I was thinking, but why a constant? Why not a variable?
 
12:03 AM
@AustinBurk Because it's constant...
 
@AndreaFaulds .0. (It all makes sense now?)
 
@AndreaFaulds use that uopz thing
:-D
 
@bwoebi what?
 
@Aus
@AustinBurk - how to reach this leave, to I have to iterate from the beginning? don't know how to go one step deeper...mhhh
 
@AndreaFaulds that ext from Joe, you know…
 
12:06 AM
@bwoebi hm? haven't heard
 
how'd he ping me with only the first three letters of my name?
 
that thing…
 
@AustinBurk SO chat supports it, I keep forgetting
 
I've gotta go, see ya
 
12:10 AM
seeya
 
12:22 AM
by the way
why can't variables start with a number?
e.g. $0
 
12:50 AM
because we have the same regex for everything
and well… try to imagine a constant starting with a number…
 
1:03 AM
@bwoebi well we shouldn't
 
why not?
 
1:17 AM
@bwoebi because there's no good reason not to allow $1
 
user895378
Finally fixed a bug today :)
 
@AndreaFaulds It'd break regex
 
user895378
It's one of those days.
 
@AndreaFaulds $0 = 1; $0++; that would look incredibly weird.
 
@bwoebi WHY ARE PEOPLE USING DOUBLE QUOTES FOR REGEX????
@marcio not really
 
1:23 AM
@AndreaFaulds is there any language that allows variables names to be just numbers? BTW, it gave me one idea to have named parameters without make variables name part of the api.
but it's probably the worst idea ever.
 
@marcio don't know, but most languages lack sigils
 
$0, $1, $2... could be an interface to access function arguments independently of the names:
nah, stupid idea, still wouldn't help with named params as it would make code looks confuse with $1, $3 etc.
 
@AndreaFaulds to include variables
@AndreaFaulds I btw. always use double quotes… or nowdoc.
 
@bwoebi oh god why
 
why? what why? :-P
 
1:32 AM
@AndreaFaulds think replacements
 
@PaulCrovella don't use regex :/
 
 
2 hours later…
3:23 AM
I am hoping someone can help me understand a small piece of code I have been trying to figure out for a while... It is to find a fibonacci number by giving it the place you would like starting at 1. What I can't figure out is how it is actually doing it.

function fib($n) {
if ($n <= 2) {
return 1;
} else {
echo $n-1 + $n-2 . "\n";
echo $n . "\n";
return fib($n-1) + fib($n-2);
}
}
$n = 8;
printf("fib(%d) = %d\n", $n, fib($n));
it destroyed the formatting
so i want to find the 8th fibonacci number. So in the order of things "8 <=2" so it will jump down into the else statement and thats where I get lost
 
That doesn't look like any language I recognize.
 
it is php
 
5 messages moved from Lounge<C++>
 
 
2 hours later…
zan
5:02 AM
Good Morning
 
 
1 hour later…
6:03 AM
is the exclamation point
if (! $_FILES['image']['error'] && $_FILES['image']['size'] < $max_file_size) {}
the same as
if ( !$_FILES['image']['error'] && $_FILES['image']['size'] < $max_file_size) {}
or ?
 
6:17 AM
@this.Tony yes
 
@PaulCrovella so if its the same how come people dont go with the !$_FILES instead of ! $_FILES?
 
@this.Tony it's just a stylistic preference.
 
@PaulCrovella oh okay. thanks for your response!
 
7:12 AM
morning
 
Hello All Morning
 
i am facing an error "no video with supported format and MIME type found. What does this mean and how can I change this" when i am using my site on mozila
can any one please help me for this
?
 
Unable to understand, would be great if you ask an question on stack..
and give us link here
 
here i am facing the error
 
7:27 AM
@Prabhash add a webm version of the video, you can't get away with just a mp4
 
i am not getting any error.
 
check on firfox mozila
 
posted on January 22, 2015 by kbironneau

/* by AdminSys */

 
i am using joomla so please give me details about webcam how can i use this @PaulCrovella
 
it's working fine on mozilla firefox version 35
 
7:34 AM
it does not work for me.... @AmmarHayderKhan
 
@Prabhash I didn't say anything about a webcam. Google "webm" and do a little research.
 
moin
 
morn, @JoeWatkins
 
8:15 AM
good morning everyone!
 
why can't we do try {} catch ($e) {}...
 
pokemon isn't supposed to be that easy
 
I can think of a good reason not to have that ...
catch-all blocks are a bad idea, giving the language a way to make it easy to do something really stupid seems like a good reason not to do it ...
 
good mornings
 
8:23 AM
the fact that the language has many ways to do many stupid things shouldn't influence our decisions ... maybe there wouldn't be so much wtf if we adopted that attitude ...
 
@PaulCrovella LOL
Morning chaps!
 
8:47 AM
I wish I had epitaph like this :-P
 
mornig
 
9:03 AM
morning quick question for any users of laravel, I have a login and wish to use sessions what is the best way to keep session active (efficiency and secure).
ie. should I use database, cookies etc?
 
@Dino both...
I suggest to look into how sessions work first
 
Morning
 
morning fapore
 
what the best webhosting server to upload my website and MySQL db on localhost
 
@JavaFan :|
 
9:06 AM
would using db sessions, potentially mean unnecessary hits on the db
 
I like that some guy on reddit starts a Gitter chat room for helping newbies and some guy is like "I don't want to register a github account". If you can't spare 1-2 minutes then you obviously don't want the/to help that much.
 
@Dino it hits I/O in any case, so, no...
 
@Dino Why would querying the database to get data you need be unnecessary ? ?
 
@PeeHaa what?
 
Mountaineering boots arrived. Both shoes are size UK-12 (EU 47) for reference. Boots!
 
9:08 AM
@Fabor That's standard size for real men.
 
@Fabor 47??
 
@PeeHaa hi well thats why I was asking if I'm using session cookies I wouldn't need to access the db
 
@Dino cookies and database have nothing to do with eachother
cookies are client side database is server side
 
why did I click that
 
Because it was tagged NSFW and we all know we want to click it
 
9:16 AM
FTR that's not my foot :P
 
:D
 
ahoy hoy
 
hola @ircmaxell
 
@PeeHaa could it be that you did stackoverflow.com/search?q="kindly+help+me";
hmm ... looks like there is some XSS vector
 
@tereško I didn't, but OMFG
 
9:18 AM
writing http://foo.bar/?"text" in the chat suffixes it with a semicolon
 
lol it does
 
to the sandbox, everybody!
 
@AndreaFaulds @NikiC @ircmaxell Of interest to you three: twitter.com/SaraMG/status/558192404298477568
 
AST tools: http://github.com/sgolemon/astview (simple, easy to compile against stock PHP7), and http://github.com/sgolemon/astkit (better, but needs php-src patch)
 
unfortunately I have to work
@PeeHaa actually this might even be better: stackoverflow.com/search?q=%22kindly%22+is%3Aquestion
 
9:26 AM
Anyone going to free upgrade to Windows 10?
 
I don't take too kindly to people asking questions with kindly in it
 
@Fabor I will probably upgrade two boxes to it
 
good meurning!
 
unfortunately you cannot upgrade Vista to 10
 
9:29 AM
I'm wondering what MS Spartan will be like.
And what's up with project hololens.
 
> Tyrael: we are almost at the point when any rfc is approved/declined based on the consensus of reddit/SO chat
 
woo
@ircmaxell I'm trying to translate this [article](http://blog.ircmaxell.com/2014/12/what-about-garbage.html) but I can't find right terms for some phrases. So now I'm looking for the meaning of «_list of possible "roots"_» phrase. Does it mean «_vertices_» or «_nodes_» in terms of Graph Theory or something else? As only _trees_ have roots, but graphs with cycles cannot be trees.
Also I don't understand why the arrow on [the diagram](http://2.bp.blogspot.com/-v14QXmkxfxw/VH5RfGgiOpI/AAAAAAAAPXo/RkM8W_hNoGs/s320/gc_inital.png) goes from _Value 1_ to _Value 3_ instead of going from _possible r
 
@Fabor don't be fooled by MS Spartan fancy new name
 
@Tyrael explain yourself please
 
9:34 AM
The quesion that keeps lingering around in my mind is: how many websites will we have to restyle just for this new browser.. :O
 
@woo the root is a graph vertex that's identified as a possible point where a deallocation occurs
It is a graph structure, not a tree
 
morning
 
@Tyrael there is sometimes a consensus among like three of us but we don't always agree on everything, and I'm not sure why it would be a bad thing if the outcome of a vote reflected the prevailing opinion on reddit either ...
 
@woo and Value 1 links to Value 3 as a linked-list (possible roots are added to the linked list, and then iterated on)
 
moin
 
9:39 AM
moin @DaveRandom
 
woo
@ircmaxell so it looks confusing for me as I cannot distinguish the internal true reference from Value 1 and external not actualy pointer from «possible roots» list.
 
@woo sure, I can see that. The lines on the left are linked-list pointers
 
9:55 AM
@Fabor probably
I've got a student license for my windows 8. It's valid for 1 or 2 years. So I wonder if I upgrade to 10 if I will get it for free for unlimited time...
 
woo
@ircmaxell Maybe this one is more obvious? Or maybe I misunderstand something?
 
@woo I need to sign in to view that content. Just saying...
 
> Your requested page requires authentication.
 
@SaraGolemon There's also github.com/nikic/php-ast in case you weren't aware
I think it's similar to astkit with a different api
 
@NikiC Oh, I wasn't... :/
 
10:03 AM
someone else should deal with people ...
 
@NikiC you really need to hop on a train and come over to PHPBenelux this weekend :-P
 
@NikiC How'd you get the zendparse() symbol? My gcc doesn't find it without ZEND_API
 
> Pierre: "just because a few of us get together in one particular chat room" that part should be avoided, tbh. if not this room or the list
 
@SaraGolemon I didn't even notice, I build extensions statically
 
am I being told where I can hang around ...
help
 
10:05 AM
@JoeWatkins where?
 
php.pecl
he's talking about SO chat ...
 
@NikiC Ah, yeah, static builds would "just work"
 
@JoeWatkins What does that mean? We are not allowed to discuss things here?
 
have no context, can't jump in (my IRC client was disconnected from efnet)
@JoeWatkins how did it start?
and why not just walk away?
 
Tyrael: we are almost at the point when any rfc is approved/declined based on the consensus of reddit/SO chat
Tyrael: Pierre: do we want to do anything with voters who only have pear karma (a php.net account is neccessary for the old pear repos under svn.php.net)
Pierre: Tyrael, reddit? what is that?
Pierre: (teasing :-)
Tyrael: reddit.com/r/php
Tyrael: hope this is just a coincidence
 - datibbaw has joined the room
- 09:41:43 -
krakjoe_t: Tyrael: you're wrong about SO, there is sometimes agreement between about three of us, but we don't always agree on everything, not sure why i
well I was talking to tyrael, I misread what he originally said and then pierre piped up with his opinion that we shouldn't be hanging around in here ...
 
10:11 AM
that's an interesting discussion
but as long as votes are public, that problem doesn't exist
 
woo
@HamZa @ircmaxell Thank you, fixed
 
@SaraGolemon we should talk about merging those exts maybe. anyway got to go now
 
@JoeWatkins I kinda see what he is getting at, but the statement is rather "stupid"
 
should I walk away ? I'm annoyed because he's saying we're doing something wrong, in some sense ...
 
walk away
 
10:14 AM
okay
 
@DaveRandom nevermind, I'm stuck in pecl_http porting anyway
 
PORT ALL THE PECL_HTTP!
 
PHP unreletated: So I've got a laptop which has HDMI and mini display port connections. At school they have VGA. So I'm wondering, should I buy a HDMI to vga adapter or mini display port to vga?
This is the first time I see a "mini display port" so I'm kind of leaning towards buying hdmi -> vga
 
Good morning
 
@AlmaDo morning
 
10:21 AM
@AlmaDo morning
 
@HamZa hdmi would probably have a better chance at finding more uses in the future
but I'd probably go with whatever's cheap
 
I hate Solr .. Do anyone knows solution (or reason): X AND Y AND Z works, while (X AND Y) AND Z doesn't
second one parsed correctly (no 400 from solarium), just empty result
 
@PaulCrovella I guess you're right. The hdmi -> vga is 28euro in a nearby store the other one is 30. Damn expensive for such small toys
 
https://web.whatsapp.com/
what a horrible launch. doesnt work with an iphone. doesn't work on any browser except chrome (not even chromium)... what were they thinking?
 
morning
 
10:28 AM
@Patrick and it needs to be synced with your phone which is why it's advised to connect your phone via wifi
 
Any of you guys use Docker? Or more specifically had issues with starting cron from in a container?
 
@Fabor I use docker, but haven't used crons
 
Ah fair enough
 
svn commit goes through but when I log into the server, the files dont show up... what gives?
 
@user3692125 did you push it?
Also this is what I've been doing with team mates the last few months:
(we didn't build the robot though, only programmed it)
 
10:39 AM
@HamZa I'm using tortoisesvn... is commit not enough?
 
@HamZa In SVN you don't push, commit is a server-side operation, because SVN is a centralised system
 
@AndreaFaulds do you have any idea what I'm doing wrong?
 
Hi guys
i have a form
after filling the form the data to be stored in xml file and that xml file should be transferred to a url and the data should be shown there.
how can i do it in php...?
any help please
 
@HamZa I want that robot. plz send copy !!!!1111
 
@ircmaxell I think the ballot should be secret until the voting period ends, then votes may be published. I don't like the bandwagon effect.
@user3692125 Nope, sorry :/
 
10:46 AM
joking aside. That's awesome. How long did it take?
 
@edward you can do it in php by writing code to do it...
 
@user3692125 Check it's the same branch?
 
@AndreaFaulds the url matches exactly
 
Weird
 
@patrick any examples like that i am unable to find any example to write the code
 
10:50 AM
@edward That is kinda what programming is. You have a problem and then write some code to fix it. Otherwise it would be called copypasteing
 
@AndreaFaulds that'd also cut down on lobbying specific people for vote changes and such
 
@edward If you don't know where to start, then I recommend you do a few tutorials first to get better at programming
 
@PaulCrovella Exactly
 
@edward Then once you have some code and get stuck, feel free to ask. But nobody will write your code for you
(unless you pay them)
 
If people wish to announce why/if they voted a certain way, they may
 
10:51 AM
@edward your question is quite broad. Someone might eventually end up explaining HTTP or TCP even to you. Do you have any specific problem?
 
But broadly speaking it'd be better if the results are unknown until the end of voting
 
@edward you should learn the basics of PHP first. Otherwise you won't go very far. It shouldn't take too long to aquire the skills to implement such a task. And stay on the ball. Even if it seems a bit overwhelming at first.
 
ok thank you guys i will learn and implement
 
And you're welcome to come back once you have a question to a specific problem :)
 
@AndreaFaulds You should create an RFC for this, then when it goes to a vote annoy the crap out of everyone you see voting against it with personal emails "I see you're voting against this, here is why you're wrong..."
should pass handily
 
10:57 AM
@PaulCrovella :D
 
@AndreaFaulds ... when I do a checkout from the repo again, it shows the updated files... but when I log into the server, it shows nothing
 
@user3692125 Maybe the server shows a cached version that updates every now and then?
 
@AndreaFaulds I see. TIL
@ThomasDavidPlat You could order the parts on deal extreme/ebay and build one. Honestly, I do want to do that in the future and build it from scratch.
@ThomasDavidPlat With a dedicated professional team, you could maybe finish it in one or two weeks. We did about 5 months. This is because we didn't have a really good team (slackers, not enough knowledge etc...) also because we weren't working full time on it
 
@SecondRikudo manga stops at 700?
 
@Naruto yes
 
11:07 AM
Congrats on the new job @ThomasDavidPlat.
What's the role?
 
@AndreaFaulds I don't disagree with that
 
@Naruto Yup
 
Hmm
A thought.
Strict type checks can (largely) be done at compile-time
 
woo
@ircmaxell I fixed link, so here the diagram is available
 
11:17 AM
Weak type coercion can only be done at runtime
So, only adding weak checks would be workable if you're a strict typing fan, as you could use some sort of static analysis tool (IDE integrated?) to type-check your code.
 
@woo that works
@AndreaFaulds not really
PHP is too dynamic to do that even remotely reliably
 
True :/
I want property types, I think I'll implement them and write an RFC for them once return types are in
private NodeType $type;
We could actually do limited compile-time type inference to detect errors AOT :D
For example, the following code is obviously broken:
class Foo {
    private Bar $bar;
    public function getFoo(): Foo {
        return $this->bar;
    }
}
Also, writing parsers is fun :D
I get to write a "serious" PHP application making full use of OOP features
I get to write a parser without using a parser-gen, good learning experience
I get to do fun static analysis stuff
:D
 
11:38 AM
Trying to decide how to structure the AST
 
Heyyy guys !!!!
I have a I got image thumbnail from this
$cmd = "$ffmpeg -i $videoFile -an -ss $getFromSecond -s $size $imageFile";

if(!shell_exec($cmd))
{}
 
OK, what's the problem?
 
I want to echo this $cmd as a image.How to do this
I want to show this image preview
 
@Sandesh What format is the file?
 
Seriously the author of notepad++ has nerves. Atleast a warning that my editor will now start typing a text by itself would've been nice.
 
11:41 AM
its jpg
 
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at "http://example.com".This can be fixed by moving the resource to the same domain or enabling CORS.
anybody have any clue
 
@Sandesh $data = 'data:image/jpg;base64,' . base64_encode(file_get_contents($imageFile));
That encodes the image to a data URI which you can then put in src= for an img tag. This isn't a good idea for large files, but if it's only a few KB it's fine:
echo '<img src="', htmlspecialchars($data), '" alt="">';
@Sandesh By the way, are you checking and escaping your filenames carefully? You don't want a user-specified filename to work
It'd be bad if they did something like myurl.php?thing=; rm -rf /; # and erase your server
or worse
 
Yes I did that
thanks @AndreaFaulds
 
Glad to help :)
Does it work?
 
it is working now ....
 
11:45 AM
Great
 
yeah!!!
 
@Sandesh For larger thumbnails it might be better to save that imagefile somewhere accessible from the web, then point <img src= towards it
 
ok
But this the thumbnail created from the video that is uploaded
 
woo
@AndreaFaulds it's harder to cache images like this with built-in webserver methods. So it can cause additional load
 
@woo Yeah
@Sandesh Is it only shown once?
If you're showing a bunch of thumbnails, it's best not to regenerate them with each request, that'd be quite slow
Save them somewhere
 
11:49 AM
ok!!
 
say videothumbnails/$videoId.jpg or something like that, then you only need to generate it once
 
It is working eachtime
when file uploaded
 
Is it only after the file's uploaded?
Or are you showing it in other places?
 
yeah!!!
 
Which?
 
11:51 AM
no I need this when video file is uploaded and thumbnail is created
 
@Sandesh OK. Do you ever show that thumbnail on other pages, or just once you've uploaded the video file?
 
NOt now but may in future as per requirement...
Please suggest if you have something for this
 
@Sandesh In that case, I suggest saving the thumbnail somewhere and linking to it instead.
Is $imageFile always the same place?
 
yes I ll
definitely I have to do that if I have to use this any other place...
@AndreaFaulds I have another question to you...
 
woo
@Sandesh Also you can directly return this image with proper headers to let the webserver and browser cache it correctly
 
11:54 AM
Alright.
@woo That only works if there's nothing else on the page, and you probably can't cache this page anyway
 
it is working fine when one video uploaded if I have more than one video file to upload
then how to get video preview for all these
 
You'd have to do each thumbnail separately, but the same code should still work
 
woo
@AndreaFaulds sure, but I believe that long executing operations like system calls and file converting should be executed via separated process. But still it's not the best option ever, it's just yet another way to do it. =)
 
@woo Sure, but this thing is relatively quick
@Sandesh the same code should work if you run it for each video in turn
 
oh yes ok
 
woo
12:01 PM
@AndreaFaulds Yes, that's definitely true
 
@Fabor thanks :) I'll be a PHP dev there. In my current employment Im the guy for everything. And i really hate frontend stuff... Finally i dont have to deal with it anymore
 
12:21 PM
So you think -_- muahahhaah!
 
12:31 PM
Hmm, I popped a simple "* * * * * /bin/echo "cron works" >> /tmp/fab.txt" in my /etc/crontab but it's not creating the file. Crond is running
 
@Fabor sucks
 
The unanticipated and most likely dumb reason errors are the worst kind of delays.
 
@m6w6 No worries. May be of interest: github.com/DaveRandom/pecl-pq-stubs
 
12:47 PM
Late Static Binding is awesome and people who dislike it are wrong :p
It lets you do fun stuff in abstract classes ^^
 
Seriously crond. Y u be so annoying.
 
1:23 PM
@Fabor How hard can it possibly be :P
 
Not usually this annoying.
Basically crontab -l shows my crons but they're not running
crond is running.
No log file found anywhere. And the pipe output isn't created either.
FTR this is inside a docker container too.
 
@AndreaFaulds sure. You could prove if code is invalid. But you couldn't prove if code is valid (type wise)
 
Afternoon all. I have the following string: € 144.12 but if(strstr($columns['4'], "€")) { always returns false. Any idea what's up?
i've tried preg_match and i've also tried to convert the srtreing to UTF-8 (incase it isnt) i've done that using mb_convert_encoding
 
try var_dump(bin2hex($str)) for both the string and the needle, and see if they are different
 
Looks like just the thing created for me gist.github.com/JCook21/3824584 :)
But the Dude did not gave any usage example =/
 
1:33 PM
@ircmaxell string(18) "80203134342e313220" string(6) "e282ac" € 124.50
var_dump(bin2hex($columns[4]));
var_dump(bin2hex("€"));
also, var_dump(bin2hex($columns[4][0])); returns 80
so looks like somethings up, prolly encoding issues right?
 
yup
 
hmmm the original HTML has: <meta charset="UTF-8" />
so i'll need to make sure that i "use the data as UTF-8" right?
 
the data in $columns is not in UTF8
 
argh. $columns comes from a $_POST ... can i sert PHP to handle POST as UTF-8?
 
you need to convert it from 1252 to UTF-8
 
1:39 PM
here's what i'm doing:
- Copy a report to clipboard
- paste into textarea which then posts (this page is UTF-8 [based on meta])
- parse the data to normalize the report.

So i guess i'm copying as UTF-8 but then the POST is breaking the encoding
if($_POST['report']) {
$report = utf8_encode($_POST['report']);
$lines = explode("\n",$report);
doesnt seem to do what i expect.
what's fthe best way? mb_convert_encding?
 
well, it matters to format before output, mostly and see if data is written to file/hdd at some point in process there might be UTF with BOM issue
 
seems this does the trick
$report = mb_convert_encoding($_POST['report'], 'utf-8','windows-1252');
 
lucky ;)
 
i know :)
i bet it doesnt work tomorrow, stupid php ;)
or rather, bad workman
true to form
reload the page and Blam not working
WTF man, i hate encodings :)
 
So do i, you must clearly understand small blocks there, a.e. where to encode htmlentities(), try output same inside and outside input field, and look the difference
 

« first day (1559 days earlier)      last day (3392 days later) »