« first day (659 days earlier)      last day (4272 days later) » 

12:01 AM
@Nile Pretty much.
Free doesn't make them any less classic.
 
user895378
@LeviMorrison I wasted a long time thinking that while loops had completely stopped working in PHP trying to make persistent connections work before realizing it was breaking because I set a custom socket timeout that was way too low.
 
user895378
Back on track now.
 
user895378
I lost a good chunk of the afternoon to that stupidity.
 
@rdlowrey It's okay, PHP was dying on return $this->value for me earlier. Never did sort that out.
Glad it sorted itself.
 
user895378
I'm really good at failing my way forward.
 
12:04 AM
lol
I'm with you on that one.
It's really odd that PHP was dying without errors though.
Very strange.
 
okay, I'd say that are enough of that meme.
 
user895378
@hakre lol. the rainbow trail is a nice touch. please collect all of those in a blog post for posterity :)
 
@rdlowrey the super static meme collection. I bet there are more out there.
 
Why did I do again?
@PeeHaa You're not adding a new item to #mainNav, you're changing an existing item. If you add another item dynamically, it will not have the click event attached unless you bind it inside of the function that changed the nav. — Chris Clower 6 mins ago
@hakre lolski
 
@PeeHaa thanksi, and nightski. my computer needs some rest.
 
12:13 AM
laterski @hakre
I'm also off
 
1:02 AM
$this->staff_id        = $object->staff_id;
$this->foreign_table   = $object->foreign_table;
$this->foreign_id      = $object->foreign_id;
$this->raw_url         = $object->raw_url;
loop with variable variables is a valid approach for this kind of "problem" ?
 
2:01 AM
yes , but you have a leaking encapsulation there
 
2:13 AM
@rdlowrey completely stole your stduri class
'stole'
 
user895378
I've never seen it before in my life.
 
user895378
But it would make sense if a URI class looked similar ... considering there's a standard for URIs
 
user895378
@Lusitanian Oh, sorry, I'm a dummy.
 
lol, i was pretty confused
 
user895378
2:14 AM
I thought you were saying I stole someone else's StdUri :)
 
user895378
I was like, "What?"
 
user895378
Oh, don't care. Knock yourself out.
 
haha no
yeah, the implementation i had (cough @PeeHaa) wasn't strict to the rfc
didn't support query strings or username/pw
 
user895378
Yeah, I've spent a lot of time poring over the relevant RFCs ... implementing the gory details of HTTP is a lot more work than I originally expected.
 
indeed. i'm changing it slightly, making the constructor into a ::fromAbsolute static method
and making a new constructor which accepts parts
this is where I miss C++ and its multiple constructor support, along with every other oop language
actually...a "fromParts" makes more sense
actually...there's literally no point in a constructor from parts :P
 
2:22 AM
Static. Ick.
 
user895378
@Lusitanian Actually the whole point is a constructor from parts. It's called dependency injection.
 
@LeviMorrison i know
@rdlowrey your constructor builds from a uri string
im probably missing something from being braindead/half-asleep though, enlighten me
lol
 
user895378
well, the point is, classes that need a valid Uri instance shouldn't be able to statically generate it on their own with something like Uri::buildFromString. They should ask for an instantiated Uri instance in their constructors.
 
Right, I agree with that [and do it]
 
user895378
Then why would you need a static factory method?
 
user895378
2:26 AM
$uri = new StdUri('http://localhost');
 
i wouldn't...that was the reason i backtracked initially
initially what i wanted was this:
$uri = StdUri::fromParts('google.com', '/search', 'https', 443, blah, blih)
 
user895378
Oh, I think I misunderstood you again. I think I'm braindead from trying to parse chunked transfer encodings.
 
yeah it's okay that's totally understandable
 
user895378
I see what you're saying.
 
i'm just trying to determine if there's such a use case for a method like that, i guess
 
user895378
2:29 AM
I don't see why there would be, given php's parse_url function.
 
user895378
Well, I take that back. I specifically do that in my SuperglobalUriDetector class.
 
user895378
That builds the absolute URI from the $_SERVER superglobal.
 
yeah i noticed that...but in terms of the library i'm building there's no use:
the only time this is used is for callback uris and api endpoints
for the callback it could be useful i guess
public function testAllUriComponents()
{
    $absoluteUri = 'https://joe:bob@example.com:6912/relative/path?user=jon&password=secret#div';
    $uri = new Uri($absoluteUri);
    $this->assertEquals( $absoluteUri, $uri->getAbsoluteUri() );
    $this->assertEquals( 6912, $uri->getPort() );
    $this->assertEquals( 'example.com', $uri->getHost() );
    $this->assertEquals( 'https', $uri->getScheme() );
    $this->assertEquals( '/relative/path', $uri->getPath() );
    $this->assertEquals( 'joe:bob', $uri->getRawUserInfo() );
woo passes
 
Having issues with script. I want to check to see if the php script I am on (install.php) is in a subdirectory or subdomain. My question is here
 
more brain deadness -- can't figure out where i want to store a list of scope values
 
 
1 hour later…
4:03 AM
back in here!!!
willing to learn.
 
 
2 hours later…
6:20 AM
curiosity lands almost 23 hours from now
 
6:41 AM
what do you mean?
(@MikeB)
 
 
2 hours later…
8:39 AM
bonjour
 
9:07 AM
user image
3
 
six weeks? I'd say it's already after two weeks.
 
9:38 AM
dafuq I wrote last night :D
 
reads back chat to see the discussion while was asleep: "Trigger a jQuery event using PHP."
 
Who needs PHP when you have jQuery
 
lol @webarto . .
 
9:55 AM
 
I am trying to rewrite url as http://domain.com/show.php?url=http://google.com to http://domain.com/show/http://google.com

I am using this mod_rewrite script

RewriteEngine on
RewriteBase /
RewriteRule ^show/(.+)$ show.php?url=$1 [NC]
The problem is that the output should be http://google.com but it gives http:/google.com with a single '/'.
 
Jon Skeet's revolver is full of silver bullets.
0
Q: How atomic are lockfiles in PHP?

chiborgI have a PHP page that should be accessible only by one user at a time. It's a kind of "poor man's cron": A "Javascript" file, that is requested in the background. At the moment I'm thinking of creating a lock file like this: if(file_exists($lockfile) && filemtime($lockfile) + EXPIRES_AF...

> A "Javascript" file, that is requested in the background.
 
10:40 AM
a good morning to veryone
 
good evening in here.
 
Good morning, @NikiC.
 
morning @Whisperity, evening @Joey
 
thank you!!!
 
@Whisperity Hey, I am still having problem with my code from yesterday. Do you maybe have the time to help me a little more?
 
10:50 AM
@webarto hey :D nice.
 
@hakre too bad that superstatic.com is taken :D
 
@webarto Obligatory this domain is for sale hoax.
 
LOOOL. what a hoax. I was offering one buck for that name and their form then tells me: "We're not responding to offers less than $1,000. Please visit LatestDomainSales.com to see current domain values and make a higher offer if you're still interested."
 
@Blade Put together a question on the main site showing the database structure, the data and the scripts itself with the got and the expected output. I'll look into it and post an anwer.
 
we always have super-static.com :D
 
10:56 AM
we should trademark it and then sue the current owner of superstatic.com of trademark infringement and blocking of business.
 
@Whisperity this company I worked for, sold some crappy co.za overtaken domains (registered for $7) for $1000+ ... I really couldn't believe that idiots would buy something like that...
 
I Am Rich is an iOS application which was formerly distributed using the App Store. When launched, the screen only contains a glowing red gem, and an icon that when pressed, displays the following mantra in large text: I am rich I deserv it I am good, healthy & successful The application is described as "a work of art with no hidden function at all", with its only purpose being to show other people that they were able to afford it, making it a Veblen good. I Am Rich was sold on the App Store for 999.99 United States dollars, 799.99 euros, and 599.99 pounds sterling, the highest pric...
I bet if we make basic PHP scripts with some rather basic licence evaluation (which could be easily removed with commenting out one line in the source), people would still buy it.
 
probably. truth is, most people actually want to do the right thing
 
11:16 AM
no one wants to buy my pink rims and they give $1000 for domains :(
 
i hope @tereško is here
 
@JoeySalacHipolito Seen 11s ago, talked 9h ago.
 
hehehe...
 
morning
 
11:39 AM
morning
 
5
Q: Not receiving realtime updates at all from Facebook

Malcolm ChristieI've setup my server to receive realtime updates from facebook, I've gone through the authentication to get the token etc, registered the callback url... and I've not received a single notice since the authentication GET request. When I GET graph.facebook.com/APP-ID/subscriptions I receive... d...

 
@AlexanderNorway why don't you ask Facebook guys?
 
They havent taken the time. Actually.. If I write what I receive to file with php, it just says userArray. I believe that its a php related problem as I cant see the contents of said userArray.
 
12:00 PM
@AlexanderNorway it is not related PHP as a language, it is E_PEBKAC related then... I'm just saiyan, post a thread/bug on Facebook Developers...
 
WIll do, thanks
 
@AlexanderNorway they push changes all the time and docs are not updated ... I don't understand nature of your problem exactly... but if you are doing it "by the book", and it doesn't work as expected, feel free to ping them on Developers...
 
@Lusitanian are you awake :)
 
What is this sudden e-mail verification spree? GitHub and FimFiction requires me to send and verify my e-mail. Was there some sort of breach which made site owners cautious?
 
Ruby on Fails probably :)
 
12:14 PM
so much fun, a guy's retagging all questions as just php, suddenly a lot of unread feeds in my reader
 
@Whisperity GitHub has been getting money. I figured they want something back for it :)
 
@webarto You have experience in this matter?
 
@AlexanderNorway I only have experience in writing FB API wrappers because their API constantly changed (few years ago), and for this, none whatsoever :) sorry
okay :(
 
@webarto Yeah, its annoying as hell. They just recently started changing dates from NSDecimal into Encoded Strings.. 2012 suddenly became 2024.....
 
bunch of elitist hipsters IMHO
 
12:20 PM
@webarto They changed it back for some reason.
@webarto So know it works again. Same with inviting friends to events. It used to work, suddenly didn't for like a month, and now it does again........
now*
 
blog.ircmaxell.com/2012/08/… I really want to reply with Lester, you're an idiot
 
@ircmaxell Is he still at it... :(
@ircmaxell There has to be a service somewhere that you can say "Ignore this user everywhere" like in chat only for the entire internet
 
nope
 
Good morning, @ircmaxell. On topic: .
 
@ircmaxell omfg he is expanding his rants to your blog?
 
12:24 PM
yeah...
HAHAHAHAHAHAHAHAHAHAHA
 
Is there a sampling profiler for PHP?
 
I just looked at my horriscope for today (I get it to my rss reader for a joke), and here it is:
> Be very wary of any people who like to broadcast their problems to the wider world.
 
:D
 
caused my brain to loop
 
12:28 PM
@webarto Okey, Im receiving updates from the facebook api like this:
} else if ($method == 'POST') {
$updates = json_decode(file_get_contents("php://input"), true);
file_put_contents('/filepath/updates.txt', $updates, FILE_APPEND);
 
@NikiC not that I'm aware of. And how would you? in a signal handling callback can you get the information of the current point in the stack?
 
@ircmaxell the execution context is a global ;)
 
@webarto The file files up like this: userArrayuserArrayuserArrayuserArrayuserArrayuserArray
@webarto Thats why I think its php related
 
I'd just like to see real profiling information for once, not the crap that xdebug provides
 
@NikiC Well, in PECL, sure. I'm talking in userland...
 
12:29 PM
@ircmaxell I mean in PECL
 
@webarto I dont think im reading the contents correctly.
 
@AlexanderNorway json_decode produces an Object
 
I mean in userland. So you require "profiler.php" which installs a signal handler, and then run the app while you run an external profiler...
 
@AlexanderNorway Because you are outputting $updates as a string whilst it is an object or array.
 
$updates = json_decode(file_get_contents("php://input"), true);
$updates = (array) $updates;
file_put_contents('/filepath/updates.txt', $updates, FILE_APPEND);
@AlexanderNorway try like this
 
12:30 PM
@ircmaxell not sure what you mean
 
@webarto dude, that makes so much sense..... sec!
 
You're talking about a stastical profiler that runs external to the script, using interrupts at specified intervals to check execution process...?
no?
 
@ircmaxell Yes
but I don't that this can be reasonably done in userland, has to be pecl.
 
Why not in userland? we have signal handlers...
 
@AlexanderNorway json_decode($updates, true) will produce an array, so you don't have to cast it, you can also use serialize($updates) to convert object/array to string, and unserialize($updates) for vice-versa... also consider filename to be current time() value... then you can use glob('*.txt') to iterate files... on second thought, you only need serialize() to store object/array as a string...
 
12:35 PM
@ircmaxell but can you access where execution currently is?
 
time to find out
 
and also, is the signal overhead low enough?
 
no idea
recompiling with enable-pcntl now
 
/me already has a pecl build :P
but I think signal handling in my vm is kinda broken
last time I tried to use sigalrm handling it never reached the handler ^^
 
I'm going to set a sig_alarm
actually, that won't work, it's only second resolution
 
12:41 PM
yes
and ticks can't be used for this purpose because they are not uniformly distributed
@ircmaxell What do you think, how hard would it be to build a pecl extension for this?
xhprof has a sampling mode: php.net/manual/en/function.xhprof-sample-enable.php but it seems rather low-res and high-overhead
 
it should be fairly easy actually
 
Because it captures the full stack
0.1 seconds are waaay too much for sampling.
@ircmaxell you think so?
 
debug_backtrace works in a signal handler
so you could use it in a signal handler in PHP natively...
except you'd have to alarm it externally
 
and high overhead ;)
 
well, but it would be useful in places you can't install a PECL extension
 
12:53 PM
in such places, could you send the signal externally though?
(and also: in such places, will pcntl be enabled?)
 
potentially
 
Apple Allowed Hackers Access To User's iCloud Account - Forbes http://onforb.es/NUN6zT via @sharethis
 
1:10 PM
@webarto You are awesome! serialize worked! Theres like no tutorial online on actually handling the notifications.
 
Hi! Could someone test this: print file_get_contents("http://www.iltasanomat.fi"); since it wont' work for me
does it work for you
Anyone??
 
@Olli whatever does not work for you means. at least it should return FALSE when it is working.
 
the page displays nothing
I tried with cURL and it says 403 - Forbidden
how could I bypass that
 
Sounds like you are trying to break some TOS
 
@Maerlyn guilty :)
 
1:21 PM
However: have you tried adding a user-agent like a browser? @Olli
 
@PeeHaa do you mean using CURLOPT_HTTPHEADER
 
0
Q: Setting a user agent with cURL is "not valid"

MarkI'm trying to set a mobile user agent so I can access a mobile website with cURL. Here's the code I've got... $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'http://www.google.com/m/place?dc=gorganic&q=deli+in+new+york+city&latlng=40715995,-73987350,10718109707806394595&...

 
added that and it won't fix it
 
what does it return?
 
@Olli You need to find out what makes the server tell you that the request is forbidden. E.g. take a look into the request your browser does when it's okay. This can be done with some developer tools in your browser, e.g. firebug in firefox.
 
1:31 PM
@AlexanderNorway glad it worked ;) no, tutorials as we know are mostly buzz oriented...
 
2:44 PM
@Blade Are you using two accounts?
Uck phpMyAdmin is so slow...
 
3:00 PM
function _parameterize($str, array $params = array())
{
    if ( ! empty($params))
        foreach($params as $key => $value)
            $str = str_replace(':' . $key, $value, $str);

    return $str;
}
how would you call this function?
mimic of this
$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)");
$stmt->bindParam(':name', $name);
$stmt->bindParam(':value', $value);
 
0
A: Get value from one table, insert it in query of other. How to?

Whisperity Warning: Please, don't use mysql_* functions to write new code. They are no longer maintained and the community has begun the deprecation process. See the red box? Instead, you should learn about prepared statements and use either PDO or MySQLi. This article should give some details ...

 
I just had the realization that Liskov is a she, not a he
 
@NikiC this thread is worthless without pics
 
@NikiC Yea, and sometimes I wanna hug her, other times I wanna egg her house
DAMMIT BARBARA!
 
@NikiC brace yourself :D en.wikipedia.org/wiki/…
 
3:18 PM
What you search for is called database replication. Possible related issue: stackoverflow.com/questions/7278163/…Whisperity 1 min ago
Yay. This made the other question appear in the Linked list on the right. Wow.
 
@webarto Ada Lovelace sounds like a pornstar
 
@PeeHaa and worlds first programmer :D (altough 4chan might disagree)
 
prefers to waste time writing comments instead of posting his own answer - while complaining that others are faster. priceless.
 
@hakre Who, where, why?
 
3:21 PM
@hakre :P
 
@Whisperity: Insider, I'm waiting that this triggers something.
 
hehe it does
But but but I was just writing an unit tested answer ;)
 
@PeeHaa You did not? I always write tests for answers first and then run them against all supported and unsupported PHP versions on the various operating systems before actually pressing the submit button.
 
@hakre Crap I forgot PHP1 test
:D
 
3:23 PM
@ircmaxell what a contribution
 
LOL
 
@ircmaxell lol, it needed me to leave two comments.
 
I like the simple if statement with the "default" better though. But that is probably just me :)
 
btw when it's going to become more stable?
@PeeHaa Well actually removing the else clause there reduces cyclomatic complexity a bit which is a good thing.
 
Dry storms are a lot more terrifying than wet storms.
 
3:29 PM
@hakre That why I like it
Glad somebody finally agrees with my CS :D
 
@ircmaxell YPY wants to merge 1 commit into ircmaxell:master from unknown repository
Seems like a test for me.
 
@ircmaxell epic comment as epic (epic #fail that is)
as = is
 
@PeeHaa My is tangling.
thanks the problem is I am using two Database so access is an issue $result = mysql_query($query, $bckconn) as the Insert run on the bckserver I cant access to the real access??? — Andras Sebestyen 4 mins ago
> I cant access to the real access???
 
@Whisperity :|
 
3:37 PM
> readability?? \n lol. \n This is PHP, NOT BASIC. if you want to more readability go to BASIC programming..
@ircmaxell
 
@PeeHaa it says Access Denied.
 
@Olli Have you inspected the requests made by a browser like @hakre told you and replayed that request using cURL?
 
@PeeHaa how I can inspect them ? I'm using Chrome
 
@ircmaxell wtf
 
@Olli F12 -> network tab
 
3:41 PM
@ircmaxell don't feed the troll. damn, I wanted to see how that guy reacts on my nitpicking. now you ruined that :(
 
I'm not feeding. I closed with a valid reason, and that's it...
 
and then the first request ?
copy request headers
now I have them
what I should do witht hem
 
@Olli Read them, understand them, rebuild them for the curl request.
 
what I should take
addition to User-agent
 
how come when I use

echo <<<MY_STRING
// javascript block here
MY_STRING;

Parse error: syntax error, unexpected $end
 
3:50 PM
@Michael just use
print"
<script>
// smthing
</script>";
 
@Olli okay sure. can I ask why print instead of echo?
 
i'm just used to it, feel free to use echo :D
 
@MichaelEcklund put a newline after the MY_STRING; ;)
 
but if you want to read more about it
42
Q: Reference: Comparing PHP's print and echo

user187291Stack Overflow has many questions asking about PHP's print and echo keyword usage. The purpose of this post is to provide a canonical reference question and answer about PHP's print and echo keywords and compare their differences and use-cases.

 
@Whisperity: Hey, thanks, I will read your answer right away.
 
3:54 PM
@NikiC didn't do that trick
 
i have set session variable now when tab closes does it gets reset?
 
@MichaelEcklund it didn't work?
 
nope
same error still
 
PHP and MySQL does not have a real-time built in :(
 
just use the print/echo without any <<< things @Michael
 
3:56 PM
evening
 
hello @teresko
nice to see you :D
 
@MichaelEcklund works for me. maybe your editor automatically strips the last empty line on saving ;)
 
@NikiC definitely doesn't.
are there any rules about using quotes?
 
no
but you could also try putting the MY_STRING into single quotes so it start with 'MY_STRING'
 
does it matter that it's in a class method?
 
3:58 PM
no
is the ending MY_STRING; at the very start of the line?
i.e. without indentation=
 
no, it has indents
 
get rid of them ;)
it has to be at the start of the line
 
awe, but that breaks my neat looking code
 

« first day (659 days earlier)      last day (4272 days later) »