« first day (1681 days earlier)      last day (3263 days later) » 

5:00 AM
The concepts are relatively identical.
The client talks to your webserver, which talks to your Java/PHP, which spits out some HTML back to the client.
 
CGI?
webserver CGI?
 
Sure you could use FastCGI to have the webserver talk to your PHP, or you could also use something like DSO or libevent (i.e. old HHVM)
But as far as designing the web-application itself go with a framework.
It will do 99% of the hard work for you.
Then you can just focus on your application-level code.
The rest is pretty much already a solved problem.
 
So I have to work with a framework?
 
You don't have to, but you probably should. Unless you like spending time re-inventing wheels.
Even worse when you don't actually have a better wheel in mind.
 
// use evil magic to see ALL properties!
$evilMagic = function () {
    return get_object_vars($this);
};
$keys = $evilMagic->call($thing);
I am despicable.
 
5:04 AM
ok
 
@Andrea What's the matter you don't like var_export?
 
Oh, I could try that. Hmm...
Huh, var_export's actually kind of bearable!
Still, I like my own function
 
Better than eval
 
ajf\ElePHPants_Love_Coffee\OpcodeArray {
    $name = '(null)';
    $filename = '/Users/ajf/Projects/2015/ElePHPants Love Coffee/ElePHPants-Love-Coffee/test.php';
    $startLineNumber = 1;
    $endLineNumber = 10;
    $opcodes = [
        0 => ajf\ElePHPants_Love_Coffee\Opcode {
            $lineNumber = 4;
            $jumpNumber = 0;
            $type = 0;
            $operand1 = NULL;
            $operand2 = NULL;
            $result = NULL;
        },
Pretty, no? ^^
 
What on earth are you up to?
Ele PHP ants sounds like a bunch of foreign ants planning a coup.
 
5:07 AM
@Sherif parsing the output of phpdbg to reconstruct the opcode array for a PHP file (parsekit hasn't been updated for PHP 7)
 
Why not parse into something more useful, like a flowchart in dot notation and run it through graphviz?
Me likes visualizations
 
Oh sure, I'll probably do some transforms on it
But first I need something I can actually work with, that's not text
 
Does phpdbg give you the code branches?
 
I just plain opcodes. I'd have to figure out the branch points based on the jumps.
 
Wait... the compiler doesn't already have the branch points computed?
 
5:12 AM
It depends on what you mean by "branch points", but no.
just JMPZ and such
 
yea, but aren't the jump points already computed in the op array?
I thought they were compiled away
 
In the op array there's just implicit opcode numbering, and JMP instructions
 
ahh, right so it does know which opcode to jump to at least.
 
Right
 
I thought you were saying it had to compute the opcode to jump to at runtime.
 
5:15 AM
Ah, no, sorry if it sounded like that
 
You should probably check out the way Derrick did vld. He draws up opcode branches in dot notation.
 
Interesting. I'll be sure to take a look!
 
and the wallpaper i.imgur.com/TQIPIAG.png
 
heh
Makes me want to turn on netflix and watch that movie again
Wa?! How is that movie not netflix?
Bleah, netflix you disappoint me so!
 
 
2 hours later…
ThW
7:46 AM
morning
 
morning
 
8:15 AM
morning
 
morning
 
morning
 
@PeeHaa did you get your wildcard certificate from startssl too?
@PeeHaa 110$ / 2 years seems like a steal
 
 
2 hours later…
10:21 AM
Hey guys I made a very simple uploader script (with the js part by copy/paste/editing), tell me what you think: click
 
10:43 AM
@Gizmo for https://github.com/grasmanek94/simplePrivatePHPfileUpload/blob/master/index.php you should seperate the php from html and the html from the js.
You seem to have more entry points then just index.php, look into a front controller.
In https://github.com/grasmanek94/simplePrivatePHPfileUpload/blob/master/dl.php you need to exit or you collide with the last header(NOT FOUND).
In https://github.com/grasmanek94/simplePrivatePHPfileUpload/blob/master/upload.php , too much deep nesting.

But it mostly just some random hints. After the superquick inspection, I would guess that is is also
[tip] you can add all the arguments you want to a single isset .. so instead of isset($foo) && isset($bar), you could do isset($foo,$bar)
also.. why are you doing stuff like @touch("./.uploads/" . $id . "/" . session_id() . ".session");
 
11:01 AM
This seems to be a weird question: stackoverflow.com/questions/30422641/…
Could be me ofcourse. But I really don't understand any possible purpose of what he wants?
 
nope
@icecub disabled=disabled makes the click event not accessable
 
@icecub he doesn't want disabled to be added to <option>s, but only on <select>
 
@MarcelBurkhard nope. Comodo positivessl
Morning
 
@Worf Ye I understand what he wants, I just don't understand why. If a select element is set to disabled, it's pretty much impossible to still select any of the options. He says he wants to be able to select them on a jQuery click event. But that's only possible if the click event removes the disabled attribute.
 
yeah no idea what that means
i think he just wants to avoid having to remove manually disabled on all the things
 
11:17 AM
Moornings @PeeHaa
Tommorow is a no-work day
\o/
 
@PeeHaa ok thanks
 
@RonniSkansing \o/
 
yaaaaaaaaaaaaaAy
 
@PeeHaa do you guys celebrate whatever too?
pentecost, they call it
 
I celebrate day-off-work-for-whatever-reason
 
11:22 AM
that ^ :)
 
it's so disappointing, i thought we were the best with random celebrations :(
 
Nope random celebrations has more to do with christianity than country :)
 
en.wikipedia.org/wiki/Befana @PeeHaa we even have this
 
11:26 AM
EpiPHPany
 
celebrates the three wise men bringing xbox to baby jesus
2
 
That looks a lot scarier that proper santa claus or even sinterklaas
Even though we have some black guys who would take you to spain if you are really bad (who the hell doesn't want that??)
 
it's supposed to be scary for the nasty kids
 
*While shepherds watched their flocks by night*
*While watching ITV,*
*The angel of the lord came down*
*And turned to BBC*.
 
Sinterklaas (Dutch pronunciation: [sɪntər'klaːs]) or Sint-Nicolaas (Dutch pronunciation: [sɪnt 'nikoːlaːs]) is a traditional figure based on Saint Nicholas. Other names for the figure include De Sint ("The Saint"), De Goedheiligman ("The Good Holy Man"), and De Goede Sint ("The Good Saint") in Dutch; Saint-Nicolas in French; Sinteklaas in Frisian; and Kleeschen and Zinniklos in Luxembourgish. Sinterklaas is celebrated annually with the giving of gifts on the night before Saint Nicholas Day (5 December) in the Netherlands and on the morning of 6 December, Saint Nicholas Day itself, in Belgiu...
 
11:30 AM
How many black men are there @PeeHaa?
 
@Danack The supply is basically infinite
 
:D
 
@PeeHaa and still they decided to paint a white one for this photo upload.wikimedia.org/wikipedia/commons/a/a7/Zwartepiet.png
 
Yeah that's how we roll
 
11:32 AM
lol
 
11:42 AM
All those questions about codeigniter, cakephp.. I sometimes wonder if I'm becoming to old fashioned by not using any frameworks, lol
 
Anonymous
12:14 PM
who's in favor of making github.com/samayo/bulletproof for image upload only? No watermark, crop, resize ...
 
Anonymous
I'm finally done with the new version 2.0 but kinda having more thoughts about making the class upload only. Keep it neat and simple
 
Could anyone tell me why this jsfiddle.net/f3dsgv1n/1 loads perfectly fine in FF and Chrome, but not in IE? I mean, besides the fact that IE simply sux once again xD
 
@icecub Without looking you probably have a trailing comma
 
@PeeHaa Ye thought that was it to, but even after removing it, it still refuses to work
@PeeHaa Seems it only works in IE when using jQuery 1.9 instead of 1.10.. strange
 
Any errors in console?
 
12:30 PM
IE has a console these days?
 
lol Yeah it does :P
 
Ah, ye found it. Lets see
Ye got it.. stupid IE again xD
// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 <--
 
12:45 PM
So is it a jquery or a IE bug?
 
It's a jQuery bug for that specific version
The bug is marked as fixed. It only occurs in jQuery 1.10.1 Both 1.9.1 and 1.11.0 work perfectly fine
 
1:36 PM
Ha @Ocramius! Just the one I was about to ping :)
 
@PeeHaa NO.
 
`:(
I have a table with a tree. Every record has a top (this is the top parent in the tree)
I am trying to query the top level items including all the children
SELECT menus.id, menus.parent, menus.name, menus.url, menus.link_type, menus.target, menus.accesslevel, menus.active, menus.updated, menus.created, COUNT(menuitems.id) AS count
FROM menus
LEFT JOIN menus AS menuitems ON menuitems.top = menus.id
WHERE menus.parent = ?
GROUP BY menus.id, menus.parent, menus.name, menus.url, menus.link_type, menus.target, menus.accesslevel, menus.active, menus.created, menus.updated
ORDER BY menus.name asc
LIMIT 20 OFFSET 0
That gives me an empty recordset
Halp? :)
Also morning btw :P
 
dat group by
wtf, don't you have primary keys?
 
I do
Why?
It's postgres btw
 
@PeeHaa do you have nested children?
it seems like what you want is a nested set instead
 
1:42 PM
@Ocramius I do, but all records have a top column pointing to the "topmost" level
 
ic
 
I thought that would make my life easier, but even now I fail
 
well, I don't understand the group by there :X
anyway, should be SELECT a.* FROM menus a WHERE a.parent = ? to just fetch them, if what you say is correct. Why are you trying to stuff everything into a single query?
 
Sorting on number of children
If I remove a column from the rgoupby I get:
> PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "menus.updated" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: ...e, menus.target, menus.accesslevel, menus.active, menus.upda... ^ in
 
SELECT a.*, COUNT(c.id) AS childCount FROM menus a LEFT JOIN menus c ON c.parent = a.id GROUP BY a.id ORDER BY childCount ASC
something like zis?
 
1:47 PM
Hmmm that looks the same as what I have. Let me try
Nope. That doesn't work in postgres
It probably work in mysql though
> PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "a.parent" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT a.*, COUNT(c.id) AS childCount FROM menus a LEFT JOIN... ^
 
Maybe it's because you're counting by c.id, but not grouping by c? Try counting by 1 or by a.id?
 
Let me try
 
@Ocramius Presumably this bank holiday didn't catch you out?
 
No dice. I'm fairly certain my query should be correct though. brb gonna grab a coffee and food and think about where I screw up. Tnx all
Holy shit it's actually nice weather over here \o/
 
2:05 PM
@Andrea phpdbg hides many parts of the opcodes ^^
 
user1648409
hey guys - when using apache and running a little website on it if i just want that website to work via https all i need to do is disable "Listen 80" and replace it with "Listen 443" + adding a custom certificate - correct?
 
If you want to do it proper you would also have to setup ssl correctly
And if it is public you don't want to completely disable 80
Because people will go to yourdomain.com and it will not work
 
user1648409
@PeeHaa all i did so far was replacing "Listen 80" by "Listen 443" and adding my custom certificate in the apache/conf/ dir. What am i supposed to do to set up "ssl correctly" ?
 
Is it a public website. What kind of certificate is it? Self signed?
 
user1648409
@PeeHaa This website will only be used "internally" by the company on their own apache server, yes self signed
 
user1648409
2:11 PM
@PeeHaa and i want it to always use ssl, to ensure data is being sent encoded
 
You will have to setup the ciphers used. Disable sslv*. fix logjam. setup a non ssl -> ssl redirect for all requests. Setup hsts
 
user1648409
holy shit - thats a lot to do
 
Well do you want to do it proper or not?
 
user1648409
@PeeHaa sure i want, but i've never done that kind of stuff before
 
user1648409
1. setup the ciphers used? i used openssl that generated a rsa2048 cert for me. what am i supposed to do here?
2. disable sslv* - what is sslv* and what does it do?
3. fix logjam - what is logjam and what does it do?
4. setups hsts - what is hsts and what does it do?
 
2:18 PM
Now is the time to learn it. Every time I have to setup SSL I have to research new things to mitigate different things. But in the end it is worth it
2. Disable all SSL in your config and only use TLS
3. Look it up
4. Look it up :)
 
user1648409
@PeeHaa k will do - thanks
 
Once you have done your research and are having specific questions I might be able to help, because I have set up ssl for my own server recently so I still remember most stuff
Ah yes people (@Danack, @Ocramius)! E_PEBKAC don't ask what the problem was but certainly pebkac
FWIW @Ocramius postgres (and I would assume any sane engine, read non mysql) should have that group by clause I think
 
@Danack I'll be around. Flying in a couple of hours
so I guess we catch up for beers tomorrow? :-P
 
2:34 PM
Yep. fyi I'm going to go and visit my dad in Normandy for a couple of weeks from Thursday.
So catching up would be good.
 
Weeeeee! A PHP chat room.... :P
 
fyi, Sundays are usually quiet....
 
Yeah, I figured as much.
See you Tuesday then lol
 
@Danack neato! :-) I'll ask if Steve tags along :)
 
cool.
 
3:10 PM
Monday is off for UK too?
@Danack your dad lives in France?
 
3:26 PM
@FlorianMargaine Yep, in Normandy.
aka buttfuck, nowhere.
 
Monday off here too (Switzerland)
 
3:44 PM
Bazinga!
 
3:56 PM
@NikiC yeah...
Also, its output isn't the easiest to parse
I'm hoping Sara will update ParseKit for 7 :p
 
4:09 PM
@Danack in the middle of cows, heh
 
Not even that many cows where he is, it's mostly just wheat.
Oh and corn.
 
@Andrea not harder than vld etc.
 
user895378
4:29 PM
@bwoebi It was actually 80k/s with 1,000 simultaneous client connections using PHP7. ~50k/s for the same test on PHP5.6 /cc @Trowski
 
70 or 80, doesn't matter ^^
 
@rdlowrey w/o exts?
 
user895378
But that's also the result of ruthless optimization over the course of multiple years, so ...
 
user895378
@NikiC without extensions, yes.
 
How's it look w/?
 
user895378
4:30 PM
haven't tried yet ...
 
user895378
Still trying to finish the latest big big big refactor
 
user895378
I suspect those numbers to drop a bit because we're introducing some nicer abstractions for the end-user that may make things slower but I think it'll be an acceptable trade-off.
 
user895378
The other issue with trying to bench with extensions is pecl/libevent doesn't support php7 yet.
 
@rdlowrey actually, AFAIK it's only PromiseStream which makes things slower I think
 
user895378
We've been working with a version of chobie's php-uv extension that @bwoebi ported to PHP7 and there are still some issues which end in libuv failures under high load (I think they're due to the extension's code -- not Bob's porting of it).
 
user895378
4:34 PM
Considering pecl/ev is currently well-maintained (a release as recent as three weeks ago) we're looking at potentially targeting that as the primary extension environment even though it isn't available in windows.
 
@rdlowrey I think we should target both
 
user895378
We just need to prod osmanov to support PHP7 or help to do so.
 
user895378
@bwoebi Definitely. php-uv is the ideal solution because it provides the same capabilities in windows as everywhere else.
 
user895378
@bwoebi yeah you're right ... I'm not sure we'll see any dropoff for requests that don't carry an entity body.
 
user895378
It actually may end up being faster than before because of all the recent amp performance tweaks.
 
4:38 PM
@rdlowrey yep and 80%+ of requests anyway won't carry an entity body I suppose
 
I think you should do 100k/s instead.
You know, so it's a round number.
 
user895378
It very well might if we can get an extension to work in php7 without bugginess
 
with uv, probably
 
I have no idea how, but you should do it :P
 
user895378
I think it's a real possibility once we get an extension working well ... to get 80k in php7 without any extensions was mind-blowing (to me).
 
user895378
4:51 PM
^ that was when I was like, "woah, php7 is FAST."
 
@bwoebi Maybe.
 
 
1 hour later…
user1648409
5:59 PM
Hey - I save PDFs as blob in db by mysql_real_escape_string() their content String. When i try to retrieve it and display it, it says that the pdf binary is invalid. Do i somehow need to reverse the mysql_real-escape_string() ?
 
@Shiuyin Why are you storing pdf's in the database?
 
user1648409
@PeeHaa because i want to?
 
He's doing it ironically....
 
Also stop using mysql_*
It's dead
 
@Shiuyin You shouldn't be doing real escape string in the first place for binary data.
 
user1648409
6:01 PM
@Danack an stackoverflow post about the same problem i found told me to?
 
The data shouldn't be transformed when you send it to or retrieve it from any data storeage.
 
user1648409
@Danack ok
 
@Shiuyin Why?
 
The other possibility is that the PDF file length exceeds the field limits, so the complete file wasn't saved
 
There are some use cases for storing blobs, but if you don't have a reason please don't
 
user1648409
6:03 PM
ok
 
@Shiuyin why not just store address of that pdf in database ?
 
user1648409
so
 
(Tip: Read up on sql_mode and make sure STRICT_ALL_TABLES is enabled, then make sure you're doing proper error handling for your SQL code)
@NullPoiиteя I would, but @Shiuyin obviously hasn't
 
In my experience mysql is horrible with "larger" blobs
 
user1648409
Once i remove the real_escape_string() around the pdf binary it wont save the pdf anymore. once i add the real_escape_string() it saves the pdf binary string into db - no the pdf doesn't exceed the limit! i checked that. it gets properly added into db with real_escape_string() now i just need to retrieve it and display it
 
6:06 PM
4 mins ago, by PeeHaa
@Shiuyin Why?
 
@Shiuyin What's the filesize of the PDF and what field type are you saving into?
 
user1648409
@AllenJB 30kb, saving into a normal "blob"
 
user1648409
@PeeHaa because the project i am doing this for actually wants us to save automatically generated pdfs. They are automatically deleted from db after 24h - nothing special. And when storing some binary stuff we use blob - thats how i learned it in my studies
 
@Shiuyin you are doing stupid thing ... i see no reason to store pdf in database so there is no point to discuses it further
 
@Shiuyin Just store it on the file system proper
 
6:08 PM
@Shiuyin LOL
 
I don't know whether it is still the case, but querying mysql records with blobs in it used to be fucking slow. Even when the blobs where not queried.
It was 2 years ago I've seen that project so not 100% sure whether that still is the case
 
@Shiuyin you can check that if address exist in database after 25h just delete related file and remove that address from db or something like that
 
@PeeHaa It's actually not that bad.....the only thing you have to do is separate storing the file data out into it's own database, and stored a fileID with the upload info.
 
s/database/table I assume?
 
user1648409
guys... its cool to tell me that in your opinion its bad to store pdfs as blob in a database. fact is that, i can't change that since it was decided long ago and i have to do that now. I am just failing and trying to insert and retrieve them
 
6:12 PM
If you want to shoot yourself in the foot go ahead :)
 
@PeeHaa Yes - curse Mysql's ambiguous naming of things.....
@Shiuyin Why don't you try finding why the PDF is mangled....
 
@Danack :P
 
user1648409
@Danack when i run the $GENERATOR->run() it works perfectly i get 100% valid pdf, once i store it into db and retrieve it again it fails
 
Is that still the case, because AFAIK mysql should separate the binary data itself from the actual table? @Danack
 
Yes.......that's the bit you need to investigate - what the difference in data is.
 
6:13 PM
@Shiuyin compare the data?
 
@PeeHaa Haven't checked recently - the problem was storing the blob data inline with the other columns in the table, which automatically blows SQLs page caching, and so every query has to do a physical IO to get each row.....which is quite bad.
 
Asshole mysql
3
 
user1648409
@PeeHaa on it (again)
 
How many bytes is a standard blob field btw?
 
user1648409
@PeeHaa 64k
 
user1648409
6:22 PM
ok so now i have the normally generated pdf file, that works (i can open it normally) and the blob in the db - how do i compare those properly?
 
user1648409
uhh
 
user1648409
there is actually 8KB of a difference between those files...^^
 
xor?
 
user1648409
one is 39, one is 31kB
 
user1648409
with one of those generated pdf string i just use header("Content-Type: application/pdf"); to show it (the one that works), the other one is just dumped into the blob field...
 
6:30 PM
@bwoebi Why do phpdbg tests have a # before everything? Isn't that annoying for copy and paste?
 
@marcio I wonder how you imagine that mode… just like gdb requires you to always prefix with "p "?
@NikiC I have literally no idea… Joe did the test runner
also, yes, it's annoying
 
@Shiuyin stackoverflow.com/questions/8166697/… but really you should just be able to figure out the differences by looking at it.....
or thinking hard.
If the length is changing, that means that something is probably trying to escape the bytes.
 
@NikiC I need an easier way to make tests so that I'm also eventually motivates to create them…^^
 
@PeeHaa I actually started thinking that BLOB is the best way to solve that
 
user1648409
@Danack yes, i know. The question is "how to escape binary data in mysql" and im googling that for quite some time now :P
 
6:34 PM
BLOB or TOAST tables
 
@Shiuyin No it's not - it's figure out what is escaping the data and turning it off.....
 
@bwoebi I was thinking whether we should have tests for opcodes generated by php
 
Filesystem has too many stupid problems such as number of files per directory, backups, replication, transactional integrity, astral alignment, etc
 
Like to make sure that certain optimizations are done
But maybe it would be too hard to maintain
 
@NikiC re-running a test should be potentially only copying the input
 
6:36 PM
@Ocramius What is "astral alignment"? :P Sounds scifi :D
 
Ah good ol C-x M-c M-butterfly
 
user1648409
thanks anyway for your help guys
 
...S3 all the things.
 
@FlorianMargaine That most upvoted answer doesn't make much sense though
 
So apparently 7 months ago I started writing this tutorial of sorts gist.github.com/srgoogleguy/6453a6578bffb48431d4 and forgot all about it. For the life of me I can't remember what I was thinking...
 
@FlorianMargaine very nice :o
 
7:14 PM
@FlorianMargaine Wow. +1 for awesomeness
 
@Trowski you missed/didn't like this bit?
2 days ago, by Danack
@Worf "Throwable, Error, TypeError, and ParseError will be built-in interfaces/classes and so it will no longer be possible for users to create classes with those exact names. It will still be possible for those names to be used within a non-global namespace." /cc @Trowski
 
@Danack I missed that.
Does what I wrote mean something else? Maybe I should have said root namespace, though I thought the terms were interchangeable.
 
@Trowski Check internals ;-)
 
@rdlowrey What sort of requests? HTTP requests, ping/pong request, or something else?
 
user895378
7:24 PM
@Trowski just standard http/1.1 requests
 
@rdlowrey With a "Hello, world" type of response?
 
user895378
yeah
 
user895378
But that's with full routing, name-based virtual hosting, etc ... Not just reading the socket and using fwrite to send something back
 
user895378
The performance is derived from the actual HTTP server implementation ... not the underlying amp libs (though they obviously can't incur unnecessary overhead either).
 
@Danack Yes, I see there was some confusion. I'll update the RFC and reply to that email.
 
@PeeHaa this was a reference to astral alignment :P (with the cosmic ray et al)
 
ah :)
 
But yeah, interesting nonetheless
I was in awe first time I read it
Now... I work with people who send patches to grub because they have an annoying bug
Or patches to glusterfs
Crazy guys
 
Grub: The final frontier
 
7:50 PM
What is Amp?
Asynchronous Message Passing?
 
@PeeHaa Interesting
@PeeHaa So this is still a single-process server, no?
 

« first day (1681 days earlier)      last day (3263 days later) »