« first day (811 days earlier)      last day (4142 days later) » 

3:00 PM
I want to dynamically create in memory file and write to the file and then read
@DaveRandom
 
@abdulwakeel Yeh I guessed that, but you really don't need the pointer. You can just use the string, it will be much simpler and the pointer is what's causing the problem I think. Give me 1 second.
Since it's XML, personally I'd use DOM for building it anyway
 
posted on January 04, 2013 by Rafael Dohms

Note: This article was originally published on the april/2012 issue of php-architect. If you like it subscribe to the magazine and keep a close eye on the Community Column in the magazine, where I get the chance to write alongside other awesome community people. There is a lot more to being part of this great community we call the PHP community than just learning, sharing and contributing. The

 
@DaveRandom I am using directly without creating file, but its still give me contentdoes not match error
 
Thanks feeds-guy for reposting old articles. Perhaps you should try to force the article down harder in our throats.
 
3:07 PM
Hey @DaveRandom
php.net/manual/en/function.stream-socket-client.php <-- this does not seem to exit ever...
Here is my code:
    ob_start();
    $fp = stream_socket_client("tcp://127.0.0.1:1918", $errno, $errstr);
    if (!$fp) {
        echo "$errstr ($errno)<br />\n";
    } else {
        echo "<pre>";
        $msg = "blah";
        fwrite($fp, $msg);
        do {
            var_dump($fp);
            $newMsg = fgets($fp, 1024);
            echo $newMsg;
            echo PHP_EOL;
            echo "EQUALITY:  "; var_dump($newMsg === $msg);
            echo "newMsg:  "; var_dump($newMsg);
            echo "msg:  "; var_dump($msg);
wait.
it does work, just very very slowly...
What could the reason be?
 
The TCP server should just be echoing back what it is sent
 
@Neal yo
 
(after sending "hello")
Here is what is returned:
resource(22) of type (stream)
hello

EQUALITY:  bool(false)
newMsg:  string(7) "hello
"
msg:  string(4) "blah"
Name: string(15) "127.0.0.1:63152"


resource(22) of type (stream)
blah
EQUALITY:  bool(true)
newMsg:  string(4) "blah"
msg:  string(4) "blah"
Name: string(15) "127.0.0.1:63152"
but it takes forever to disconnect... am I doing domething wrong?
@DaveRandom yo yo
 
@Neal OK firstly what is the server returning? Crucially, is the line the server sends back newline terminated (for fgets())?
;-)
 
3:11 PM
@DaveRandom ehhh I do not think so. i am using the echo server example
 
@Neal Try $msg = "blah\n";
 
  netServer = net.createServer(function(connection) {
    console.log('server connected');
    connection.on('end', function() {
      return console.log('server disconnected');
    });
    connection.on('message', function() {
      return console.log('server message', arguments);
    });
    connection.write('hello\r\n');
    return connection.pipe(connection);
  });

  netServer.listen(1918, function() {
    console.log("   net server listening");
    netServerAddress = netServer.address();
    return console.log("   the new server address is ", netServerAddress);
@DaveRandom k one sec
Yea, that worked instantly!
Why is it waiting for the new line? @DaveRandom
 
@Neal Because you are using fgets(), which doesn't return until you hit an end of line, and it's not like a file where it will return because it's the end of the file, because the stream persists.
feof() is only true for network streams when they have been closed, either by you or the remote end.
 
@DaveRandom hmmm so what can I use instead of fgets if I do not want new lines?
So what should I be doing?
 
@Neal Why would you not want new lines? For what you are doing (ascii message passing) they work as a good message delimiter.
 
3:14 PM
@DaveRandom , If I use base64_encode(md5($feed)); xml directly without creating file. its still give me the error
 
@abdulwakeel What is the error you are now getting sorry?
 
@DaveRandom hmmmm. well how would i hadle actual information passing? currently I have a post that does it, but I want to switch to the stream connection.
 
@DaveRandom ContentMD5DoesNotMatchthe Content-MD5 HTTP header you passed for your feed (ODRjMjIzMjlhMjQ0NTM3NjMxOTE0MzkyMzNlNWJhYTA=) did not match the Content-MD5 we calculated for your feed (hMIjKaJEU3YxkUOSM+W6oA==)
 
lets see if it is possible to install GitLab on FreeBSD .. it was a royal pain on CentOS
 
Also on the Node end I never see the "blah\n" message... am I missing something @DaveRandom ?
 
3:16 PM
Yes. First bottle is open
 
@Neal Well, let's say you choose to use JSON for you message format (which I what I would recommend, being that one end is JS) then you would just do fwrite($fp, json_encode($data)."\n") to send from PHP to JS and sock.write(JSON.stringify(data)+"\n") to send from JS to PHP
 
@DaveRandom ok, but I do not see how to read it on the node side. My message function does not seem to ever be hit.
 
@Neal The Node.js end is using connection.pipe(connection) which just sends the data on the socket back to the socket and doesn't log anything to the console. If it were PHP, you didn't echo it
 
@DaveRandom ahhh haaa. So how do I read the actual message?
instead of echoing back everything?
 
When you get one of those you use the .read(), .write() etc methods to actually do stuff.
 
3:20 PM
@DaveRandom ehhhh
 
@abdulwakeel Ow wait, it probably wants the MD5 of the whole message body, duh, hang on.
 
@DaveRandom cool. it works :-)
awesome :-)
 
@abdulwakeel pastebin.com/kB9yKuzJ <-- try that
 
@DaveRandom thanks, let me try
 
3:26 PM
@PeeHaa :'(
You've finished early
(and started early)
 
@DaveRandom Server 500 500 - Server Error
 
Good morning
 
@abdulwakeel As in that's the response you get back from them or there's an error on your server?
@ircmaxell Mornings
 
the response
the problem is content md5, which I am sending. and which server is comparing.
 
@ircmaxell morning
 
3:36 PM
@ircmaxell Morning
Though it's evening here :D
 
@abdulwakeel Well a 500 error is an error at their end, if it was a problem with the request they should return a 4xx response code, not a 5xx response code.
 
HTTP/1.1 500 Internal Server Error Date: Fri, 04 Jan 2013 15:38:31 GMT Server: Server Last-Modified: Fri, 02 Sep 2011 01:29:37 GMT ETag: "a7-4abeb4b5ea240" Accept-Ranges: bytes Content-Length: 167 Vary: Accept-Encoding,User-Agent Content-Type: text/html Server 500 500 - Server Error
@DaveRandom
 
@abdulwakeel That's a problem with their web service, you would have to contact Amazon support about that. It may be that they are rejecting the request for some reason but if the is the case then they would normally return an error message.
 
@DaveRandom Still on the job no worries.
Drinking and working is the best combination after drinking in your time off
 
3:41 PM
@NikiC: What happens with a generator in PHP 5.5 when it's not yet finished but the script ends? Is there some control over that?
 
I wanna work somewhere where I can drink at work :-(
Actually, no I don't, that would be dangerous.
 
@DaveRandom You probably want to prefer journalism.
 
@hakre finally will be run ;)
 
@NikiC is that true? That's something different, isn't it? ;)
 
@hakre No I said "where I can drink at work", not "where work drives me to drink"
 
3:42 PM
@Neal bountied question can not be closed ... try flag instead
 
@hakre not sure what you mean
 
@Neal I'd say, it's okay to ask. That user actually invested 400 rep. This will settle anyway.
 
function gen() {
    try {
        // some really cool code here
    } finally {
        // this code will be run in any case, even if the generator is force-closed
    }
}
 
Any question that starts with the sentence(s) "No kidding. Really." is probably NARQ
 
@NikiC oh cool.
 
3:43 PM
@hakre ehhhh I flagged. it is not constructive at all
 
@Neal Well as said, if the user put a bounty of 400 on it (I mean it's not the petite 50 bounty), it deserves some respect. Sure this is a personal investment, but the question if answered as simple as asked properly, is not that bad. I actually tend to like these simple questions more and more.
They are often more concrete then something like "How to write this CSV" and the OP only want's to know how to re-order an array for example.
 
@hakre lol just because I put a big bounty on a crappy question, it does not make the question any better :-P
 
@Neal Well at least it shows that OP actually doesn't do this out of nothing. I think this makes a little difference at least. It might not improve the question, but shows some more will then just asking.
 
@hakre lol no. It just means noone really looks through those tags much and it did not get caught earlier, so he thought the question was OK for stack overflow, therefore he put down a bounty
 
Looks more to me like he asked two days ago and as fast as he was able to, he put the bounty on it. Let the bounty go, it's only seven days, you then can still close-vote it if you like.
And you can also flag the question if you really think it's moot. Moderators will give the rep back to the OP and remove the bounty from it. It than can be voted to close.
 
3:50 PM
@hakre meeeh. ill forget about it by then. The user should not have to waste 400 rep on something that should not have been bountied in the 1st place
I did flag it.
 
Also take care that at least one answer has two upvotes so that the bounty will (at least 50% of it) be spread to some other user if you're not successful with the flagging.
 
Now its giving way to answers like this: stackoverflow.com/a/14160327/561731 ...
It is becoming a link pharm
 
@Neal (or anyone else) Do you have any rep in the or tags? They should be synonyms but I can't propose one because I have no rep in either because I don't use flash, which is in turn because I am not one of the cool kids.
 
@DaveRandom idk, ive got nothing.... ask meta
@hakre felt like some fun: stackoverflow.com/a/14160401/561731
 
3:56 PM
@Neal There's already a q from 2011, seems to have been ignored
 
@DaveRandom linky?
bounty?
 
@Neal you could also link to some web-service that takes the referrer to turn it into a PDF that has some javascript to trigger the print dialog from the PDF-reader.
 
@hakre add them on. It is all CW
 
@Neal I don't have enough meta rep, you can if you want though, 1 sec
 
@DaveRandom k. lemme know when u have the linky
 
user1125394
@DaveRandom is it possible or good to use zeroMQ in a network* with hosts not necessarily in the same local network?
 
Ahh that makes more sense
Erm... I don't know
 
bumped it
@DaveRandom Y U NO ONEBOX?
 
and I added an "answer":
1
A: "flashbuilder" and "flash-builder" -- Aren't they the same thing? Can they be merged

hakreYes, please fix. For example, when I enter soapclient I get an error telling me I should use soap-client. This should be at least the same with those two in my eyes.

 
@Neal ONEBOXY NO USEFULY for that, I mean who in here really cares about flash?
 
4:00 PM
@DaveRandom , thanks its worked now.
 
@DaveRandom Cameras do.
 
@cyril I don't really see why not. It's a bit of a toss-up though - what's the local:remote ratio likely to be?
@Neal :-P
 
@DaveRandom ^_^
 
@abdulwakeel What was the problem?
 
user1125394
@DaveRandom it can be 5 machines in my lab, and others in another city, but just wondering because we use a http (rest) interface, zeromq enables more fancy things
 
user1125394
4:04 PM
sorry I do know it reping when you edit a pinged message :P
 
user1125394
zeromq is just for the communication between those hosts, not the client of course
 
@cyril The thing about ZMQ is it abstracts the transport layer. As has been a recent topic of discussion in here of late, HTTP is a pretty inefficient way to implement IPC on the local machine, but if it's a bunch of separate hosts then it's a question of what you are actually doing with it. But comparing ZMQ and HTTP is a bit of a moot point because they operate at different OSI layers.
(kind of)
 
2 more for hat! I want to beat @hakre :-P
 
user1125394
zeromq is still above IP right?
 
user1125394
but you means connected sockets with hosts 50kms away is probably not a good idea
 
user1125394
4:08 PM
but in local network it is
 
Yes. It's sort of layer 4.5 if you will. It's an abstraction of the transport layer, in a nutshell.
 
first question ever with video ... O.o
 
> Code it only with jQuery.
That's the option for me
in Android, 21 mins ago, by WarrenFaith
user image
7
-_______-
 
Insta star
 
4:19 PM
@PeeHaa I should have copyrighted that :P
 
lolz
 
Has anyone used PHPillow before? arbitracker.org/phpillow.html Any other experience with a couchdb wrapper?
@hakre I think I'm in the same boat as BoltClock. I get the merge request but are you suggesting something more automatic for tags whose only difference is a dash in the middle?
 
Considering the comments on my (apparent) coherence earlier, I figured I'd toss you guys this quote:
"The object of life is not to be on the side of the majority, but to escape finding oneself in the ranks of the insane."
Whoever identifies the author wins 5 internets.
 
@MikeB I'd be down with that
 
4:30 PM
@MikeB Well SO warned me taking the "wrong" one. I actually wonder that it is possible to have two such-close-tag-names. I would say, do it for that tag, too. Merge and then warn.
 
@Sommer Marcus Aurelius
 
God bless his Stoic heart.
 
(Yay for Google and its point obtaining skills)
 
You have won 5 internets sir.
 
Winner. Not sure where I'll keep them though.
 
4:32 PM
If you're concerned about storage space, don't be.
They're more like a series of tubes
You only need to hold onto one and the rest is by definition attached
Hey have you seen Sem recently?
 
@DaveRandom , I set feedcontent = $xml
and revert my code. but got very help from your script
 
Guys why does my browser(Firefox) log only list Internal Network 500 error's if I get an error in my script?
 
@Sommer Nope :-(
 
Oh well.
I gotta dash out to the store.
 
Anonymous
is there any reason why ORDER by RAND() is not working for me in PDO?
 
4:37 PM
Bbl
 
user1125394
crossroads.io/faq wtf is their reason for not accepting pull request? looks they are afraid of git
 
@MarioS Because the client only has the http response code to go on. If you want to see the error message you'll have to check the web server logs
 
0
Q: get_results return doesn't iterate

user1765876I am creating WP plugin,here is my code $cmdb = new wpdb(DB_USER,DB_PASSWORD, DB_NAME, DB_HOST); $retval = ''; echo '<table align="center">'; echo '<th>Coupon ID</td>'; echo '<th>Coupon Name</td>'; echo '<th>Coupon Text</td>';...

^ QC this user please. Thank you! Not that we raise another Help Vampire, it seems a bit so.
 
That makes sense @DaveRandom
 
4:38 PM
@Sommer laterz
 
Hi all i am new here
happy new year :)
 
Alright guys, time to roll out. See you probably after the weekend :)
 
Hi new here, I'm DaveRandom
 
... and good morning
 
4:40 PM
Shit, you people do weekends?
 
@igorw Yo dawg, I heard you like async SSL connections, so I put an async SSL connection API into your async SSL connection API so you can run async SSL connections over your async SSL connections.
 
@DaveRandom Shalom Dave random, you look so beautiful as usual inside and outside and all around! Especially your hair, your hair and everything you wear. Your shoes, your shoes and everything you choose....
 
@Sommer Some of us have no life whatsoever.
 
@DaveRandom seems legit
 
@DaveRandom, I meant logging off for the weekend. I'm gonna spend it working too.
I have a life, and right now my work is it.
 
4:42 PM
Noone went to camp as a kid?
boring
 
@igorw morning
 
@Neal Camp is kind of an American thing I think. We certainly don't really do it here.
 
How can trying to defy existing design patterns or reconcile opposing ones be boring?
 
@DaveRandom you dont have sleepaway or day camps in the UK?
 
@Sommer I hear you man
 
4:43 PM
Tweaking algorithms to blaze past the peer review process in terms of cryptographic security and leave the masses obliviously wanting.
/me high fives DaveRandom
 
@Neal Not unless that part of culture passed me by.
 
Plus like Dave said, camp's actually a geekier thing here in Euroland
 
We sit indoors drinking tea and complaining about the weather instead.
 
@DaveRandom interesting... So what do kids do during the summer?
 
That or of dubious sexual nature.
 
4:45 PM
@Sommer Your country men enjoy it somewhat IIRC. I used to go on camping holidays when I was a kid, you go to a campsite and everyone there is Dutch. And all their 7 year old kids show us up by speaking perfect English.
 
@Neal might be complaining ... to there lazy parents ...lol
 
This is true.
I thought you meant like boyscout camping trips and themed camps for kids only.
 
@NullPointer eh?
 
But for families as a whole, especially with young kids, boats/caravans are quite popular yes
 
How's it going?
 
4:47 PM
Hey Maxell. It's alright, how are you?
 
@Sommer Yeh we were originally talking about that sort of camp I think. You know the American one, that's spelled with a capital C.
 
@ircmaxell camping ? lol
 
Yeah, I don't think I've ever heard of such a thing or know someone who attended as a child.
Not here that is.
 
doin good
 
In American shows you constantly hear about "space camp" and stuff.
 
4:48 PM
I went on a couple of scout camps, but the majority of them were in winter for some bizarre reason.
 
Well there's scouts.
 
Mmmm tasty stereotypes of American Life.
 
I gave it a few swings but I always found it boring.
 
Ahhh, Holywood.
 
guys i have a question
 
4:49 PM
Shit it.
 
does anyone use
 
Yes Harshal?
 
codeigniter tank auth
 
I'm not your man I'm afraid
 
Oh god he mentioned CI. Run for cover!
:-P
 
4:50 PM
I got errors working in PHPPHP... Going to push after I fix a few broken test cases...
 
I'm not your man either, sorry
 
user1125394
the webscale protocol nanomsg.org
 
Is anyone well versed with MongoDB? ^^
 
user1125394
I prefer ComboDB
 
4:53 PM
God I feel like such a newbie asking for query help - probably why I got the n00b christmas hat for my profile
 
user1125394
dam it actually exists
 
@cyril haha, so it does!
 
@Jimbo See room description ;-)
 
Hmm, it's a query that will be run using PHP driver ;)
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
 
4:55 PM
Alright alright, thanks for the clarification guys :P
 
user1125394
Discussion for all PHP things Id say
 
@Jimbo I was more referring to Just tell us your problem. If anybody can and wants to help, they will.
 
I have a multidimensional array stored in MongoDB; I can UPDATE a field by going like this: $collection->update(array(),array('$set' => array("key1.key2.key3" => "NEW VALUE!!")));but what I now want is to GET that value, giving only key1.key2.key3
Btw if I succeed here, I can use MongoDB for my project for everything from simple value modification to versioning, so I just need to be able to do this now ^^
 
@Jimbo You mean like findOne()?
 
5:05 PM
.. and i'm home. Good evening everyone =]
 
@DaveRandom That would work if I knew the value I was looking for
But that's what I'm trying to get, without knowing it of course, by using it's parent keys
Good evening @tereško
 
man, adding error handling (and parameter checking) really slows down the execution...
 
I think I have to use $elemMatch, not sure though
 
@ircmaxell slows down the execution, or slows down the execution when it's actually used?
 
both...
 
5:09 PM
why?
 
@NikiC haven't profiled, but takes 30 seconds longer than it took yesterday
 
why would that happen?
unless you constantly check for an error everywhere, which you presumably don't
 
@Jimbo Sounds like key3 (the deepest level of the keys) should actually be a value in an id field, so you can query for "key1.key2.id" => "key3"
 
@ircmaxell Will look at your additions later
@ircmaxell btw, why not add arnaud to the repo?
 
does sizes attribute work with apple-touch-startup-image ?
 
@NikiC Yeah, I wanted one or two more PRs to validate, adding now
 
5:24 PM
stackoverflow.com/questions/14161209/… because no clarification was given
 
Hi all :)
 
@Daverandom thx!!
 
I am new at here but feeling free to join with you in some discussions :)
 
A lot of people have gone home/are on their way home I suspect because a lot of people here are European and most of us are on 5-7pm at the moment
 
5:34 PM
YES. DONE IT :) I have stuff to do over the weekend now
 
this now includes myself
 
Hey all
What is the difference between using socket_create vs stream_socket_client?
 
@Jimbo Nice one. I'm really genuinely pleased for you, watching the battle of Jimbo vs MySQL and The Ridiculous Serialisations was getting a little painful to watch,
 
@DaveRandom ^ ?
 
In MySQL, if you want a value according to a key, you perform the following: SELECT value FROM table WHERE key = ""; In MongoDB, you have to do this: $mongo->findOne(array('key1.key2' => array('$exists'=>true)), array('key1.key2' => true));
 
5:36 PM
@Neal Different extensions. Use stream_*(), it provides abstractions that make IO easier and is more readily available because Streams is bundled with the core and Sockets isn't.
Right, I'm really going home now
Catch y'all in a couple of hours
 
@DaveRandom hmmm ok. I just noticed with an old PHP 5.1 project that I used socket_create and it's siblings
 
Have a good weekend guys ^^
 
@Neal Yeh I stream_socket_* is 5.2+ IIRC, but they are way easier to use because you can use file system func.s
Seriously going now, back in a bit
 
@DaveRandom latr
 
5:52 PM
@ircmaxell lol, I get a memory limit error when running phpphp :D
due to all the aliases
 
@DaveRandom based on looking to my right, you've been on a roll of late
 
@DaveRandom would appreciate your feedback on github.com/symfony/symfony/pull/6540
 
@NikiC yeah, I got that as well at home
must be a windows compile issue, because on OSX I see a peak memory usage of int(20386648)
 
Backsies
 

« first day (811 days earlier)      last day (4142 days later) »