« first day (1368 days earlier)      last day (3594 days later) » 

10:00 AM
@JoeWatkins well. I was being serious, 'stupid question'ing me isn't really helpful but I'll take it any way.
2
@bwoebi meh. I never used watch or breakpoints to debug php. var_dumping and commiting code-suicide is what I do.
tbh and fair: I never even knew there were debuggers for php. that's how much I needed them over the time x)
 
serious projects need serious tools ...
 
@JoeWatkins Are you implying that PHP projects are never serious?
:P
 
it wasn't meant to be helpful, I was telling you it was a stupid question, because it was ... how useful is a debugger of anything is a stupid question, undeniably so ... debugging is a part of programming, you can either use proper tools, or keep hacking away ...
 
Tbh, I've only ever used var_dump() and xdebug :-)
 
xdebug is a debugger ...
 
10:05 AM
Yep, nothing hardcore though. I find that in my own code, I never use xdebug. Only in legacy stuff
 
@JoeWatkins well, then my "i never used a debugger" is void :\
 
PHP code just ... doesn't need particularly much debugging
Unlike C code, where you do little else ^^
 
that seems like a silly assertion @NikiC
 
@JoeWatkins but what I meant is: I never thought that anything else was needed to properly debug it but what's already coming with php (that i think it's xdebugger) and var_dumps. BUT I'm not bashing on people who do use fancy debug tools - i was just flabbergasted because of "fancy debuggers" actually existing.
 
@NikiC Unless you inherit code / a project
 
10:09 AM
I work on a team with 50+ other programmers, on 3 million lines of code ... do I want them to sprinkle the code with var_dump exit() all over the place before every commit, do I have time to wait for them to debug like that, or would it make moving forward impossible ... hint: it would be impossible, as it goes they are using xdebug and probably will continue to do so, a debugger is a debugger ... var_dump is fine when you are working on some isolated code somewhere ...
when you're working on something serious it's not enough, nothing like enough ...
 
I guess I haven't worked on large codebases then :-)
 
@JoeWatkins wow. point taken. I think i shrank a little bit.
 
@PeeHaa Hopefully a 3 million line project based on a mixture of wordpress and cakephp ;)
 
that would actually be better ... there would be some documentation :D
 
:D
 
10:11 AM
@NikiC :P
 
Also... phpdbg...
 
@JoeWatkins s/serious projects/large projects
 
@JoeWatkins Haha.
 
Imma start using a fancy debugger then, just so I feel the power. ;x
 
@Leri yeah I just say serious because I can imagine working on something simpler but large, you might get away with it, when I say simpler I mean better actually ... this isn't a system where you can take a class and debug it with your eyes as we all can when we review each others code ... I obviously haven't read all of it, and may never have a need too ...
 
10:14 AM
@JoeWatkins where do you work right now? / what on?
 
a company named first beat media, on a set of dating sites ...
 
I'll admit I'm ignorant to testing and debugging, as I am lucky enough to write my own code on small-ish projects, so I've never needed to use a debugger.
 
and doing anything in particular there?
 
Resisting the tentation of creeping up user profiles? Sounds like a serious job descriptiong to me.
 
I have the best job in the world ... my job is "improve stuff, be productive, write in thai if you like" ... I pretty much have free reign ...
 
10:16 AM
Kicking ass and taking names.
 
@JoeWatkins cool :)
 
wow. That's actually pretty neat :o
 
it's pretty cool ... and they actually listen to me, since I came along they got github acc, allow everyone to write and use open source projects, started to use composer, reworked large sections to remove horrible patterns ... you'll have to pry me from this job with a crow bar ...
 
+ free membership to dating sites. His wife doesn't approve -_-
 
oh and I can publish anything I write that is useful for anyone else ...
 
10:20 AM
@JoeWatkins How goes the house hunt too? Wifey found any others she likes?
 
we have a shortlist @Fabien
 
All around the UK?
 
in devon
 
Congrats on breaking £11k :D
 
http://www.rightmove.co.uk/property-to-rent/property-46927712.html - 5 bed, devon - 995
http://www.rightmove.co.uk/property-to-rent/property-30427815.html - 5 bed, Devon - 995
http://www.rightmove.co.uk/property-to-rent/property-45101083.html - 5 bed, devon (thatched things) - 950
http://www.rightmove.co.uk/property-to-rent/property-47028206.html - 7 bed, devon - 895
http://www.rightmove.co.uk/property-to-rent/property-31138995.html - 5 bed, very large devon - 875
http://www.rightmove.co.uk/property-to-rent/property-31105395.html - 8 bed, rectory, limited tenancy - 725
 
10:20 AM
Devon is a nice place.
 
then there's that one on the iow, one in kent, and a huge property in leiscter that we want to check out (because totally suitable for subletting, it has 10 bedrooms, prepared for use as nursing home and is dirt cheap)
 
House 3 is nice.
 
Is IoW top?
That 7 bed come with the pool table? :p
 
omg, the 5th one looks like a small farm!
 
it's actually not ... we really really don't want to wait until September to get this sorted, it will screw over schools and everything ... we need an address asap to make applications to school hopefully beginning of school holiday so it's sorted shortly after new term ...
 
10:24 AM
@JoeWatkins 5th is looking good
4th too
 
IoW is best though.
 
Isle of White property
 
aw ... IoW one is gone ...
 
Bastard
 
10:28 AM
@Jimbo strace all the things - although that profile would be 'ok' I find it a lot easier to have a tool just show the actual underlying system calls that take the time....because every other bit of information that application level profilers give is basically irrelevant, until you've gotten rid of the system level problems.
@JoeWatkins I hate giving people lifestyle advice....but living on the IoW would really isolate you.
 
@JoeWatkins 4th one is epic but seems to be literally in the middle of nowhere
 
@Jimbo my problem might be caused by the version of auryn I'm using... see error I get when I run composer update without changing composer.json pastebin.com/H39rZ5RD
 
@DaveRandom yeah, pretty much all of devon has that problem ... but the prices are making me ignore that ...
 
@iroegbu What is the version requirement for Auryn in your project's composer.json?
 
10:32 AM
Weird, why don't I get that issue?
 
I changed to ~0.2.0 and things break
 
@iroegbu That's not surprising. v0.13.0 is the latest tagged version.
and 13 > 2.
 
Jimbo isn't having any issues getting "rdlowrey/auryn": "dev-v1.0.0-dev",
 
Jimbo has previously forgotten to check in composer.json/lock files....
 
isn't "~" supposed to make composer get the latest version?
 
10:37 AM
Not like that. ~0.2.0 is equivalent to (>= 0.2.0 && < 0.3.0)
 
oh! I've change to "0.13.0"
 
@iroegbu I think it's best to do >= your minimum known working version. If there's ever a problem with running a newer version, it's really easy to through in a "&& < 0.15.0" and in the meantime you get bug fixes, and access to new features automatically, whenever you 'composer update'.
There are obviously arguments against doing it like that.
 
@Fabien Naruto's out
 
Whuuut
No spoilers
 
@Danack I checked in the composer.json with that version as a requirement though
 
10:43 AM
ok, I'll go with that... maybe, ~0.13.0, is best for me now. I just want to get current features to work, I'll look to change later.
 
Wonder what the justification behind this width site was gracion.com/server/whatldap.html
It's almost mobile responsive.
 
@Jimbo it's working fine now. I used ~0.13.0 for auryn.
 
Still don't understand why it wasn't working... we're basically pulling in the same version
 
$field_key = str_replace("]", "", str_replace("[", "", preg_replace("/[a-zA-Z][a-zA-Z0-9_]*/", "", $_POST['field_key'])));

lol
 
Maybe @rdlowrey is the best person to ask, he told me sometime back to use a different version.
 
10:49 AM
I don't believe he composers - so probably not.
 
Anyone interested in a challenge? Take this string "@*~(SDXCXC[0]{1}3221ZXAS[0]AZEWE[000]0" and turn it a string with a single 0 with 1 line of php
 
echo "@*~(SDXCXC[0]{1}3221ZXAS[]AZEWE[]";
 
@JoeWatkins Just don't forget to scope out the internet situation, since you need that in order to work...
 
@JoeWatkins cant seem to find the gofundme page now, how much did you end up with?
nm
 
10:52 AM
@Hybridwebdev Like... echo (int)"@*~(SDXCXC[0]{1}3221ZXAS[]AZEWE[]";?
 
@Fabien Because LDAP is for people with 640 x 480 displays :-P
 
bah that's cheating
 
And presumably they also hate themselves so much that they made it 4px wider just annoy people
@Hybridwebdev substr($str, -1) then
 
okay, challenge changed. Must use regex :P
 
@DaveRandom yeah will be checking that out ... they aren't black spots anyway I don't think ... doubt it will be fibre either, but any adsl will do ... plus they must have mobile networks for backup ...
 
10:55 AM
@JoeWatkins Be careful with that "any adsl will do" stipulation. I have seen line speeds of <1Mbps in the sticks
 
anything above 3 I can cope with ... was only three from talktalk ...
 
@Hybridwebdev These aren't really challenging...
 
@DaveRandom lol
 
I guess it's a testament to my skill level, because I have to disagree haha
 
@Jimbo you are missing Column(name="is_active", type="boolean") in your readme, that's a column in the users table.
 
11:01 AM
@iroegbu I think you should be able to run vendor/bin/doctrine or something similar, and one of the commands in there creates the DB table from your entities ;)
 
@Hybridwebdev preg_replace('/.*/', '0', $str) - technically satisfies the requirement
 
no, because that would replace all charachters with a 0, ending up with many 0's
 
No it wouldn't.
OK so apparently PCRE is insane. Anyone care to explain 3v4l.org/LvmGB ?
 
Do people prefer ClientFactory or ClientBuilder. And why?
 
@Jimbo that is exactly what I did... I had to refer to the readme when it told me default user was inactive. =P you need to update INSERT statement too
 
11:10 AM
yo!
 
Dammit where is @HamZa?
 
@DaveRandom Why?
 
What can I do when HTML purifier is ignoring allowed?
 
@iroegbu If you have a few minutes, think you could make a PR for the readme update as you know exactly what the changes required are?
 
@DaveRandom Im guessing they have it at least somewhat secured. Like some sort of pre-filter
phpinfo works
 
11:14 AM
Please help me
 
Lol
 
@VeeeneX So right at the top your code is looking for a class named "HTMLPurifier_Config". You need to require_once "/path/to/file"; to include the file that has this class within it
 
@SecondRikudo Nostalgia
 
@Jimbo have a code This is just a paste and problem is in u tag
 
11:17 AM
Wonder what happens if you drink Win95
 
@Jack There'll be bugs in it and you'll die because it's so out of date.
And the bugs are full of acid.
Acid bugs
 
@SecondRikudo That's basically a can of whup-ass
@salathe Why would replacing .* with a static string produce two of that static string. I mean I get that * is potentially zero width but it still doesn't seem logical
 
PHP
anyone here with experience of creating freight forwarder application in PHP using cargo XML?
I want to know how can we create this XML in php, so that application can communicate to carrier/cargo.
 
0
Q: Disable the default TAB key behavior in chat

Second RikudoCurrently, TAB in chat has one purpose, name completion. You type @seTAB and it would complete to @SecondRikudo, awesome. But there's a problem, TAB's default behavior is to change focus to another input, incidentally, the next input is the submit button for chat (the send button). This is a pr...

 
@Jimbo done
 
11:32 AM
@iroegbu Danke
 
@SecondRikudo Not sure how that is a bug.
 
@Leri Noted.
 
Anyone know the name of the scheme where, next to functional requirements, you put an "M", "S", "W" etc? W = wont (I think). I think M might be "maybe"
 
@Jimbo yes, I know one, MSWW
 
@AlmaDo Know what it's called?
 
11:38 AM
yeah
 
What is it...?
@AlmaDo Oh you're such a troll.
 
MicroSoft Wont Work
 
Anyone else
:D
 
:( You hurt me :\
 
@Jimbo Logically, maybe, sure, won't
 
11:41 AM
I gave such a good scheme
 
Hi everyone, is there any whatsapp api for PHP ?
 
@Jimbo you see? no one else :p You should be grateful !!
 
vs7
How we can convert an HTML to PDF
 
@RakeshShetty Is there even a whatsapp api?
 
@vs7 generatePdfFromHtmlPlease($html, $outputPath). :)
 
@Leri newbie.. who needs such many params? :p
 
vs7
@Leri so there is no direct library ?
 
@vs7 princexml.com and learn how to google.
 
vs7
@Danack I already search a lot and then i have used fpdf library to generate PDF
 
@Danack thats what I am asking
 
vs7
11:54 AM
but its not upto the mark
 
and if you want LGPL: github.com/dompdf/dompdf
 
@vs7 So make your question be more relevant. Say " I have been using X to do Y, but it isn't good enough because of Z. Is there a better library that doesn't have that problem".
@RakeshShetty No - I'm pointing out that whatsapp doesn't appear to have any api, let alone a PHP one.
 
@Danack whatsapp uses content providers for data access, so basically you can hook up for their data in Android (unless it's not denied).
 
vs7
@Danack ya , Will remember next time
 
@Danack so is there anyway to integrate whatsapp on website so that user will get the message from the website ?
 
11:59 AM
@Leri So....there's not API? (not that I care - I was just pointing out there is conspicuously no api listed on whatsapp.com)
s/not/no
 
regex: '#[^/]/#'
I want to match a single forward slash, but not two
What am I failing on
Do I really have to do negative lookarounds?
 
@Jimbo oh wait. no.
 
Sample IO, please. :)
 
http://dontmatchthis.local/butmatchthisplease // I want to match "/butmatchthisplease"
Oh wait, I found parse_url(). It's all good :-) But out of interest, how would you go about that?
 
12:07 PM
@Magikaas I copy-pasted that. It was the password, no less (:
 
@AlmaDo To what?
 
No idea
I have a key, but not a door. So I should try to guess
 
Checking to see if I even use that anywhere important :P
 
@rdlowrey a small question about HTTP: can header's value contain ':' in it (since ': ' is a separator between headers name and value)
 
bah.. more like revision
 
12:10 PM
or have I got it completely wrong
 
@DaveRandom Wow, all that just for single not double characters :o
 
@Jimbo parse_url is a b**h believe me. :/
:)
 
parse_url() is a lie!
 
^ php is a lie!
 
12:13 PM
@AlmaDo If you find something that uses that password, could you tell me after you compromise it? I can't find any xD
 
@Leri parse_url is a blah?
 
1) Fracture\Http\HeaderFactoryTest::testInstantiatedHeader with data set #1 ('\\Fracture\\Http\\Headers\\ContentDisposition', 'Content-Disposition: form-data; name="text"')
PHPUnit_Framework_Exception: Argument #1 (No Value) of PHPUnit_Framework_Assert::assertInstanceOf() must be a class or interface name\
 
@Magikaas I'm too lazy for that
 
Hahahha
 
fucking phpunit
 
12:14 PM
You should be rrrreeally interesting for me so I would do that
 
@SecondRikudo exactly. :-)
 
@AlmaDo Well, thanks ._.
 
Besides, I'm trying to be sort of "good guy" , heh, so I won't steal private data :p
 
@tereško class names don't usually start with \\ - that's only for typehinting stuff outside of strings.
 
Very kind of you ^^ I wonder what kind of personal info you could find off insert random gaming forum I once registered to xD
 
12:17 PM
^ no idea
 
@Jimbo That wasn't the problem though, the problem was getting the path component of a URL...
 
user895378
@iroegbu yeah, @Danack is right. If I give good composer help it's probably just blind luck.
 
Mornin' @rdlowrey . How close are you to checking in a refactored Artax?
 
user895378
@tereško Yes a header value can contain more colons. The fields are delimited by \r\n
 
user895378
@Danack I'm only ~40% through, I'd say. Hoping to finish most of the remainder today. Starting now ... we'll see how it goes.
 
12:27 PM
@rdlowrey's online. Pile on!
 
user895378
:)
 
@rdlowrey 40% time spent or 40% progress? :-)
 
@rdlowrey Cool. As I said before, the service/oauth stuff I'm doing isn't touching any events so it won't be affected by any refactoring, however I think it will need access to query params/the form body to be able to sign stuff (for Oauth1), so will wait until you've committed.
 
user895378
@bwoebi 40% progress, but I'm not sure they're really different.
 
user895378
12:36 PM
The API is actually going to be much simpler, so it should be really easy to work with
 
As a heads up this service description generates this service
 
@rdlowrey maybe, because you needed time to refamiliarize yourself with its internals
 
which is usable like:
    $api = new GithubAPI(GITHUB_USER_AGENT);
    $command = $api->listRepoTags('token '.$accessResponse->accessToken, $username, $repo);
    $repoTags = $command->execute();
    foreach ($repoTags->getIterator() as $repoTag) {
        echo "Tag name: ".$repoTag->name." sha ".$repoTag->commitSHA."<br/>";
    }
 
user895378
Nifty!
 
@rdlowrey oh btw, when doing a multi request is there/will there be a way of specifying different callables for each of the requests?
 
user895378
12:39 PM
There can be ... I've gone back and forth on whether or not that's really necessary.
 
ThW
@Danack $repoTags->getIterator()?
 
@DaveRandom ping?
 
@ThW For the type-hinting.....PHPStorm doesn't understand IteratorAggregate
but does understand the actual function.
Support for it is working it's way through the PHPdocblock PSR people.
 
What if you use /* \@var */ to tell PHPStorm a variable's type?
without that backslash, my bad
 
@Magikaas I'm too lazy/don't like littering my code with IDE specific stuff.
 
12:43 PM
I see, I'd add it while developing, but there's the risk you forget to remove it then, I guess
 
You just need a bigger monitor =p
 
2 hours ago, by DaveRandom
OK so apparently PCRE is insane. Anyone care to explain http://3v4l.org/LvmGB ?
Why are there two replacements?
 
@DaveRandom .* will also match empty string. That's why you get 2 "0"
 
Puzzle! =D
 
So use .+ instead
 
12:44 PM
@HamZa Yeh but where does it match the empty string? Does it match the whole thing and then run the match again even though it's at the end or what?
Whatever is happening, it's counter-intuitive imo
 
user895378
@DaveRandom Maybe @NikiC can help. He's the local regex wizard as far as I'm concerned.
 
I concur
 
@DaveRandom Regex? Being counter-intuitive? No, I don't believe it.
 
@rdlowrey Morning. Basic connections work like a charm. However, I want to test on heavy/busy processes, like processing large data for one client. My current plan is to put busy waiting on client request and then try to connect with other tcp clients. Does that sound sane test for you?
 
On a tangentially related note @Jimbo 3v4l.org/c19Ah#v540
 
12:45 PM
@DaveRandom rubular.com will help you like a mofo
 
@DaveRandom Yes, exactly this.
 
@MoshMage regex101 is far better :)
 
@DaveRandom Man, what the shit is that? That's mental!
 
user895378
@Leri Not sure I understand what you're saying. Can you explain a bit more why you want to busy-wait at all?
 
user895378
Are you trying to simulate load?
 
12:46 PM
@rdlowrey Exactly
 
@Jimbo It's a thing that matches URIs and fetches the components. It also matches a bunch of invalid things though, much like parse_url()
(just use parse_url())
 
@HamZa didn't knew that one, looks cool :)
 
@DaveRandom What are the <tag> things? Didn't know you could put tags in regexes
 
@Jimbo They are named capture groups
 
named memory captures
@DaveRandom Hmm, that replacement thing sure makes no sense, because if you do a match it only returns one match.
But once you do replacement ... tada, two matches?!
 
user895378
12:48 PM
@Leri I assume the processing work you need to do for the one client needs to block?
 
To the JavaScript mobile!
 
@Jack Actually now you say that, now it makes sense
 
JavaScript does only one replacement .. verdict: pcre stinks
haha
 
It's because replace does match -> replace -> match from current pointer
 
oh ya
 
12:49 PM
@rdlowrey "headers" are delimited by newlines , but each header entry is in one line
 
user895378
@Leri Because I have a lib that can offload the work to a thread via pthreads so the main server thread is unaffected by something like that.
 
verdict: JavaScript RegExp stinks after all.
 
@rdlowrey Yes, more likely: 1. non-async IO; 2. Heavy loop. 3. Large response that may require some time before it's fragmented (not sure if this ever will be a case).
 
the question was whether each entry can have a column in the "value" part
 
C:\Users\HamZa\Downloads>pcretest
PCRE version 8.34 2013-12-15

  re> /.*/g
data> test
 0: test
 0:
data> ^C
C:\Users\HamZa\Downloads>pcretest
PCRE version 8.34 2013-12-15

  re> /.+/g
data> test
 0: test
data>
 
user895378
12:50 PM
@tereško well here's specifically what's allowed in a header value:
 
^ I guess at the end then @DaveRandom
 
user895378
       field-value    = *( field-content | LWS )
       field-content  = <the OCTETs making up the field-value
                        and consisting of either *TEXT or combinations
                        of token, separators, and quoted-string>
 
2 mins ago, by DaveRandom
It's because replace does match -> replace -> match from current pointer
 
@DaveRandom you nailed it :)
 
user895378
And you can find the allowed chars for OCTET, TEXT, token, separators and quoted-string here
 
12:51 PM
@DaveRandom Ah, noob mistake ... '12345'.replace(/.*/g, '0') yields '00' ... normality restored.
 
@Jack I would argue the JS behaviour is the correct one, there should be a curpos < subjlength check before continuing to match IMO
 
Nah, I forgot the /g modifier .. I'm stupid
 
oh right lol :-P
Still, I feel that continuing to match when you're at the end of the string is... weird
 
@Jack how could you forget to be greedy, man? Greedyness will get you places, as you just noticed x)
 
I can't see a case where that would be what the programmer intended
 
12:53 PM
@MoshMage That's g for global :)
 
user895378
@Leri Well, the main setting that will influence how many sockets can be queued waiting to connect is the "socket_backlog" context option. You can modify that by passing a context to the stream_socket_server() call like so ...
 
@Jack always called it greedy; I think it's one of those slangs you pickup and forget about the proper name xD
 
The only modifier (afaict) that does anything with "greed" is the /U and that's PCRE :)
 
@Jack And I hate that modifier :)
 
@HamZa Who doesn't like toggling behaviour?
 
user895378
12:55 PM
// allow up to 256 sockets to be queued waiting for acceptance
// before rejecting connection attempts
stream_socket_server($addr, $errno, $errstr, $flags, $ctx = stream_context_create(['socket' => ['backlog' => 256]]));
 
user895378
@Leri ^
 
@Jack it's like you read a regex from left to right and then realise you need to keep switching left-right left-right ><
 
I like throwing /U at somebody's HTML parsing regex to make them wonder why it suddenly works =D
 
user895378
I think the default socket backlog is either 64 or 128. I forget. If you have a busy server it behooves you to customize that value.
 
@Jack pure evil :P
 
user895378
@Leri You can easily dispatch blocking processing jobs to worker threads using my Amp library. All you have to do is install pecl/pthreads and instantiate Amp\Dispatcher($reactor) using the same reactor instance you pass into the example server class.
 
user895378
@DaveRandom oh yeah, that's really low.
 
they say evil is the summation of the numbers on a monte carlo roulette board >D
 

« first day (1368 days earlier)      last day (3594 days later) »