« first day (1218 days earlier)      last day (3730 days later) » 

9:01 PM
function count_digits($digit) {
    // TODO: add type validation

    return $digit >= 10 ? 1 + count_digits($digit / 10) : 1;
}
 
@Leri Ummm... wat?
 
He wanted recursion so...
 
@AustinBurk return !ctype_digit($str) ? false : strlen($str);
Returns the length of the string or false if it's not all digits
Oh no wait
 
There we go
 
@Leri Coming up with recursive methods in exams on paper is really annoying. It is very simple to do them on the computer because if you left something out you can see the problem right away but on paper in an exam it can be overload on the head thinking of each stack frame in the recursive call
 
9:04 PM
fixed
 
I have a ridiculous problem that has nothing to do with php...
I accidentally used bind and can't use my c key or use alt 099 or anything now.
Maybe I'll make a php script that'll unbind the key run it as root
 
lol
 
Except I don't know how to do it. Hmm
 
@David Honestly, I am not a big fan of recursive functions and use them only when they are way better than alternative methods. Counting digits in integer with recursion is what I'd never do with php. :)
 
Suggest you rm -rf ~ <-- doesn't require the letter C at all
 
9:08 PM
exec("bind -r " . chr(99)); maybe
@DaveRandom Why don't you go and try that yourself, see if it works for you first?
 
@AustinBurk #worksForMe
:-P
 
@Leri Yeah I think this specific question is related to Java. The method is public int countDigits(int number)
Definitely not PHP
I'm having second thoughts about bothering doing this exam. The next question is solve the towers of hanoi problem using recursion. I'd prefer to go to bed and watch tv
 
@David I have to say it's a ridiculous question. There just aren't any languages (at least, high-level languages) in which you would do that
 
No it won't duh
 
@David String.valueOf(intOrLong).length();. :p
 
9:11 PM
@DaveRandom When I was in college all the computer science questions were stupid problems which would not arise in the real world working enironment
And basically all the programming questions too
@Leri 0 marks for that answer ha
 
Actually @David does it specify base 10? If not you could definitely be a pedant and do it in base 2, in which case it would be easy to write a recursive function to do it using nothing but ints and bitwise ops
 
@DaveRandom Haha no it does not specify the base.
 
Dang it! I think I bound the uppercase C too
 
The rest of the paper is just about stacks and queues implemented in arrays and linked lists. That is easy and also binary trees. I just don't like writing recursive methods on paper
 
@AustinBurk Case is irrelevant, you bound the key code
 
9:16 PM
lowercase c is 99
This is quite stupid, really
 
@AustinBurk Surely the answer is just to rm whatever file that config is stored in (and restart the ssh session), which is presumably in ~ and could tab-completed, avoiding the need to press c at any point...
 
Oh
Wow
Started a new ssh session
C works
 
ThW
I think i will skip that kind selectors for now - h2:nth-of-type(n+2):nth-last-of-type(n+2)
 
9:33 PM
It's kinda late here. Night, @all.
 
ThW
@Leri night
 
@ThW wait wat? You're not setting out on the fools mission of CSS->xpath are you?
Especially not in ext/dom libxml
let me assure you, you're gonna have a bad time
 
3.10AM
 
ThW
@DaveRandom I am :-)
 
@ThW for the record I wish you godspeed and I would be happy to contribute whatever I can (I do have a certain amount of xpath-fu), I just think that if it were (sanely) possible someone would have already done it, plus XPath 1.0 sucks compared to 2.0. I think in order to implement it properly you need to write a proper parser and DOM traversal engine, which (as you can see from pre-QSA versions of sizzle) is so resource hungry that it's borderline impractical
I think a more productive approach would be implement a selector engine in libxml itself
(which is also, obviously, decidedly non-trivial)
 
ThW
9:44 PM
I got most of the css 3 spec working
 
@ThW I have to say that is by far and away the best attempt I've seen so far
 
ThW
thanks
Don't think I will ever use it myself.
:-)
it's easier to write xpath diectly
 
@ThW This is almost exactly my point. Don't get me wrong, I would love for CSS selectors to work with DOM. But the only way I see it as being practical is if libxml does it properly. All these PHP userland impls are impractically slow and resource hungry. Yours is decent, but you've still got a huge amount of overhead (lex/parse/interpolate) even before you factor in the PCRE and XPath expense
Yeh, lets parse before we lex, that'll work out well :-P
 
ThW
True, that was my main reason for using xpath in FluentDOM
 
user895378
okay, so never ever use the http:// wrapper to do this in real life but streams will likely be supported for setting the path to a cafile in your 5.6 encrypted transfers:
 
user895378
9:57 PM
$ctx = stream_context_create(['ssl' => [
        'cafile' => 'http://curl.haxx.se/ca/cacert.pem'
]]);
$html = file_get_contents('https://github.com', false, $ctx);
 
ThW
I modified that yesterday, so I can insert the transformation as a callback function. github.com/ThomasWeinert/FluentDOM/blob/master/src/…
 
@rdlowrey Please, for the love of god, don't tell anyone about that
That code fragment is so wrong in so many ways that I may actually cry
 
user895378
Well, it's for bug #65538 which is a very valid use-case (phar://)
 
@rdlowrey OK, that's legit. I suppose using file:// is valid too. But srsly.
 
user895378
Yeah, same for file://
 
user895378
10:00 PM
However, I can prevent stream wrappers that claim to be "url" wrappers (i.e. anything that would be disabled by allow_url_fopen = 0) ...
 
user895378
As long as non-remote wrappers don't identify themselves as such then it should be pretty safe.
 
user895378
@DaveRandom I thought you would appreciate the hilarity of that actually working :)
 
user895378
Actually deploying the above code would be the ultimate SSL
 
@rdlowrey If there is anything that defies that then leaky abstraction is leaky and needs plugging immediately
@rdlowrey I might start pointing curl.haxx.se to my VPS in random machines I sit at for shits and giggles
 
user895378
lol the sad thing is it would totally pwn a lot of people.
 
ThW
10:09 PM
btw how do I provide an absolute path to phar on windows?
 
user895378
I have no idea. I've never used phar but I'm about to try so I can test this patch.
 
@ThW Never tried it but based on how other things work, phar:///C:/foo/bar/baz.phar
(triple slash, drive letter, path)
 
ThW
@DaveRandom did not work
 
Don't you have to set it manually as an environmental variable?
 
Then leaky abstraction is very leaky
 
10:11 PM
right click > my computer etc.
 
user895378
> Warning: remote cafile streams are disabled for security purposes in /home/rdlowrey/php-src/bug-65538.php on line 6
 
ThW
@DaveRandom without the drive letter worked
 
@rdlowrey That's better
 
user895378
:)
 
@ThW yeh but that doesn't help when you need something other than current working drive
 
ThW
10:13 PM
yeah, ended up removing the phars and used composer require-dev
i tried to get behat.phar to be able to use assertions from phpunit.phar
 
@ThW before I dive in to this, are you 100% positive you used the triple slash and not just phar://C:/...
 
ThW
@DaveRandom let me try again
 
user895378
triple slash always gets me with file:///
 
ThW
Warning: include(): Failed opening 'phar:///c:/PHP5/tools/phpunit.phar/phpunit/Framework/Assert/Functions.php' for inclusion
 
I will have a poke around shortly (although bare in mind i.imgur.com/xVyoSl.jpg)
 
ThW
10:22 PM
include('phar:///PHP5/tools/phpunit.phar/phpunit/Framework/Assert/Functions.php'‌​); works
 
I'd be seriously concerned if that didn't work
 
ThW
Noticed it yesterday.
php version is 5.5.6
 
I imagine it uses the somewhat scary parse_url routine (or sth similarly horrifying)
(which IIRC doesn't handle that case correctly)
 
ThW
@DaveRandom I appreciate it
 
I can't believe I haven't tried out Vagrant before today. Friggin' thing is awesome.
 
10:31 PM
btw on a somewhat unrelated note @rdlowrey, nog looked at your reworked rate limiting codez but my original needs reworking to use a linked list, its currently O(n) and doesn't need to be (although that can definitely be a 5.6.x fix if the current version get in under the 5.6.0 window)
In fact I think it's O(2n) IIRC
 
dkjshcksdjhdskjhsdk all
 
Yay drunk @PeeHaa
 
On Wednesday night, law enforcement officials contacted Kickstarter and alerted us that hackers had sought and gained unauthorized access to some of our customers' data. Upon learning this, we immediately closed the security breach and began strengthening security measures throughout the Kickstarter system.

No credit card data of any kind was accessed by hackers. There is no evidence of unauthorized activity of any kind on your account.

While no credit card data was accessed, some information about our customers was. Accessed information included usernames, email addresses, mailing addres
 
user895378
@DaveRandom No big deal. I was actually going to revisit that in the next few days. I'm going to submit a bug report in the next couple of days for reneg limiting. Then as soon as the current RFC passes I'm going PR the reneg fixes. Should be able to address that before then :)
 
> Actual passwords were not revealed, however it is possible for a malicious person with enough computing power to guess and crack an encrypted password, particularly a weak or obvious one.
That's damage control talk for: "we didn't properly hash our passwords"
 
user895378
10:33 PM
Oh, and I'm going to merge the reneg limiting bugfix PR. For 5.6. For sure.
 
@DaveRandom It's a dirty job but somebody's gotta do it
 
user895378
Are we talking about @Lusitanian's mother?
 
Did I miss any interesting sand in @JohnHaugeland's vagina or isn't it worth it to read back the transcript?
yay double ping
@rdlowrey That's not dirty, that's just filthy
I'm thinking about setting up a new github account @lusitanian's mom
 
user895378
@PeeHaa I just tinyAvatar'd ...
 
I was feeling kind of guilty for being authoritarian and not listening until I looked back realised that I posted exactly 4 messages, all of which were very reasonable during the course of my being shouted down
 
10:39 PM
@rdlowrey Yeah I can see why
@DaveRandom DO YOU WANT ME TO GIVE YOU THE SVN COMMITS!?!??!?!!?
@JohnHaugeland Best intro evah
@JohnHaugeland insert needless ping here
@JohnHaugeland
 
@PeeHaa I would literally rather have cancer. that may be a step too far. I'm willing to look at the code but if I have to use SVN to do it then shoot me now.
 
hehehehhehehehe
 
#yayMultiPing
 
@DaveRandom Nope not too far at all
I'm serious a cancer when I say WTF dude what's your fucking problem moron!??!?!
Ow wait that's not how the lyric goes
^ related
Apparently it even won a price
You people better be reading either the article or watching the clip or you are ignoring me
:-)
 
@PeeHaa Reading the article, which I now regret
:-P
 
10:46 PM
:D
 
I am currently listening to youtube.com/watch?v=p8Kdzluxxdg and can't abandon it for some shitty 90s dance
The shitty 90s dance comes later, after more alcohol
 
@DaveRandom E_TOO_RELAXING
 
alcohol, mdma, amphetamine, lsd
potatoe, potatieh
;-0
 
@Danack I am currently obsessed with that album
 
Needs some Australia/latin combo - youtube.com/…
 
10:48 PM
I had never head of City and Colour until a couple weeks ago and I'm just blown away by it. I totally get that a lot of people are going to look at me funny but I don't care
 
You might want to commit suicide yet fucking crazy ass track youtube.com/watch?v=jIBcarAwsjw
 
@PeeHaa Hey, Portishead, next time you play live, how about some Strip Hop? Boozy girl naked - very pleasant.
 
@PeeHaa The only suicidal song I know of is Mad World
 
@Fabien LIES!
 
@PeeHaa Brizzle sound - represent.
<-- Bristolian
 
10:51 PM
 
> ...with DJ Lemsip and Catatonia's Cerys ironing beans in the background. Nicely understated that, like a bomb made out of jazz and feathers.
 
@PeeHaa That's a song that hypes me up tbf :P
 
@Fabien Issues... you have them
 
@DaveRandom WHATTEHFAKIZDAT?>!?!?!?!
I search the almighty google and I get just that
@Danack That sounds like pickup music :)
 
10:54 PM
> so, if you do go to that, leave the bollock to drown
 
@Fabien I mean WTF dude I'm sure you have seen requiem. HOW TEH FUCK DOES THAT HYPE YOU UP?!?!??!?
 
That's why
 
As a matter of fact I am cutting arteries as we speak
 
I was pretty heavy into breakdancing when that video came out. So the song reminds me of it.
 
@Fabien Well they can put it in as many epic clips as they like it will always have this epically insane uberfucked up feeling to it
 
10:59 PM
@Danack I though you were one of those Australian types?
Also, you must have got some stick because your name over the years...
 
@DaveRandom From Bristol, was living in Oz for a few years - back in Bristol for a while.
@DaveRandom If you can think of an actually funny joke, I will buy you a beer.
 
Soooo couple of hours later I returned drunk slighty high tired and I have an open window of my texteditor with the project I was working on. Do I continue and trust I will not fuck up?
 
Do it.
 
There aren't m?any funny jokes based on the fact that you the same name as someone famous
 
Just branch it as a "Drunk"
 
11:02 PM
@Fabien I prefer the first version, read more like "just... fuck it, drunk"
 
lol
 
:D
Can you fork your own repo under the same name?
To the git mobile!
 
@DaveRandom About the only one that made me titter was when I was in a hurry once, and said I had to get somewhere urgently, and someone asked "what, are you on a mission from god or something?"
 
@PeeHaa You can certainly fuck your own repo under the same name. Just rm -rf ./ and commit
 
GODAMNIT I feel like flappy cunt guy with all the github issues and waiting PR's. STOP HARRASING ME!!!!
@DaveRandom Can you fork your own reop on github?
Will it be divided by 0?
 
11:05 PM
No, that's what branches are for, you could fork it to an org though
(I think)
 
Oooooow shiny I have a ssh connection open for some reason.
Now what was I doing there?
 
Or if you can't, I could do it to one of the various orgs of which we are both members
@PeeHaa You were about to rm -rf /
 
We are corporate fucks :)
 
(eventually someone will do it)
 
@DaveRandom Doesn't work
Or does it!??!?!
 
11:06 PM
Only one way to find out...
 
gmmmmmmmmmmm
 
Tempting my british friend!
:-)
 
@PeeHaa ironically I read that as fiend
 
I'm pretty sure without -f it doesn't work
@DaveRandom What's the difference :P
 
I know on win it doesn't work, you won't even get past .trash
 
11:08 PM
@PeeHaa You should definitely try this while you have beer courage in you.
 
But Win keeps file locks on a whole bunch of pointless shit for no reason
 
ThW
Good Night
 
@ThW nite. I'll get back to you on the whole phar thing, I would like that to work
 
We (@lusitanian's mom and I) have been ignoring this totally needed and awesome PR for waaay too long and now merging is going to be fucked :(
@DaveRandom You clearly underestimate me
 
ThW
@DaveRandom no hurry, if it is a bug it was here a long time :-)
 
11:10 PM
@Fabien I would rule that shit. Hell I think it works the same for snowboarding courage
 
I think that kid was born spinning.
 
@PeeHaa rebase is surprisingly clever
 
@ThW <chat><users><user id="too lazy to lookup">ThW</user></users><messages><message id="1337" userid="too lazy to lookup">Night</message></messages></chat>
Bitches love their xml :-)
@DaveRandom 5 months ago clever?
 
ThW
@PeeHaa where is the namespace? :-P
 
:D
 
11:13 PM
@PeeHaa Depends whether it's against cv-pls/cv-pls or not :-(
 
cv-pls most be older :P
> Note that connections will be slow as shit, due to the fact that authentication and getting all the required cookies takes about 15 requests.
Say WHAT!?!?!?!11!?!?!?1!!1
 
> It is a massive hack over the data.SE internal API, and while it does work it's definitely not something we should make public.
 
[tag:javascript-question] Is it possible to .replace() with a value based on the matched value?

Example: var text = 'foo bar baz'; text.replace('regex here to split by words', function('currently matched word'));
 
It's pretending to be a browser, going through the whole openid auth process
 
Don't you get hit by the captcha thing?
 
11:18 PM
There's no captcha if you authenticate
 
huh?
 
srsly, go log in and take a look
Actually I'm also pretty sure there used to be, but apparently not any more
 
So I see
This is new for me :-)
 
@DaveRandom So how do I specify a current auth token so it doesn't have to do that whole 15 requests thing?
 
I'm really quite pleased with it, it's the result of about 45mins reverse-engineering over lunch plus a couple of hours at the end of the day and it works pretty well
@crypticツ It's all about your cookie jar, you're basically at the mercy of ASP.net sessions
If you hit it every 15 mins or so then you won't get logged out
(btw, the cookies are handled internally by the HTTP client, you can specify a local storage dir in the constructor)
Actually I may have forgotten to proxy that arg in the factory
I pinched that curl wrapper from the Exchange lib I'm working on
 
11:22 PM
Manual following Location headers WTF I remember I had to do that also for soundcloud
 
Answered my own question -- edit: ty @PeeHaa
 
@PeeHaa It's a long standing bug in libcurl to do with the order or response headers
Essentially if the response code is 3xx and the content-length appears in the wrong place is doesn't work
 
@DaveRandom And why do I hear that for first the first time in my life?????
 
I looked into it quite extensively, seems like it should be an easy bug to fix tbh
 
Damn... Well there is that curl dude hanging around SO
 
11:25 PM
Problem is, the libcurl master codebase is still CVS based, which basically means I cba even looking at it
Also it must be a fucking shit mess based on the userland API
 
@crypticツ At least prepare the "answer" by downvoting it ;)
 
@crypticツ Can you delv @ 10k?
 
dunno
<-- under 10K
 
11:28 PM
Yeah 1 moment...
 
@crypticツ btw I suggest if you are going to build something off the back of that stuff I wrote you set it up on a cron job once an hour or something and store the data locally. data.SE refreshes so infrequently anyway, and it would be best to avoid people arousing suspiscion over scripting since I'm pretty sure that's a huge TOS violation
 
Does anyone know any algorithm that would solve pathfinding in grid, when each field has a number limiting the movement you can make (vert. and horizontal only)?
 
@PeeHaa Yeh but you have to wait 72-hrs IIRC
unless they changed it
@crypticツ has exactly 9000 rep, this should be celebrated
 
@DaveRandom Yeah but cryptic is cleaning old shit (with possible already downvoted answer)
 
11:29 PM
@DaveRandom if the black helicopters come to my house I'll point them your way =oP
 
@DominikHadl "http://en.wikipedia.org/wiki/A*_search_algorithm" and set the 'forbidden' routes as infinite cost.
 
I just flag, and if enough flags as non-answer it deletes itself
I think O_o
 
@Danack I know about A*, but not very familiar with it, what exactly are forbidden routes in it? thanks :)
 
@crypticツ Show me one of your answers you are particularly pleased with
 
I have such crap answers =oP
 
11:32 PM
Find a good one
:-P
 
4
Q: regex differentiating between ISBN-10 and ISBN-13

mk_89I have an If-else statement which checks a string to see whether there is an ISBN-10 or ISBN-13 (book ID). The problem I am facing is with the ISBN-10 check which occurs before the ISBN-13 check, the ISBN-10 check will match anything with 10 characters or more and so may mistake an ISBN-13 for ...

 
@DominikHadl "when each field has a number limiting the movement you can make" => so from that node, vertical movement would cost '1' and horizontal movement would cost '10000000000'
 
^ that should get you half way :)
 
@PeeHaa =oO
 
Yes @crypticツ that's how much internet moneyz your are worth to me :-)
Incidentally it's the max bounty one can give :)
 
11:35 PM
@Danack oh, I see what you mean. That's not exactly what I meant - I mean that each field has a number which represents the length of a jump I can make to another field (only to those within the grid of course). Meaning if in the upper right is number 5, I can move onto a field 5 fields below the starting one or 5th field to the right.
 
@PeeHaa paid too much! =oP
 
Hey could someone please help explain this to me, github.com/gilbitron/PHP-SimpleCache
 
Neh I've always been curious about the regx pattern for ISBN-10 and ISBN-13. Whatever the hell that is :p
 
@jack what part?
 
Why do you need to add the url when you call latest tweet should you not just add the url within simple cache
Or does it create a new cache for each url but if you call the url again from a different area will it create a new cache or use the one made rpeviously
 
11:37 PM
@DominikHadl So why can't you use A* for that? There may be a reason but what you said, doesn't alter the fact that you have nodes which are connected to other nodes, which is what A* is for.
 
@crypticツ Sorry I was typing as you posted :P
 
@jack Without looking at the thing it most likely either requests shit when not cached and/or not expired
 
@Danack Ok, I'll look into that. Thank you
 
Anyone slightly knowledgeable with htaccess url changingÉ
 
@DaveRandom yay I have found another use for github.com/DaveRandom/json-prettifier!
 
11:40 PM
Been stuck with a really minor, but annoying problem.
 
When in doubt
 
What I'm trying to do is change localhost/article.php?id=bryan to simply localhost/article/bryan and I've implemented the following code: Options +FollowSymLinks
RewriteEngine On

# Removes the .php extension from pages
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) $1.php [L]

# Cleans up the PHP URL of all pages on website
RewriteRule ^article/([^/]*)$ /article.php?id=$1 [L]
I'm still getting an internal server error though. I'm using wampserver by the way.
 
@PeeHaa ?
@PeeHaa How long before you can allocate it?
 
@DaveRandom I have been working on an oauthlib intergration tests site. And prettifying the raw response is just want I need
@DaveRandom 23h
 
Jesus @crypticツ you need to create some better answers on the main site to demonstrate your actual competence :-P
 
11:49 PM
:-)
That moment you have to click to view all answers in order to award a bounty...
;-)
 
@DaveRandom lol, yeah...I don't know if that's possible
 
@user3020461 Do you know what the first block does and how affects the second?
 
I think today is the first day in a long while on which my backlog did not increase
 
@crypticツ It totally is, you just have to pick and choose. Also it helps if you give way more info than the OP asked for
@NikiC plz implement AST in zend engine kthxbai
 
@NikiC What backlog?
 
11:51 PM
Does that help?
 
^ that
 
@PeeHaa The all-the-stuffz-to-do backlog
 
Stop bitching and start fixing wunderkind
:-)
Can we close this as some dupe stackoverflow.com/questions/21805338/… ?
 
Also I handled russian text today and php makes it a breeze, as always :) no damn special unicode handling to get in your way ;)
Aaaand good night :)
 
@NikiC nite; although let it be known that I wish to get your take on the whole unicode thing when you are not about to go to sleep
 

« first day (1218 days earlier)      last day (3730 days later) »