« first day (1416 days earlier)      last day (3548 days later) » 

2:00 PM
running Zend tests now
it passes
I think this is probably because the scanner doesn't initialise the refcount, etc. properly.
Seems to be have been fixed in master, though.
 
posted on September 01, 2014 by nlecointre

/* by JohannaJP */

 
2:18 PM
@Ja͢ck Can you please tell me how you configure those god damn tests
I have ZF1 and I have been struggeling for 2 hours already
using PHPStorm as a test IDE
but 5 people tell me 5 different things in their blogs
I just want to make simple tests with simple data
I don't want to test controllers and actions etc
just simple class calls and their methods
 
I don't think Zend means what you think it does ;)
 
@ziGi are you using phpunit?
 
yes
 
do you know how to use phpunit and write test if you started a new project without any framework?
 
@ziGi what goddamn tests?
 
2:21 PM
@RonniSkansing I know the basics
 
1 min ago, by PeeHaa
I don't think Zend means what you think it does ;)
 
maybe that's my problem, I want to do all at once
 
goddamn tests are just regular tests, but when your code is full of singletons
 
haha well I don't have singletons,
 
@PeeHaa right .. nothing to see then ;-)
 
2:21 PM
usually it's a bad idea to do many statics
 
s/usually/always s/many/
;)
 
well I am in too deep shit to start changing it now
cause I found it that way and Refactoring would mean 3 months of work at least
and there isn't even testing right now
 
@ziGi do you have an example of some (minimal) code that you want to unit test? And maybe what you have tried? Or is it running the test suit.. or.. ?
 
Afternoon folks! :)
 
heya @PaulDragoonis
 
2:25 PM
I have a sample class from the "Service" layer that has some functions, I just want to run them with 5 examples of edge cases data, nothing more
so it's like testing if 2+2 =4
 
@ziGi =] when I say code I mean code
 
Hi @PeeHaa
 
not things like whether a page contains forms etc.
@RonniSkansing well I have to simplify it but yep ok wait
 
@ziGi you would not unit test that in phpunit neither
Sure
 
I want to instantiate a class of this, add some things to the mapping field
and run the validateMapping() method
 
2:28 PM
@ziGi the protected method should be covered by test that run via. the public methods
 
yeah sure
I can make it public no probs
that's just an example
 
Oh yea great =]
 
cause the class is 200 lines, I don't want to paste it all
because it would get confusing
so that's just a really small chunk
 
@RonniSkansing @PeeHaa Received a mail from hosting saying it was a 'bug' within the server causing all scripts that are uploaded to that specific project were being executed.. With other words the fucked up and now they are playing the BUG excuse game :D
 
And do you have an example of any unit tests you could write for it?
like testValidateMappingThrowsExceptionIfblabla
@Naruto wow
that is evil
 
2:31 PM
I do
something like that
Product_Product extends the Abstract Data class
and has the _mapping defined
so basically I want to run the test() in the Test
but I am not sure because ControllerTestCase it to broad for my simple needs
 
@RonniSkansing That is just pathetic, considdering I talked with one of their employees for over 30 min through live chat trying to fix that crap..
 
currently I have written in one of my controllers a sample action that I invoke and it does the same but that's a bit stupid
 
+ keep in mind that the only thing I do is actually just write code and ftp-upload them to the server.. So It must have been server side issues..
 
@salathe what are the addresses for the translation team mailing lists? (specifically the DE team in this case, but I guess they are the same format) - I tried sending a mail to php.doc.de@lists... - which is what news.php.net calls it - but this is not correct, apparently
/cc @Gordon I guess you know what that address is ^
 
@DaveRandom doc-de@ IIRC
 
2:40 PM
Good morning.
 
@salathe tnx
 
@ziGi What is actually being tested there? Why is it a controller test?
 
@ziGi that looks abit like integration tests and not unit tests
I would have expected something like
testValidateMappingThrowsExceptionIfMappingNotSet
testValidateMappingThrowsExceptionIfMappingNotArray
testValidateMappingThrowsExceptionIfMappingLengthNotEqualTo0
if it was a public method =]
 
@Naruto idiots
 
@RonniSkansing yeah, actually I haven't done much testing so I don't know the difference
if you can point me to some articles that you find good, I would be grateful!
 
@JoeWatkins you speaking?
 
@RonniSkansing ok great, thank you!
 
@ziGi no problem
 
2:54 PM
Is it also true that you first make the Test, then run it to show you red then you implement the method and run it again to see the green
and that's something of a good practice?
 
that is one of the core tenets of tdd
 
Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards. Kent Beck, who is credited with having developed or 'rediscovered' the technique, stated in 2003 that TDD encourages simple designs and inspires confidence. Test-driven development is related to the test-first programming concepts...
 
I tried to do that, never really worked out for me.
 
But if you just start out testing that really is going to be a PITA
 
And I also believe that it is better to start with TDD on fresh projects
If you try to start that on an existing, legacy project you're gonna hate it
 
2:56 PM
@PeeHaa I like eating pitas
 
Yes a project most be very well defined imo to do tdd.
 
exactly
 
I've written the tests before the implementation a few times and it works out when the unit is well-thought out before I write the code.
 
@ziGi Me too \o
 
o/
haha :D
Pee T Haa
 
2:56 PM
Usually I am working on "exploration" kind of projects, so it's hard to know exactly what to write the test to do since you are exploring.
 
@BenjaminGruenbaum hadn't thought about it ... I might like to have a go though ...
 
@JoeWatkins pong
 
hi Tyrael :)
@FlorianMargaine was asking about getting svn account so he can get involved with bug fixing and what not ...
 
I do TDD. I'm on a new project. I don't care if tests are written prior or after the feature works but the feature will not pass the "Review" stage without a working set of tests against this.

Also, if there's an 'enhancement' on an existing feature then test cases need added to this feature to cover the new set of functionality.

It's working very well for me thus far with a good team behind me who see the value in unit tests. :-)
 
willing to +1 that, if it's needed ...
 
2:58 PM
That's my two cents on TDD ^^ :)
If you want to introduce TDD into a legacy project, you're smoking crack. IMO :)
 
Well yeah. You could call it what you like, but people often agree on a meaning of terms to prevent confusion ;)
 
> At the rate these images are being deleted we should probably be backing them up to something like iCloud.
 
@PaulDragoonis I think it depends on how far gone the particular project is and how comfortable your team is with writing tests.
 
@PaulDragoonis I do not understand how you can follow TDD, if you write code first and then call it test driven, cause the code was not driven by tests
 
@webarto :D
Why do you have diaeresis on the U? — Daan 4 mins ago
lolol
 
3:01 PM
@cspray I agree with you, however wether you started or ended with tests, when you present your feature to your lead engineer it needs tests. If the developer used TDD it's not too important. :)
/cc @Ronn
 
And by that I obviously mean cv-pls
@PaulDragoonis It is not. Still not TDD though :)
 
@PeeHaa LÖL
 
@PaulDragoonis I understand TDD as development driven by tests, not as code with test coverage.
not that it matters much =]
 
@salathe sköl
 
@RonniSkansing I'm agreeing with you. My point is that TDD isn't the a must have, tests are a must have. How you achieved it isn't too important :)
 
3:03 PM
skål
@PaulDragoonis =]
 
gawd, i hate git sometimes =S
 
@DaveRandom - Du Hast Tests?
 
@PaulDragoonis Yea, I agree with that
 
@DaveRandom :)
 
3:06 PM
@PaulDragoonis So after the rebase with preserving merge commits ... it still found a chance to not merge a few small changes that were made at the previous push attempt .. sigh
but i guess i'll have to get used to this for a while.
 
@Ja͢ck it's a pain in the arse. I don't work on 5.6 branch directly. I work on a feature branch, which I branch off of 5.6
I'm unsure if this was obvious to you, I don't know what you're doing :-)
 
Anyone here knowledgeable about SSDs? I'm trying to pick between the options and I'm really unsure which to buy.
 
@Lev
@LeviMorrison - speed vs size.
250GB one is usually good enough for your OS
and then SATA for your files
If you have a specific question about SSD's then go for it.
 
I am looking around something sized at ~200 (180, 200, 240, 256 are all fine) but the prices for those are all over the charts.
 
@PeeHaa That's just an understatement ;) Not the first time they fuck up :P
 
3:09 PM
@PaulDragoonis Yeah, I realised that when you suggested to rebase my 5.6 branch from upstream/master lol
 
@LeviMorrison pick something in the middle price range.
entry level ones are usually crap .. and high price ones are well ... not worth the price.
 
@LeviMorrison ended up with a hybrid drive.
 
200GBP for a 250GB samsung SSD, was solid for me.
@Ja͢ck in my opinion hybrids are f**kin terrible. Spend the money and buy a SSD :-)
 
In this case I'm not replacing a drive, I'm adding one to a system that has an HDD already.
 
define f**kin terrible.
 
3:11 PM
I have my os on 60gb ssds, two in raid 0 ...
200 seems ott
 
So hybrid isn't really worth it.
 
[joe@localhost php-src]$ sudo hdparm -tT /dev/md0

/dev/md0:
 Timing cached reads:   25312 MB in  2.00 seconds = 12674.68 MB/sec
 Timing buffered disk reads: 1434 MB in  3.00 seconds = 477.81 MB/sec
 
@Ja͢ck So... you are listed as a maintainer for PECL OAuth. Mind if I ask what the shit that API is about?
 
I like to live on the edge ...
 
@JoeWatkins - you rebel
 
3:14 PM
@DaveRandom Go for it ... unless that was the question ;p
 
I do lots and lots of compiling ... there are now about 30 hours in my day ... they've failed once in two years ...
roughly two years ...
 
@Ja͢ck yeh that was the question. The OAuth class just seems to be a collection of random methods.
 
@DaveRandom Cool huh?
 
And... php.net/manual/en/oauth.fetch.php... I don't even....
 
@DaveRandom Yeah! you like that dirty stuff? hehehe
 
3:16 PM
lol
 
@JoeWatkins nope, just a php.net email :P I don't care about an svn account, I'd rather have any PR reviewed anyway
 
@DaveRandom WHat the fak are yu doing in there you filthy boy
 
Auditing docs patches
 
@DaveRandom Anyway, yeah, so that's how it kind of evolved.
 
ping tyrael @FlorianMargaine ... (that's same thing btw)
 
3:17 PM
oh
well I'll ping him once at least a couple patches are in then :)
 
okay do that ... although I summoned him and he was here a few minutes ago, so maybe explain that to him ... i don't want to ping him again ....
 
@Ja͢ck Reasonably certain that's one of evolution's failures, like the cow. I think you need to throw it out and start again. Preferably without a hard dependency on curl.
 
@DaveRandom There's no hard dependency on curl .. don't know why you think that
It works on streams too
In fact, that's one of my contributions.
 
I seriously do not understand how evolution came up with the cow, I do not believe that an A-frame draped in meat would survive without farming.
 
@DaveRandom cows are tasty, nor can the kind of cows you see be blamed on nature ... we did that ... the almost perfectly rectangular cows I mean ...
 
3:20 PM
@DaveRandom At this point I'm not sure whether we should reset the project at all.
Isn't OAuth 1 out of style already?
 
you can always have a new version ...
 
@Ja͢ck nope
If anything oauth2 is :)
 
Oh ...
Hey, I was told that Google is no longer going to support OpenID?
 
{insert big corp here} might disagree with me on this one :)
 
@Ja͢ck Oh I finally found the #if OAUTH_USE_CURL, like a trillion miles away from the code I was looking at. Those back ends really need separating out into different files with a sane adapter API.
 
3:21 PM
@DaveRandom - there's a PHP userland library for OAuth2 that I use, you might wanna give that a look if the PECL extension isn't to your liking :-)
 
@PeeHaa big corps is exactly why oauth2 sucks so badly.
 
yep
 
@PaulDragoonis Oh there are a few, I'm just auditing docs patches in the OE which caused me to go see if a patch was valid though, never even looked at it before
 
Roger that
I've not used it either.
 
@PaulDragoonis Which one do you use phpoauthlib or the phpplague one?
 
3:22 PM
I personally use github.com/Lusitanian/PHPoAuthLib because it's maintained by @PeeHaa and another ex-regular here
where is @Lusitanian, he just sort of stopped showing up?
 
@PeeHaa - latter. I made some patches to phpleague one recently after using it.
 
When James and Rasmus started the pecl/oauth the aim was to provide a simple, one class, thing to do oauth ...
 
@DaveRandom - I'm apprehensive about using pecl extensions since my issues with ext/soap :-)
 
I don't think they realised that it would last so long.
 
I heard OAuth 2.0 was a disaster.
 
3:24 PM
Yeah, so the narrative goes.
 
@PaulDragoonis Aside from the fact that you were using SOAP at all, what were they?
 
@PaulDragoonis Are the supported services still somewhat limited?
 
@DaveRandom Back then I didn't have so much C-fu yet ;-)
I still don't, really, but it's improving.
 
wow ... Rasmus done a thing :D
 
@Ja͢ck Seems like the sort of thing PHP should have first-ish class support for, I'm not against there being a PECL (or even core) OAuth ext, but that is just... no.
 
3:27 PM
first class support for OAuth before HTTP, or and not HTTP ... would be ... something for everyone to fight about ...
 
I don't mind .. not sure what kind of API to model for it, though.
 
look around at other implementations and see how people slag them off ...
 
I don't like introducing a gazillion classes just so that initialisation occupies 20 lines of dependency injection.
 
@Ja͢ck @PeeHaa and @PhilSturgeon would be good people to talk to about that, I guess
 
you can't have phil ...
 
3:29 PM
lol
 
he's all mine when he's free ...
 
who's Phil?
 
@DaveRandom I guess I should carve out a Request object ... probably the least we could do.
 
dart is a good place to look for api inspiration maybe ...
I haven't heard anyone say "I really hate the ______ api in Dart" about anything yet ...
 
D'Artagnan ?
 
3:33 PM
@FlorianMargaine the town crier ...
 
@JoeWatkins because nobody uses it...
 
possibly true ... but they talk about it ...
 
@DaveRandom / @PeeHaa - it was for a project about 5 years ago, I can't even remember what this system did now.
XMLRPC and HTTP for the win now :)
 
mkeeey
 
Sorry, on a side topic, have you guys ever tried Guakamole?
 
3:43 PM
it looks like I have some minor issues with the mysql
when I do a dump with workbench , it add the DB create-and-use information at the top of the file
which means that I cannot really use it directly in the structure-dumps
is there a good way to mitigate this
 
do your dumps through the command line?
 
nope, through workbench , but if CLI give the options that I need, I can switch any time
I also have CLI access on the box where I need to import it
 
@PaulDragoonis ext/soap has had a number of recent improvements. It's still SOAP, obviously, so not that many improvements, but some holes have been plugged
 
good, butt plugs are a requirement after all.
 
butt plugs for everyone
 
3:49 PM
@tereško Meaning that you want to import the structure/data into a db with a different name or...?
 
yes
 
I've always just manually removed those lines
You need this to be more automated?
 
15
Q: How do I use mysqldump to export only the CREATE TABLE commands?

FMcI'm trying to use mysqldump to export only the DB schema -- no data, no additional SQL comments, just the CREATE TABLE commands. Here's what I've got so far: mysqldump -h localhost -u root -p --no-data --compact some_db It almost achieves what I want, but I'd like to eliminate the "character ...

?
 
I mean, it's not great but it would be easy enough to preg_replace out those lines if you need to do it programatically
(or whatever)
 
Also pg_dump :D
 
3:52 PM
@PaulDragoonis LOL
 
@PeeHaa it not my personal project =/
 
4:03 PM
posted on September 01, 2014 by nlecointre

/* by Noelia */

 
@LeviMorrison One of my favourite articles: OAuth 2.0 and the Road to Hell - written by the ex-lead author of Oauth2.
 
@Danack That's the article I was thinking of when I said that :D
 
It always cheers me up....sometimes my code is bad. But it's never been so bad that I've decided to never have anything to do with it again.
 
@Danack heheheheh yeah that's an awesome ragequit
 
insert analogies between the Oauth2 spec process and HTTP 2.0 spec process here
 
4:11 PM
@Danack Really? I'm never going to have anything to with loads of the code I've written ever again.
Admittedly this applies only to stuff I wrote years ago, but still
 
@DaveRandom Yeah, I meant during a project, where you've probably never gone, "fuck my own code, it disgusts me, I'm out of here."
 
-1
Q: How to convert microseconds to seconds in PHP?

Swapnil DalviInput format of time: hh:mm:ss.ms Example: 00:02:17.25 I want to convert it in to seconds. I am it confuse with that microseconds. How will I get accurate number of seconds for this kind of situation?

For your amusement
WTF somebody misclicked and upvoted that thing
 
^ *mislicked
 
:)
 
Tell me, why are you doing -1 on questions like these? This makes max. sence. Question is in the right format... — Tomáš Aresak Malčánek 2 mins ago
 
4:17 PM
@PeeHaa Most likely author's friend.
 
Huh? Argument 1 passed to Class::init() must be an instance of string, string given, called in Path ?
 
init??????????????????????????????????????????????????????????????????????????‌​???????????????????????????
 
@VeeeneX You've typehinted string, haven't you? function init(string $blah)...
 
yes
@salathe
 
4:22 PM
@VeeeneX Don't do that. We don't have scalar type hinting... yet.
 
@PeeHaa What is wrong?
 
@salathe The fact that you recognize it is scary :P
 
@PeeHaa hehe, I've seen it all before :P
 
Fuel::init('config.php');
 
4:24 PM
If you need to call something init and you haven't made a typo where you actually meant __construct there is a fat chance you are doing it wrong
 
Use function init($thing) and you'll be good
 
@PeeHaa probably one of the users who also answered it
 
@FlorianMargaine Yes, I've just wanted to write it with type hinting
 
@VeeeneX Switch language
 
@VeeeneX type hint doesn't work for scalar (string and int, basically) types
...yet
 
4:27 PM
@PeeHaa Ok, :D So initialize it with new Class?
 
@FlorianMargaine Thank you for useful info. ;)
 
That's what @salathe said...
 
Although he didn't explain what scalar means.
 
4:30 PM
*wants scaly type hints*
 
@salathe well, php is a do-acracy, just do it :p
 
@salathe Scally type hints? "Nah, give us an integer or I'll cut yer"?
 
...but do it well :>
 
@DaveRandom lol! scaly, not sckkkkkkhkhhkhkhkkhkkhally!
 
4:37 PM
So it's better to use new Class, than Class::init();
 
5:29 PM
damn
I have an issue with my PR.
emitting a warning means text is output, so headers can't be set anymore.
so... the patch does change functionality when run with warnings
I'll just write 2 tests.
how can I use regex in the EXPECT part in phpt?
like... I want to check a warning is thrown... but the output is dependent on the system (paths)
I'm just going to use set_error_handler.
 
@FlorianMargaine EXPECTF usually (or even EXPECTREGEX if you really need to)
 
5:50 PM
@salathe ah, thanks!
perfect
 
Guys
I need some help
Could you vote to close stackoverflow.com/questions/7747526/… for me as too broad or something
Or if there's a mod here, lock it please
People keep adding stupid answers
It was answered correctly three years ago
The answer was accepted
 
there we go, tests added
 
6:36 PM
On request of the owner ^
 
6:49 PM
:)
 
That audio question doesn't look 'too broad' to me.
 
@halfer It's not, I just don't want more low-quality answers
 
@AndreaFaulds, I do wonder whether 'completely unhelpful' and 'useless' are a bit ouch! though :-)
 
Morning
 
@halfer They should've read the other answers before chiming in with their unhelpful responses in a bid for more rep.
 
6:54 PM
Closing a question for incorrect reasons isn't the solution to bad answers, in any case.
I agree they probably +aren't helpful, but that is still our subjective opinion :-)
 
Well, I'm not a mod, I don't have the option to close it for other reasons
:/
 
Leaving it open is fine. We can't close all questions that are at risk of poor answers.
 
@PeeHaa Morning
 
@PeeHaa Is that icon in your avatar Windows's Disk Cleanup? :)
 
Evening @PeeHaa.
 
@PeeHaa Ah.
 
@DaveRandom git.pieterhordijk.com:81 user your nick pass in mail
 
@halfer Providing an answer that's already been provided in a year-old plus question is the definition of useless.
As a programmer you should want to adhere to a DRY standard... even with answers on SO.
 
@cspray, sure, but tone matters.
 
@halfer And sometimes that tone needs to imply "Do not do this. Ever." Don't take things that people say about code personally :)
 
7:00 PM
@PeeHaa I have to set it up at work
some time this week
 
@AndreaFaulds
when display_errors is set to on, the warning is shown
 
Are you going to manually set it up or are you grabbing a package? @tereško
 
so the headers are already sent, for the warning to be shown
so you can't set a new header...
 
@PeeHaa I am not entirely sure.Previously I have set it upon FreeBSD, which was a manual task. But first I have to make a "working prototype" and "sell" it to both m coworkers and the upper management (PM can go and fuck themselves)
 
7:03 PM
@PeeHaa Aha, thank you :)
 
@tereško Do the coworkers already use github?
@AndreaFaulds np
 
protected was what I was actually after I guess, not closed :)
 
@PeeHaa nope
 
Too bad. Would have been an easier sell otherwise
 
lol
 
7:06 PM
Dafuq. Mind blown
console.table(). One of those handy little things you can use in the browser developer tools console. http://t.co/wzBi12KyK1
 
nifty
 
7:24 PM
 
mnornigniouoihjkh @Jimbo
 
yup
 
think it should have been thought through, with justification, use-cases and explanation prior to posting ;-)
 
@ircmaxell I explain a little better here: news.php.net/php.internals/77010
 
7:36 PM
I understand why, and what. ;-)
 
It'd be particularly good with exceptions. @NikiC please revive them already ;)
 
@ircmaxell Nice, where is this?
 
@ircmaxell I got bigger boobs, it's not NSFW. Nice shot.
 
Well, I had to put it there
but thanks :-)
 
7:49 PM
@ircmaxell Heh, reminds me of the painted on shirt prank
 

« first day (1416 days earlier)      last day (3548 days later) »