« first day (2316 days earlier)      last day (2626 days later) » 

9:00 AM
Happy Friday
 
!!lxr-jeeves ChatClient
 
Hi
 
@Ekin oooooo
@astrosixer Tried Room 17 (JavaScript)?
 
Oops! this is php but if you know that will be great. Thanks in advance
 
9:03 AM
@astrosixer Well I think it is that it isn't defined where you get the error, just a wild guess tho' I might be wrong.
 
There you go.
You haven't defined the link to your jQuery file.
 
@Sean yeah, DaveRandom was working on that last night, pretty nice indeed :-)
 
and in case you haven't seen it - also renders markdown lxr.room11.org/xref/jeeves
 
Load the page, open your browser debug console and type window.jQuery, if it returns undefined then jQuery was not included in the page correctly, check your file path. If it returns a function (or is not undefined) then you're running your code before jQuery has fully loaded, try confirming your script order.
 
I checked the source code and its loaded
 
9:05 AM
But before any other script.
 
is it just me or some examples are arguably wrong here?
https://github.com/kamranahmedse/design-patterns-for-humans
 
Yes I have taken pretty much care to load it before every other script is loaded
 
@StefanoTorresi you want us to review the whole thing to figure out which you're talking about?
 
@astrosixer Could you atleast show an example how it's loaded (lé source)
 
@PaulCrovella nope, I'm just throwing a bone :p I scrolled it quickly and I didn't like some examples.
 
9:08 AM
Use chrome developer tools check for erros.
What are you getting?
Check the console.
 
> Singleton
Yup
I mean in a quick skim there's a bunch of other stuff too, but that's a big red flag
 
@MikeM. I should send you the link of that particular page is it ok?
 
sure
 
Please check the view source page
 
@Sean actually I think the singleton example is formally correct.
 
9:12 AM
> <script src="http://adoxsolutions.in/qatpedia/public/js/jquery.js" async></script>
> async
Adding the async attribute will not block the rest of the resources loading while your browser requests for that script.
 
I meant to load the script after the rest of the page is loaded @sean
 
Not fully true.
 
Anonymous
Moin
 
You're doing <head> <body> <content> <javascript> <content> </body>
 
mornis! o/
 
9:15 AM
You can also look at the waterfall of the JavaScript resources timeline.
Notice how jQuery UI and bootstrap are loaded in well before jQuery is.
Morning Jay.
 
That means using async is the issue?
 
Most likely.
 
using async when script is inside <body> is wrong?
@MikeM.
 
I mean I'd just recommend fixing the HTML on that page first as Mike suggested. Then take a look at async.
 
Let me try it without async
 
9:20 AM
Plus, your jquery version may not be compatible with your bootstrap-min.js
nvm might be a previous warning :P
 
which version should I use in that case? @Mike M.
 
@astrosixer might be a warning not for you but it said "above 1.9.0 and below 4"
But as I cleared the logs, it didn't popup again at your page...
 
dam
 
@SalOrozco What?
 
Those html errors
 
9:29 AM
:D
 
Something keeps tapping the back of my head in regards to auryn. If I'm providing dependencies through the constructor or method, is it considered wasteful if they're not needed? Example, a form which sends an API request, if the validation on the form fails then you just bat back the form to the user without touching any SDKs or anything.
It's kind of a weak example, but does it make sense?
 
Get what you are saying.
 
Unless in this case you're able to specify a chain of tasks after a route, or set it up so validation is part of the middleware, etc.
 
@Sean you've seen the ping about imdb being brokenish?
 
2 hours ago, by Eugene
Is there any known good solution for wiremocking in PHP?
 
9:36 AM
@JayIsTooCommon If I have the dolla
@PeeHaa Missed that, cheers.
 
:)
 
It's very slow
 
Not just that
It also doesn't find all teh stuff
!!imdb resident evil
 
Resident Evil (2002) [ http://www.imdb.com/title/tt0120804/ ]
Resident Evil: Apocalypse (2004) [ http://www.imdb.com/title/tt0318627/ ]
Resident Evil: Extinction (2007) [ http://www.imdb.com/title/tt0432021/ ]
 
That fails for some reason
Oooohkay
It reaaaally didn't last night
Promise
13 hours ago, by Jeeves
I couldn't find anything for that title.
 
9:49 AM
!!!tv Lucifer
Jeeves doesnt love me :(
 
@Izopi4a it's not good
 
@Izopi4a He loves you, but you added too many exclamation marks :P
 
:D :D
!!tv lucifer
!!imdb lucifer
 
Lucifer (2015) [ http://www.imdb.com/title/tt4052886/ ] - Lucifer takes up residence in Los Angeles. [♥ 8.3]
Lucifer Rising (1972) [ http://www.imdb.com/title/tt0066019/ ] - Egyptian gods summons the angel Lucifer - in order to usher in a new occult… [♥ 7.2]
Underbelly Files: Tell Them Lucifer Was Here (2011) [ http://www.imdb.com/title/tt1684227/ ] - The tragic story of the 1998 murders of Victoria Police officers Rod Miller… [♥ 6.8]
 
ahaaa, got it :D
 
9:53 AM
can someone explain to me why the first doesn't work and the second does? 3v4l.org/Eenq2
 
Assuming it runs off of alphabetical ordering, where A comes before AA, but B comes after.
 
some ... I was watching some Deathstars movie videos ... and the pre-roll add was "welcome to the kid's magic world"
seriously, wtf
 
It loops through all the way for ZZ because there's no letter after Z, so it loops back through to AA, which comes before ZZ
 
@Sean wait what? :D the first one stops because the loop should and at 'AZ', the second one goes all the ay through, that's what I don't understand
 
If it was BB, you would get A and B, but then C is ordered after BB
Yeah
 
10:00 AM
I'm surprised either works - I would've thought the for construct would implicitly cast to int
 
ow
@Sean I think I understand
 
Think of it as two different things: The incrementing system and the evaluation system.

Incrementing letters goes A,B,C..Z,AA,AB.. etc.
Evaluation of those letters is based on alphabetical ordering, where 'J' comes before 'John', but 'H' comes after.
Also yes I'm very surprised this is a thing
 
mm.. suprising to say the least :) but thx @sean
 
The op that will actually happen will be memcmp("A", "AZ", 1) (I think)
so they will be equal
 
10:04 AM
Also note that it doesn't actually echo 'ZZ' because you used <, if it was <= it would probably loop all the way until ZYZ.
Also listen to Dave, he knows things where I don't :P
 
I'm not 100% certain that is the path that's hit
lxr.room11.org/xref/php-src%40master/Zend/… is definitely the string increment routine
 
well it explains better to me why it does that
 
!!issue Feature Request: !!tv, !!film, etc. aliases for filtering in !!imdb
 
I guess asking why they did it like that would be pushing it? ^^
 
10:11 AM
Two things to do today then. Fix imdb and sort out rfc
 
What's up with rfc?
Oh I see, that PR
@Sean I have totally screwed you with the changes for that PR, I don't mind fixing it up if you want, or not you'd rather do it yourself
 
@DaveRandom thx for the extra info btw
 
No worries, although I'm not really authoritative :-P
 
I think I we should buy @krakjoe a t-shirt with "I broke http://php.net, wait" on it
 
10:25 AM
should be on my desk by monday, right ?
 
I know a website called "safaribooksonline". Here the word "safari" has nothing to do with the safari browser, doesn't it?
 
@DaveRandom The more I get to write, the more I get to learn :>
 
@Sean git pull --rebase upstream master and see how incomprehensible the merge file is
 
lol, if I panic I'll give you a ping
 
Also I don't like this, surely there must be a better way there?
 
10:31 AM
Sure, to be honest I'm not really sure why I bundled that commit in
Also with the other helper to check if Jeeves can do something it's not particularly needed. Either way, that's the only response Jeeves gets from the server when he can't pin
But I'm aware that is also ran for unpinning too and I didn't manage to account for that.
 
Why isn't there a space between that if and that pranthesis?!
 
Oh, because I suck.
 
:-P
 
asking the important questions here
 
I'm trying to work out of the habit :P
 
10:33 AM
pre-commit hook? :)
 
Safari Books Online LLC is a digital library founded in July 2000 and headquartered in Sebastopol, California, with offices in Boston and Scottsdale. Safari characterizes itself as a "platform for technology and business learning". Safari Books Online originated in 2001 as a joint venture between O'Reilly Media and the Pearson Technology Group. In 2014 O'Reilly Media acquired Pearson's stake, making Safari Books Online a wholly owned subsidiary of O'Reilly Media. Safari's main product is a subscription-based, digital library that includes books, videos, short-form content ("Short Cuts"), and evolving...
 
@Sean check the HTTP response code?
 
Possibly. It'd be real nice if there was a way for PHPCS to only check modified code
 
That case probably does need to be handled but hopefully there will be a better way than a string comparison
 
Well, the hook gets a list of modified files, loop and cs each file individually?
 
10:34 AM
I like safaribooksonline very much.
 
@DaveRandom Good call. I'll add it to the feedback
To check at least
 
Although in the 99% case we could short circuit that by checking isBotUserRoomOwner() before creating the action @Sean
 
why true == true returns 1, but true != trure returns nothing? Why it doesn't return 0 ?
 
@MartinAJ Use var_dump() instead of echo
!!> var_dump(true == true, true == false);
 
10:37 AM
oh! I see
 
!!> var_dump((string)true, (string)false);
 
@MartinAJ ^ that's what you were seeing
 
posted on February 17, 2017

New Cyanide and Happiness Comic

 
And the reason that (string)false === '' I'm still not clear on...
 
10:39 AM
Feb 10 at 12:12, by Joe Watkins
1 is the minimal expression of truthyness, nothing is the minimal expression of falseyness ...
 
#!/usr/bin/env php
<?php
var_dump(shell_exec('git diff --cached --name-status'));
exit(1);
put that in .git/hooks/pre-commit and go from there
(make sure you give it +x mode)
you'll have to parse the output, but it's in the format of "<letter code> <file path>"
where the letter indicates added, deleted, etc.
 
@Leigh Damn, that's good, thanks. Lunchtime project get!
 
The exit(1) prevents it from doing the actual commit, so you can spam it without having to rollback each time
just remove it when you're done
 
@Eugene there appears to be a library for it: github.com/rowanhill/wiremock-php If that's not what you're after, asking phil sturgeon on twitter might be a good idea, as he knows about that sort of shit.
 
Okay
 
10:45 AM
@Sean oh dude, the looks even better. git diff --cached --name-only --diff-filter=AM - just a list of files added or modified
 
hi any one can help me google calendar api
0
Q: Unable to block room using Google calendar Api

Research Developmentpublic class CalendarQuickstart { private static final String APPLICATION_NAME = "API Quickstart"; private static final java.io.File DATA_STORE_DIR = new java.io.File(System.getProperty("user.home"), ".credentials/calendar-java-quickstart"); private static FileDataSto...

 
man are you lost
 
^
 
@Leigh PHP Mallorca @Jimbo
 
11:09 AM
!!dad
 
What do you call cheese that isn't yours? Nacho Cheese
 
So, @Jimbo, reminding you when I'm sober, room 11 party at your apartment in the summer
 
I am still undecided whether I will go to Mallorca
and the flight fares aint gonna get cheaper
but the whole trip will already cost €500+
and the flights are at stupid times
 
11:28 AM
Is float passed to sleep function converted to int?
 
@Leigh Oooo, thanks :D
Adding an index on a 100k row join table is gonna take seconds to do right?
Nothing big stored in it, not a lot of records
 
100k isn't that much, and if you have a semi-recent mysql version it can add indexes without locking
 
11:35 AM
Ahhh. I thought it might be there in comments, but did not jump at me. Thank you.
 
Anyone here from Europe?
 
@bwoebi undo the whole lot of it.. if they want to put in shit for ancient versions let that stuff be a small note in a version box
default should only worry about what's current
also someone should let that dude know that [] works in 7 too
 
How does rtrim alters the string?
I was working on some sort of web scrapper yesterday, which required pinging to a url.
The header when sent as "abc:abv" returned wrong results, but rtrim("abc:abv") in headers returned correct results
Can anyone explain what kind of sorcery is this?
 
!!docs rtrim
 
[ rtrim() ] Strip whitespace (or other characters) from the end of a string
 
11:43 AM
I know that it removes the null byte, but in PHP
"abc"=="abc" is true always.. right?
 
not when one has a null byte at the end and the other doesn't
 
if("abc"==rtrim("abc")) echo 'damn'; else echo 'goddamn';
if("abc"===rtrim("abc")) echo 'damn'; else echo 'goddamn';
@PaulCrovella, pls explain
 
explain what?
 
How can I match the strings(original and rtrimmed) in a way that my code shows a difference? Like from the above code, how would I print out goddamn
@PaulCrovella any 1 liner code to prove this.. thats all i am asking
 
!!eval var_dump( "abc" == "abc". chr(0) );
 
!!eval echo var_dump( "abc". chr(0) ), var_dump( "abc" );
 
[ 5.6.0 - 5.6.30, hhvm-3.15.4 - 3.17.1, 7.0.0 - 7.1.2 ] string(4) "abc" string(3) "abc"
 
see the difference?
!!eval var_dump( "abc" == rtrim("abc" . chr(0)) );
 
@th3pirat3 ^
 
11:56 AM
Your use of chr() irks me
"abc\0"
 
I assumed it was to avoiding having to explain \0
 
it's a waving cyclops
 
yo. guys I got this.. I am checking curlopt header, may be it adds some null characters to the array items
 
tbh, it's more likely you have rouge newlines than null bytes
 
@mike m thank you guys you were great help to me
 
12:00 PM
I fixed it by adding rtrim() for 'Accept:vdn.v1'
ignore the answer it has. that's wrong
 
hey
 
@th3pirat3 var_dump(bin2hex($header)); - don't rtrim it, paste the hex value of the header you are trimming
 
@Leigh you the MVP. thanks a lot
 
Why, what was on the end?
 
Also rtrim() generally does not work like that
@bwoebi @kelunik @Trowski @rdlowrey please can you let me know which amphp projects/branches you would/would not like on lxr?
I'd personally like everything that is maintained in v1/v2 versions
/cc anyone else with an opinion
except @PeeHaa
 
12:08 PM
@DaveRandom I think you should work on dnslib
 
@DaveRandom I think you should work on dnslib
 
But it is fucking dull and I am taking a break
 
@DaveRandom why do you DI the endcoder and decoder and MessageFactory (and why does LibDNS have a factory class at all for messages?)
(sorry, but a ctor receiving 6 args triggered me)
 
LibDNS needs a major rewrite but I am ignoring that fact for the purposes of this exercise or it will never be finished
I DI those instances internally because there is no reason for them not to be shared
I agree that the LibDNS factory madness is fucking madness though
That code is pretty old now, my views on pragmatism vs. purity have changed considerably since then
The object model is also not great
 
yeah, given that encoder/decoder is stateless from the exterior, could be just functions
 
12:22 PM
I will do a PHP7-only rewrite after I have done what I am doing amphp/dns, and I will update amphp/dns again after that (although that will be a much smaller job)
@bwoebi true
 
great :-)
@DaveRandom fine, I was fearing you'd still like your own code :-D
 
No I'm not particularly precious about anything I have ever written
Even the best code ever written is still at least partially terrible
 
@Leigh Hell yeah
Has to be before July though
Flying the colours with the Stackoverflow t-shirt today. I still think we need to ask Phil where he gets those t-shirts he has from and make some R11 ones
 
btw @bwoebi I've been tearing my hair out over DNS-over-TCP and it turns out that in the real world there are two things of which I was not previously aware: 1) at least 50% of public DNS servers do not like requests with multiple question records of different types (over any transport) 2) Google's TCP idle timeout is <1sec
Was seriously pissing me off and I though I had some disconnect logic wrong until I noticed they are sending the first FIN
However the persistent TCP logic does work correctly, once I found a server with a more reasonable idle timeout (my own internal DC)
 
@DaveRandom … wow why… to prevent connections from consuming much resources?
@DaveRandom 1) doesn't the RFC require you to support it actually? :x
 
12:33 PM
hahahahahaaaaa
 
@bwoebi No idea, I can find pretty much no technical documentation about the 8.8.8.8 service
I never bothered to look before now
@bwoebi Well yes, you would have thought
It doesn't really matter in the long run
 
@DaveRandom clients not following RFCs to the word are the worst
 
Hi, welcome to the internet, you must be new here
 
I know that it exists, but it is pretty much annoying.
@PaulCrovella STFU :-P
 
12:36 PM
guys I have one question for discussion
 
user7172542
Does anyone know much about the ?crypt=@ SagePay adds to the URL of a success/fail page?
 
i don't know
I was wondering in form submission if we add another website address in action field, it still works. The php file still loads. Can this be misused?
@Dan can you share some light on this question?
 
user7172542
@VarunJain what do you mean by misused?
 
I do not get it, if sleep and usleep are not so dynamic as to allow to specify time unit in which time should run, then they could at least accept float.
Kinda feels as not thought through approach.
 
like suppose if the form field requires a mobile number to register, we can submit our own form without giving the mobile number to the 'submit.php' file and get registered
@Dan isn't it possible?
 
12:44 PM
@Eugene You need finer resolution than microseconds?
 
Plus, one can't even use sleep and usleep depending on input, because they behave differently
 
like the restriction are due to javascript and html code, which we can overwrite by our own html file and send it to the target website php file.
anyone tried this?
 
@pmmaga milliseconds would be superb, but issue is with that sleep is the one I need, since it allows to check whether it was interrupted or not, but I can not pass smaller value, that 1 second to it.
@tereško where is all that hate towards angular coming from?
 
from working with angular. where else would it come from?
 
@bwoebi if we get a partial success (say we are trying UDP, we get a result for A but not AAAA over UDP) and the request is allowed to try the other transport, should we try the other transport of just return the records we got? I would say that chances are we are not going to get a result from the other transport either, it's more likely that the records just don't exist
 
12:48 PM
 
@DaveRandom Just master everywhere and additionally 1.x for amphp/amp.
 
@Eugene Is usleep() underlying system call not interruptible?
 
@kelunik The thing I would say to that is that most apps currently are using 1.x
so most bug reports are going to be against 1.x code
 
@pmmaga will try that one. On first look seems to be okay. If it allows 0 seconds and then some amount of nano seconds, then should be all good.
 
> If the call was interrupted by a signal, sleep() returns...
Okay so according to the docs sleep is
 
12:50 PM
yep
And according to docs usleep isn't, because it doesn't state otherwise
 
But it doesn't say that usleep() explicitly isn't interruptible
Where does it say it isn't? Doesn't state !== not. (Basically I'd prefer it was, so confirmation bias helping my optimism here)
 
@Jimbo iirc @JoeWatkins knows about this
 
@DaveRandom Right, which is master everywhere except for amphp/amp.
 
@Jimbo :) I like well documented functionality as well
plus sleep() with parameters like timeUnit and delay would be even better
 
!!man usleep
 
12:54 PM
[ usleep -- suspend process execution for an interval measured in microsec- onds ] #include < unistd.h > int usleep ( useconds _ t microseconds );
 
It seems to me, that such function would eliminate any need for any other sleep functions.
 
> The usleep() function will fail if:

[EINTR] A signal was delivered to the process and its action was to invoke a signal-catching function.
 
@DaveRandom Later on, fancy helping me submit a PR for this? :-) <3
 
It does seem to be interruptable according to that
A PR for what, sorry?
 
Docs
 
12:57 PM
Well need to test it first, that's the BSD man page, may not necessarily be an accurate reflection of PHP's behavior though
 
what we really need is a function that lets us enter our own machine code - that'd eliminate the need for any other functions
 
I'll set up a vm w/ pcntl extension to prove it (Y)
 
Easily tested though, just create a script that does usleep(30000000) with signal handlers and send it a signal with kill...
 
Exacto
@Leigh Where are you you hairy bastard
Oh wait he's not in today :(
 
@Jimbo at work
 
12:59 PM
Now this approach is great. Not applicable I assume in PHP, but just saying.
Every TimeUnit has own sleep function and runs it for that timeUnit measurement.
 
@Jimbo while you are at it, write a phpt test
 
@Jimbo and new and better PHP function as well :D
 
@Eugene PHP's implementation more closely mirrors the underlying C API I think, that abstract will likely use usleep(3) underneath
!!lxr usleep
 
[ /win32/time.c#102 ] PHPAPI int usleep(unsigned int useconds)
 
win32?
 
1:02 PM
Well, shit
!!lxr-7.1 usleep
 
[ /win32/time.c#101 ] PHPAPI int usleep(unsigned int useconds)
 
Oh good, lxr is broken
Not sure how I managed to do that
 
Yeah. Windows owns everyone and everything.
 
Okay.
 
1:05 PM
oh god damn it OpenGrok
It's just the links, will have to rewrite it
 
how close are you to starting up an opengrok alternative?
 
In fairness, the biggest problem it has is documentation
There's probably a way to avoid that problem, but in order to figure that out I'd have to read the codebase
which is why I may put it on lxr :-P
I finally figured out how to get it to ignore dotfiles and tests though
Although w.r.t the tests, it still generates history for them during indexing, which is the part that takes ages :-(
 
But I would probably do something like gist.github.com/jeserkin/b75851947ac097d8613e5bc536f7700b except I am not sure how accurate would timing be with all those additional calculations
 
Well timing is not accurate anyway
all of those functions only guarantee that it will sleep for "at least..."
 
and frankly even that guarantee is fuzzy
 
1:12 PM
If the kernel is busy, it will wake the process up when it has CPU cycles available to schedule
In theory that could be days later
 
@DaveRandom well, it depends. if we do a normal resolve() call, just the A is fine … if we do a query for multiple types … I think we shall retry.
 
@bwoebi Right, I'm talking about resolve() here, I haven't addressed query() yet
 
@DaveRandom A no-record response and no response at all are different things, no?
 
OK I have patched the nginx config so that /source-based links for for now on lxr
@kelunik True, I'm talking about timeouts
A no-record response would be considered a successful lookup
 
@DaveRandom I'm not sure. On the other hand I think resolve should just always return one record, on the other hand it makes it harder to retry with the other IPs.
But the retry should just result in another resolve call probably that returns a random entry from the cache then.
 
1:22 PM
> usleep((unsigned int)num);
That's... really easy..
 
!!lxr usleep
 
[ /win32/time.c#102 ] PHPAPI int usleep(unsigned int useconds)
 
I think that #if should be outside the PHP_FUNCTION macro? lxr.room11.org/xref/php-src%40master/ext/standard/…
 
@kelunik i guess the idea of having it inside is disabling the function without fataling b/c the function is unknown
 
@pmmaga Guessed so, but that's stupid, it just doesn't sleep then silently. It's also not the way it's done for all other functions.
 
1:31 PM
@kelunik true! maybe it could at least warn or something
 
!!should Chris pull his finger out or just become a hobo?
!!uptime
 
╔═══════════════════════════════════════════════════════════╗
║ [14 hours, 47 minutes and 21 seconds] without an accident ║
║                since [2017-02-16 22:44:30]                ║
╚═══════════════════════════════════════════════════════════╝
 
Without an accident = bs
 
@Chris should just become a hobo.
 
is it intentional that commands are case-sensitive?
 
1:33 PM
I didn't know they were, it was a guess :-)
 
I finally have a correct computer \o/
 
@DaveRandom well, then we agree :-)
 
@kelunik The problem with this is that a) "random" entry means that you are likely to get the same one more than once b) application has no way of knowing when it has tried all available options
 
@DaveRandom Yes, it should just be handled in amphp/socket
 
@PaulCrovella I don't think it has really been thought about. I will make it lowercase the command name in the parser, I don't think it makes sense to have them case sensitive /cc @PeeHaa @Ekin
Internally everything is lower case
 
1:53 PM
Agreed
 

« first day (2316 days earlier)      last day (2626 days later) »