« first day (660 days earlier)      last day (4285 days later) » 

9:00 PM
    function contains($object) {
        return $this->containsNode($object, $this->root);
    }

    protected function containsNode($element, BinaryNode $node = NULL) {
        if ($node === NULL) {
            return FALSE;
        }

        $comparisonResult = call_user_func($this->comparator, $element, $node->getValue());

        if ($comparisonResult < 0) {
            return $this->containsNode($element, $node->getLeft());
        } else {
            if ($comparisonResult > 0) {
                return $this->containsNode($element, $node->getRight());
contains has coverage, but no lines inside containsNode have coverage.
 
user895378
so your test case should look like this:
 
/**
 * @covers Spl\AVLTree::contains
 * @covers Spl\AVLTree::containsNode
 */
public function testGetLeftSubTree() {
    $this->object->add(2);
    $this->object->add(1);
    $this->assertEquals(1, $this->object->get(1));
    $this->assertNull($this->object->get(3));
}
 
@rdlowrey hmm, just failed my test case though. /me checks
failed at testing post and testing put, succeeded at everything else
 
user895378
@Lusitanian I think there is at least one failing test case in the current version on the repo for my tests
 
The content-length isn't getting calculated i don't think, lemme do that manually and see what happens
 
user895378
9:02 PM
I have some changes I need to finalize before pushing an updated version ... there were definitely some small bugs in the latest commit.
 
user895378
But not that I'm aware of concerning Content-Length ... which will only be automatically assigned if the request method verb allows entity bodies.
 
user895378
So if you're doing a GET request, it's not going to add a content-length header because GET requests aren't allowed to have entity bodies.
 
user895378
@LeviMorrison yeah, that looks correct ...
 
@rdlowrey I manually added content-length and it's no longer failing the PUT test
 
@rdlowrey By the way, you renamed ConnectFailureException.php but failed to rename the actual exception.
 
user895378
9:04 PM
@Lusitanian Cool. I'll make sure it works for the next push, which may not be till later tonight.
 
HOLY COW I'm the #22 best rep earner this week!
 
user895378
@LeviMorrison YEah, fixed locally, awaiting push :)
 
I'd commit it but I don't want to ruin anything you might have done.
@rdlowrey Let me know when you push next and I'll rerun tests as well.
 
@rdlowrey for POST requests, it wasn't adding "application/x-www-form-urlencoded" as the content-type
 
user895378
@LeviMorrison Yeah, I've got a few small things like that fixed. I'm going to try to wrap up what I've been doing and push something in the next few minutes just to take care of the known issues.
 
9:05 PM
that was the other issue. works perfect now!!!!
 
user895378
@Lusitanian it shouldn't.
 
great work
 
I guess you guys have been rubbing off on me.
 
@rdlowrey I know, but PHP does automatically i think
hence why i expected it
i.e. my fault
 
@SomeKittens Most of us don't try to get rep anymore :)
 
9:06 PM
ok, so maybe I'm a little addicted
 
user895378
@Lusitanian well, PHP isn't always the perfect example of implementing the HTTP protocol :)
 
user895378
but yeah, I can understand that.
 
i don't really think it has a perfect implementation of too much at all
 
Please press all thumbs that the new office will be close to the swimming pool. Yay :)
 
user895378
@Lusitanian Most people don't realize that's how POST forms work in web pages, so it's probably worth some explicit documentation explaining how to emulate a form encoded POST request. Thanks for the idea.
 
9:08 PM
@Lusitanian You can setup your credentials and prefered http client in here to be used by the examples
 
Not sure I'm liking my Request object now I've finished all the unit tests for it. Think it needs breaking down into bits I can compose together instead.
 
Just don't push the file with your credentials ;)
 
@PeeHaa lol right and i'm glad you added the http client in there
going to change it to artax
since i dumped the curlclient
 
good
 
user895378
@GordonM ugh, I know that feeling. Now I don't strictly TDD ... I try to wait until I know the API is finished changing dramatically before I uber-test everything :)
 
9:09 PM
but first gotta do some more tests
 
@rdlowrey Yeah, I know it's best practice and everything but I always feel slightly odd about writing tests for code that doesn't exist yet.
 
@rdlowrey By the way, do you need / want my help with anything? I'm just working on the data structures repo. Not terribly important.
 
But the current Request object is kinda big and it's mostly getters. Feels like there's something wrong there.
 
I like how it would be very easy to switch to another http client when hell freezes over for whatever reason :)
 
...and now some random kid is trying to add porn links to SO.
What a creative, out-of-the-box thing to do!
 
9:11 PM
@GordonM try out php6 it has magic getters/setters :)
 
@PeeHaa I bloody hope so, and I hope it isn't the proposed spec for PHP 5.5 either.
 
user895378
@LeviMorrison Not particularly at the moment. With some luck everything will be fully tested by the end of the day tomorrow? Maybe Wednesday. I'll be better able to answer that question at that point.
 
@PeeHaa Are they in that book?
 
:)
 
@PeeHaa should I add Artax as a submodule?
 
9:12 PM
@Lusitanian yup you can add the http client and dependencies so I can also fiddle with it :)
 
@rdlowrey I'm browsing all your HTTP request stuff on Github. Did kinda have a suggestion regarding code organization
 
user895378
@GordonM Feel free
 
I put all my interfaces in a subnamespace (with a subdirectory to go with them) so it's obviously where all the interfaces are. Not saying it's the right way to organize things oranything, but I just thought you guys might want to think about doing something to make your interfaces more obvious. Like calling it RequestInterface instead of just Request, or subnamespacing them like I'm doing.
 
@rdlowrey I improved my test coverage by 8 percentage points by adding @cover annotations. How lovely.
@GordonM We considered it, actually. Decided to not do that.
 
9:15 PM
@LeviMorrison What was the reasoning?
 
@PeeHaa question. should i add an autoloader for artax automatically or require_once the artax bootstrap file
 
@GordonM Entry points to libraries should work on interfaces. I shouldn't HAVE to explain it.
 
probably the latter
 
use the bootstrap. That's what it is for
:)
 
user895378
@GordonM It's generally considered a suboptimal practice to explicitly add things like 'Interface' to your names. The name should describe the concept of what the class/interface is/does on its own ...
 
user895378
9:16 PM
I used to do the same thing, though.
 
user895378
I've just read a bunch of stuff that convinced me not to.
 
@rdlowrey clean code?
 
user895378
@PeeHaa IIRC, yes.
 
@LeviMorrison I'm not arguing that. :) I'm just asking about how things are organized. I browsed through the Request file and was a little surprised to discover it was an interface.
 
Next thing on my list :)
 
9:18 PM
@rdlowrey If you've got any pointers to that stuff then please share.
 
@GordonM did you use the github gui client?
 
@PeeHaa I played with it a bit but not really used it seriously. I'm more likely to either just use the shell or use the NetBeans Git integration.
 
I use the GUI. I need to learn command line...
 
@GordonM well I've played a little with it and it sucks :P Keeps complaining about stuff, but when I just use sheel it just works
 
user895378
9:21 PM
Passage from CodeComplete p.24:
 
@PeeHaa GitHub for Windows? Mac? Is there a Github for Linux?
 
user895378
> These are sometimes a special case for encodings. For example, say you are building an ABSTRACT FACTORY for the creation of shapes. This factory will be an interface and will be implemented by a concrete class. What should you name them? IShapeFactory and ShapeFactory? I prefer to leave interfaces unadorned. The preceding I, so common in today’s legacy wads, is a distraction at best and too much information at worst. I don’t want my users knowing that I’m handing them an interface.
 
@GordonM windows
 
@PeeHaa go pull and test
 
user895378
> I just want them to know that it’s a ShapeFactory. So if I must encode either the interface or the implementation, I choose the implementation. Calling it ShapeFactoryImp, or even the hideous CShapeFactory, is preferable to encoding the interface.
 
9:22 PM
@Lusitanian I'm feeling kinky I'm going to fetch :)
 
imho, the name of interface should describe, what the implementation entails
 
I've got CC right in front of me, that's not on p.24
(CC2)
 
@GordonM only basic GitGUI I think... not the fancy one...
 
for example class Foo implements Printable
 
testGetInOrderPredecessorWithLeftSideHavingRightSubTree
Can't figure out how to shorten that one.
Might have to leave it.
 
9:24 PM
@LeviMorrison foo
 
user895378
@LeviMorrison I've also read that your test case methods are supposed to be very long and descriptive like that.
 
@LeviMorrison it's for a test so meh
 
user895378
@SomeKittens Woops, sorry, I said Code Complete, but I meant Clean Code
 
oh, ok.
don't have that one yet
 
user895378
Can't these people use titles that don't have the same abbreviations? Geez.
 
user895378
9:26 PM
CC++
 
Wow, epicly misread titles. Definitely getting tired.
 
user895378
lol I saw that
 
aw, I missed it
 
user895378
@Lusitanian technically, PHP doesn't add a Content-Type: application/x-www-form-urlencoded header. Your browser sees it in the form's enctype attribute and sends a form-encoded POST body and adds the Content-Type header when you submit a form.
 
9:31 PM
@rdlowrey I noticed your getScheme() methods don't seem to do much, mine don't either. I'm assuning http if there's no evidence that there's a secure connection and https if there is, but I'm not liking that approach. What about spdy or other alternate protocols?
 
user895378
@GordonM well, it doesn't do much because it's only returning the value it was given when the object was instantiated. The actual scheme is determined when the URI is parsed from the $_SERVER superglobal in some other class. The actual request implementation has nothing to do with detecting those values. It's a dumb value object that just provides access to the request values it's given.
 
user895378
SRP.
 
OK, need to look into how to do that then. I couldn't find much info on determining the scheme.
 
user895378
@GordonM I would suggest doing the research yourself, because you learn exponentially more that way. However, if you want to see the results of my research on the subject feel free to look at my SuperglobalUriDetector
 
Now somebody's going to do the super::$global thing!
 
9:36 PM
@GordonM Somebody called for help?
 
user895378
SuperStatic::SuperglobalUriDetector
 
@hakre Are you receiving pings when somebody mentions Super:$statics? ;)
 
Did you mean Super::$tatic['Super']->global['Uri']->Detector?
 
@rdlowrey Yours seems to do pretty much what mine does anyway. Assume HTTP or HTTPS based on whether or not it's a secure connection.
 
Go go Gadget submodule
 
9:38 PM
Would be nice if you could detect SPDY or some other HTTP dropin as well though.
 
user895378
@GordonM It would be really nice if PHP would give you unfettered access to the raw request message ... sadly it doesn't :/
 
Then again I guess PHP doesn't know about SPDY so it can't tell you that that's what the request is in.
@rdlowrey Quite!
 
user895378
not without the PECL http extension, anyway.
 
So I'll just learn Rails and node.js instead
 
user895378
And according to wikipedia, SPDY is ...
 
user895378
9:40 PM
> not currently a standard protocol
 
user895378
So I wouldn't expect PHP to think twice about supporting things like that. Nor should it.
 
user895378
@LeviMorrison Oh, are you okay with this? (forthcoming) ...
 
user895378
protected $userAgent = 'Artax-Http/0.1 (PHP5.3+)';
 
user895378
If you want to change it to something else, great. just needed to put something in there.
 
@rdlowrey Guess I'll just stick with github.com/gordiansolutions/reefknot/blob/master/http/… then.
 
9:43 PM
@rdlowrey: If it is HTTPS the default port ain't 80 but 110.
 
@rdlowrey Sounds good enough to me. As long as it doesn't have the words Mozilla and KHTML like Gecko I'm okay :)
 
user895378
@hakre How did that get in there? :)
 
@rdlowrey It sneaked in :)
 
user895378
@hakre Yeah, I very likely need to revisit a few things like that in light of the disgusting amount I've learned about HTTP in the last couple of weeks.
 
user895378
@hakre Although, I thought it was 443 for https?
 
user895378
9:47 PM
According to wikipedia:
 
user895378
> HTTPS URLs begin with "https://" and use port 443 by default, whereas HTTP URLs begin with "http://" and use port 80 by default.
 
https == 443
 
user895378
443 is what I use in the HTTP client and it works correctly, so ...
 
110 == pop
 
@rdlowrey That "By default" qualifier might lead to huge headaches later. :) HTTP on port 8080 isn't totally unknown.
 
9:50 PM
@GordonM default means if you don't specifically define a port it uses 80 for http and 443 for https
@Lusitanian Do you have a facebook account?
2 hours ago, by PeeHaa
I need to create an account to get hold of the oauth docs and to test the oauth lib, but it ask for a phonenumber???
 
user895378
@GordonM If it's 8080, it should already have been specified in the superglobal variable. That default should almost certainly never be used.
 
user895378
It's a failsafe.
 
But is it an epic failsafe? :)
 
hehe
 
Yeah, definitely going to break the Request object down into objects for its various component parts. If in doubt, make a shitload of classes :)
 
9:58 PM
@rdlowrey yes 443. but the important info was that it's not 80 :)
 
user895378
@hakre lol we're like two blind mice bumping into the wall trying to find the cheese.
 
@rdlowrey cheese! mjam! but it's late, so just wanted to give feedback what I did spot.
I'll file you a pull request/issue
 
I do get Bob's stuff about putting the public API at the top of a class and the non-public stuff below it. Unfortunately I just can't break the Pascal habit of something only being able to depend on things that were declared before it in the source.
 
user895378
@GordonM hmm ... maybe it's better to throw an exception.
 
So all my code has all the utility code at the top and all the more abstracted code at the bottom.
I really do get the idea behind it, but it's just such a hard habit to get out of :(
 
user895378
10:05 PM
@Lusitanian It's going to be later tonight before I can push today's fixes and improvements. The API won't have changed, but some problems will be fixed. Make sure you pull the latest later this evening or tomorrow morning.
 
Hey guys, i just reopened my question, would anyone mind having a look at it?
http://stackoverflow.com/questions/11835117/retrieve-all-data-from-table-then-count-how-many-results-there-are-in-another
 
$(document).attr('title', 'New title');
this jQuery is so cool, you can even change title in tab
 
It is kinda a hard one :/
 
Heh. WTF-per-minute as a code quality metric
 
wtfpm, I like it
 
10:17 PM
Heh, I was trying to figure out a way we could actually track our wtf/minute at work
Also, wtf is up with github burying our watched/starred repos deeper in the site? Used to I could get to any watched repo in 1 click, now I have to click 3-4 times
 
you can track wtf/per minute by counting the WTFs while you metric the time.
 
Yea, but that would just track my wtf/minute. I wanna track the entire team's wtf/minute
 
@CharlesSprayberry That's for what surveillance audio kits are for.
 
@CharlesSprayberry Get one those big red "EASY" buttons from staples, and mod it to say "WTF!?" and increment a counter when pressed
 
@orourkek Ya know, I really like this idea. Maybe I can get it to be really sturdy and you can just bang the shit out of it. Not only would it track wtf/minute but it would be a stress reliever!
 
10:32 PM
@CharlesSprayberry ^
 
@rdlowrey: How do you run a single testcase in artax?
And/Or which IDE are you using?
 
what'd i miss?!?
@PeeHaa how's it going
 
Is there a known "XDebug does not include ____ in coverage" list?
I'm getting 97% regularly and I'm curious to know why it isn't 100%.
 
10:51 PM
Doesn't the code-coverage report tell you which lines are missed?
 
@MikeB Well, I'm using PhpStorm. Supposedly it highlights lines in red that weren't tested, but no lines show up in the 97% files. I'm guessing it suppresses known issues or something.
 
ah, maybe have a look at the html report?
phpunit --coverage-html /path/to/output/coverage/
I can't think of anything weird that kept me from covering 100%
 
    <class name="BinaryNode" namespace="Spl">
      <metrics methods="12" coveredmethods="12" conditionals="0" coveredconditionals="0" statements="22" coveredstatements="22" elements="34" coveredelements="34"/>
    </class>
    <line num="30" type="method" name="__construct" crap="1" count="8"/>
    <line num="31" type="stmt" count="8"/>
    <line num="32" type="stmt" count="8"/>
    <line num="37" type="method" name="getRight" crap="1" count="8"/>
    <line num="38" type="stmt" count="8"/>
    <line num="44" type="method" name="getLeft" crap="1" count="8"/>
^ There's the clover output of the file in question
 
looks like 100%?
 
okay the vb6 revival might even become true.
but it looks like that it will become hashcat gui getting githubbed.
 
11:02 PM
@MikeB It reports 97% in HTML?
Oh well
 
(function(){ if (!jQuery && !MooTools && !YUI) { document.write("this rules!"; } });
@hakre I'm downloading VB6 atm :P
 
@PeeHaa just saw your question. no i don't and i never intend on having one (:
but the docs are available, i found em earlier
 
11:17 PM
@orourkek , is it just me , or he's doing it wrong
 
@tereško I was so sad that I actually opened his question history
and the pièce de résistance: stackoverflow.com/a/8280264/1183986
 
@rdlowrey: You are too fast. Please note that the new update is a squash and a forced commit.
You have only pulled in the tests that demonstrate the problem, but the fix was missing :)
 
user895378
@hakre lol, sorry, I just got back from walking the dog and was like, oh, lemme merge this
 
forgot that var before name in JS changes scope #fml
 
@rdlowrey you can merge whatever you want :) I can do the merge, too if you run into problems changing history.
 
11:25 PM
Hey guys, does ayone know how to keep special characters (čžš) when json encoding the string for ajax call?
utf-8
 
@John json has no problem to transport these. you just need to json_encode and you're fine as you use utf-8.
@orourkek ah the service that does it ;) Quite a silver bullet like Super::$tatic.
You need a service that you can use to change the column type. — hakre 17 secs ago
 
@hakre My bad sorry. I forgot to set mysql charset when fetching from database :) Thanks :))
 
@hakre Funny how "you need a service to do that" could work as an answer for just about anything :P
 
user895378
@hakre Thanks -- I guess you figured out how to run a single test case.
 
user895378
11:32 PM
I'm going to start including a brief note about how the tests are structured in the readme file so people know how they're structured.
 
@orourkek yeah, it's the service man, the one that does it. You only need that service, job done! SOA to the MAX!
 
user895378
@Lusitanian The push I just sent should correct the content-length issues as well as anything else you may have run into before.
 
@rdlowrey nice. time to struggle with git submodules again
 
@rdlowrey jup, just configured to use the bootstrap.php and done.
 
user895378
@hakre cool.
 
11:34 PM
@rdlowrey structure of tests are actually pretty straight forward. probably if you explain the configuration files a little. I was unsure if I need to use unit.xml, but I didn't. Only bootstrap.php was needed.
 
user895378
yeah, it's just phpunit --bootstrap test/bootstrap.php or you can use the config file with:
 
user895378
phpunit -c test/unit.xml <--- runs all tests and writes HTML coverage info into test/coverage
 
user895378
both commands from the base project directory
 
user895378
or use the bootstrap and point it at a specific file:
 
@rdlowrey Yup, content-length issue is fixed
 
user895378
11:35 PM
phpunit --bootstrap test/bootstrap.php test/unit/Http/StdRequestDetectorTest
 
what xml setting is used to tell phpunit to write html code coverage
 
user895378
<logging>
        <log
            type="coverage-html"
            target="./coverage"
            charset="UTF-8"
            yui="true"
            lowUpperBound="35"
            highLowerBound="70"
            showUncoveredFiles="true"
        />
</logging>
 
user895378
or, from the command line:
 
user895378
phpunit --coverage-html destination/directory/path
 
user895378
you have to have xdebug installed to get coverage info
 
user895378
11:39 PM
if you're running your tests from the command line, phpunit --coverage-text is also helpful.
 
cool, thank you [yes, i do]
i actually run from phpstorm but i don't know if it has support for displaying the information in an integrated manner
 
@rdlowrey for me this looks like:
 
user895378
I can't work without $ pywatch "phpunit -c test/unit.xml" src test/unit running at all times on my second monitor ...
 
 
user895378
I learned everything I know about phpunit in the CLI, so I'm a little disdainful of GUI tools to interface with it, but whatever gets people testing is good :)
 
11:41 PM
well I normally test within CLI, too.
But if you explore a new project, sometimes IDE is not bad, too.
is there a reason you use pywatch instead of watch btw?
 
user895378
@hakre yes.
 
colors?
 
user895378
exactly.
 
please help with getting watch from procps-ng ready to ship
support for colors and utf-8
which distribution are you using?
 
user895378
fedora 16 currently
 
user895378
11:43 PM
have the same issue with CentOS 6.2 as well.
 
@rdlowrey lol, making jokes, hein?
 
user895378
:)
 
I'm on fedora 17 and I have the rawhide procps-ng installed.
that ticket requires another bug-report for rawhide. if you want you can create it.
 

« first day (660 days earlier)      last day (4285 days later) »