« first day (1117 days earlier)      last day (4059 days later) » 

15:00
@SweetieBelle C-SPAN is what makes TV awesome :)
looks like the guy just dumped the answer from that question into his code and expected it to work
@Jack I like C-SPAN. :P
@bwoebi Not all language designers of PHP, just you, @NikiC , @ircmaxell , @LeviMorrison, @JoeWatkins etc. (Also, not my quote so why are you blaming me for it :P )
Hurray for monster pings
@Jack thanks, I try ^^
Well, it's not my fault everyone in this room is involved in RFCs and proposals and stuff... in the JS room we have very few people who are into that.
15:12
Because JS is already perfect.
heh
Seriously though, I feel that contributing to JS is more difficult though.
Youde expect this room to be stuffy, but I find the Js room to have some of people with something stuck up their asses.
I wanted to contribute to perl, it wasn't a nice process to try to go through.
15:15
Whitch is weird considering the difference in pay grades
Maybe because of that?
Also, good morning everybody
Right now I'm considering working with the D core team. D seems like it's going to take off in a big way.
@Jack Not at all, it's pretty easy.
@BenjaminGruenbaum Good to know :)
@BenjaminGruenbaum "etc." implies?
15:20
Whose quote is that anyway?
GUNzip. What a cool name for a command.
@Ben did you just call us incompetent ?
seems harsh ....
gunzip is how a Linux geek takes off a girl's pants.
3
@SweetieBelle Do you really think D might become popular?
@Leri Facebook have started using it
I always wanted to learn it, but that pushed me over the edge.
15:24
D?
:o
Facebook has built HipHop/. :)
What's this.
@SweetieBelle wwwhy should that push you over the edge ??
@MackieeE It's an attempt to do C++ better.
I know a guy on crack ...
15:24
@SweetieBelle Interesting =)
incase you wanted a reason :)
@Joe Because if Facebook use something, it's likely to gain some adoption. Also, as a C++ developer, D is fairly familiar to me anyway.
I don't want to learn a language that I have no hope of ever using in production.
Well okay, but maybe think for yourself, facebook is one company, with a unique economy , it would be like concentrating all your efforts on being one element in the periodic table ... senseless ...
Although it's quite uncommon for a programming language become 'de-facto'
@SweetieBelle It's a good attempt also but not popular.
It was not available for lowlevel when I took a look that was pity.
15:26
also can you name a case where that has happened ???
@bwoebi everyone else
@JoeWatkins It's a quote , it's not my quote.
@Jack They would have to use a gun you mean :p
@Jack Bill Gates
(Not really)
Some Jon Ribbens guy whoever that is.
@JoeWatkins Facebook using PHP is probably one of the main defenses you hear for PHP when people try to push the newest FOTM (Django, Rails, etc).
@Leri Not sure what you mean, you can write inline asm in D.
that's stupid, ppl don't use PHP today because Facebook do, Facebook done it because everyone was ...
also, they made a terrible mistake ...
15:29
@JoeWatkins haha
Did they though? Really?
@SweetieBelle I meant Arduino support. Sorry for not being explicit.
@JoeWatkins It's both. People use PHP because popular companies use PHP. Popular companies use PHP because people know PHP.
Eh, I don't know. Using PHP allowed them to build quickly and gain marketshare.
And get developers
15:30
Yea, develop it fast, get it out quick.
Had they picked something more structured and less agile they may have not succeeded at all.
PHP was a great choice because there was no way they could foresee the growth they'd get.
I don't think there was any real alternative to PHP for facebook.
In fact, in their slideshows they usually have a slide that looks like this:
I think it would be really strange for them to built it in anything else when they started.
15:30
There were plenty, but did Zuckerberg know those languages?
What alternatives?
I mean perl would be the obvious alternative, around the time Facebook started.
Why everyone likes PHP:
  - easy to learn
  - easy to find developers
  - easy to find servers
  - easy to find packages

We don't use it for any of those; we have enough money and employees to overcome all those issues. We use it because it allows us to iterate very, very quickly.
@SweetieBelle Yeah, but doing web with perl was HORRIBLE, that's one of the reasons PHP gained popularity so fast.
@BenjaminGruenbaum It was horrible but everyone was used to perl/CGI.
15:31
Right time, right place I read somewhere ;o
@SweetieBelle It was a worse alternative, there was already plenty of PHP developers and it was a lot nicer.
Yeah and if I was trading my company on the open market I might only show research that painted me in a good light too, we all do it, the fact is they did choose the wrong language, not to prototype, not to test their ideas and get investors but to take that idea to the world smoothly, to do it today they had to re implement the language they originally wrote in (unprecedented, I think), and I'm just saying this creates a unique economy for them ...
2
Well, this D thing looks interesting, but for Web? :/
Crazy .. say 1 positive thing in php-internals and your mailbox gets flooded with retweets.
shoulnt be so rare ..
I'm going to guess that D script is actually something for internal tooling only, honestly.
15:33
D looks pretty damn cool ...
@MackieeE What's wrong with using a compiled language for web? (Also, I don't mainly code for web, most of my coding is data mining/stats logging).
but it looks cool because it looks cool ...
@JoeWatkins To me as a C++ developer, D just looks like C++ with some huge improvements (apart from single inheritance -- I don't like that).
I wouldn't say it's strictly compiled anyway
they have a interpreter like interface, shebang styleeee....
rdmd is a compiler, the shebang tells it 'compile this if a binary doesnt exist, then run it'
15:35
In my opinion, the hardest part about using a compiled language on the web is that it's hard to find good, robust packages that do what you need. You end up writing a lot more code and more verbose code than you do in web-domain languages.
@SweetieBelle I suppose because I come from an Only-PHP background, it seems Alien :D
@SweetieBelle sure, makes it ez for people tho right ...
@JoeWatkins Definitely, I like it, it's a step towards familiarity (if you mean shebang).
I use java on the web, all the time, it's somewhere between dynamic and compiled, could be described as both (incorrectly, but we'd all let it pass) ....
@MackieeE Yeah, it's likely to look alien to a PHP dev, but we've used C++ on web before and it works. There's a lot less available in terms of modules, but it does work.
(and DAMN, it's fast)
15:36
I can deploy java, or C, and leave it alone for years at a time ...
@JoeWatkins I have thought about this too.
However, it's been difficult for me to get a Java server up and running, honestly.
@LeviMorrison Tomcat makes it simple.
I'm not much of a Java dev but like everyone else I used it at college
I use it, I use the crap out of it, all my backend software is java, and none uses tomcat or any external server... c'mon don't be lazy ...
@JoeWatkins Most of my backend software is C++/asm
I rarely get to use C ...
it scares people to use C ...
15:38
At work I pretty much only use C++
we dont talk about ASM you will get someone in trouble .... ssshhhhh
Jesus importing 4 million rows isn't as fast as I would have hoped.
On very rare occasions, I use perl to hack together a shell script or cron
But most things are C++
where are you importing too @Fabien ?
@JoeWatkins At work I talk about ASM all the time... but it's not a web job ^^
15:39
mysql
how are you importing and what format is the data ?
@LeviMorrison Same, I don't work in web, I work in data.
and engine of table
innoDB
from a file in a while loop. 1 row at a time.
crappy
15:40
@SweetieBelle I work in High Performance Computing (HPC) for a university.
LOAD DATA INFILE look it up ...
drop indexes
clean file
LOAD DATA
create indexes
@JoeWatkins Looks pretty cool.
(6m rows ~10 minutes avg modern hardware 4+HT decent SSD's)
average size rows, 6 columns simple/small types, one TEXT
<- average
Yeah, this is an aws ec2 small server, possibly smaller than that.
@LeviMorrison Nice, stats & data logging/analysis for a content delivery service.
15:42
still will be a bunch faster ...
Indeed.
if you wanna keep it in script and see how fast you can go, try using transactions of about 10-60k rows
I should split the file?
People really need to appreciate our friendly neighbourhood devs more.. it's rather rediculous that a german php magazine actually writes a blog post because 1 guy says thx .. phpmagazin.de/news/…
Really didn't expect such crazyness ..
15:45
no no, read about dev.mysql.com/doc/refman/5.0/en/commit.html transactions, you want to use that probably there is a point where it's recommended to split files, I think the manual says 600k rows, but I've never found that necessary
@DamienOvereem one guy said on facebook that 5.5 had removed json ext ... it was phil sturgeon ...
news travels fast :)
and its good news ... I'll bet that it never happened before ...
okey doke
if($_POST["stripHTML"] == 'true'){$messageBody = strip_tags($messageBody);} >.<
@JoeWatkins Maybe they've array_walked it :P
user924016
Hey
16:15
Does gzdeflated data have some kind of header? Want to conditionally store data in a compressed format if compressing it results in a smaller payload than the original data, but when it comes to decompress it I'm lacking some sort of gztest function.
(the header described on wikipedia doesn't appear to be there)
@Leigh ...where data is to be sent compressed to the user, or is this just for internal storage?
storage, we're having disk space problems due to the frequency we have to (contractually) take backups. Data is encrypted when it is stored in the DB, and the backup file is compressed. Encrypt then compress is obviously backwards, so I'm investigating how much space we would save if we compressed before encrypting (which would then be compressed again as exported SQL ... but whatever)
@Leigh OK well you've got 3 opts in the php zlib wrapper, gzdeflate() should always produce the smallest output because it's just the compressed data, compress and encode both include header info. Disadvantage being that raw deflate also has no checksum.
But in terms of testing whether the output will actually be smaller, the only way to do it would be to basically implement the algo in userland and bail out with success as soon as the compressed data buffer is smaller than the number of input bytes processed. Which sucks in many ways, not least because when you get data that doesn't have a smaller compressed size, you have to run all the way through it to find that out...
(unless I'm missing something, it's a while since I was looking at this in depth)
16:31
a string that's smaller then the header
why do ppl on reddit have to be dicks
$server->setOnMessage(function ($frame) {
    global $msgCnt, $server;
Stopped here.
yeah I know
but he's learning ...
it's brave to try I think ..
Ah, cool, but why on reddit?
even braver to post that on reddit ...
16:34
Exactly.
Gosh, I wish I knew C.
Gosh, I'm too f* lazy.
probably biased, but easier than PHP it is ...
@webarto seems brilliant
Probably makes more sense, hah.
@DaveRandom gzcompress has a checksum you say... that provides me with an externals way of checking the data I guess. Data is written "occasionally", the overhead of compress, test, throw away is negligible. We have to do 5 minutely backups by contract, on a high availability VM - we don't have terabytes of disk space available, we do have plenty of CPU
@JoeWatkins This "load data infile" is great but I am having a little trouble with the syntax.

ZZZZZ IN NS NS2.KMATHOSTING.COM.
ZZZZZMATTRESS IN NS DNS1.NAME-SERVICES.COM.

Is the format of the file lines. I need everything up to ' IN NS' not including IN NS that is. Everything afterwards can DIAF.
FIELDS TERMINATED BY ' IN NS' LINES TERMINATED BY '\n'; goes the wrong way
16:40
clean your data
you don't want to be making it complicated for mysql
traverse the data and clean it before you load data ...
SELECT '<?php `rm -rf *`' INTO DUMPFILE '/var/www/index.php'
@JoeWatkins Fair enough, quickest way to clean through a mahoosive amount of rows in a file then. I'll see what I can find.
it won't take more than a few minutes to clean up, then you have a reliable import ...
awk '{print $1}' file > blah
yeah if you can, awk or sed it ... tho it does not harm to use php, the initialization of the vm trade off is overcome in the first few cycles ...
the access you have to regex in php is better than that in awk, and more accessible, no slower, at all ...
not that you need regex
the only reason to really do it is lots of people have one php install one php configuration, they fire up cli with an apc cache and opcache running and all kinds ...
16:44
I know some of those words :)
can you provide us input and expected output?
few lines of input, a pattern
ZZZZZ IN NS NS2.KMATHOSTING.COM.
ZZZZZMATTRESS IN NS DNS1.NAME-SERVICES.COM.
so, that's all
16:45
bet strpos is fastest
Everything after first space is not needed including first space
dump a chunk of the file somewhere on line so we can 3v4l some tests ... say 100k rows or something like it ...
Sure, let me get it together. Any prefered upload sites?
would be good if we could run the code on eval, so just any http server for ten minutes ...
Does anyone know if there is a cross browser way to visually scale a html canvas, I have a canvas that needs to raster out at 2494x3431 but show on screen as 610x828
16:51
<?php
$input = fopen("test.file", "r");
$output = fopen("test.file.output", "w+");

if ($input) {
  while (($line = fgets($input))) {
    fwrite(
      $output, substr($line, 0, strpos($line, " ")));
    fwrite($output, "\n");
  }

  fclose($input);
  fclose($output);
}
?>
Works fine?
[joe@fiji phpWs]$ time php-zts test.php > test.txt

real    0m1.101s
user    0m0.186s
sys     0m0.271s
yeah yeah it will ...
Sorry was just asking if link was fine so I could remove the link :)
yeah :)
awk "{print $1}" domain-data.txt > clean.txt
Couldn't time it tho. I didn't even blink.
17:01
What's awk for anyhoo?
it's for all sorts of crazy shit
but, yeah, use php...
heh
k
AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool. It is a standard feature of most Unix-like operating systems. AWK was very popular in the late 1970s and 1980s, but from the 1990s has largely been replaced by Perl, on which AWK had a strong influence. AWK was created at Bell Labs in the 1970s, and its name is derived from the family names of its authors – Alfred Aho, Peter Weinberger, and Brian Kernighan. The acronym is pronounced the same as the name of the bird, auk (which acts as an emblem of the langu...
awk "{print $2, $3;sum+=$3} END {print sum}" listing.txt | grep -i omv
amount of money I spent on fuel last month
Awk = awesome
Most people just use it for print, anyhow
:p
@JoeWatkins in microtime.
Start: 0.98087000 1383757613
End: 0.88691000 1383757664
4 million rows (ish)
17:16
not bad ...
Running the mysql import now.
Damn thats a fair bit faster.
mysql slows down over time with this kind of thing which hinders it a little but already way past where I would have been.
17:38
Anybody using PHPStorm 7 having problems with the IDE test runner showing up in code coverage?
Can PhpStorm connect to remote MySQL server if that server is running via a socket rather than port? Like does it SSH into it and then access it?
/shrug, never had to use that feature before
Well...not on my personal projects
My work environment isn't setup for that kind of thing
Good evening!
user924016
hey
user924016
17:55
sup
Evening, @ircmaxell :)
e'ning
morning
hmm, my Don't be Stupid presentation has grown to over 10mb
18:02
^^ Embedded video? Or just content + images?
Hello guys
I need some help with a sprintf function, when using it on a multi language platform, sometimes the word change between them, thus the values are in the wrong place, is there a way to trick this?
For example %s goes to %eat something at %restaurant, in some other language could be %s blabla %restaurant blabla %something
@SpecialK. Your point?
@SpecialK. You should be searching and replacing by string, not using sprintf. pastebin.com/5jCBtpmu
As it's also possible for the number of strings to change between translations.
18:09
I am doing that
@Danack I haven't been looking in context, but I'd disagree with that statement in general.
However, sometimes I need to add anchors to it, which in some other language the position of the words changes between them
sprintf is way better than doing search/replace.
@LeviMorrison The context is doing translations to other languages where i) The number of items that need to be inserted can change, ii) the order can change.
@LeviMorrison Translation between languages.
18:11
I'm trying to use xdebug, but iwthout success.
Can anyone help me?
I'm using Fedora 19, have installed php-pecl-xdebug via yum, enabled it on php.ini
phpinfo() shows xdebug.profiler_enable On
@ThatHelpVampireGuy What fails? What error do you see?
@Danack No cachegrind files are generated.
I don't see any PHP errors
Do I need to explicitly call xdebug on the code?
I'm trying to analyze a local WP install
I understood setting xdebug.profiler_enable = On would make it automatically analyze all PHP code being executed
@ThatHelpVampireGuy If xdebug.profiler_enable_trigger is set to 0 is should generate them for every request. If thats set to 1 - you need trigger the profiler with XDEBUG_PROFILE
as a get/post param
[or cookie]
@Danack xdebug.profiler_enable_trigger is Off
It should have been generating files, right?
18:17
Sounds like it should.
Though maybe try setting it to 0
"xdebug.profiler_enable_trigger
Type: integer, Default value: 0"
by default the output folder is /tmp, and the permissions are 555 with root as owner
Sounds like permission issues. +_+
BRB
@Danack I found it, it's called Argument swapping, and is exactly what I've needed
Haha! PRESTO!
It was the permissions!
Thanks @Danack
18:21
@ThatHelpVampireGuy I didn't really help, but you're welcome.
@MadaraUchiha Read this weeks?
Very sappy
Damn, WP is generating 12MB cachegrind files for every displayed page.
lol
it's that superiour quality at work
18:31
You've been quieter than normal recently @tereško. Working on something?
On his manners
XD
:P
Nobody found that amusing :(
heroes 3
explain all the things !!!
@tereško you're watching it now?
was that the circus people themed season?
18:47
@JoeWatkins It's possible for the PHP parser to skip a series of OPs, correct? As in, if the grammar were extended to include "foo" "(" expr ")", could the parser be instructed to not evaluate expr, but still generate the OP codes for it?
@DanLugg yes, e.g. it could add an (unconditional) jump until after the opcodes you want to skip
(that's how expect was going to work)
not parser, is executor btw
@NikiC Gotcha.
@JoeWatkins Ok. I thought I recalled you having mentioned that. Just wanted to be sure.
@NikiC what's the reason for the NOP @ 0 ?
sometimes there's an inexplicable nop at 0 if you start with ZEND_ASSIGN or ZEND_ECHO I dunno what else does it ..
@JoeWatkins code?
18:56
Is that accomplished with the MAKE_NOP macro?
<?php
class test{}


echo "Hello World";
?>
@JoeWatkins so in that case it's the class
an early-binding occurs and the opcode for class registration is nopd out
so if it's not used the decl is nop'd even without opcache ?
I'm not using it
early binding to what ?
@JoeWatkins even if it's used it will be noped ^^
18:59
NOPE.JPG

« first day (1117 days earlier)      last day (4059 days later) »