« first day (1238 days earlier)      last day (3935 days later) » 

10:03
morning everyone
morining @Patrick
moin @Patrick
hands up if you use mac ?
promise I won't shoot your fingers off, I genuinely need a crazy person .... I mean mac user ...
I use a mac but it runs Linux
Does that count? :P
no gotta be osx
@JoeWatkins need to install ubuntu on it, right now its still running osx
10:11
Macbook Air was part of the job perks
I use mac!
and PC - whatever gets the job done :)
what's the most common way of installing php on a mac ?
0
Q: how to enable pthreads on MAMP

WorkSessionsI'm using a Mac with OS X Mavericks, and running php scripts within MAMP. Some of the php scripts I'm running require the use of pthreads. Can anyone provide step-by-step instructions on installing or enabling pthreads on a Mac? I have Googled extensively and have found little-to-no documentat...

or what's mamp ?
10:12
is that mamp ?
no
I don't like mamp
hm. interesting Friday tricky question (nothing to do with real use-case). We have some delimiter-separated string. For example, $string = "Foo;Bar;Baz;Fee;Feo";. And we have to explode it into array, but last and first element should be swapped. Also, tricky part: be should do that as one-liner. What should that be? I.e. most "elegant" solution? Mine is:
$string = "Foo;Bar;Baz;Fee;Feo";

$result = ($y=explode(';', $string))?($x=array_shift($y))?array_merge($y, [$x]):null:null;
I can guess, but dunno what it is, I think it'll be specific to them though ...
@JoeWatkins commonly i'd say MAMP
morning
10:14
But it's not my preferred way
hi, @NikiC
Morning @NikiC
morningi @NikiC
@AlmaDo ...
<?php
$string = "Foo;Bar;Baz;Fee;Feo";

$array  = (($split = preg_split("~;~", $string))) &&
		  ($head = $split[0]) &&
		  ($tail = $split[count($split)-1]) &&
		  ($split[0] = $tail) &&
		  ($split[count($split)-1] = $head) ?
		  	$split :
		  		[];

var_dump($split);
haha
10:18
moin new peeps
@JoeWatkins jesus :D what was that? :p
strangely indented code ...
It's best read on a single line.
I never really understand why people say "it has to be a one liner"
@JoeWatkins Tab user! Burn him!
10:20
terrible terrible person
hm. Sounds like my first attempt, but too complicated. May be simpler way?
@NikiC I'm in counseling, another 30 years and my shrink says I'll be cured ...
@AlmaDo define simpler, I don't like function calls or array merging, it's wasteful if all you are doing is swapping the head and tail, then swap the head and tail, don't call three functions and jump through hoops ... in my opinion ...
@JoeWatkins ok, good point
@JoeWatkins my first approach was like yours, but with explode(). Why preg_split(), btw?
@JoeWatkins Are you sure it wasn't... another 30 years and you'll be dead?
Trolololol ;D
*yawns*
10:24
I can't say that, I'm feeling a little old now... gotta watch my lower back...
@SuhosinPony So, when I left, last night's chat went a lot better....
@Jimbo lol
You two become best bum-buddies didn't you?
I honestly don't recall much of it, I left work and went to the bar
:D
Yesterday was a clusterfuck at work lol
@AlmaDo explode(';', preg_replace('/^([^;]*);(.*);(.*)$/', '$3;$2;$1', $string))
@Jack haha, that was refused (but also used by me) :D figures. You even named it in same way. And used same regex :DD
10:26
Refused?
@Jimbo he said I wouldn't be when he asked me for up front payment ??
yeah. @JoeWatkins's proposition is the best, it seems. (I misunderstood "one-liner". It is - but also fastest way)
now that guy has his one-liner and happy
You didn't say there were rules :)
lol
yeah, my bad. Your option is good in terms of one-liner. But.. we've done that in exactly (literally) same way :D
10:29
Great minds ... hur hur
@JoeWatkins Ye gods, wtf is that monstrosity?
$readability--;
@Jack heh.. as it always happens - now task is "take N items from start and swap them with N end"items..
I'm out of that :p
Oh jesus, wth @AlmaDo you are creating some horrifying things here
@DaveRandom which are.. ?
@AlmaDo Does the order within those N items matter?
10:32
morning, btw
@Jack yes
dat thread (also see the initial formatted question)
It's not a problem. Now I can argue and say: do not do that with one-liner :p
@PeeHaa he has been struggling with it for 4 days ;-)
@PeeHaa Gosh, why don't you just help the guy?!!
also, got interesting SO question. SELECT MAX(DISTINCT colName) FROM t is valid syntax. I've checked manuals, it's ok. And equal to just SELECT MAX(colNAME) FROM t. In MySQL. Reason: for compatibility. Thus. does anyone knows DBMS where they're not equal? And if yes - what is the behavior of MAX..DISTINCT ?
10:35
What time is it? Bug fixing time!
@Jack it's always bugxifing time. Even if you sleep
I meant php-src bug fixing time :)
^ so what's the difference? :Ь
different bugs
Different bugs. Same time.
^ promo slogan
10:38
I would make a Die Hard joke, but I can't think of one.
@Jack You mean to say, feature adjustment time?
Yeah, fair enough :)
To the feature adjustment mobile!
@DaveRandom I've already said NO to that person. But thanks :p
10:42
@DaveRandom UMM
@NikiC inorite
I didn't say it was a good idea...
@AlmaDo MAX(DISTINCT) won't have a different result from MAX() anywhere (unless the engine is broken). Depending on the implementation it may have a performance difference (e.g. max of 2 distinct values out of 2000000 values) but I suspect many databases just ignore the distinct for max. As for why it's there, I'm assuming to keep the function signature the same across MAX() and other aggregate functions (AVG(), etc.).
@DaveRandom Three slices should "cut" it ;-)
Wait wut?
btw is there any different between array_merge and array_replace? I can't work how merge doesn't just replace...
@salathe well, I've checked. No - there's no difference for MySQL in terms of performance. DBMS won't create distinct set and then do MAX. It will just ignore DISTINCT keyword. (For example, if colName has index, then DBMS won't do anything with table data - it will just read one entity from index for both cases and that's all)
and - yes, MAX for distinct set is same as MAX for original set just by definition
10:46
Well there must be a difference, but I can't think of any input where the outputs would be different...
Oh it's assoc/indexed, duh
@SuhosinPony Asynchronous JavaScript and... JavaScript...?
@krakjoe this extension will open many wonderful scenarios! thanks!
aww fanx :)
Hi, I'm building a opencart website greenthegap.prayerkart.com and the problem is if i change my shipping (india to international or international to india), The currency unit shows opposite conversion & if i refresh its showing proper currency. How to solve this, I can touch cache as it may effect cart...suggestions please...
@DaveRandom Yeah, array_merge() works in a special way if the keys are numeric :)
@Jack Yeh I realised that, should apply brain before opening mouth
Replace works like $arr + $arr
11:00
Only if the keys are disjoint.
@rdlowrey Awesome!
Would be a nice feature in chat to highlight the starred message when you hover on a direct reply of it :)
All tests pass? Push that crap!
@Jack Z_STRVAL_P(return_value)[length] = 0;
Hmm?
11:08
length != Z_STRLEN_P(return_value)
Either php_stream_read already adds the NUL byte or that code won't be working correctly is not enough bytes are available
Ah ... okay, let me write a failing test case for that.
Ehh
I must have copy/pasted it from somewhere
Can't have copied it from here, because that one actually seems to be correct :)
You'd expect something a little better from a large organisation
You forgot to mention that it's a financial institution :)
crap..
well no
it's a sample :p
When I've worked in SMS-aggregator company, we also had API and sample scripts. And there were very dummy. So dummy that even last blasted idiot who'll do connection maintenance at client's side will understand :p
@Jimbo JSON. :P
11:21
@Fabien These scripts tend to be 10 years ago.
PHP really looks crappy written like this.
:( yeah
@NikiC Updated, thanks for spotting that.
Couldn't really figure out a good way to make a failing test case though =/
@webarto it's main property of crap. So crap is the universal thing: you can do crap from anything you want. Thus I doubt if it's only PHP problem :p Take any language and you'll be able to create crap
@AlmaDo So true, I've seen a lot of crap in C++
@SuhosinPony oh.. C++ is mainly like PHP. I mean - sooo hard not to create crap :D
@SuhosinPony haha, just faced: stackoverflow.com/questions/22146094/…
11:30
0
A: how to enable pthreads on MAMP

Joe WatkinsI'm not a Mac user, however the build process is the same for Mac and unix, so I can help you with that. To configure your current installation: Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user This is the reason pecl install failure, maybe check the ...

if anyone has anything useful and mac-centric to add ...
@AlmaDo That makes me so mad.
@AlmaDo People using pointers when they shouldn't.
@JoeWatkins Hmm, you reckon anyone is going to touch the hash_equals() PR? ;-)
Though, imo, not enough PHP_SAPI heh
11:50
@Jack It's not ready to be merged yet
@NikiC Anything in particular that needs to be worked on?
Btw ... should I merge this or will someone make a more substantial fix for the failing test cases?
@Jack I added a comment
I wish there were some awesome testing framework for integration / regression tests, written with PHP, but can target JavaScript
Looks like I'm going to try PhantomJS + CasperJS unless anyone else has any good ideas?
Already using webdriver + selenium, and it's pants
@Jack For the cast-128 tests they keys should be padded with NUL bytes
@NikiC Huh, how would that have ever worked?
@NikiC To make the test pass?
11:55
Not sure how I missed that test failure...
I can update it for ya .. :)
@Jack Yeah, so instead of \x01\x23\x45\x67\x12\x34\x56\x78\x23\x45 it should be `\x01\x23\x45\x67\x12\x34\x56\x78\x23\x45\0\0\0\0\0`
Same for the last key, also needs nul padding to 16 bytes
Yeah :)
doesn't make sense to me
I swear I ran those tests
It changes the outcome though hee
Wait, that can't be. . i must have screwed up sth
12:00
@Jack The cast-128 test doesn't fail for me
only the hash one
diff mcrypt versions?
could be
I have libmcrypt 2.5.8
Version => 2.5.8
Api No => 20021217
Same ...
Hello all
eek
what does mcrypt -v say?
12:04
I only have libmcrypt
I am trying to connect from PHP to SAP, using SAPRFC library. I have XAMPP installed on my system, and SAP system is conncted through LAN. Is this setup ok, or do i also need to have SAP GUI installed on my system ?
so, that's weird
Yeah, that key size issue comes from libmcrypt itself, right?
yes
at least I'd assume so
strange ...
12:07
heh
oh, the message itself comes from php_mcrypt_ensure_valid_key_size() :)
in any case, i can pad the keys but that affects the output.
expected?
@NikiC Oh, because apparently the rounds are increased to 16 when the key is bigger :)
Still, it's weird that your build doesn't exhibit that issue.
I tried disabling cache in stackoverflow.com/q/22249737/3392534 but still its showing correct currency only after refresh chat.stackoverflow.com/transcript/message/15149523#15149523
any one here for zend?
Yeah i want to learn zend & one day zend certification :)
12:23
I remember those days when I was motivated.
When you pass certification, your life is complete, there's nothing else to hope for.
Everything went downhill from that point on.
then YII (yes it is )
I'm not suicidal.
Yii is still around?
Forget rest, Laravel is the latest buzzword in php frameworks
YII supports multi-threading?
12:26
@Joe supports multithreading :P
@lusitanian's mother supports multithreading
6
^ :D
I toast breads with one hand and eat with another
@shasi Because if software development is any one thing it is definitely buzzwords
And basing your career, livelihood and the products you create around them
@cspray Agree
12:29
Man, this is too much for not-even-had-coffee-yet. I'll see you guys later.
2
Whoever creates the next big thing should call it "Buzzword"
That'll really screw the CVs
or "Insert Buzzword Here"
mysqli_query($is_member, "insert values (select * from stackoverflow.com) into awesome")
yay me ?
along with ur peers and sweets (cookies)
12:38
@NikiC Could you see if these cases pass for you?
Morning
@AshwinMukhija can you please explain to us why static is considered bad, especially in this case ? — Christophe Roussy 59 secs ago
Good to introduce statics to beginners in programming.
Static makes my hairs stand up
@ChristopheRoussy Oh boy. If you are not using Object Oriented concepts in Java by turning everything into statics, why even use Java? Statics break OO fundamentals, statics make testing harder by a magnitude and statics are okay ONLY to declare constants in Java. For any other purpose if you are using statics, there is always a better way. — Ashwin Mukhija 16 secs ago
Sorry if I missed something.
:P
good to read
I love it when people solve OP's homework for him/her.
12:48
@NikiC Ignore my previous msg =/
@AshwinMukhija: I strongly disagree with you here. Static methods definitely have a place in Java, and are completely ok to use in a lot of places. Good examples include the Collections and Math classes. — Keppil 56 secs ago
I'm out of here.
Hai =]
How do you like your dates served? m/d/Y right?
@Jack Okay ^^
Those test cases are the test vectors from RFC 2144, so I'd assume they are correct, including the key sizes
I'd just leave it failing
Yeah that's why :)
12:55
@PeeHaa Because 'MURICA
@NikiC Hmm, maybe a full rebuild ... brb
@Fabien That is the us format right?
user895378
@Jack I just read over your bug66384 patch. It looks sane to me. I also pulled in the branch and the new test case passes fine with a debug build. Also valgrind has no complaints. Caveat emptor: I'm still a zend noob so I can't say for sure that nothing is wrong with it, but it "works for me."
Quick a murrican! nag him to answer! @rdlowrey
@PeeHaa Yeah
user895378
12:56
@PeeHaa I think that's the standard way people do it but the only sane format as far as I'm concerned is Y-m-d
<3 Y-m-d
@rdlowrey <3
user895378
But yeah, you usually see m/d/Y in everyday life here
tnx both
d.m.Y for life.
12:58
@rdlowrey You mean 66834 right? :)
@webarto +1
user895378
@Jack sorry. I'm a bit dyslexic at times :)
Aye, never understood the 'm' first - I suppose those Americans need reminding everyday.
dd/mm/yyyy ty
> Month/day/year is used by:
US and some traditional UK organisations. The format was traditional in England, whence it was brought to America. Since the 1900s the English have begun to use the Day/Month/Year format, imported from Europe.
12:59
LIES
It hurts me too @Jimbo
Don't trust that Wikileaks now.
But at least we had the sense to change.
Well..
I guess it's been the Romans Europeans have given the best of British right?
@rdlowrey Oh, on master could you run ext/mcrypt/tests/bug62102_rfc2144 test case?
user895378
13:02
sure.
I want to make sure it's not just me
@NikiC will probably put the blame on MacOS =p
user895378
@Jack passes for me.
!#$!%!
user895378
Debian GNU/Linux 7 (wheezy)
@rdlowrey It gives me this instead.
user895378
@Jack try updating your libmcrypt-dev package?
It's 2.5.8
morning guys!
happy friday!
Morning :)
13:17
@MackieeE how's it goin?
Yea pretty good :D Needing an Americano right now though.. x)
Good afternoon clever heads
user895378
@Jack yeah mine is 2.5.8-3.1 ... not sure what to tell you :/
Can somebody please tell me why I should move my website away from PHP generated images
because i'm thinking of doing this to speed up my site
@rdlowrey It's time to hunt >D
13:18
however will it actually achieve such a thing?
@Naveen pls, upvote all you've downvoted class Error { private static $_CODES = array( 301 => array( "code"=> 301, "message"=> "User With ID Not Found", "type"=> "Error" ), 302 => array( "code"=> 302, "message"=> "Email Id Not Valid", "type"=> "Error" ), ); public static function getError($code) { return self::$_CODES[$code]['message']; } }zogby 4 hours ago
lol ... answerer noob
Sorry but, I don't think there's a flag for Copy-paste answers right?
This dude: http://stackoverflow.com/a/22243677/292735

Copied this answer:
http://stackoverflow.com/a/5226333/292735
@MackieeE Ah, him!
I keep seeing him do it =[
user895378
@JoeWatkins looks awesome, though I'm wondering how I can do that without blocking the main process while they resolve
13:20
@reikyoushin and you? :D
@MackieeE I've already flagged that answer, but it seems that the mods are having coffee.
@Jack Aha good good :)
@Daffy What do you mean by "generated"?
user895378
@JoeWatkins Or am I misreading that and the then() calls return immediately? I think I'm misreading that.
@MackieeE same old.. :) although there's gonna be something interesting coming up in the next few weeks ;)
13:22
Do you mean routing image requests through a servlet or do you mean actually generating the images on the fly?
well its part of a code that generates a resized image based on an original version that lives in the ether
@reikyoushin Career wise? :D
@MackieeE well, maybe.. who knows? ;)
@Daffy Well if you're doing that for every request then you shouldn't be. When you obtain the image, you create static files for each require size and serve those statically (or through a servlet)
I dont know the exact ins of that code, but all i know is if i put in something like image1-100-100.jpg it knows to return that image 100 x 100 - and the actual image is "code"
13:24
@Jack He also did it here, as his pasted answer doesn't even work with the Fiddle he provided stackoverflow.com/a/22250049/292735 from stackoverflow.com/a/22249957/292735
:/
somebody else with more brains than i built the site, however some bits i find messy - this being one of them, i dont think site speed was as big a consideration then
@rdlowrey no blocking they are executed in background
I'm trying to follow (roughly) Promise/A*
@MackieeE lol ... amazing, but i don't think he'll last for long.
@Daffy That's going to be pretty slow and resource-hungry. Instead you should work out exactly which sizes you need and generate them when you obtain the image (when it's uploaded etc.) and make it so that image1-100-100.jpg is a real file on your server
@DaveRandom that's good to hear because thats the eventual plan
when i go to the URL of the file I get gd-jpeg v1.0 (using IJG JPEG v80) so will investigate that a bit
user895378
13:29
@JoeWatkins is there any way to get information from onError and onProgress? Like a string describing the error and the actual partial data from a progress event?
@DaveRandom much bigger job at hand because there are lots of image locations and varying sizes plus the code to get rid of, but from your suggestion i might be able to leave the code in place and actually create hard copies of the images with the same filename. Just wanted to check it was a worthwhile folly - thanks for your help as always
@Daffy In the interim, you could create a simple caching mechanism, so just wrap the resizing code in if (!file_exists($localPathWithFileNameAndSize)) { /* image generation code */ file_put_contents($localPathWithFileNameAndSize, $imageData); } readfile($localPathWithFileNameAndSize);
That way you can ensure that only the first request for a given image/size combination will cause a whole generation cycle
It could also help you work out which image/size combinations are actually used because they will all be in that cache location
user895378
@JoeWatkins If you're able to make these things work reliably it will be an unbelievably big win for me. Like, more than I can explain. Right now to accomplish this stuff I have to do all sorts of hacky things in userland that are (by relative comparison) pretty slow.
13:47
Issues like this makes me feel sad for Xcode devs all around.
Nice, Bergmann must be ecstatic :)
14:12
yeah baby
can someone, who has looked at Promises/A* or knows of another implementation somewhere, suggest names for the interfaces/classes there ?
I hope this works...
Feb 28 at 15:17, by Dan Lugg
Feb 21 at 14:01, by Dan Lugg
Feb 14 at 3:32, by Dan Lugg
Feb 7 at 5:00, by Dan Lugg
Jan 31 at 12:54, by Dan Lugg
Same words we all use when going live.
@DanLugg You have to be careful with that, you can seriously break the styles which them breaks the entire chat application because it borrows some computedStyles at one point. @Shaq properly broke the sandbox once, balpha had to go in to the database and manually deleted the message :-S
It may have been fixed by now but I know it was a long way down the list of things to do...
14:18
I wonder if @PeeHaa has a beer countdown timer on his desk or it's just an internal-alarm.
/me is too heavy now (: eat too much on corporate celebration of March, 8 :p
@Fabien I bet it subscribes to events emit from his circadian rhythm.
lol
user895378
@JoeWatkins I would call your IFulfill something like FutureComputation because that's what it is ... it's a placeholder for a yet-to-be resolved computation and its methods (onComplete, onError, onProgress) are essentially just accessors to those computational results.
user895378
Also: AWESOME.
user895378
14:26
I'm still a little unclear on how I would go about manually killing the worker that's resolving a given promise if I determine in the main thread that it is taking too long.
user895378
And yes, I still agree/understand that timeouts+kill() are not a good solution; but they're necessary to protect against badly-written user code in a generalized server environment.
I updated em with different names, maybe bit better ?
they have the info to know which worker they are being executed by
I don't think I'll write this as part of pthreads, there's nothing to gain by converting it from php to c and other people can get involved, maybe do something better or follow some standard ....
you can run it from now, I commited changes required to master
maybe I found something I can put on composer ?
if I alias Stackable with Promisable, then the only classes in userspace would be Promisable and Thenable, that makes sense right ?
and PromiseManager
and Promise
user895378
Makes sense to me.
user895378
I will play with this today and try to make sense of everything.
14:43
hehehehehehe
BTW it is almost beer time!
user895378
s/beer time/breakfast time/
gaaaaaaaaaaaay
Or do you mean it is the same thing? :)
Because it totally is
user895378
Yeah, the two are definitely not mutually exclusive :)
:D
@rdlowrey You already ran your shit with phpunit 4?
user895378
@PeeHaa not yet, but now seems as good a time as any
@PeeHaa I have a friend who used to have Special K + Peroni Nastro Azzuro for breakfast every morning
Actually it usually involved some green and/or white stuff as well
He's not what you'd call a productive member of society
user895378
lol

« first day (1238 days earlier)      last day (3935 days later) »