« first day (881 days earlier)      last day (4085 days later) » 

5:04 PM
@Gordon: migrate this to security? stackoverflow.com/questions/15437840/…
 
Good evening all, have a good weekend :)
 
Good evening @Jimbo
 
Hello all
I am trying to implement chat functionality for iOS. The client side is clear but on the server side, there is a problem. I was finding out xmpp server code in php. xmpp.org/xmpp-software/servers This url provides the list of xmpp server's. But this can not be hosted on justHost.com. So how do I come up from this situation??
 
0
Q: Why is inserting into multi-dimensional array so slow?

artfulrobotI have code similar to this: <?php $index = array(); foreach ($results as $row) { $index[ $row['field_a'] ][ $row['field_b'] ][ $row['field_c'] ] = $row; } Each $row is not big, and $results only contains ~200, yet this takes it 4s to run. I realise I'm duplicating data everywhere, of...

Hi All
 
5:19 PM
Woot, answered 3 questions today... This must be a record for the past few years
 
Anonymous
I guess SO is too tough for ya ;)
 
no, I just stopped caring about answering questions
 
were php 5.3.23 and 5.4.13 officially released already? http://bit.ly/10XuQfL
3
 
because there weren't any interesting (to me at least) questions. All just repeats and duplicates
 
Anonymous
I thought. The same thing when I saw your reps stuck at 46k long enough.
 
Anonymous
5:24 PM
I guess so best years are behind it
 
it hasn't been stuck at 46k
it goes up every day
I average about 50 rep per day just on residual upvotes
 
Anonymous
Yep, you'r right when I first saw your reps abt 4 to 5 months ago, it was 44k
 
Anonymous
Good answers pay dividend
 
@hakre Do you have any decent XPath docs (other than the spec) for the OP of stackoverflow.com/questions/15437139/…? I only read the spec these days but it's a bit inaccessible to a newbie...
 
5:32 PM
'@Baba provided an excellent class, which is written with the use of SPL. I wonder how to rewrite this code without SPL. The reason is that calling this class multiple times will give function overhead, that can be avoided rewriting it in raw PHP, and maybe using goto statement in final version, to avoid recursive function calls.'
 
@DaveRandom this is porbably good schlitt.info/opensource/blog/0704_xpath.html
 
@hakre Cheers
 
@DaveRandom hi
Is there any overhead using Anonymous functions ?
 
@Baba yo
@Baba vs what? I mean yes there is, but it's probably negligible, depends what you are doing
 
@DaveRandom How is your son ?
2
Q: Implementing MongoDB-like Query expression object evaluation

fitheflowI've been looking for a MongoDb-like ( http://docs.mongodb.org/manual/applications/read/#find, docs.mongodb.org/manual/reference/operators/ ) query expression object evaluation function implementation or a class. It may cover not all the advanced features, and should have extensible architecture....

 
5:35 PM
Fine fine
 
@DaveRandom the guy wants goto
 
Hey Dave.
 
@jkushner yo
 
Never been on a stackoverflow chat before. Very nice.
 
@Baba That's a total bullcrap reason for wanting another answer if you ask me. It's not like low level languages where goto is often quite close to a JMP assembler instruction.
 
5:37 PM
@DaveRandom i don't think he know how complex that task is ... because my class looks simple does not mean its a walk in the pack
 
So I have a question. The constructor for a DOMDocument has an encoding parameter. Should I worry about this?
 
@jkushner Yeh it is nice, we have spent a lot of time pulling it apart and seeing how it all works and generally breaking it ;-)
 
rewriting it in raw PHP,
what is raw php ??? help anyone :)
 
huh?
 
@ircmaxell The guy is saying that because a solution uses stuff from SPL it could be done more efficiently, basically. And he's saying this without being able to write it, he's created a bounty and is asking for said more efficient solution.
 
5:40 PM
@NikiC is there anything missing from phlexy for a v1.0.0?
 
@jkushner No, that's only really relevant if you are creating an empty document for the purposes of building/outputting, when you load an existing document in it has no effect
 
I see.
 
@DaveRandom he's an idiot
 
Those args are basically the attributes of the <?xml ?> declaration when you output
 
@fitheflow: avoid premature optimization. Try it. Never make anything faster than it needs to be. You always lose something important in the process (like maintainability). If you're worried about function overhead without even trying it, you're doing it wrong (tm). — ircmaxell 21 secs ago
 
5:41 PM
Right. I didnt know if it mattered if the xml document is this encoding or that encoding.
 
Which is more readable?
    protected function isCached($name)
    {
        if (array_key_exists($name, $this->_cache)) {
            return true;
        }
        return false;
    }

    protected function isCached($name)
    {
        if (array_key_exists($name, $this->_cache)) {
            return true;
        } else {
            return false;
        }
    }
 
@jkushner and you can change that stuff after the constructor anyway, its just a shortcut to setting the corresponding public properties of the document object
 
the first isCached is how I would do it.
 
@an1zhegorodov micro-optimization. Don't worrya bout it. Pick one and run with it. But be consistent about your choice
 
protected function isCached($name)
    {
       return array_key_exists($name, $this->_cache);
    }
 
5:42 PM
^ what he said
also , why are you using hungarian notation ?
 
@jkushner It does when you output, if the data in the document is UTF-8 but the XML declaration says iso-8859-1, it ain't gonna work. But for what you are doing it's irrelevant, it will use the values declared in the document you load in.
@an1zhegorodov I vote the first one, but I'd probably put a blank line between } and return
 
So I dont need to worry if the user supplies a UTF8 versus a ISO88591 xml file?
 
@Ocramius is this doc stored somewhere as repository too?
 
2 days ago, by Gordon
Guys, can you please collaborate on improving the phrasing of https://gist.github.com/3881905 and also think of a less obtrusive way of putting it on StackOverflow. They way it's used now it's rather spammy. Thanks!
Anyone got something on this? ^ If you do, please comment on it.
 
@jkushner As long as they declared the right encoding in the document it's fine - and you have no control over this, so don't worry about it.
 
5:44 PM
@Baba I like this, thanks)
 
@DaveRandom Great. Thanks for the help. I really appreciate it.
 
@jkushner np
 
@Baba fix your white-space if you're going to do that
 
@ircmaxell .... i like avoid premature optimization
 
@Eugene it's in the main repo
 
5:45 PM
	protected function isCached($name) {
		return array_key_exists($name, $this->_cache);
	}
@ircmaxell fixed
 
For you to do all that for a question. And then him say it's not good because it uses standard library tools? WTF? He's an idiot...
@Baba Much better... Now, if only we could fix the variable naming. And get rid of the function call overhead
 
@ircmaxell .... lol lol lol
 
protected function isCached($name) {
    return !empty($this->cache[$name]);
}
 
@MadaraUchiha I've been mulling it over and I just can't see a way to improve the situation. I pondered creating a ref question instead but I can't see that it would help, plus there's like 200 billion basically identical q/a already.
 
^^ That's how I would do it
 
5:46 PM
 
@DaveRandom There already is a sort of canonical question.
Is all the information on that comment necessary?
 
@ircmaxell that is better ...... isset would also work
 
@Baba yeah, depending on what you're after
 
@ircmaxell really your comment .. its funny that the only he can find for such a complex task is SPL ..... and to avoid recursive function calls. .... .. you are right he is an idiot
 
5:53 PM
@MadaraUchiha I just can't see any way to trim it down. I mean we spent long enough tweaking the wording choosing a URL shortener with minimal chars for the links to satisfy the character limit, it can't see a way we could just bin some of it. The real issue is that people still answer the damn questions immediately, regardless of how shit they are, which means it looks like spam because it's kind of superfluous off-topic noise.
If people stopped answering the questions, then people would actually take some notice and it would be less spammy and more productive.
 
@Baba yeah, don't get caught up over it
 
@DaveRandom It's not the problem.
 
I know that's not really a practical observation, but I feel it has a lot of truth to it.
 
The problem is that we've been getting comments that the comment gets spammed too much.
@DaveRandom And you know we can't change rep-horse, so there we go.
If you have a different solution, we'd sure love to hear it.
 
@MadaraUchiha Actually, I have a less obtrusive way: we answer the questions (properly) and include the comment at the top of the answer body. And we don't post the comment on shit questions that will obviously get closed anyway because they are unanswerable.
 
5:56 PM
@ircmaxell yeah .. am glad i did not waste my time implementing $and , $or , $regex or $set
 
hehehe
with goto, because that's a really fast performance improver
 
lol ^^
 
We could make it longer and less blunt if we did that as well
 
@DaveRandom That is a solution, will it work though?
 
Am still trying to figure out how goto would make the code better
 
5:57 PM
 
@MadaraUchiha I think it would feel less spammy and more friendly towards the OP if they got "here's the answer to your problem and by the way, ..."
 
swtich with hard coded options might work
 
@DaveRandom That's not what I mean by will it work
 
@Baba he thinks that he can avoid the overhead of function calls (which there is) by making is code far more complex and retarted... Which won't work...
 
Posting it as a comment (especially with the addition of Pro formula comments) is much much easier than doing so in a comment.
 
5:58 PM
@Ocramius darn. Didn't spot docs directory
 
@ircmaxell Maybe he secretly wants to code in assembler
 
@DaveRandom reminds me of a CS101 problem a friend of mine was given
write an elevator control system using no functions and no variables...
 
@ircmaxell you can not even avoid recursion when dealing with multidimensional array with unlimited depth .. and querys can cut arrows multiple depth
I stand to be corrected
 
me, him and his older brother (who works for me) spent 8 hours on a wall full of whiteboards to get it
 
@ircmaxell ... video -- lol
 
6:00 PM
the final flow chart had over 800 decision points, and like 4000 connections...
 
@ircmaxell No variables??
 
@Baba You can avoid recursion... All tail recursion can be optimized to a simple loop (well, not simple, but a loop)
@DaveRandom we went in to talk to the teacher, and yell at him for such a dumb problem. He said he never expected anyone to finish it, it was there to prove how hard programming is without these constructs. And to appreciate them
 
@ircmaxell loop ??? Really .. how are you going to determine the depth to know how many time you would loop ??
 
:\ Bitbucket changed the font of source code... looks ugly
 
@MadaraUchiha Well, I know where you're coming from, but I think we need to maybe look at this as a problem that needs more effort putting in. We've made it easier for us but cold and clinical to the recipient, and that is when it really does start to tend towards spam. If you (the generic you) don't have time to properly help the OP, don't do anything at all. You could always come in here and see if anyone else does have the time, or bookmark it for later.
 
6:04 PM
@DaveRandom You want to form a ring around it?
 
In computer science, a tail call is a subroutine call that happens inside another procedure as its final action; it may produce a return value which is then immediately returned by the calling procedure. The call site is then said to be in tail position, i.e. at the end of the calling procedure. If any call that a subroutine performs, such that it might eventually lead to this same subroutine being called again down the call chain, is in tail position, such a subroutine is said to be tail-recursive. This is a special case of recursion. Tail calls are significant because they can be impleme...
 
@MadaraUchiha Not necessarily, I'm just saying it's an option. To be fair, a lot of the ring stuff that happens is kind of negative, it might be nice to have something a bit more positive. Although don't get me wrong, I see that this is a lot more human-resource-hungry, and we would definitely have to pick and choose our battles.
This is just my opinion though, we could do with a meeting of the regular minds/people who regularly use The Comment, and see what everyone things.
 
@ircmaxell This is a special case of recursion. .. its till recursion .. i was thinking you said it can be done with only loop ... I get it now
 
@ircmaxell PHP doesn't do tail recursion though, does it?
 
yes, not that only, but can be optimized to
@DaveRandom no
I don't know of any interpreted languages that do... I could be wrong there though
A good exercise: type song lyrics as you listen to the song. Really works on typing
 
6:11 PM
i used to do that often
 
it's possible to emulate tail recursion using a trampoline
 
lol
 
Is simple.com using Keyword Search or Natural language processing ??
 
in case anyone is interested in what I just said, blog posts: (1 2 github).
 
dinner this month in portland .. returning all dinner (Time Of Day) this Month (Time of Year) Portland (Location : Country not city ) ... looks interesting
 
6:17 PM
wait, waht?
 
^^^^
trying dinner this month in Portland would bring all transaction relating to dinner , this month in portland
so i said is this Keyword or Natural language processing
 
@igorw emulate. It's not really tail-recursion because there's still a function call being executed. But it is saving stack space...
 
yep, it solves the stack space problem, it doesn't save on the procedure calls.
 
which is still pretty cool, don't get me wrong
 
@igorw ping
 
6:26 PM
Im trying to parse a csv file. The result is a multidimensional array. The first array contains all the header information. What PHP function should I look into for setting the keys for all of the post-first arrays to the values for the first array(the array containing the headers)
 
@Lusitanian no tests? :)
 
@Lusitanian ;-)
 
@igorw pssh...testing is for people who aren't sure their code works ;) (yeah it's broken)
 
6:28 PM
@ircmaxell lolwhoops
 
@DaveRandom Didnt even think about just looking at the API because Im in a PHP chatroom. Thanks for the info :)
 
@Lusitanian Isn't set() supposed to return a bool as well? ;-)
 
@DaveRandom it does
 
Oh, I see. You did send me a function
 
@Lusitanian No it doesn't.
 
6:30 PM
@DaveRandom ?
 
oh it does
 
I just looked at the link and saw just php.net
 
lol
@jkushner Oh yeh it shortens the displayed URLs quite enthusiastically
 
Normally I would just read through the API anyway so I didn't take any offense to it.
 
OH: "pssh...testing is for people who aren't sure their code works" #fail
 
6:32 PM
@ircmaxell I (hope) you know that that was sarcasm :D
 
@Lusitanian Oh I definitely know that :-D
 
@jkushner Meh, I can't complain too much with the array functions, there are way too many random ones that seem like they should be left to userland implementations, or not enough of them, depending on how you look at it (I say too many).
 
@DaveRandom way too many and arrays should be objects
 
Right, I have finally finished sending these f*cking emails and I am going home
@Lusitanian agreed
Catch y'all in a couple of hours.
 
@igorw updated pr btw, but i'll add tests if you insist on me not ruining your coverage
lol
 
6:41 PM
8 messages moved to bin
 
0
Q: looping through an array

user2162372My question is how to stick array values into variables as I loop through them. I am using this to fetch my array - I need two values from the query. $categ = array(); while ($row = mysql_fetch_array($result)) { array_push($categ, array( 'cat' => $row["CategoryName"], ...

 
just 21 more twitter followers
 
just... another... 15... minutes... vacations... ARGH!
when does this friday end? :(
 
never
 
@igorw One thing I'd like to add is the ability to create the samantic value directly in the lexer (e.g. like this: gist.github.com/nikic/f5b1be5b009c124cd05a) rather than rematching lateron
 
6:48 PM
Hi all
 
Why would the count of an array change if i specify the size in array_pad. For example, the size i specify is 79 but every array is having the size of 89
 
isn't possible to execute some code, example setting a member variable in a catch block? I try to set a boolean variable once the connection ot database is failed
But cannot see the echo of that variable when running the code
 
@Malloc (string) false === ''
 
Efe
hello all
can I ask a simple question
facebook realtime has been a torture for me
 
Nevermind the question. The data is invalid.
 
6:53 PM
@Efe Efe .. where are you from ?
 
:8291991 catch(PDOException $e){
				    	$this->setIsConnectionToDataBaseSuccessfull(FALSE);


					}
}

}//End of class


$updateStock = new UpdateStock;
echo $updateStock->getIsConnectionToDataBaseSuccessfull();//This is displayed only when connection succeed
 
Efe
new york
 
 
The last echo is running only when connection is successfull, otherwise, the code into catch seems doesn't getting run
 
@Efe Most people with the name ever originate from Benin
 
6:55 PM
So I've been trying to get the paypal ipn to work for a couple days now, and I just am not getting any response in my database when I post. Does anyone have any good resources other than the paypal website with an example?
I'm trying to use their new code ever since they deprecated http 1.0 headers
 
@Efe In Turkish it also means 'older brother'.
 
Efe
wow I didnt know that
but hold on to that
 
@Efe Just Google it :)
 
Efe
I really need help here
I wasted a good 3 hours here
 
@Efe On What ?
0
Q: Facebook realtime updates post request

EfeI am trying to setup Facebook realtime updates for my website. I am almost done with it but stuck here. I dont understand what will be the name of the form submitted here with POST request. For example, foursquare sends it in _GET("checkin") which is Request.Form("checkins") in classic asp. ...

 
Efe
6:57 PM
I dont understand facebook api
 
^^^^^ on that
 
Efe
yes!
Is $data = file_get_contents("php://input"); ~~~~ _GET("php://input")
 
@Efe nothing like _GET("php://input")
Have you Set up an endpoint URL in facebook ?
 
Efe
yes
I subscribed for the real time update and there is an endpoint where facebook is sending the data
 
@Efe Then you are done
 
Efe
7:04 PM
php://input ~ what do I replaced it with?
 
you are not replacing that
@Efe This is all you need codedestination.com/2012/08/…
$json would give you the update in JSON format
 
Efe
see I need to find out the equivalent of "file_get_contents("php://input")" in classic asp
fixing a website for my client that was built with classic asp long ago
I just cant get paid until I make this work :)
 
Use HttpRequest.InputStream
but this is actually a PHP chat room not asp
 
Efe
I was just trying to understand
 
ok
 
Im trying to use array map but my custom function contains 3 input parameters. Is there a way to handle using array map with multiple parameters?
 
@LeviMorrison happy birthday ...
 
Efe
Sorry, just got disconnected
thanks a lot Baba
I will read that article
 
@Efe you are welcome
 
Nevermind the API details what I need to know
how do I call array_map on $data with a function like this: function csv_fix($data,$headers,$numCols)
Nevermind I see the problem. $data is a multidimensional array
 
7:26 PM
@Baba Thanks :]
 
@Lusitanian I don't want tests for the sake of tests, I want tests so I can add more as I fix small inconsistencies. I'm working on it now, thanks :)
@NikiC oh yeah, that'd be cool
 
in Dart Lang, Dec 16 '12 at 16:15, by Levi Morrison
As long as it has 100% test coverage I'm fine with it. Who cares if it actually works, right?
@rdlowrey What do you think about me merging Sunrise into Ardent?
 
user895378
@LeviMorrison I like it.
 
I like that it gives people a reason to use the iterators.
However, @igorw seems to think it's better for them to not be merged.
 
user895378
7:46 PM
Merging forces you to take both even if you only want one. You really just need to ask yourself how many people are really going to want one without the other?
 
@Lusitanian merged, thanks
 
Is $_GET deprecated in PHP5+, cause I see someones using $_REQUEST
?
 
Anonymous
@Malloc Are you kidding?
 
LOL, yes
 
Anonymous
Maybe somone wants to get get,post and cookies at
 
Anonymous
7:58 PM
the same time
 
hi, i have a shared hosting account witch means i cannot use node.js so is it possible for me to still use some kind of cross browser web sockets?
 
user895378
I seriously doubt if you'll ever be able to host websocket applications that will run on shared hosting. Your best bet is probably to use a third-party service like pusher
 
user895378
I don't think anyone will shed tears for you over your crippled shared hosting account, though. Shared hosting isn't for applications -- it's for a front page and a contact form.
 
@rdlowrey yes i know about shared hosting, but that wasnt my question
 
user895378
If you "know about shared hosting" you already know the answer to your question and don't need to ask it, do you?
 
8:07 PM
Why are you trying to reason with an idiot?
 
user895378
Good point. Problem solved forevermore.
 
Ardent is down to 74.88% coverage! Oh no! The horror!
I'm sure glad I haven't pushed that commit yet, I'd never be able to live with it.
 
@webarto your the idiot
 
@Connor I know he started it, but let's not propagate this any further, alright?
 
@LeviMorrison What do you expect, what did i do wrong? did i even speak to IT?
 
8:09 PM
6 hours ago, by DaveRandom
At lest I can typ
 
@webarto Good for you! at least you know something
 
@LeviMorrison happy birthday! don't ban me :P
 
@Connor I expect you to be polite and civil, just as I expect @webarto to be.
 
Yes, Sir.
I get freaky on Friday night.
 
@LeviMorrison well you obviously have to high of expectations from it
 
user895378
8:11 PM
The ignore list is just so ... liberating.
 
@Connor You still aren't being civil, are you? I know he started it; man up and ignore him.
 
@LeviMorrison its unnecessary and you also joined him by saying "Good point." whats all that about?
@rdlowrey Use it then honey (Y)
@LeviMorrison By the way whats the opposite to civil?
 
Anonymous
@Connor Don't talk to attention seekers,
 
@rdlowrey I sometimes wish I have that option IRL/AFK.
 
user895378
It's true. It's really nice to just tune out the noise.
 
8:17 PM
@PHPNooB i wont
 
@webarto it's called headphones
 
@igorw I almost ran over a dude with a car, he was wearing headphones, but was blind too I guess (red light) :D
 
@LeviMorrison I'm not strongly against merging them, but you should consider your target user base. if you merge, you are assuming that they want both iterators and data structures. which means if they do not, ardent will be bloated.
 
hiya @webarto
 
@Lusitanian Hiya, little cute man.
 
8:27 PM
@webarto UM
 
@Lusitanian I won't tell your mother, she would be disappointed. /cc @rdlowrey
So, what's up?
 
nothing at all
 
user895378
Asynchronous php function calls, bitches. That's what's up.
 
Oh, I'm sorry! *makes lemonade*
 
lolol
 
8:29 PM
@rdlowrey Have a whiskey, release yourself from the chains of PHP.
 
user895378
Hmm ... no whiskey around, but I may go snag a beer from the fridge.
 
@rdlowrey $person->drink($beverageFactory->create($person->getPreferredDrinkNameFactory()->createPreferredDrinkName()));
 
user895378
flags what?
 
who is talking about flags?
 
Shog9 will not come if you (removed)
He's already here :P
 
8:34 PM
already read 'em
 
Everyone knows we are mentally unstable, so they just ignore it.
 
$person = $person->drinkPreferredBeverage();
because you're never quite the same after you've had a drink
 
@Shog9 which one? the doodle? just done
 
@Gordon awesome, thanks
 
user895378
@igorw lol well done, sir.
 
8:36 PM
@igorw combine that into one message so i can star it please
 
@Connor You are mistaken; I did not say "Good point", that was rdlowrey.
 
@LeviMorrison is the most polite person on the internet
 
Everytime I think I got a virus it's just Avira poping up commercials, ironic.
 
i refuse to believe he did anything that could be construed as rude
 
@LeviMorrison k, sorry
 
8:38 PM
Good point
 
it did look like it though
 
:8293144 lol
 
user895378
@LeviMorrison I totally did. I stand behind my harmless but whimsical statement and reserve the right to never remove the victim from my ignore list.
 
@rdlowrey who is the victim, btw?
 
user895378
Not sure, I can't see any of the victim's messages.
 
8:40 PM
i don't think i can either and i see one of my tinyvatars talking...must be him
 
Yup
5th from the left, atm.
 
yup
 
you and your tiny avatars
also:
Just published a PHP extension for buffer based typed arrays (like in JS) that I had lying around: https://github.com/nikic/buffer
 
I try to keep my list very small.
 
user895378
@NikiC Nice!
 
8:46 PM
@NikiC I might install and see how my performance goes for my hotplate problem.
 
@LeviMorrison I don't think it'll go anywhere ;)
This is not performance relevant (as you can see with SplFixedArray). It's more about memory usage and in this particular implemenation also about data reinterpretation ;)
And I think more importantly:
ZendOptimizer+ has just been merged into PHP 5.5! https://github.com/php/php-src/commits/PHP-5.5
 
yay...
 
user895378
Well at least it didn't turn into a long, drawn-out quagmire of release-delaying bug-fixes. Well at least the ZO+ commit didn't make the world blow up ... yet. /cc @ircmaxell + @NikiC
 
Ah, I already see the commit spam coming...
@rdlowrey Oh, that's yet to come ;)
This is just the initial merge (modification-less)
 
8:51 PM
wow
@rdlowrey Oh, it already has
 
basically just renamed zo+ to "opcache" and merged it
next step will be removing all those version specific #if directives I guess
 
@rdlowrey believe me, it will
 

« first day (881 days earlier)      last day (4085 days later) »