« first day (731 days earlier)      last day (4208 days later) » 

12:00 AM
you might find this relevant : stackoverflow.com/a/11943107/727208
especially the "update" part
 
Tek
12:25 AM
@Christian Another quick python question. How can I use variables as a key name in a dictionary?

a = 'somestring'

somedict = dict ( a = 1 )

currently

print somedict

prints a : 1 instead of somestring : 1
 
@Tek no idea there..
 
@Tek there's four questions asking that on SO all with answers....
and this is the PHP room :P
 
Tek
@Lusitanian Maybe I searched the wrong terms? I saw similar question but it didn't seem to answer my question. And I'm aware it's the PHP room but I don't think I'm interrupting the flow of the conversation considering there's little activity :P
 
no you aren't, but you might get more success in the python room -- that was my point (:
anyway, it's because you're using the dictionary constructor syntax
it interprets everything as a literal
do something like this
 
Tek
@Lusitanian Ah, I see. Thanks.
 
12:34 AM
Yup :)
And you were right, I double checked those questions and they were slightly different. My bad.
 
user895378
Dear PHP custom stream wrappers: YOU SUCK. fwrite can return false on an error, but a custom stream wrapper has its fwrite return value cast to an integer. Thanks for making my life more difficult. Now I have to go around my ass to get to my elbow to test that code using streams behaves correctly if an error occurs on a write operation.
 
@rdlowrey You could end that with: My name is Dart and I approve this message.
 
user895378
PHP is like the average-looking wife you're married to and Dart is the smoking hot 20 year old. Unfortunately Dart is just to young for me at this point.
 
That analogy works perfectly --- holy shit.
 
user895378
The stream wrapper thing isn't even really a big deal ... I can mock the class that operates on streams to return the value I need. It's the principle that's annoying.
 
Tek
12:50 AM
@Lusitanian Np :p
 
@rdlowrey actually it doesnt
most of people have already forgotten about Dart
 
user895378
@tereško In that case, Dart is like the 20-year old girl who lots of people think is weird looking but to me is strangely super hot.
2
 
and since it compiles to javascript , i would say that Dart is 20 years old transvestite
 
user895378
lol, transvestite is a good metaphor
 
hahaha
 
1:01 AM
if you want to learn new language , look in the functional ones
you have to get a backup plan , because single-core computing is thing of the past
and with functional programming languages i mean the pure language , not coffee/type script
 
haskell/erlang?
i started learning erlang a while ago but haven't had time
i need to just take an ebook and stick it on phone/tablet
and read it when i'm not doing anything else
then play with it when i have time on weekends
etc
 
those are two options , there is also Scala (if you can stand to be tied to JVM) and javascript is a candidate too
 
Scala is cool but i haven't used it functionally
i'd go for erlang or haskell i think
 
user895378
Or, if you don't want to learn a functional language, there's Python, which fakes threading well enough.
 
user895378
1:14 AM
(for non-scientific applications, anyway)
 
yeah but in a functional language you don't need to worry about threading
 
user895378
Just saying :)
 
understood
 
1:53 AM
@Sommer I was gone, but I got to read your reply as soon as I logged back on.
Hello all.
 
2:38 AM
Something simple to use for encoding and decoding ?
I would like to make a referral link, but without it show the user id
so i would like to encode it and then decode when i read it again, it should not be something secure
What can i use? base64_encode and decode is not so many chars
 
2:56 AM
@Karem What's wrong with showing the user id?
 
user895378
@Karem @SomeKittens This article is a good review of how to handle textual identifiers.
 
user895378
Hint: you're best served not to display easily guessable, sequential numeric IDs in your URLs
 
3:44 AM
hello
anyone here
 
3:55 AM
@NullPointer See the room description at the top right.
 
4:05 AM
@paul
        var dataa = {};
        dataa["sort"]=sort;
        dataa["location"]=location;
        dataa["startingprice"]=startingprice;
        dataa["endingprice"]=endingprice;
        alert(dataa);
it give me [object object] could you tell me why
 
@NullPointer That is javascript code. You should ask it in the javascript room. You can't expect them to answer your question by only saying hello to them.
 
@Paul console.log it instead
alert doesn't give you the details of the object
either that or use firebug to examine it
 
This sort of thing belongs in the javascript room in my opinion.
 
4:34 AM
@Paul it was an object, not an array
if you want to create an array
try var mycars = new Array();
mycars[0] = "Saab";
mycars[1] = "Volvo";
mycars[2] = "BMW";
 
@JosuaMarcelChrisano I wasn't looking for a solution, I knew what the problem was, I just think these things should be discussed in the Javascript room. I guess the point is moot now, but I think @NullPointer should have asked the question there and got help from that room rather than this one. This is the PHP room, not the Javascript one.
 
 
1 hour later…
5:46 AM
anyone here knows restful webservices in php
 
its awfully quiet here today...
 
do you have idea on restful webservices
?
@ShyamK
 
a little... which REST API are you trying to use?
 
6:29 AM
Good morning fellow SOers!
 
6:39 AM
0
Q: php ideal way to check function returns true

meWantToLearnWhich of the following way of checking whether a function returns True or FALSE is best, in terms of efficiency and code readability I was told by a friend that Method B is a good practice, but I believe Method A is better since it checks whether function returns TRUE then Assigns Method A: ...

 
@meWantToLearn Either is ok as it is. Generally I'd prefer Method B. If your code changes to have an if / elseif then placing assignments in elseif isn't so good, as they might not be executed.
 
@Paul but in MethodB, its first assigning then checking, whereas in Method A it only assigns if returns something
 
= can be confused with == and === in if statements too.
the speed is absolutely not important.
 
Woot! Finally cracked the last password
15 days, 9 hours and 24 minutes...
 
6:53 AM
Congrat @ircmaxell
Has anybody actually use Codeigniter - MongoDB?
 
not codeniter, but have used mongodb itself
 
@meWantToLearn with ODM?
 
@W.Kristianto no, wrote my own wrapper class
i dont use ODM
 
@meWantToLearn Wow amazing.. I have an active-record for CI but need more reference github.com/Kristories/Monggo
 
@W.Kristianto check this one out query7.com/mongodb-php-tutorial
 
7:06 AM
@meWantToLearn Thank you.. :D
 
welcome
 
> Pyrus is a tool to manage PEAR packages. Pyrus simplifies and improves the PEAR experience.
Not yet it doesn't. It baffles you, is unresponsive and can't install much (as far as I can tell).
 
@Paul how about getcomposer.org
 
@W.Kristianto I just installed that before pear, but what I want now is the vulcan logic dumper. I like composer a lot though.
There is so much to install on a new system.
 
@Paul :D
Nice try thinkupapp.com
 
7:32 AM
has anyone used couchbase
 
on what basis should a framework be chosen?
 
7:57 AM
3
Q: what frameworks should be chosen for the particular web application?

Suresh SWhat are the factors in deciding framework to choose ,technology for a web application .any architect please provide a guidance.

 
RewriteRule ^products-(.*)-([0-9]+)$ products.php?id=$2 [nc] Got a htaccess rule as such. On the same page I'm trying to access a new GET parameter that I set in the same page, but am not getting it. Is it due to the htaccess rule? or is it something else?
 
Sem
@ShyamK Not that experienced with redirecting but why are you using $2 instead of $1?
 
(.*) = $1, ([0-9]+)= $2
$1 contains product name like stuff... gibberish...
 
morning people
 
How can i fetch scor'pion from table with using escapes
 
8:17 AM
@ScoRpion... just retrieve it like anything else
Are you using prepared statements btw to insert those values?
 
I tried to do it like SELECT * FROM employees WHERE lower( name_first ) = E'scor'pion'
 
@ScoRpion... use prepared statements
 
I am trying to test it directly from database browser
 
803
Q: Best way to prevent SQL injection in PHP?

Andrew G. JohnsonIf user input have inserted into an SQL query directly, the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')"); That's because the user can input...

 
Thanks @PeeHaa but is their a way i can do it without adding slash
 
8:20 AM
803
Q: Best way to prevent SQL injection in PHP?

Andrew G. JohnsonIf user input have inserted into an SQL query directly, the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')"); That's because the user can input...

In case you didn't see the link I posted or you forgot to read it
 
pyrus sucks way more than pear.... simplify and improve they said.... I'm going back to plain old pear.
 
morning :)
 
composer
 
@hakre morning!
@Paul PEAR sucks period
 
8:24 AM
but composer won't let me install the Vulcan Logic Dumper?
 
vld is PECL, not pear
 
ahh, now things are looking better.
 
Morning all
 
morning @DaveRandom
 
8:27 AM
yay! damn it's getting late already.
 
Hows it hangin' y'all?
 
hanging good.
 
@DaveRandom It's hanging on the leftside as usual
 
"Small, shrivelled and slightly to the left"
 
lol
 
8:30 AM
- Is it cold in here?
- Nope, just really small.
and so on and so forth
 
mornin
 
morning
 
word
 
Word up to the mummy lover
 
bonjour
btw, how is the cheese in france @ircmaxell?
 
8:34 AM
Accepts with no upvotes kind of annoy me, so my answer fixed your problem, but you didn't like it?
 
havent had cheese yet
 
Tim Post here?
 
what's up?
 
No cheese yet? But I thought you're in France. Hmm.
 
Sem
Ohayo gozaimasu
 
8:42 AM
Wine, meat, and a lot of other stuff
 
user1125394
he please what would be a restful url for the login page?
 
user1125394
mysite.com/myapp/login?
 
www.example.com/foo/bar/do/something/who/cares/124
 
user1125394
because login is not really a ressource
 
user1125394
@ircmaxell meh
 
8:46 AM
the point is any URL would be a restful url
 
the URL isn't what makes it restful, but how you interact with it
Not to mention that login can NEVER be restful, because rest is stateless, therefore there can be no concept of login or session...
 
user1125394
ok but normally the last url elementt is a ressource, or am I wrong?
 
time for some breakfast.
 
user1125394
@ircmaxell right, but session are really needed everywhere, I don't know if Roy Fielding thought of that when he specified REST
 
8:49 AM
No, sessions are not needed anywhere
I run high traffic social sites without sessions
Drupal: takes 32,000 times the amount of RAM that landed man on the moon to render a web page. #foodForThought
 
hehe
 
user1125394
@ircmaxell so you need accesstokens in each requests
 
Lookup oauth and how it works
 
@cyril no, the whole URL names the resource, not just a part of it.
 
9:05 AM
Woot!!! https://github.com/php/php-src/commit/9aacdf6e892fe46526e1e60a3b3fea1b1c350699
 
@ircmaxell Grats, been a long time coming
 
:-D Thanks!
 
Trying to work out the best way to make a product advert in the form of a question. I've been promised beers for click conversions
 
@homakov The good think is, I don't have to use it, and I won't. @ircmaxell
 
Yes, the good "think".
Good think the internets is full of smarty peoples.
 
9:14 AM
lol
who probably use smarty
 
Probably
 
9:35 AM
 
Lix
Is anyone else not able to access php.net?
 
use a mirror
 
Lix
@irc - thanks for that sound advice :)
 
yo
Elephant in the chat room!
 
@Lix uk. is working fine, although root and www. do seem to be broken
 
Lix
9:40 AM
@dav - seems to be only the raw php.net is down...
Thanks for your help guys... I'm going to go RTFM... See you around!
 
^- still. after close please delete. thx.
 
@DaveRandom yes and with fire. :)
 
user1125394
@ircmaxell accesstokens are stored client -side?
 
yes
but verified server side (back-channel). So they can't be forged
 
9:49 AM
@hakre Was considering a mechanism for automatically posting a when a is closed, not sure how to implement it reliably though. I thought maybe via @Feeds, but you can't just do it to everything because not every should be ed as well. Food for thought.
 
@DaveRandom Did you ever look at doing stuff with review? (when you vote to close via review - post a cv-pls link in chat - for example)
 
@DaveRandom what about question url
?
 
@Leigh On the back burner for a little while, priority 1 (for me at least) is a FF port built in such a way that new features will require minimal porting. I'd also be hesitant to try and do it while the new review is still in beta, it's a bit of a moving target.
@PeeHaa sorrywhatpardon?
 
@GordonM Thats not true, Agile is... do what you want at your own pace and let other people worry about any issues.
 
4 mins ago, by DaveRandom
@hakre Was considering a mechanism for automatically posting a when a is closed, not sure how to implement it reliably though. I thought maybe via @Feeds, but you can't just do it to everything because not every should be ed as well. Food for thought.
 
9:53 AM
Ooohhhhh right I get you
 
:D
 
yeh that might work
or maybe
 
user1125394
@ircmaxell this answer stackoverflow.com/a/1135995/1125394 is interesting: a restful session ressource, somewhat close to what I meant
 
yeah, that's pretty much it
 
10:00 AM
I'm thinking these days that REST is nice and all but it's not the silver bullet a lot of people claim it is. The human-user facing stuff gets compromised by the needs of being RESTful
 
user1125394
it's just a set of best practises, linked with the use http
 
;-)
@cyril No, it's not
it's a set of practices...
best is very arguable
it's just another way of doing things
 
user1125394
it optimizes cache etc..
 
user1125394
meh :(
 
10:04 AM
morning
i see you people have already managed to upset maxell
 
user1125394
this link seems good too thebuzzmedia.com/…
 
10:20 AM
@cyril I think I feel a new meme coming on
 
how we trace that some one mouse over on pic thn change div position ??
 
@cyril, even though there are guidelines they're just that. The exact implementation, return codes and interface functions still varies somewhat.
I found a paper on an interesting twist on it that you might like, I enjoyed reading it - docs.google.com/document/…
Though I dislike theirs, and the general reliance on XML for returning output. It's an inter-system interface, so JSON seems like the logical solution to me.
 
any solution for my question ??
how to change div position dynamically
 
10:37 AM
@Danish, you're asking for a Javascript solution. If you're using jQuery, an easy way to do this would be $(selector-for-target-container).append(select-for-your-div);
 
Use more jquery!
you're better off asking in a javascript room about javascript stuff.
 
actually i want that whn user mouse over on image the dive which cary that image move an show completely
 
user1125394
@Sommer thx a little overcomplicated, I think the first solution of ircmaxell is ok, using OAuth and the accesstoken during your session
 
@Danish, without knowing more context it's going to be hard to help you.
 
/me wants to use finally
@Levi @nikic what was it again why you guys voted against it?
 
10:46 AM
i want to make the facebook sidebar like this website
http://www.lcbsdhaka.com/
 
@DanishIqbal Go for it
 
i am trying i think i am near to achieve this
 
SPL exceptions are stupid. My brain is hurting.
 
whats SPL?
 
10:53 AM
:D
 
@DanishIqbal it optimizes cache etc..
 
Upps :D
 
Danish, the easiest approach would be to construct both the interface and the button for the closed variant in the container DIV for that menu, and always hide one of the two using CSS Display
 
The exception model is really stupid. I am rarely ever certain which type of exception I should throw in a given situation. Actually the real problem is that the manual descriptions of them are really bad, they're far too general IMHO.
 
@GordonM please stop trolling newbies
 
10:55 AM
hi all
 
@DaveRandom You mean the given exception hierarchy?
 
hi @tereško hi need ur help in an issue
 
@GordonM Yes. For example I just wrote something that takes a file path as an argument, and throws and exception if the file doesn't exist. Now I think this would be an InvalidArgumentException, but that is a logic exception and specifying a bad file path is not a logic problem. So then I land on UnexpectedValueException, but that doesn't sound right either, mostly because of the name.
 
ok my problem solved
i use onmouseover() with javascript function
 
is there anybody who have worked in magento?
 
Sem
11:02 AM
@DaveRandom What about a I/O exception?
 
@DaveRandom Yeah, it's a pain. I tend to use InvalidArgumentException for invalid inputs (a string passed when an int was expected for example) and RuntimeException for everything else because of the whole @doesn't make sense@ issue. I did think of building my own exception inheritance tree but I'd really prefer to use the built in ones if possible.
 
@Sem SPL has no such thing (does it?)
@GordonM I know. But I always try and write it in a way that will make sense to someone else if they take a given module and try and use it somewhere else. But I guess since it simply doesn't make sense, that's a bit of a lost cause.
 
Sem
@DaveRandom DomainException ? Hmm, guess not. Because that means invalid instead of not found / doesn't exist.
 
@Sem Not a ridiculous suggestion, but again it's a Logic exception, and an invalid file path is definitely a Runtime exception in my view.
 
DomainException looks like it's just a generalization of InvalidArgumentException. Domain appears to be "This var is invalid" whereas InvalidArgument seems to be "This var that you've passed as an argument is invalid in this context"
 
Sem
11:09 AM
@DaveRandom Hmmm, it's a weird list of exceptions. An IOException sounds like a default one to me.. (That is thanks to Java)
 
You see this is exactly what I mean. The whole model is extremely open to interpretation. Even some more specific descriptions would be a start.
 
@DaveRandom The problem is how do you define "invalid"? Is it "Something that obviously couldn't be a path to a file such as an array" or "Something that is a valid path but points to a non-existant filesystem resource" or is it "A path that points to a directory when it should point to a file"? etc
 
Sem
@GordonM It's the second.
 
And which one to use in other given situations is far from clear too. A value that's out of range is an unexpected value!
@Sem For the first I'd be inclined to use InvalidArgumentException because I tend to think of that as indicating arguments have been passed in that make no sense in context. For the second one I'd use... um, well given what a mess the exception tree is I'd probably just use RunTimeException.
 
Sem
@GordonM Even though we are talking about an invalid argument that's not really what the exception triggers. You don't use a InvalidArgumentException in Java in that situation, just a regular OIException, then you know instantly we're talking about a missing file and that the problem lies in either privliges or a wrong dir in the config.
 
11:17 AM
Hey guys, i know its not php related, but does anyone have some experience with ubuntu wubi installation (vs dual boot)? I've heard that it has some impact on hard disk access, but how big?
 
I am going to sit down at some point in the near future and draw up my own exception hierarchy based on Logic/Runtime exception, because I think that is a sound base. It's just the classes that extend those two that make no sense. I think. At the moment. I'll see what I think when I've tried to make something better.
 
Sem
@JamaicaBob askubuntu.com might be a good place for that question.
 
@Sem oh great, thank you :)
 
@DaveRandom I'm going to start looking along similar lines myself. Let me know how you get on!
 
Sem
@DaveRandom If so, can I copy it directly and take the credit for it?
 
11:21 AM
@Sem I wouldn't have it any other way. Although I might make it rectangular with rounded corners, so be careful you don't get sued by Apple.
 
@vascowhite you realy find it a good way of adding css and js stackoverflow.com/a/11122692/359179
 
@Tarun huh? Find what a good way?
 
@vascowhite Clairvoyance I think.
 
throw new InsaneJourneyException ('One does not simply walk into Mordor');
 
@vascowhite oops,edit the question :)
 
11:26 AM
@DaveRandom Yeah, clairvoyance works for me every time, auto-updates too :)
 
@GordonM throw new NobodyCaresException('Y U TRY AND REPORT BUGS TO MICROSOFT??');
 
@Tarun ah, OK. Yes, I don't always use it, but it works fine when I do. It only makes sense if you have a lot of js or css files though and I tend to try to avoid that.
 
Sem
@DaveRandom And if you make 'em to blocky windows will sue you for copying the metro interface.. Only circles allowed these days.
 
@Sem, bevelled corners you say? Then Apple will sue you.
 
Sem
@Sommer No no just plain blo.... oh oh wait can't talk about this these days.
 
11:31 AM
@vascowhite by lots of js and css files ,do you mean when every action of controller have its own css and js file right?,because if they dnt its going to create lots of condition
 
@Sem Rubbish!
 
@Tarun Well, I doubt I would ever write something where every controller needed its own js or css, but if they do need their own, then that is the method I use. What do you mean by 'lots of condition'?
 
Sem
@DaveRandom If google will stop using borders they're in deeeeeep trouble.
 
@Sem Nobody has made an interface based on parallelograms yet.
 
@GordonM That's old hat. We're entering the age of the Hexdecahedral user interface!
 
11:40 AM
I mean if bunch of action method of controller going to use same jss or css ,then we have to specify that in viewhelper,like if action name is a,b,c,d,e,f,g then use media/css/controllerName/a.css.For a big project it can be overkill i guess
 
That Baba guy should have his question mark key confiscated.
 
@Tarun Anything used by more than one controller would just go in the layout.phtml as usual using the headScript() helper. The method used in my answer is used where only one controller uses a particular js file
 
Hey @hakre, I finally managed to comprehend the Excel-COM stuff enough to be able to extract meaningful values from it. I've not tried to write anything to it yet but I've managed to do something without throwing myself off a bridge. There's still time though...
 
Sem
11:56 AM
Ugh, so many people that know how to install a CMS + modules and are able to make a template consider themselves webdevelopers. Why O, WHY?
3
 
hah...true
 
@Sem I Am A HTML PROGRAMMER!
 
Sem
@GordonM HTML isn't a programming language you silly, XML is.
 
@Sem Correct...CSS is right below XML too
 
@vascowhite yeah got it,It can be useful sometime.Thanks zf guru :)
 
12:04 PM
@Sem I hear people calling themselves "html programmers" all the time. I grit my teeth every time I hear that, and now I have dental issues.
 
I'm no guru, I just stumble along until something works :) Developing by coincidence FTW :)
 
@Sem ML in both stands for Markup Language, right? so then how are they different. I mean if XML can be called a programming language, why not HTML... just curious... not really here to argue...
 
AS for XML being a programming language, have any of you ever used BPEL? It's a programming language implemented in XML. It's also HORRIBLE!
 
Sem
@GordonM Glad this is the first time I'm hearing that. Now, let's forget it as well shall we?
@ShyamK You trolling son?
 
@Sem not really...
I haven't used XML that much... prefer json... and that too only while doing API calls...
 
12:10 PM
@Sem I had to attempt to learn it as part of my degree. Now the module for which I needed to learn it is ove I'm trying to put the whole sorry experience behind me. I feel like it scarred me for life. People who keep trolling PHP for being bad should be forced to build a system in BPEL just to teach them what real horror is.
 
@DaveRandom even it turns out akward again, please don't jump. It's just microsoft, you should not ruin your life because of them.
 
Sem
@GordonM <redundancyAtItsFinest>0<redundancyAtItsFinest/> aka XML is awefull already. I can see why you're hurt.
 
12:20 PM
hmm ... SO chat might actually benefit from implementing MOTD
 
Sem
12:36 PM
@tereško With rep as reward? (what else)
 
i get the impression that you have no idea what "motd" is
 
ummm... #fail
> I have concluded that Mr McKinnon's extradition would rise to such a high risk of him ending his life that a decision to extradite would be incompatible with Mr McKinnon's human rights.
So, that means nobody should ever be extradited for anything, since they may take their life instead of facing up
that kind of logic is circular and dangerous. It's the same thing as the think of the children argument...
 
@ircmaxell That's going to be my citation
But seriously, the US should stfu and accept they failed hard at securing their systems, and just give him a slap on the wrist since he did nothing malicious, they've been pressuring to make an example of him for 10 years.
 
Oh, I'm not arguing that point
just questioning their logic for this decision...
 
12:44 PM
Oh the logic is terrible, but the outcome is the one that was needed.
 
Sem
@tereško And you do not completely comprehend LOL. Hozay, hozay.
 
@ircmaxell "BREAKING NEWS Dominic Casciani Home affairs correspondent This is a very significant decision for Gary McKinnon. But here's the really, really, interesting part. The home secretary has human rights powers to block extradition and the independent review for the government said ministers should lose those powers." - so basically, used a loophole while it is still in effect
 
yeah
 
user50049
@Gordon Could you give that <ul> an ID? I'm playing with redis as a cache for the SO API PHP library and would like to have some fun scraping that this weekend if you don't mind? Or make a way to get that in JSON?
 
user50049
12:50 PM
@Gordon I'd just like to watch close votes on that list, for my own personal curiosity
 
this explains the crap i have been seeing coming in from twitter stream
 
refreshing parent page after closing colorbox ??????
 
was that a question, a statement or are you working on random sentence generator ?
 
user ignored (everywhere) .. precautionary measure
 

« first day (731 days earlier)      last day (4208 days later) »