« first day (879 days earlier)      last day (4062 days later) » 

8:00 AM
@NullPointer I have to agree that this guy trolls the rooms because I have seen him in android rooms asking a question many a times and disappears.
And then appears and then disappears
 
@Appu ahh agreed
global $troll_renj_jr;
while($troll_renj_jr){Get_the_f_out_here();}
 
Lol.. Nice. Programming way of expressing disgust.
 
it winning amount is like 100k than i think any one would show some interest
@Appu :D
@Swati fyi most of time those are only troll
some time ya its helpful .
 
anyways
i m looking on google for some tutorials on php sessions
 
@Swati php manual .. is way to go imo
 
8:08 AM
-1
A: Why declare a function as a variable in php

Jack in many cases functions are defined as variables If you're talking about the function names being prefixed by @, that's actually an error control operator. Notices that would otherwise be emitted are silenced when you use it. $db= @mysql_select_db($db_name, $connection) or die(mysql_error()...

 
yeah i m doing the same
 
Can anyone see improvements I could make to this answer? It seemed okay to me ...
 
whyyyy use @ ?
@Jack with my limited knowledge i can not find anything wrong .. already +1 :P
 
@NullPointer Well yeah, that was also one of my points lol .. the code was riddled with it
@NullPointer much obliged :)
Together with those horrid or die() constructs.
 
@Jack welcome ..
 
8:14 AM
@Jack you should ask the down-voter for a reason.
 
@Gordon can we ping like http://stackoverflow.com/a/15379996/1723893 ?
?
 
@Rikesh That's pointless :) because they never reply.
If they wanted to comment they would have
 
@Jack true
 
And some frequent users know me by now, so they would only place a comment instead of downvoting ;-)
 
@Jack I don't think your answer matches the question to be honest. He asks why mysql_connect(...) is assigned to $db, which then is never used again. At least that's what I understood. He probably didn't even notice the @ to be something special and thinks that's how a function name has to start. While your answer is definitely helpful, because it might clarify some misconception, you don't really answer the question, I think.
 
8:22 AM
@TillHelgeHelwig The question is actually hard to really answer, because I'm not sure what they meant with the first sentence.
doesn't help that op is not responding =/
 
@Jack I think the key point is "As you see here $db is not used in any following codes".
 
@NullPointer nah, dont ping me. just keep going like always. except for maybe severe cases.
and good morning to you all
 
@TillHelgeHelwig Well I explained that too ...
 
@Gordon morning .. cool... after that message i think same ..:P
 
@Gordon Many Congratulations !!!
 
8:25 AM
@Gordon Morning and congratulations on obtaining that shiny diamond. ;)
@Jack But your answer clearly focuses on the @, which struck me as being somewhat off.
 
@TillHelgeHelwig Yeah, maybe that should take a backseat .. I'm just trying to figure out why OP talks about "in many cases functions are defined as variables"
 
@Jack $foo = someFunction(); <-- "Define function as variable"
 
I suppose that's one interpretation heh
 
thanks guys :)
 
8:29 AM
http://stackoverflow.com/questions/15106698/cant-make-two-if-statement-and-return-false-in-javascript
 
@Gordon Congratulations.
 
http://stackoverflow.com/questions/7296196/formatting-a-date-in-php
 
@Ihsan thanks
 
http://stackoverflow.com/questions/7185803/php-parse-error-syntax-error-unexpected-t-return
http://stackoverflow.com/questions/13568279/crop-portion-of-string-with-php
 
@TillHelgeHelwig Well, thanks for the pointers; updated the answer to get straight to the point :)
 
8:34 AM
http://stackoverflow.com/questions/9287645/cannot-modify-header-information-headers-already-sent-php
 
Man, what's up with chat .. keep getting disconnected; darn trans-atlantic fibres.
 
gota chance to get some rep on meta
 
JavaScript choked me to death yesterday...
 
> deleted by Charles, Gordon♦, Gordon♦ 1 min ago
That's odd.
 
PHP seems cleaning up soon now ;) All Thanks to Gordon
@Jack Happening with me to :(
 
8:37 AM
There are others who can delete stuff as well ;-)
 
@NullPointer Yeah. BTW you are from?
 
@Jack could you tell me cool title for that post ?
@Appu india
 
@NullPointer Sorry, what title?
 
@Jack gong to create post on meta regarding that post
 
Oh! Okay. Couldn't expect because of your name here. @NullPointer
 
8:40 AM
@NullPointer I see ... regarding the multiple deletes?
 
PLB
@Gordon Congrats. :)
 
@PLB thanks.
 
@NullPointer now it is official, "Gordon" is an SO bug
3
 
8:42 AM
thanks is actually the word I have used the most ever since the election ended
 
lol
 
@tereško interesting. I guess I voted for it when I wasnt mod
 
Morning all
 
yeah , that was my guess too ... it seems they are either handling/storing the "delete" actions differently for mods, or mod status comes with new user ID.
 
HAIL @Gordon
 
8:44 AM
@PeeHaa morning ...
 
@Gordon do share How you feel being elected as mod? Whenever you get bit spare time from your mod activities :p
 
@tereško my user id is still the same
 
profile ID might not be the same as user ID
@Rikesh it's the change from voluntary acting like one of janitors for php tag, to having that as an official responsibility for the whole damned site
 
@tereško They're both http://stackoverflow.com/users/208809/gordon
 
8:49 AM
@hakre Did we stumble on unusual cURL behaviour? :)
 
@tereško in the time you had to put up with Yii did you do unit testing? Is that even possible in a sane way?
 
@tereško But official is always cool than a voluntary ;) A Moderator !!
 
http://stackoverflow.com/questions/tagged/php?page=7141&sort=votes&pagesize=‌​50
 
@PeeHaa no i did not try unit testing it, but as i understand it - it is quite impossible
 
@Jack I'm not sure. Did you test? I fire up my IDE now.
 
8:51 AM
@hakre Yeah, tried both scenarios
 
@tereško Just as I suspected
tnx
 
@NullPointer i undeleted and delete it again. now it says only Gordon
 
Mornings
 
@DaveRandom morning ... :)
 
Im trying to learn how to fetch data from mysql.This isnt working any clues function get_news()
{
$result = mysql_query("SELECT news_content FROM news");
echo '$result';
}
 
8:52 AM
@Gordon nooooo .... .
@Gordon please answer that question
 
@DaveRandom monring
@Sebastian While you are still learning please consider using PDO
 
@NullPointer but its already answered
 
mysql_* are deprecated and PDO is sooooooooooo much nicer
 
@PeeHaa whoooot lol
@PeeHaa please copy that gist and past here :P
 
;-)
I'm lazy
 
8:55 AM
@Jack Okay, I stand corrected. False alert, I didn't test that one. Duh.
 
@StackExchange please sort Gist oneboxes out, I don't want oneboxes to take up half the damn screen!
 
@grasshopper That tutorial is missing some vital information
 
> 5. There is no five
 
morning
 
8:57 AM
@hakre Hey, regarding using LOCK_EX and FILE_APPEND ... the underlying open() call doesn't use O_EXCL flag ... you think that would matter? :)
It does use flock() later though, so I guess it pans out okay.
 
posted on March 13, 2013 by Qafoo - PHP

The use of Mock and Stub Objects is an important skill to learn when using Test Driven Development (TDD). Mock objects allow you to replace dependencies of an object with lookalikes, much like crash test dummies are used during automobile safety tests so humans aren't harmed.

 
@Jack Nothing in PHP ever uses that flag does it?
 
@Jack I think you can only aquire a lock on a file you got a handle for.
 
@DaveRandom Eh?
 
@Sebastian You cannot just echo the result. You have to fetch data from the result.
@Sebastian Also, the mysql_* functions will be deprecated from PHP 5.5.
 
8:59 AM
@Jack I'm not aware of a way to get a proper OS level exclusive lock on a file in PHP, unless I've missed something...
 
@Nitin Alright thanks
 
@Ocramius, those behaviour extensions are so confusing in usage.
 
@DaveRandom The 'x' mode can be used for it.
But it fails if the file already exists.
When I use the flag I see this:

    open("/path/to/file", O_WRONLY|O_CREAT|O_EXCL, 0666)
 
O_RLY
 
9:02 AM
@webarto Yes O_RLY :)
 
:)
Good morning folks.
 
moniring @webarto
 
I love that comment:
> sorry if it wasnt clear, i just want to know how to avoid the warning message.. – Alesta Softdev
 
man, converting Link Only answers and Me too answers feels awesome
 
9:04 AM
@webarto morning O_RLY :P
 
:P
 
:P :P
 
Did I hear @Gordon is throwing a party?
 
@Gordon you mean question => comment ?
 
@webarto Yes free bratwurst und bier
 
9:05 AM
Ja ja
 
@Gordon is there an api for automating mod jobs. At least to a degree?
 
@hakre yes
@Ihsan not that I know of
 
You may need it :D
 
Gordon the Blue has arrived
 
@Jack Yeh so O_EXCL doesn't do what I thought it did. I thought it locked the file exclusively so that any other program attempting to open it would fail, but apparently not.
 
9:07 AM
gordon, stackguru ;)
 
this? :P
 
@DaveRandom Of course not :) it's advisory locking hehe
 
Thank you everyone for electing me a StackOverflow moderator. And thanks for all the good wishes. You guys rock :)
9
 
ahh i know that i am rocking :P
 
@NullPointer More like this
 
9:08 AM
If (PhpQuest->content->hasCode() == false) PhpQuest->addComment("Please supply an example code...", Gordon);
 
@Jack It's nothing to do with locking. It just makes the open() fail if the file already exists
 
Thanks won't cut it, we want free bratwurst und bier :D
 
@webarto that will work too :P
 
@DaveRandom Ehh right, what you said lol
Advisory locking can be applied afterwards.
As long as both sides use the x mode, it works.
http://stackoverflow.com/a/15380588/1338292
@hakre ^^
> I believe that locking is not required for appending. Filesystem will handle it all right. However, I could be wrong
Interesting ... I've always thought that too
 
What I do find interesting though, is open(3) states If O_EXCL is set and O_CREAT is not set, the result is undefined. - so why doesn't O_EXCL just include O_CREAT?
 
9:11 AM
@DaveRandom It does? Hmm let me see.
@DaveRandom It's open(2) here btw.
 
@Jack I know, I just landed on open(3) first from Google
 
Hi all
 
@Baba baba hiya
 
@Baba yo
 
@Baba I don't like SplFileObject because I think that returning false or null on failure is not a good practice (i.e. exceptions should be thrown) for OO architecture. Anyway, I was saying that throwing exceptions like this when some function fails is not a good practice. — PLB 2 mins ago
@NullPointer hello
@DaveRandom how is my friend ?
 
9:13 AM
@Baba I agree with that
 
Hmm, apparently most unix file systems support atomic append ... interesting :)
 
@Baba Not bad, you?
 
@DaveRandom Why don't people understand the difference btw example and real code .. it was just to show the op how to catch exception
 
@NullPointer No that's wine and fresh baked bread. Nothing like it :D
 
9:14 AM
@Baba Hey
 
@DaveRandom am ok
@PeeHaa ... how are you doing
 
@webarto hehe nice
 
bootstrap is a cursed word.
 
@Baba Hey, You are also from India? Because your name means saint, doesn't it?
 
PLB
@Baba Let me expand on that. Some people directly use the code written in answers.
I understand that it was an example how to throw exception when function returns false on failure but you could at least mention it in answer.
 
9:15 AM
@Appu lol ..... India .. nope don't even know how to sing their song
 
@Baba Good busy
 
@PLB Noted than i"ll delete
 
@Baba (quickly reads the question) for completeness you should probably demonstrate ErrorException as well then, I think the only reason that try/catch is in the OPs code is because he's trying to handle errors as if they are exceptions
 
@Baba sining is hard-nut ..:P
 
File system functions really suck for emitting errors when stuff that might reasonably fail happens
 
9:16 AM
I wrote the try-catch statement in case something goes wrong
 
@Baba Okay. Might be it has some different meaning at your place.
 
@DaveRandom even if PHP does not throw Exception by default .. why is SPL not also throwing exception ???
@NullPointer how is your c learning
@Appu in most countries / languages it means father
 
@Baba getting very less time due to some other competition exam :(
 
@NullPointer what competition ?
@DaveRandom how do you effectively manage file system failures ?
 
@Baba administrative services exam
 
9:19 AM
@NullPointer Oh ok
 
@Baba Okay. Father of PHP would suit in this context because after all we are in SO rooms and that too in PHP. Lol...
 
@Jack yeah interesting ..
 
@Baba how you doing ?
 
@Appu ..... lol
@NullPointer am very angry at the moment .... have not been able to beat boss 4 in God of War
 
@Baba Well, much as this really sucks, it's one of the only two places I ever use the @ operator (the other being LDAP), and I check every call for failure and usually throw exceptions if it's unrecoverable.
 
9:22 AM
@Baba lol..:D
 
@DaveRandom LDAP .. thank God am free from that ...
 
@Baba And I agree, SPL should throw exceptions on failure. Returning false on failure is not an acceptable way to handle errors in an OO library.
 
@Jack nice :)
 
9:23 AM
@NullPointer i hate jumping and fighting
@DaveRandom exactly .... I really think this can be easy implemented in 5.5
 
@Baba It's not that bad. The original NoSQL. It's only good for what it's good for, though (if you see what I mean) it is not a relational database and forget that at your peril. It's used a lot in the telephony world, and often to great effect.
@Baba It'll never happen, it's a BC break, unless you add a flag to the constructor or something. Either way, I can't see it happening, because internals are too busy arguing the toss over other unimportant crap/politics.
 
@DaveRandom nice original NoSQL .. but i did not like it ...
 
AD is the biggest pile of shit ever created, I'll give you that
And I think AD is most people's only experience of LDAP
 
@DaveRandom i really wonder how messed up PHP Internal is right now ...
 
9:27 AM
is there phpchatroom twiter account ?
 
This one is for @Gordon ;) - stackoverflow.com/a/15109227/367456
 
@DaveRandom hehehe ....
@DaveRandom have never worked with AD at a programming level
 
@Baba just do what other are doing :P
 
@NullPointer am sure that guy was on easy mode ......
 
@Baba alt+f5 :P
 
@Baba keep it that way if you value your sanity
2
 
@DaveRandom lol .. Why id Microsoft always like that ? I was scared once thinking they wanted to take over PHP
 
Just curios .. What is Azure built on ???? Unix or Windows
 
9:36 AM
moningr
 
@PeeHaa lol
 
@PeeHaa lol
 
9:46 AM
night guys
 
Hello any one helping me in authorized.net ARB payment.
i have problem in production mode test credit card running
 
Night @NullPointer
 
in authorized.net ARB payment.
i have problem in production mode test credit card running still after setting path = api.authorized.net and test mode "off". i want to stop test card.
 
@NullPointer Thanks for the link in your user profile it is very very helpful. (phpjs.org/functions)
 
@Eugene in fact I suggested avoiding such extensions. In most cases, you can implement all that logic in your service layer.
 
@Nileshpatel You will need to contact their support, in general we can't help with problems with a specific service not behaving as it should
 
@Ocramius Okay. One more thing. I'm reading doc. now and question came up regarding foreign keys. I see that quite an amount of references point to repository entities at same time in your slides I understood, that it is same entity class as for the record, except it is used to work as a table. i.e. to get collection of records, right? Or is it different class like, Customer, CustomerRepository?
 
> 139,718 voters were eligible, 87,022 visited the site during the election, 33,846 visited the election page, and 6,573 voted
Those are some pretty abysmal stats
 
33,846 visited but only 6,573 voted seems bit strange
 
I know, that's pretty weird.
 
It's because they knew Gordon would win it, so they just cba.
 
10:01 AM
lol
 
@Rikesh Visited also means visited while in the pre vote phase IIRC
And yes that took my three edits to write
 
@DaveRandom correlate them with the stats about rep distribution. might yield an explanation then.
 
@Eugene a repository and an entity are different things. The entity repository is an object that is responsible for fetching entities. The entity instances are the record themselves
 
@PeeHaa yeah that's the possibility
 
@Rikesh You think so? Outside of the few people that frequent the chat rooms, there is not a lot of community going on. Most of the people nominated I had never even heard of before.
 
10:04 AM
@Gordon I don't know how to get those stats without a data.SE query that I don't have time to write, but I suspect you are right
 
if i var_dump($_POST) its showing 'img' variable value but if i try to access any of its property like $_FILES['img']['name'] its saying undefined variable...suggestions pls..
 
I'm willing to bet they would follow quite closely with user question/answer ratio as well
 
@DaveRandom they are given at the ladders page
 
10:05 AM
@pbvamsi You are checking $_POST & accessing $_FILES.
 
@Gordon best of worths bro ;)
 
@Rikesh i mean img variable is passed, but i'm not able to access $_FILES
 
@DaveRandom although now that I see it. No, nothing to correlate there :/
 
10:07 AM
hi all !!!
 
@HamZaDzCyberDeV lol
 
@pbvamsi If something appears in $_POST it cannot also appear in $_FILES
 
@pbvamsi - Make sure your form contains "multipart/form-data" something like <form action="upload_file.php" method="post"
enctype="multipart/form-data">
 
@hakre i removed the part asking about a tutorial and think the question is okay to have
 
@Gordon no, it's an RTFM case
since I am sure I wrote those docs :P
 
10:09 AM
@pbvamsi You should var_dump($_FILES) to see if/where your file upload is
 
@Ocramius provide a link as a comment then or quote the relevant parts in an answer
 
@DaveRandom thanks
 
@Gordon I might try and draw up some stats from data.SE later on, I'm kind of intrigued by the relatively poor turnout compared the people who visited the election page
 
hmm... who upvoted that question? :D
/me prepares machete
 
@DaveRandom but i'm moving the uploaded file , move_uploaded_file(), any how it is showing if i var_dump($_FILES), but now i need to access the file name, size, type @Rikesh i did but still the problem persists
 
10:17 AM
oh, btw, this is very very important: github.com/panicsteve/cloud-to-butt
4
 
@pbvamsi Can you show the output of var_dump($_POST, $_FILES); on a pastebin please?
 
@DaveRandom i've a primary key which auto increments, should i mention it while placing an insert mysql query
 
@pbvamsi no. The point of auto increment is that you don't need to include it in a DML query, the database handles it for you.
 
@DaveRandom i've 10 primary keys in the table, i've deleted 8th for some other cause, now am trying to place DML query, does missing of 8th key matters! (does auto increment gets effected if 1 row is deleted in between!)
 
anyone know wordpress?
 
10:29 AM
 
@pbvamsi try it
 
@David19801 look at the room description
 
@pbvamsi You never need to worry about auto increment
It'll just keep going up, even if you delete all the previous records to it - the point is, it'll always be unique and best for primary key
Every single one of my tables has an id field, created as : id INT AUTO_INCREMENT PRIMARY KEY
Now in MongoDB, if you're sharding, you don't want to use id as the shard primary key, but that's another story
 
@Jimbo then there is some trouble in my code, thanks bro :)
 
@pbvamsi No worries ma brizzle
 
10:39 AM
@Jimbo do u find something wrong in this
$query="insert into latest_news_biglist('heading','content','imgloc') values($heading,$content,$img1)";
i've echo'ed 3 variables-no problem with them..
column name is also correct
 
I would rename that to
INSERT INTO latest_news_biglist (heading, content, imgloc) VALUES ($heading,$content,$img1);
 
i've just destroyed my first user account. bam!
 
Murderer!
 
Oh @Gordon, you look so, so sexy with your blue text and all...
 
PLB
@pbvamsi Use back ticks (i.e. `) when you want to escape reserved words in mysql.
 
10:42 AM
@Jimbo true ;)
 
@pbvamsi Btw you're using mysql_* functions, when you should be using mysqli_* or PDO_* to access your MySQL database - you want to look up those and prepared statements to protect your code from things like SQL injection - I think you need to do some research on this
 
♫♪ shine bright like a ♦ ♫♪
10
 
@Jimbo yes i'm a newbie and just into maintenance
@PLB heading is a reserved word?
 
PLB
@pbvamsi dev.mysql.com/doc/refman/5.5/en/reserved-words.html Here are all reserved words in mysql.
I've told you generally, because you were using single quotes.
 
@PLB just after the fear factor i've renamed it to headingx and executed the query once again ;)
 
PLB
10:48 AM
@pbvamsi There is no need to rename table names, columns, etc. You can simply surround them with back ticks.
 
@PLB lol query is not throwing any error, neither it inserting
 
PLB
@pbvamsi Probably, it's magic.
And now seriously, debug your code. :)
 

« first day (879 days earlier)      last day (4062 days later) »