« first day (788 days earlier)      last day (4176 days later) » 

3:01 PM
Imagemagick FTW
 
user1125394
random avatar fights
 
Random my ass, no disrespect to anyone.
 
@NikiC ...so what would happen if you throw from catch and return in finally? Seems like the same situation to me...
 
user1125394
heh
 
user50049
3:07 PM
There was actually a case of someone having a generated gravatar that resembled a swastika just enough for someone to vehemently complain.
 
@DaveRandom the throw should overtake. the finally should run, but the throw should be the dominate action
 
user1125394
oops gravatar/avatar/<string> is treated as 0, it need number gravatar.com/avatar/1231231?d=identicon
 
@ircmaxell Why is that different to an unhandled exception from try?
 
@cyril It needs hexadecimal.
 
it isn't
except that finally always runs before leaving the stack frame.
 
...but surely try { throw new Exception; } finally { return 'test'; } is exactly that, so why does return dominate in the above?
 
@TimPost: the question we were going to ask yesterday: how should we deal with answers that are insecure?
For example: every answer to this question is bad:
29
A: Best way to use PHP to encrypt and decrypt passwords?

pagewilFound this class recently, it works like a dream! class Encryption { var $skey = "yourSecretKey"; // you can change it public function safe_b64encode($string) { $data = base64_encode($string); $data = str_replace(array('+','/','='),array('-','_',''),$data); retu...

 
@DaveRandom Who cares? Don't do that . . . :)
 
@NikiC proposed adding this to the question (as an edit):
21 hours ago, by NikiC
> **BEWARE! All the answers given to this question have various security issues. Do NOT use the code samples presented here.**
>
> For a proper encryption scheme implemented in PHP see this question:
>
> [**PHP 2-way encryption: I need to store passwords that can be retrieved**](http://stackoverflow.com/questions/5089841/php-2-way-encryption-i-need-to-store-passwords-that-can-be-retrieved)
>
> This question is only preserved to prevent breaking links to this page.
 
I don't see how the two situations are different. It's just an outstanding exception in a finally.
@LeviMorrison I wouldn't, I'm just trying to wrap my head around the decision they were just talking about
 
3:11 PM
@DaveRandom IMHO, it shouldn't
 
heh ^^
thinking about finally is definitely bad for your health :D
 
user50049
@ircmaxell Like you would any other incorrect answer, down vote and comment. There's no official way of dealing with this other than closing and eventually deleting the problematic post.
 
Good. I thought I was way off base, it seems silly to me
 
finally should run, but the thrown exception should propagate after it
 
Hey guys
 
user50049
3:12 PM
It would be a good topic to raise on Meta
 
@ircmaxell the exception will be discarded, because finally always dominates ;)
 
Hello @MadaraUchiha
 
@TimPost The problem there is two fold. First, it's VERY highly upvoted, and two it's got comments saying how bad it is. But the average person doesn't know enough to understand the comments, and will see the upvote and think it's safe and that commenters are wrong...
 
Either the exception or the return value has to be discarded. And the general consensus among languages is that one should discard whatever happened in try and let alone whatever happend in finally
 
@MadaraUchiha shalom
 
3:13 PM
@NikiC That's bad. The exception should be stored, finally run, and then bubble. Otherwise it's bad
 
@ircmaxell So you want to discard the return value?
 
@NikiC Yeh, but the issue is not whether finally dominates, it's whether an exception takes precedence over a return. Which it does everywhere else. So why not here?
 
I'll ask again in case someone missed and wants: Does anyone want an invitation to the new private beta, Anime and Manga?
 
user50049
@ircmaxell I'm not arguing against using a post notice, in fact it fits this situation quite well. I'd just like to have community consensus before you do it, and to have a springboard to have one put into the system proper
 
@NikiC really? That's not how Python does it:
> A finally clause is always executed before leaving the try statement, whether an exception has occurred or not. When an exception has occurred in the try clause and has not been handled by an except clause (or it has occurred in a except or else clause), it is re-raised after the finally clause has been executed. The finally clause is also executed “on the way out” when any other clause of the try statement is left via a break, continue or return statement.
 
3:14 PM
@ircmaxell That's definitely how python does it
 
@TimPost You got it. Will post to meta in a little while
 
user50049
A generic "Outdated information" notice, where the text reads "potentially problematic, or possibly even exploitable code"
 
@NikiC So no, it's not. The exception is still raised. It's not disgarded
 
@TimPost People will rarely read through comments, and will instead copy/paste and conclude job well done. Would it really be a problem if (as well as a comment and a downvote) a small paragraph was edited into the top answer warning the users about the specific security issues with that specific answer?
 
@DaveRandom exceptions do not take precedence over returns. Their precedence is just whatever comes first. But with finally, both now can occur "at the same time"
@ircmaxell heh
Why does no one believe me
 
3:15 PM
@NikiC one occurs first...
 
We freaking tested all this
 
user50049
@Leigh It would be better to just fix the answer if it came to that
 
@TimPost Yeah, I think that's good.
 
whoa, all users with high rep here today ;)
 
3:16 PM
@TimPost Well, that would count as vandalism in most cases ;)
 
user50049
This is a corner case, as every single answer to that question leads down a very bad path.
 
@ircmaxell Or this sentence in the python docs: "If the finally clause raises another exception or executes a return or break statement, the saved exception is dicarded:"
 
@NikiC throw new Exception; return 'some value'; // never happens - how is that not the exception taking precedence?
 
user50049
@Leigh It's much better to fix it then to draw attention to it being wrong within the answer and just attracting down votes
 
@ircmaxell And after that an example saying exactly that:
def f():
    try:
        1/0
    finally:
        return 42

>>> f()
42
@DaveRandom Let me turn that around:
return 'some value'; throw new Exception; // never happens - how is that not the return taking precedence
 
user50049
3:18 PM
But, IMHO it's too much to ask people to fix every single answer on a question.
 
@NikiC touche...
 
Point being that this has nothing to do with precedence, its just order of execution
 
@NikiC then the docs are wrong
 
@NikiC ...and the exception came first :-P
 
I was wrong then... Fair enough
 
3:19 PM
@ircmaxell YOur example shows exactly what the docs say.....
 
@ircmaxell Your described behaviour makes more sense though (to me, at least)
 
You can't really expect that the tutorial will cover such language details
 
sigh...
@NikiC that's not a detail though, it's a pretty important distinction
 
@ircmaxell Absolutely positively not
 
3:23 PM
:-(
 
It's on the same level as try { return 1; } finally { return 2; }
Which is a nice snippet to torture programmer brains, but not really practically relevant
 
that's true
 
@NikiC 2, right? Because finally always happens regardless?
 
almost always, but yes
 
@DaveRandom yes
I once saw some article where they mentioned writing that code on a whiteboard at google and programmers coming by would stop before that whiteboard and stare at it for a few minutes :D
 
3:26 PM
who here is familiar with redis :)
 
I've used it
 
My brain is melting a bit here. But I now get what @GoogleGuy is saying about how it's annoying there's no way to "catch" any outstanding exceptions in the finally block and do something with the data they contain.
 
im experimenting with using redis as a non persistant data storage.. i have an API that is written in PHP that id like to have data pushed into a redis store.. any ideas if i can use socket.io on the client side to pull from that same redis store?
 
or some other sort of non blocking event based service.. im not aware of anything for php thats similar to socket.io
from what i've read, you'd have to dev the auth/api seperatly from the socket based area.
 
3:33 PM
any magento experts here?
need some help with renderer
 
@gorelative reactphp.org
 
anybody?
 
Hi folks, I need a but of help with this: stackoverflow.com/questions/13842098/…
 
I can't find a reason why the change I am making in my code from capital "H" to lowercase "h" wouldn't make it go from 24 hour time to 12 hour time unless I am changing it in the wrong place
Here is the code before its changed $origin_dt = new DateTime( gmdate( 'Y-m-d H:i:s', $timestamp ), $origin_dtz );
and then I changed the "H" to "h"
 
user1125394
3:49 PM
 
@benlevywebdesign You need to add the A parameter to get a correct timestamp
I mean 'Y-m-d h:i:s A'
 
@Touki hold on
 
4:06 PM
@NullPointer .. am back
 
@DaveRandom Hint: You can use catch for that ... ... ...
 
@Touki look at my plugins php code for hour format and check around lines 836-1051 to see if this is where I am supposed to be changing the format
 
@ircmaxell Sorry that I got aggressive
@ircmaxell Btw, did you already post that meta Q?
 
@Baba please review of version 1 content is for only demo .... and please replay how its looking ...
 
@NikiC No need to be sorry, I don't count that as agressive
 
4:09 PM
@Touki thanks!
 
@NikiC Not yet. I will get to it, but I have a few more things to run through first. Feel free if you want to post it...
 
@benlevywebdesign To be honest, i'm somehow lazy to analyze that whole code
 
@Touki I told you where the time formatting is in that code so you don't have to look through all of it
 
@NullPointer hummm .. let me take a look at it
 
@benlevywebdesign And what are you expecting from modifying this, exactly?
 
4:14 PM
@Touki well on my calendar page it displays the time(on day and week views) in 24hr format and I want it to be 12hr format
 
And what function of this lib are you using ?
 
IMHO you shouldn't edit the library itself
You should either create another object, dependent of this library, to resolve the format you need
Or modifying its result directly in your view
 
@Touki This code is from my calendar piugin(plugin page)
 
@NullPointer obviously work in progress
@NullPointer nice but it can still be worked on
 
4:21 PM
@Baba yup... i have worked only 3 hour on it.... tomorrow ... will complete
ill give you zip if you want ...
 
You would need more than 3hrs if not it would look like every other sites
take a look at awwwards.com
 
@benlevywebdesign Ok, I did read again the whole conv
 
nice designed there you can adapt
 
And I can't locate the function you use to print/return a 12H format
My guess goes on line 1009, but it has no meaning changing the input format
Or even further, I just can't understand your question
 
@Baba OMG...baba its awesome ...
 
4:26 PM
@NullPointer i like detail
Good GUI
 
my page displays the times in 24hr format so on the "day" view it shows the times in 24hr time format(ex. 11, 12, 13, 14, etc.) but I want it in 12 hour so it goes 11, 12, 1, 2
 
@NikiC So that's what it's for...
 
@NullPointer To Increase User experience
 
@Baba looks like its kinda massive work ....
 
@NullPointer .. nothing good comes easy
@PeeHaa ping
 
4:28 PM
@benlevywebdesign Please, post the line where you're displaying this date format.
 
@Touki haven't I already said the line of code?
@Touki maybe I don't have the right lines then
 
@Baba but dont you feel its too heavy for a blog ..
imho
 
@benlevywebdesign This $origin_dt = new DateTime( gmdate( 'Y-m-d H:i:s', $timestamp ), $origin_dtz ); At line 1009 of your library has no effect on the rendered output
 
It will generate wrong value if you just put gmdate( 'Y-m-d h:i:s', $timestamp )
As I shown in my codepad
But it has no effect on outputs, since you return the difference timestamp between locale and GMT
 
4:43 PM
@NullPointer they are nice blog designs there too
an thinking of deleting my answer
 
@ircmaxell Nah, I don't like metaing stuff :)
 
lol
Ok @gordon 2
 
@Touki then I don't know where it is yet
@Touki haven't found the correct lines code yet
 
5:01 PM
I have amazon order api xml.
wanna create an array from this.
but its gives me error Start tag expected, '<' not found in Entity
Does any one know, how to work with this
<?xml version="1.0"?>
<ListOrdersResponse xmlns="https://mws.amazonservices.com/Orders/2011-01-01">
<ListOrdersResult>
<NextToken>1ikVaajLgDyaJqJYLDm0ZIfVkJJPpovRnQUZZxjVic6YPwbTF1dYxrQzazHyYVyLqBXdLk4iogz9wc5vc2Vx6PoaIJ74NjGFZCy2l+Fk8uNIgm4ByCcLHCJ0wMvlylZkWQWPqGlbsnNA4pSxvcLERpn0NUQI+TWZ5O/xVpvc8tilOzdsrZHCYruZIF9n45mtnrZ4AbBdBTdJIrj5VxaB/M747QbZ8M3hGcCyUhiPrtq5HmwX5IAmwKfxnqm3JqvZRSesN4tSbFZdMEcXMarTFVR6+v7+2qlBWjeevn2b0x2Z8nDHf10QkG9aSBCJW+cBvWmtXjCjLG6yyhzvdolLCobadZV56MGIn3PuL90mWDz6Qf71DQ/LA2QcRuAkhjt1T6B1SgezW1etTshJEF7OfAMlspDrpRAme8sLhWQBXpw=</NextToken>
 
user1125394
doesn't look valid xml
 
I have not included the bottom, this is just a top text.
Which part is not looking valid xml
 
user1125394
 
This document was successfully checked as well-formed XML!
Result: Passed, 3 warning(s)
@cyril validator show above
 
5:08 PM
why do you want to make it an array?
 
@ircmaxell Is the audio mono or I broke my headphones again? :S
 
@ircmaxell when I use load xml string function its give me erorr
I can not access any order.
I want to access all, and send it to json encode
and do some calculation.
simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in
 
@Robik It's stereo, at least it was when I rendered it. If it's not, I'm not happy
 
Well, at least here I hear only from left speaker
 
it's definitely stereo
levels are a little bit off, but not by much
 
5:11 PM
@abdulwakeel XML in general does not contain data that can be sensibly represented as an array (this usually applies to JSON as well). Where are you sending the JSON? Is the receiving end not capable of understanding XML?
to qualify that remark: that can be sensibly represented in the same structure
 
yes, but I have already used json in the project. so that will be good. if I convert it to json.
 
user50049
@ircmaxell It's definitely stereo
 
@abdulwakeel do a var_dump of the data, and then pastebin it...
 
posted on December 12, 2012 by Anthony Ferrara

The fourth video in the Programming With Anthony series is live! In this video, we'll explore the basic principles of prepared statements, and why you should use them instead of using escaped input directly in queries. I'm still playing around with the approach and style of these videos (as well as content structure), so your feedback is extremely valuable! Please let me know what you think!

 
5:19 PM
@Feeds too slow. Get with the program.
 
Actually I got the point. @ircmaxell
HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Date: Wed, 12 Dec 2012 17:15:10 GMT
Server: Server
X-Amz-Date: Wed, 12 Dec 2012 17:15:11 GMT
x-mws-request-id: 2f047b6d-cc38-46b4-9705-2883b437c76d
x-mws-timestamp: 2012-12-12T17:15:11.071Z
x-mws-response-context: BE47zEufL/sdf9D4d5PU2mJSXzfSYemblfBkNSwt4khP6lFBVIAG1a9UtmGSt25fUZxn28dSX98=
Content-Type: text/xml
Content-Length: 137290
Vary: Accept-Encoding,User-Agent
xml contain this string in the begining.
HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Date: Wed, 12 Dec 2012 17:15:10 GMT
Server: Server
X-Amz-Date: Wed, 12 Dec 2012 17:15:11 GMT
x-mws-request-id: 2f047b6d-cc38-46b4-9705-2883b437c76d
x-mws-timestamp: 2012-12-12T17:15:11.071Z
x-mws-response-context: BE47zEufL/sdf9D4d5PU2mJSXzfSYemblfBkNSwt4khP6lFBVIAG1a9UtmGSt25fUZxn28dSX98=
Content-Type: text/xml
Content-Length: 137290
Vary: Accept-Encoding,User-Agent
xml contain this string in the begining.
xml contain this string in the begining.
 
Well, there's your problem. You have HTTP headers in your response
 
user895378
I've never tried it because it seems like a really stupid idea and I want to help someone who's gotten really poor advice: what happens if you try to clone a PDO connection instance?
 
I got these headers with the response, So now I will try to remove it.
 
@rdlowrey hrm, interesting... I have no idea...
 
5:22 PM
@ircmaxell do you know how to remove these easily>
?*
 
user895378
time for a test script to find out.
 
@rdlowrey reading the source, it looks possible...
 
user50049
I think at the worst it would just block, but I've never tried it @rdlowrey
 
user895378
Well, it seems to open a second connection when I do it with a local sqlite DB anyway:
 
user895378
$pdo = new PDO('sqlite:/test.db');
$pdo2 = clone $pdo;
var_dump($pdo);
var_dump($pdo2);
 
5:27 PM
really? Weird, I didn't even see that
Yay! We can vote on php.net doc comments now
boo to the styling of said functionality
 
hi all
i am looking for Mathieu Imbert
 
user50049
"Just a moment, we're improving your Skype experience..." LIES
 
Mr. Mathieu Imbert are you in the room i want to discuss something with you.
 
There are Lies, Dam Lies, and Things Companies Tell You When They Screw Up
 
5:37 PM
Someone can help to play an audio on my website. I am using autoDJ, which is inside the cpanel.
 
user895378
For the record, my Flagrantly Stupid Capitalization and Naming alarm goes off each time I type: class FooTest extends PHPUnit_Framework_TestCase
 
user50049
@rdlowrey Don't feel bad, the same happens to me whenever I type basically anything.
 
user895378
I need to start doing class TestCase extends PHPUnit_Framework_TestCase {} in all my projects just so I can write test classes that don't hurt my eyes.
 
user895378
In related news, it makes me happy when the very first test case turns the html coverage report green/100% for the relevant interfaces :)
 
user895378
Although supposedly interfaces are ignored in coverage reports with the newest phpunit ... still need to upgrade. #lazy
 
5:54 PM
o god ... tried to improve answer and than topic on meta
0
Q: post edit previllage miscellaneous use

user1879104I saw a question Cursor appearance to Hand where this answer is edited by user NullPointer with some more information but the OP deleted the information provided by NullPointer .than nullpointer posted this as another answer . Now my question is that Does user with more than 2k rep should e...

 
@ircmaxell What, you mean you don't like being able to vote things updown?
 
@DaveRandom No, I like the functionality, I don't like the CSS...
 
user1125394
there's no even .css
 
Well, I mean the styling. How there's no padding. They look like links. I'd rather see them as up and down arrows
 
user1125394
<style type="text/css" media="all">
  @import url("http://static.php.net/www.php.net/styles/site.css");
  @import url("http://static.php.net/www.php.net/styles/phpnet.css");
 </style>
<style type="text/css" media="print">
   @import url("http://static.php.net/www.php.net/styles/print.css");
  </style>
 
user50049
5:59 PM
0
Q: Strange error log results

MDWarI keep getting errors popping up in my error log that look like this: [12-Dec-2012 10:19:11] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'jcummings'@'localhost' (using password: N...

 
@ircmaxell I know ;-) - isn't there some sort of screening process for things like that? The current iteration looks like somebody's "lets see if this works, we'll make it look nice later" stage. Surely there must be some kind of development environment? I'm not so keen on the new styling/layout of the timestamp for a comment either, I preferred it when it was just a timestamp.
 
agree
 
Too many ellipsises/ellipsii/whatever the hell the plural of ellipsis is as well. no votes... and just now...
 
...
 
cyril aka (removed)
 
user895378
6:07 PM
Poor man's plural of ellipsis: dots
 
/me is going home. Laterz
 
@DaveRandom Goodbye
@NullPointer ping
 
@MadaraUchiha hiya ...
 
You wanted an invitation?
 
@MadaraUchiha yup .... also for that i gave you my mail ...
 
user895378
6:10 PM
@DaveRandom adios
 
@NullPointer I didn't see that message, care to share it again?
 
@rdlowrey Via con Dios
Really going now
 
@ircmaxell me 2 what?
evening
 
@Gordon @NikiC is afraid of Meta.
 
@ircmaxell im not afraid of Meta. I just dont see much good coming from it
 
6:13 PM
@ircmaxell I never said afraid ^^ I just don't like it
 
I'm confused about star/snowflake schema...anybody interested in some sql talk?
 
:-D
 
Gordon is unboxing the SO 100k reward package now
 
Meta is good for laughs
 
@Gordon looks like something interesting
 
6:15 PM
@Gordon Oh yeah?
 
user1125394
you won 100k kg of air
 
rofl. awesome. they sent me a shirt, a sticker … and a glass mug :D
 
Congrats :D
Is it your size?
 
congress ...
@cyril its for only 1001k rep achievement
lol
 
actually, it's a couple stickers
@ircmaxell looks like I won't be at sunshine. didnt get an email
 
6:17 PM
:-(
perhaps it's just delayed
 
I know people in switzerland got theirs when they announced it, so my hope's are not very high on that
 
@MDWar: Ok, time for more information. How did you install your server? What OS are you using? What host are you using? What version of PHP? What Extensions? Have you changed anything recently? — ircmaxell 1 min ago
seems many question...lol
 
@NullPointer That's why I make assumptions
 
@NullPointer Questions that should have been answered already...
And his reply to that comment:
@ircmaxell, the sites are located on a webhosting service, I'm not terribly sure what type of server they're using — MDWar 2 mins ago
 
@cyril what ....??
:-\
 
user1125394
6:26 PM
nothing I'm crazy
 
but i wont like to asked like that again ..
 
user1125394
there should be a chat command !!/mysql_*
 
it require chatbot for that ....
 
user1125394
yep
 
@Gordon Does t-shirt says "I earned 100.000 rep on stackoverflow and all I got is a shirt, a sticker … and a f* glass mug." ;)
 
6:29 PM
@webarto lol...
 
user1125394
@webarto Fuck me I have 100k
 
I don't think that passes in wider female audience :D
 
@MDWar: No, it's not working fine now. It looks like it is, but there are open vulnerabilities. There must be an active connection, and it must be the same one that you're querying against (if you have multiple open). So your code, while it appears that it's working, is definitely not. — ircmaxell 48 secs ago
 
I think he was hoping for an easy solution
i.e. aptitude install fix-my-problem
 
@webarto unfortunately, no :)
 
6:35 PM
@Gordon Well, you deserve one :P Btw I fiddled with cv-backlog, awesome coding style...
 
@MDWar: there are two types of answers to any question: 1. Those that solve the problem. And 2. Those that answer the literal question. The first type is infinitely more valuable... — ircmaxell 2 mins ago
@Leigh ^ :p
 
I've noticed, in my short repwhoring spree, that someone is systematically giving -1 to answers that even involve mysql_* function...
 
@webarto What do you think of that?
 
@MikeB stackoverflow.com/questions/13793724/… Not sure, but first markus answer was accepted, then upvoted, then downvoted, etc. Mine too, and then other got accepted, etc. I've noticed that on other questions, -1 for no reason (not for me)...
 
afaik there's still nothing to disuage people from posting an answer, downvoting all the other answers, then reversing the votes once yours has been lifted high enough over the rest
 
6:46 PM
Hm, never thought of that... wow.
 
repwhoring 101
So a guy named Hacker1337 wants to know how to truncate tables.... — Mike B 3 mins ago
 
user1125394
did you ever had an helpful answer in JS chat room?
 
Am back .. hi All
@MikeB lol
 
@MikeB agreed..same happen with me with this answer rather someone made this question a topic on meta
 
user1125394
because me never
 
6:49 PM
@webarto thanks.
 
hiya .... @baba
 
@NullPointer how are you doing
 
awesome ....
 
have you see @PeeHaa lately ?
 
noop...
 
6:50 PM
@Baba He's been around - I think he's been working like crazy lately
You know.. real work :p
 
@MikeB that his crazy boss again ... lol
 
lol... i thought job time is better than degree ....
 
0
Q: Verb conjugating via php

zmogusnamasWhile I was looking for any idea for conjugating via php I made some efforts with simple: If, if else statements but it has no sense because of using memory: such constructions use too much memory. Nowadays I'm trying to create such kind of verb conjugating but the problem — I'm not a programmer...

I'm not a programmer and the script "sticks" somewhere when I have 3 or more verbs. yet he wrote dl.dropbox.com/u/4739833/verb.php
 
user1125394
^ what language is that?
 
its open popup to download
 
6:54 PM
@cyril lol .... PHP
 
@webarto i didnt code it with much care though. doesnt even have tests
 
user1125394
ok
 
@cyril ... looks like alien version of PHP
 
@baba and its 1145 line long file ... and another one is 1597 line long ...
 
PPPPPHHHHHHHHPPPPPPPP^2
@NullPointer very ugly code
I really don't want to review such code
 
6:59 PM
rather ...no one ...:P
 
@Gordon I know, but it really shows code written by experienced and up to date developer. I know some devs that wrote PHP 10 years ago, and are almost stuck in that time...
3
 

« first day (788 days earlier)      last day (4176 days later) »