« first day (632 days earlier)      last day (4316 days later) » 

8:00 PM
nope
 
@tereško That is awesome
 
@MikeB I half want to vote to re-open
 
@tereško I'm sure Col. Shrapnel found it hilarious.. and part of that contributed to him not taking the question seriously.. compounded with the fact that Tibor was giving bad advice and couldn't understand what Shrapnel was explaining
English didn't appear to be his first language
 
why do people are leaving SF
 
you mean SO
 
8:03 PM
oh sorry, but yes
 
@webarto What's the story with Lightness? Why isn't he/she coming back?
 
I am sure that is a guy. I visited the website. He is guy
 
@BikasDas , read this article : slash7.com/pages/vampires .. it might provide you with some insights on the subject
 
@MikeB kera.name probably something similar to aforementioned...
 
8:07 PM
what is the problem with base64_decode or encode. why some hosting providers consider this as a bug
 
@webarto I don't understand :x Should I be seeing something on that site?
I recall seeing the name Tomalak Geret'kal on SO often - I assume he changed his name to Lightness...?
 
yes yes, that's the guy
 
1
Q: Can an account be self-suspended?

Lightness Races in OrbitIs it possible to obtain a suspension on one's own user account by request? If so, will the message on my profile make it clear that the suspension was requested, or will it look like I got in trouble?

He has 25 thousand actions in just a year and a half.. I can understand getting burned out
 
You could just stop coming!
 
additiction is a hard thing to avoid
 
8:15 PM
why does my codes from PHP v5.2.6 doesn't work on PHP 5.3
 
@ircmaxell whats that
 
@BikasDas do you know what "errors" are ?
"doesn't work" is not an error message
 
hope so...
 
8:18 PM
@BikasDas copy and paste your pHP error
@MikeB how did stackoverflow 'disappoint him'?
 
or describe what it is doing. saying "it doesn't work" doesn't mean anything...
 
My code from PHP/Tools v1.0 doesn't work in PHP 5.4?
 
also .. it's something like 4AM in india ..
that might have some impact
 
nope it is 1.50 AM @tereško
 
oO , i am always puzzled by half-hour time zones
 
8:21 PM
@David huh?
 
NewFoundland.
ugh
 
@GordonM , you might want to change you avatar to something that included CETA IP
 
@tereško Kathmandu is UTC/GMT +5:45 hours
no regard
 
@MikeB @tereško m 4m +5.30 hrs.
 
8 mins ago, by Bikas Das
why does my codes from PHP v5.2.6 doesn't work on PHP 5.3
anyway ... this question/statement made no sense
 
8:23 PM
@ircmaxell my PHP/FI code like this `<?
Function Test (
echo "This is a test\n";
);
>`
 
it works in php 1 and 2 but i just upgraded to 5....and okay i'll shut up now
 
@tereško I'm going to change it to Monica Lewinsky
 
you ARE aware that most of SO user won't be able to recognize her
 
lol
 
8:31 PM
Is Rails very easy to rapidly develop applications with
meant to put that in the ruby chatroom...oops
 
@David s/develop/prototype
 
@David s/develop applications/troll developers/
 
@tereško @ircmaxell here is a pic showing the error. or in your words. watever..

https://picasaweb.google.com/116564600448501914784/Public?authuser=0&authkey=Gv1sRgCI7OzZbJ_a-MSA&feat=directlink
 
@BikasDas you're trying to use an index without verifying that it exists or defining it
 
first off, that's not a difference between 5.2.6 and 5.3, it's a difference in your php.ini config (error reporting).
 
8:37 PM
so what should I set it to ? E_ALL or E_WARNING OR 0
 
E_ALL
you shouldn't even have notices
notices are bad
 
bbc.co.uk/news/technology-18773690 Okay, I don't recall ever seeing someone lose a court case because they were too cool before.
 
@GordonM omg. while that's an amazing judgement...wtf
 
@BikasDas the error_reporting value should be E_ALL | E_STRICT
hiding errors is never a good idea
 
"We're not banning your competition because your competition isn't funky enough to compete with you anyway
 
8:42 PM
@tereško ok
 
user895378
Chat ignores are like the spam folder in my email inbox. I can tell that I'm missing out on a fair amount of information, but every time I check to see what's actually there I realize that I implemented the ignore for a reason.
 
@rdlowrey is a buffoon
blocked?
 
user895378
lol, no, you aren't on the ignore list :)
 
:D
 
@rdlowrey I take it you don't like reading viagra ads?
 
user895378
8:47 PM
@David not so much me. More that gmail believes I don't care to do so.
 
wtf all f r u talking here
 
-_-
 
user895378
Ok, I am agree with all.
 
Have a nice day! Thank you!
@rdlowrey w/ what dat graf i.stack.imgur.com/Q48Rp.png
 
user895378
8:51 PM
@webarto some nonsense. Was trying to think about load balancing with cached data.
 
at least you've got some answer to your question :)
 
@webarto you put your servers in front of the load balancer?
 
user895378
You can see that my skills have improved, given my Method Chaining Decision Tree
 
user895378
@ircmaxell No that was my third grade attempt at making a diagram from a long time ago.
 
user895378
It's totally unhelpful.
 
user895378
8:53 PM
Jun 29 at 1:46, by rdlowrey
user image
6
 
@ircmaxell me, no, I don''t have a clue about that things whatsoever... unfortunately. Reading...
 
user895378
Every time I create domain entities I go back and forth over whether I should use public properties, getter/setter methods, or magic __get/__set. And I always end up with getters/setters, but hate the drudgery of writing them all out.
 
@rdlowrey I thought you were too tan for UML
 
user895378
@GordonM If you only knew it took me like 45 minutes to make that stupid thing look the way I wanted it to :)
 
8:58 PM
@rdlowrey starred, so is it Yes or No ?
 
As for deciding whether you need magic __get/__set, I know of a foolproof way of making that decision. If you decide to use magic __get/__set you're doing it wrong :)
 
user895378
@GordonM Yeah I know, but I have to resist the temptation every time.
 
I freaking HATE magic get/set!
It's like canned ready-made spaghetti code
 
user895378
@webarto Well, it's no for me :)
 
@GordonM , the best thing to see in code is $this->__get('foobar')
it means that the API is just f***ed
 
9:00 PM
Even the Zend Framework guys have realised the error of their ways re: magic and are trying to remove it.
 
user895378
Another reason why ORMs in PHP are evil ... they work entirely off of magic ...
 
lol
 
@rdlowrey the salem ORM trials
 
@webarto , you might need to donate few { and } to your workplace ..
 
user895378
9:02 PM
Grab the pitchforks! Grab the torches! Give me a powdered wig and call the executioner! We're gonna hang us some ORM users!
 
start with me...i admit to liking doctrine2
 
user895378
@webarto Demeter called, she wants her Contacts object back.
 
user895378
I liked php-activerecord ... until static spread like the 11th plague into every corner of my applications.
 
@David , Doctrine 2 at least tries to implement Data Mapper like API .. used correctly the damage to codebase is limited
 
@tereško Damning with faint praise, much?
 
9:05 PM
@rdlowrey I have used Propel and I almost never recovered, but never php-activerecord
@GordonM he does that often
He calls symfony the least offensive PHP framework
 
user895378
Symfony is the least offensive PHP framework.
 
@GordonM There is a useful reason to have __set: PDO::FETCH_CLASS
 
And when did pinging in the chat room start causing actual ping noises!
 
user895378
2 days ago, by rdlowrey
Symfony is the least egregious of the frameworks. But that's like saying George W. Bush was better than Hitler and Mussolini.
 
I was trying to figure out WTF that noise was all evening
 
9:05 PM
@rdlowrey , only the 2.x branch
 
@rdlowrey Bush was better than hitler and mussolini
 
user895378
@David Exactly.
 
user895378
@GordonM did you install the cv-pls plugin? Or just turn your volume up? :)
 
Nope, no plugin.
 
@rdlowrey I was trying to port KohanaORM to ZF, but no luck so far, actually I'm persuading others to let me rewrite app in Kohana, just to avoid Doctrine1 and it's nonsense, along with some of ZF1... @tereško written by Ruby developer (now) :)
 
9:07 PM
good night..
 
BUT METHOD CHAINING IS AWESOME
i hate this shit ->
 
ZF1 forms were so bad they literally almost had me in tears.
 
if()
{
//DO SOMETHING
}
ELSE
{
//DO SOMETHING ELSE
}
 
How hard can it be to put a subform that might repeat any number of times inside another subform?
 
confusing as fuck
 
9:09 PM
REALLY FREAKING HARD if you use Zend
 
user895378
I look at method chaining the same way as magic __get/__set ... Your application will still work, but man it's going to be a PITA to figure out what the hell is going on down the road. And that's if you aren't trampling all over LoD.
 
@webarto , you already shared that dreadful part about the origins of your current codebase
.. that didn't sound english =/
 
user895378
@webarto That sounds like a casserole of awfulness.
 
@Mike , which part of it confuses you
@webarto , been that , worked with it , was not amused
 
9:11 PM
@webarto Where the hell is all this code coming from?
 
@webarto sometimes i wonder, why people prefer code like this instead of writing pure SQL
 
user895378
@GordonM The 7th circle of hell.
 
The plus side for code written like that is if you wrote it, then there's no way they can fire you. Because there's no way another dev will ever be able to figure out what the hell is going on. Job Security code.
 
@GordonM so true
 
@tereško yeah, it is the same amount of chars, leftJoin = LEFT JOIN... I'm also not amused but salary is good :D (I think)
 
@GordonM app written 3 years ago :) (by mistery person)
 
        $statement = "
            SELECT
                renewal_request_id,
                usersid,
                mentor_id,
                fullname,
                email,
                telephone,
                status,
                justification,
                num_publications,
                num_moneys,
                comments,
                request_date,
                request_approval_date,
                archived,
                webonly
            FROM renewal_requests
That's so much easier to read . . .
 
curious why people from India try to learn ZF (prejudice?)... because of moneyz or they are being told that ZF is like Java?
 
2nd
 
I think some developers are afraid of SQL.
 
9:17 PM
@LeviMorrison yuck, that is so 1999 :P jk
 
So they hide it in fluent PHP interfaces, like your mother used to hide medicine in your ice cream
@webarto Same reason anyone else learns ZF. Lowest Common Denominator.
Everyone uses Zend because everyone uses Zend.
 
and it sounds so Enterprise
 
And then you actually use it and discover it's more Herald Of Free Enterprise.
 
holy good god. Github just got $100 million...?
 
(Lets see how many people get THAT joke)
 
9:19 PM
I got shrapnel instead of ice cream :D mmmm ice cream (off to fridge)
 
> PHP Fatal error: Uncaught exception 'PDOException' with message
> } catch (\PDOException $error) {
WTF PHP, wtf . . .
 
@LeviMorrison is the catch wrapped around the code that's throwing it?
 
9:28 PM
throw $up;
 
@ircmaxell I'm sure.
 
no idea then
 
        try {
            $PdoStatement = $this->pdo->prepare($statement);
            $PdoStatement->execute(array('id' => $renewalId));

            $entity = $PdoStatement->fetch(Pdo::FETCH_CLASS);

            return $entity !== FALSE ? $entity : NULL;

        } catch (\PDOException $error) {
            throw new \Gateway\GatewayException('Could not retrieve renewal entity.', 0, $error);
        }
^ the fetch_class line throws the error because I did not provide a class name to fetch into.
 
emm ... \Pdo::FETCH_CLASS
 
@tereško It's fine, I used use Pdo;
And yes, the case is not an issue
 
9:31 PM
did you try to catch general Exception ?
 
General Exception, serves in the same army as Colonel Panic.
 
@tereško Just tried it. \Exception doesn't catch it either. What have I done wrong?
 
@GordonM , that very nice, but you seem to fail to understand what it would be testing
not sure .. a viable explanation would be "that's not where exception gets thrown"
 
I just checked the line number again. That's where it happens.
 
@ircmaxell @NikiC stackoverflow.com/questions/11403253/… - Interesting that it opens the file directly, and you can't use a stream wrapper with it. Do you think it would be hard to detect the stream wrapper and call a different SSL func to give the certificate to?
 
10:11 PM
pokit.org/get/img/ed2acb524a4fdb71d64c64bce20f0b1d.png is it me, or this code could be written inside loop (array containing variable names), since we have variable variables... or just extract variables from object...
 
10:27 PM
@webarto Not quite sure what you're getting at. But to me it looks like the author should just pop the last item off the array and use that to populate the object. Every time through the loop the previous values are just going to get overwritten anyway
 
@Leigh No, it should not use a wrapper. Otherwise you could get infinite loops
 
@ircmaxell ok... I'll have to take your word for it on that one, since I don't know the code well enough.
 
a wrapper that loads a wrapper to resolve a dependency?
 
Well if you made it use itself that would be silly wouldn't it. You can make infinite loops on your own without doing that.
 
it would be easy to do. pull from another https site...
 
10:35 PM
It does also seem rather silly that a cert has to be flushed to disk before it can be used.
 
why was it off disk?
 
Yes, now you're going to tell me that storing it in a DB puts it on disk anyway, that's not the point ;)
and it wasn't my question. I just thought it was strange it couldn't be supplied as a string.
 
0
Q: Loading array in preg_replace

SuzedI'm trying to load my classes array in preg_replace but I am unable to get it to loop through the array. My 1st thought is, because I have a break in my code that is stopping the class from looping, however if I don't have a break in my loop the whole code will loop over and over instead of just ...

 
11:25 PM
Hi there ;)
 
hi
 
@suzed: Is it that you just want to replace the class attribute?
hi @tereško
 
PHP: Y U NO HAVE GOOD HTTP API?!?!?!?
 
@LeviMorrison What do you mean?
 
I need to check a header returned from a request. There is no native PHP function I can find to get the headers.
Using get_headers means I can get the headers, but not the content.
file_get_contents gets contents, but not the headers.
I hate my life.
 
11:29 PM
Okay, what you want to learn about is called stream contexts
 
Using curl is not much help either.
 
And a similar scenario has an article on my blog here: hakre.wordpress.com/2011/09/17/head-first-with-php-streams
And if you want to know how to do the same in curl/php ask,
 
What I'm saying is that I have to parse the headers myself.
I've done it in C.
 
and the cheatcode with get_headers is to use PHP's default stream context.
 
It's not exactly trivial.
 
11:31 PM
@LeviMorrison well it's not trivial, but it's not complicated, too:
/**
 * parse_http_response_header
 *
 * @param array $headers as in $http_response_header
 * @return array status and headers grouped by response, last first
 */
function parse_http_response_header(array $headers)
{
    $responses = array();
    $buffer = NULL;
    foreach ($headers as $header)
    {
        if ('HTTP/' === substr($header, 0, 5))
        {
            // add buffer on top of all responses
            if ($buffer) array_unshift($responses, $buffer);
            $buffer = array();
 
@hakre It should be trivial.
@hakre It has an error in it.
 
@LeviMorrison Probably, yes. Or let's say nowadays. I'd say same for dealing with URIs, we should have that object oriented in PHP.
 
multi-line headers.
@hakre But with URI's we at least have functions that do the work for us.
 
@LeviMorrison I thought those are covered.
 
It's not OOP, but it's THERE.
 
11:33 PM
@LeviMorrison jup. but not for example, relative URI resolution to base URI.
A pretty common task.
 
@hakre But more trivial than parsing HTTP headers.
@hakre I do not think your code handles this valid situation:
Word-Of-The-Day: The Fox Jumps Over
        the brown dog.
 
@LeviMorrison Usage is: $responses = parse_http_response_header($http_response_header); and IIRC $http_response_header deals with that already.
But feel free to prove me wrong so I can fix the routine.
 
@hakre Where? I dont' see it.
 
@LeviMorrison PHP does that internally, $http_response_header is a special variable.
 
@hakre Oh, I see.
 
11:39 PM
Otherwise I wrote a patch for wordpress some time ago that deals with that and I see no problem to slipstream that in, too, but IIRC it's not necessary.
 
user895378
what is this $http_response_header variable we're talking about?
 
i am not sure if "slipstream" is the right word
 
i kinda reminds me of "Andromeda" series
 
Using stream contexts for HTTP requests seems so . . . wrong.
 
user895378
11:41 PM
@LeviMorrison hmmm ... I would personally try to stay away from a stream variables like that
 
user895378
@LeviMorrison yeah, I agree
 
@LeviMorrison As written, if you love curl, just ask.
 
@hakre I don't love curl. I don't even like the PHP API for curl.
I might hate it.
I definitely dislike it.
 
Hmm, well as long as it's the API, you can warp it :)
/**
 * Functional constructor
 *
 * @param string|array|resource|null $mixed
 * @return Curly
 */
function Curly($mixed = NULL) {
    return new Curly($mixed);
}

/**
 * Curly gives curl some syntactic sugar
 */
class Curly {
    /**
     * @var resource
     */
    private $handle;
    /**
     * @var array
     */
    private $config;

    /**
     * @param string|array|resource|null $mixed
     */
    public function __construct($mixed = NULL) {
        if (is_string($mixed)) {
            $this->setup(array(CURLOPT_URL => $mixed));
 
@hakre The API doesn't provide you with what is needed.
With cURL, I can get the body and a few of the headers, or the headers and the body combined into one.
 
11:44 PM
@LeviMorrison So you are looking for raw response headers?
 
@hakre Sort of. What I want is a decent HTTP API.
And there currently is not one.
All the solutions are bad.
 
well, sure there is, but the problem you note might be related to HTTP and which level of indirection APIs offer here.
For example, you can do the HTTP request your own via sockets and you will get the raw response.
 
@hakre cURL will already give a raw response. PHP just doesn't have any way to (nicely) parse it.
 
@LeviMorrison list($headers, $body) = explode("\r\n\r\n", $raw, 2) + array(null, null);
 
@hakre That is not good enough.
 
11:49 PM
@LeviMorrison You are referring to the should part of CRLF normalization?
 
@hakre No, there is a lot wrong with it, IMO.
 
@LeviMorrison Well RFC (understandably) suggests to accep "\n" instead of "\r\n" as well, so you need to preg_split or similar here.
But apart from that, there is no issue AFAIK.
 
@hakre That will parse one line, but not the WHOLE HTTP response.
 
@LeviMorrison You mean response, not request, right?
 
@hakre Either, actually but I did mean response.
 
user895378
11:52 PM
you should probably say "HTTP Message" since both requests and responses are formatted the same way
 
user895378
I spent a lot of time in the spec working on content negotiation last week :)
 
@LeviMorrison , @rdlowrey right.
 
@rdlowrey We really should write some HTTP stuff for PHP core somewhere down the line.
 
user895378
Yeah I think we should.
 
11:53 PM
Or at least a better PECL extension.
 
I said already last week we should ;)
 
Anyway, time for me to go home.
Talk to you guys later.
 
@Levi: Good route.
 
user895378
Later dude
 
I will be sleeping later.
 

« first day (632 days earlier)      last day (4316 days later) »