« first day (1503 days earlier)      last day (3436 days later) » 

12:03 AM
@CSᵠ crypto_ is IMO a bad prefix.
 
@zerkms lol
@bwoebi other way around. bin2hex is encoding, hex2bin is decoding
@CSᵠ -1
 
@ircmaxell well, IMO, neither is.
argh
> This function does NOT convert a hexadecimal number to a binary number. This can be done using the base_convert() function.
Sorry for failing.
 
sure it is. if bin2hex isn't encoding, nothing is
 
@ircmaxell Yeah, Thought it'd be a shortcut for base_convert($num, 2,16)
 
yeah, in that case, no. But that's not what it does :-)
that's dechex
wow, I was cited by Pinterest's engineering team: engineering.pinterest.com/post/103653084534/…
@FlorianMargaine that's for you ^^
 
12:38 AM
Ah crap, Safe Casting's at 5:12 :/
Oh well, it has 17 votes now! Yay! @LeviMorrison :)
I think I'll try reviving it once Exceptions in the Engine passes...
 
@AndreaFaulds how's that related?!
 
@bwoebi People objecting to the use of exceptions in ext/standard
I don't like that people object, unhandled exceptions are just fatals
 
 
2 hours later…
2:40 AM
@AndreaFaulds Personally I think most people using a custom error handler are doing something silly ^^
 
@LeviMorrison , i am using it to convert all errors to exceptions.
 
I'm curious; do you catch those exceptions somewhere?
 
wrapping fsockopen
using dateTime over user values.
Then catch all exceptions(errors) to show error page.
 
3:08 AM
Also, NOTICE for me is an exception, and execution must be interrupted.
 
@ircmaxell , I like it.
 
:-PO
 
Where is composer.json?
 
is it possible to select the value of an array from a function? For example is it possible to condense this?
$value = function_that_returns_an_array();
$value = $value["i_want_this_one"];
 
3:19 AM
for php >= 5.4
 
^ is that in answer to my question?
 
Ah thank you, I thought that's what the syntax would be but it didn't work cuz we are using 5.3
 
for php < 5.3 it was "not php way".
 
not php way?
 
3:37 AM
@ircmaxell , may I add composer.json to your exception lib? And some improvements maybe?
 
go for it
 
base 64 encoding images- anyone?
 
@rancho , are you using tags as greeting?
 
uh???hello
I need to load 100 small thumbs on web page. file size is very small
I just got set up with amazon file bucket as well as 3 cloudfront distributions to spread out http requests.
 
What about sprites?
 
3:46 AM
I looked in to that to, but for this specific project it would not be a good fit
I cant remember why i was turned off from base 64 though.
Would encoding 100 images result in far better performance than spreading requests over multiple servers?
 
@rancho , you need to measure it. Using base64 approach removes request overhead, but adds size overhead.
Also, if this images are dynamic it takes time on server side.
 
just was reading this
13
Q: base64 encoded image size

Danny FoxIf I convert an image (jpg or png) to base64, then it will bigger, or it will have the same size? How much greater will it be? Is it recommended to use base64 encoded images on my website? Thanks in advance,

yeah, looks like maybe for now i am using best approach. Will do some more testing to see. thanks
 
Remember to measure when doing optimization.
 
Yeah. I have found chrome dev tools to be very helpful.
 
 
1 hour later…
5:26 AM
That question is asking how to sort by LAST MODIFICATION date. I dont ened that but file CREATION date. 2 completely different things. — Cain Nuke 5 mins ago
78
A: sort files by date in PHP

GordonThis would get all files in path/to/files with an .swf extension into an array and then sort that array by the file's mtime $files = glob('path/to/files/*.swf'); usort($files, function($a, $b) { return filemtime($a) < filemtime($b); }); The above uses an Lambda function and requires PHP 5....

@Gordon ^^ Could you make that answer a bit more ... contemporary? :)
 
@Ja͢ck Do you have HHVM/Hack installed, by chance?
 
5:45 AM
I do not.
 
:/
<?hh

interface Comparator<T> {
	public function __invoke(T $a, T $b): int;
}

function compare<T>(Comparator<T> $cmp) {
    $cmp(0, 1);
}
Hack doesn't understand __invoke.
> This call is invalid, this is not a function, it is an object of type Comparator
I am going to attempt to fix this ^^
I will likely not succeed
 
6:09 AM
Would be nice if that could work heh
Damn, I haven't had time to look into that darn CSV issue.
I've made two code changes so far that should yield better behaviour though.
CSV is one of those loose specifications ..
Anyhoo, lunch time!
OT: I've recently bought a bread making machine ... loving it!
 
now you need to look after your weight carefully. :^ )
 
…Yeah I'm going to need some coaching through that OCaml stuff.
 
6:25 AM
OCaml, where art thou!
 
6:51 AM
@ircmaxell it's missing all the figures :( and it doesn't mention sha256/512 at all
I mention these because I had someone tell me that "md5 isn't good, but you can use sha256 with a salt"
 
morningz
 
morning
 
morning
 
4 days till I have to work again :D
 
Already awake?
 
6:56 AM
been up since 6
(is 7 now)
kids don't understand "day off" ...
 
Well they have school don't they?
 
yeah
they could let me sleep another hour though ... they never do ... children are so unreasonable ...
 
So... Back to sleep once they're there :P
 
I don't like to aim to sleep during the day ...
 
Although I know I couldn't do that...
 
6:58 AM
because I'll be sitting awake all night if I do that...
 
@JoeWatkins You get the US and EU holidays off?
 
Well no, but until 10/11am isn't in the day...
 
@LeviMorrison yeah, pretty sweet right ?
 
Indeed ^^
 
hows the return type patch going ?
have you implemented any of those options in your email yet, and what is feedback looking like (what's preferred by internals) ?
 
7:01 AM
I like sleeping an hour in the afternoon. Like at 14:00 or 15:00
"la sieste" :P
 
@JoeWatkins I haven't implemented any options, but I did make it easier to switch to invariant.
It also fixed a few bugs.
 
so is that the plan, invariant ?
 
Stuff like case insensitivity and matching the defining class name since it doesn't exist in the lookup table yet.
@JoeWatkins No, but I prefer that over call time.
Right now people have really only responded about off-topic things or misunderstandings.
Nobody has indicated what they prefer ^^
 
what about during FETCH or bind ?
 
…you mean does it exist during those phases? Didn't quite follow.
 
7:13 AM
yeah, if the checks are delayed until FETCH_CLASS then autoloading isn't a problem, and nor is the order of declarations, right ?
 
Oh, it's only an issue when you are trying to fetch the class that is being defined.
Fortunately you can retrieve it easily ^^
You just check if the return type matches the declaring class (which you obviously have) and use that instead.
 
or a class that hasn't been defined yet
you can't sanely do these checks at compile time and hold onto covariance I don't think, so what I'm saying it, delay verify inheritance step until FETCH_CLASS retrieves the compiled class at runtime, then perform the checks, then set a flag so that you don't have to perform them more than once
this is way earlier than call site check and allows you to hold onto covariance ..
so at compile time, rather than perform the checks you set ZEND_NEEDS_VARIANCE_CHECK on the class entry and do the actual check at runtime then unset the flag ...
am I making sense ?
 
7:34 AM
this is perfect! thanks Jack, you're awesome — adit 27 mins ago
Yay \o/
 
posted on November 27, 2014 by kbironneau

/* by mElt */

 
I was thinking of creating a PCRE regex pattern for the php language. I want to make it modular with recursive patterns like I did in this answer. I'm looking at zend_language_scanner.l, it doesn't seem what I'm looking for. I'm searching a source in the form of something like this tools.ietf.org/html/rfc3986#appendix-A. Any ideas?
 
Ehm ... good luck.
 
@Jack morning, couldn't get any of cmark to really work yesterday will have another look today ... you looked yet ?
 
@JoeWatkins There's no Jack today, only Objective C ...
 
7:38 AM
lol thanks
 
gross @Jack
 
@HamZa , it seems that you cannot do this.
 
where i can find routes for a resource in laravel?
 
@sectus I'm afraid that you're right :/
 
7:41 AM
PHP is a turing-complete language. And regular expression is a none-turing-complete language.
 
/**
* @param string $apikey Your MailChimp apikey
* @param string $secure Whether or not this should use a secure connection
*/
function __construct($config = FALSE)
 
@sectus But ... recursive patterns ... :D
@Patrick Documentation rot?
 
@Ja͢ck That file has docblocks about 5 times the size of the code above each method. And most of them are incorrect...
 
Hmmm I see....
 
8:08 AM
You had me at "side project" ;-)
 
victory is mine ...
--TEST--
Check cmark list creation
--FILE--
<?php
use CommonMark\Parser;
use CommonMark\Node;

$list = new Node(NODE::ORDERED);
$item = new Node(NODE::ITEM);
$text = new Node(NODE::HTML);

$text->setContent("item");
$item->appendChild($text);
$list->appendChild($item);

echo $list->getHTML();
?>
--EXPECT--
<ul>
<li>
item</li>
</ul>
 
lol
awesome!
 
yeah ... well sorta ...
should be <ol>
 
did you misread the api before or something?
 
just checked implementation detail, didn't get that you couldn't setContent on NODE::ITEM
it has to have an inner node ...
 
8:12 AM
ah
 
(stupid, but probably a reason for it)
 
Yeah, just like how you have TextNode in HTML
 
yeah
 
though, how would this be any better than just using DOM? maybe i'm just missing something heh
unless this can generate both MD and HTML
 
good meurning!
 
8:16 AM
Btw, interesting court case on copyright infringement related to printed books.
 
Good morning. I am trying to install composer on my linux machine. Global.
 
it should be in the pachage manager
search for something like "php-composer"
on freebsd it lives under /usr/ports/devel/php-composer
 
Yes it works
;)
Someone experience with ForkCMS?
 
sounds terrible
 
Should be not that bad.. fork-cms.com I've heard..
 
8:31 AM
jeez .. it is actually worse then I thought: github.com/forkcms/forkcms/blob/master/src/Api/V1/Engine/…
 
Im not that advanced to see what might be wrong there.
 
let me guesss, static?
and wth // simulate $_REQUEST
 
@Ja͢ck how?
 
By not using create_function()
Oh, I may have skimmed that answer a bit too fast.
For some reason the guy I was helping used the 5.3 version =p
Eh, somehow this question was reopened ... dafuq
 
8:50 AM
18
Q: sort files by date in PHP

sasoriI currently have an index.php file which allows me to output the list of files inside the same directory, the output shows the names then I used filemtime() function to show the date when the file was modified. my problem now is, how will I sort the output to show the latest modified file ?, I've...

 
eh?
 
This one?
 
Ah yup
heh
thnx!
 
Mjolnir away.
 
morming
 
oh god the pain -_-
 
@Fabor How is it going :(
BTW your images look pretty awesome gross
 
Not cool. At home now but it hurts a lot :-/ perpetually uncomfortable.
 
9:12 AM
@HamZa KILL IT! KILL IT WITH FLAMES!
 
@Fabor Sorry for you man
 
heh cheers. Had to be done :) I'm sure it'll get better
 
What did I miss @Fabor?
 
Had surgery on my leg to fix my stress fracture finally.
 
9:14 AM
13 hours ago, by Fabor
Pictures if anyone is interested. Little gorey but nothing too bad.
 
@Fabor have a nice recovery...
 
Feels like you could do that to my knee @Jimbo :P
Cheers @HamZa
 
hmm .. how will that impact your employment situation, @Fabor ?
 
9:19 AM
@tereško It won't. I live 3 minutes walk from work and can remote if necessary
 
cool
 
Apparently there's an Area 51 proposal for Health ... scary
 
in these situations, I'm happy to live in France. I know that breaking a leg won't hurt my employment at all...
 
@Ja͢ck Yay, you can ask about a cold and finally have a decent non-yahoo-based answer
 
php.net/mysqli_real_escape_string => "doesn't exist. Closest matches: mysql_real_escape_string mysqli_escape_string ..." => "mysqli_escape_string: Alias for mysqli_real_escape_string" ^.^
 
9:20 AM
@AllenJB please learn to use prepared statements
 
@Jimbo Yeah, "Q: I have a cold" .. "A: morphine!!"
 
upvote upvote upvote
 
@tereško I know how to use them, but sometimes (esp. if you're converting old code) they're not necessarily the best option.
 
Thing is, that can become pretty dangerous
 
Yeah, it could.
 
9:22 AM
(I don't mean morphine, I mean answers affecting people's lives)
 
@Jimbo From my experience from Pets, most of the answers would be "Go to the doctor"
 
Mhmm, pets involves behavioural issues too
I think health would have a lot of gross pictures on there
 
Yes, which is why I said "most"
 
Like your face knee @Fabor. Did you ask them to 'cast' it for you?
 
@Jimbo .. but it would require to strong administration to keep out the homeopathy/crystal retards
 
9:23 AM
@tereško LOL
this is true
"Crystal Retards"
 
lol
 
Nope. No cast needed.
 
@Fabor so, off to play soccer again tomorrow, yeah?
 
I'll settle for being able to sleep :P
 
@PeeHaa is already cv'd
...
 
Good good
 
posted on November 27, 2014 by kbironneau

/* by Nosradrugis */

 
WTH is this? Crap question day?!
 
Isn't that every day?
 
It is really sad to see that some people are using SO for personal service help desk
And their intelligence doesn't allow them to understand what they are doing wrong
 
And they say civilisation as a whole is advancing .. I just don't see it.
 
Why isn't there like a small SO test with 10 questions lets say that asks you basic things about how a question should be formulated and you have to answer them all correctly to be able to use it
 
Do it!
It won't get accepted, though.
 
Well it would get rid of a lot of people that just use it without even reading the rules
and it would ease the job of the mods
 
9:40 AM
On the other hand, when I ask a question I end up solving it myself .. sigh
 
It could be even simpler, just give an example of a wrongly asked question and 20 checkboxes below and you have to select 5 of them which are the right reason why the question/answer is not good
 
We have something like that.
 
btw Jack, is there any particular style reason you do ++i; instead of i++; ?
 
Yeah, it's because I don't want to know the old value of i.
 
?
but it is a single line of code
you are not assigning the variable to anything
 
9:43 AM
Yeah ...
 
so the old value doesn't matter anyway
the last line of your answer -> stackoverflow.com/questions/27124482/…
 
I know where you got it from heh
Dunno, I probably heard somewhere that pre-inc is more efficient.
Whether that's true is irrelevant at this point, because it's now done out of habit :)
 
I am just wondering
 
Now you're making me find out lol
 
147
Q: Is there a performance difference between i++ and ++i in C++?

Mark HarrisonWe looked at this answer for C in this question: http://stackoverflow.com/questions/24886/is-there-a-performance-difference-between-i-and-i-in-c What's the answer for C++?

 
9:46 AM
yeah
I am just reading that
 
Though, nowadays the compiler is smart enough to figure out both statements are the same so it will compile it into the same thing.
 
50
A: Is there a performance difference between i++ and ++i in C?

Sébastien RoccaSerraFrom Efficiency versus intent by Andrew Koenig : First, it is far from obvious that ++i is more efficient than i++, at least where integer variables are concerned. And : So the question one should be asking is not which of these two operations is faster, it is which of these two operati...

 
Right, if there's no good reason to use i++ it's better to use ++i regardless of performance differences .. makes sense
 
Mornings
 
yo
 
10:00 AM
yo yo [=
 
Is this pie sad, or confused? #PiesHaveEmotionsApparently http://t.co/mhWGDj09e6
 
I want a pie now
 
@JoeWatkins reminds me of Quasimodo
 
10:18 AM
mornings
 
yo @DaveRandom
 
@JoeWatkins More importantly, why is the potato more important than the meat?
Potato does not belong in pies.
 
@DaveRandom I guess the more appropriate question here is: Would you live longer by only eating potatoes or by only eating meat?
 
That's an irrelevant question. Who wants to be 100?
 
@JoeWatkins More like, tongue-in-cheek pie :)
 
10:22 AM
@DaveRandom hah that is not exactly true
If you eat only potatoes you would acquire most of the needed nutrients but you'd lack vitamins A, B12 and E and calcium and selenium
I read about an experiment where people ate meat for one year and the result was that there was no difference after a year passed
 
yeah, doing this experiment since 20 years, no difference
 
hahaha :D
I have a friend who is allergic to vegetables and eats mainly meat
 
Idiopathic environmental intolerance attributed to electromagnetic fields (IEI-EMF) is a descriptive term for symptoms purportedly caused by exposure to electromagnetic fields. Other terms for IEI-EMF include electromagnetic hypersensitivity (EHS), electrohypersensitivity, electro-sensitivity, and electrical sensitivity (ES). Although the thermal effects of electromagnetic fields on the body are established, self-described sufferers of electromagnetic hypersensitivity report responding to non-ionizing electromagnetic fields (or electromagnetic radiation) at intensities well below the limits permitted...
I raise you this ^
 
@SecondRikudo this reminds me of my father who used to stop my PC during the night because he thought the electricity running in the PC while I was sleeping was creating electromagnetic field which is not good for my health...
 
"How to Inspire Greatness: Stop Leading": http://www.inc.com/jessica-stillman/inspire-greatness-by-not-leading.html - make sure to watch the video.
 
10:35 AM
Have you guys heard of the health risks caused by Wi-Fi radiation
 
@Danack @bwoebi @rdlowrey I'm going to go ahead and split the amphp/dns caching layer out into amphp/cache. On reflection I can't come up with a good reason not to do it.
 
I just used git merge --squash
it's amazing
 
@ziGi Well, it's good to save electricity anyway.
 
10:50 AM
True, but back then my internet was slow so it took me a whole night to download 1GB and he used to ruin everything
 
I have an appliance for that now :D
 
?
shutdown /t 5000
 
I can just tell it to download this and that, then switch of my computer
 
shutdown -h 5000
@Ja͢ck most of the torrent clients have that option
 
Yup, it can do torrents too
@ziGi Actually, I meant that I can switch off my computer while it's downloading.
 
10:55 AM
ok, so?
 
So .. I save power, I guess
 

« first day (1503 days earlier)      last day (3436 days later) »