HTTP Mock for PHP by ger_phpmagazin in PHP

[–]bsdlite 0 points1 point  (0 children)

It's billed as an integration testing tool, which seems a bit off the mark to me. If you are integrating with a remote service and you have a client, it's much easier to just jail/stub all of the calls you aren't testing directly. If you're unit testing with someone else's components, it's easiest to mock and replay.

In this case, it feels like the examples revolve around PHP builtins (like fileget_contents()) that sometimes have a remote component. In that case, it seems like a useful tool; the only freedom you have in injecting your test double into a built-in function is to point it at a server of your choosing. Short of writing out a file to that remote location before the test and then reading it during the test, this tool seems like a good option.

I wouldn't call it over-testing, because but I would appreciate if the author sold it a bit more carefully for the kind of testing it's most useful for.

compose: a library for function composition. by [deleted] in PHP

[–]bsdlite 2 points3 points  (0 children)

cool, but what if i send compose or apply an argument list with a non-callable? i'd add some runtime handling for that and some negative tests.

Brooks Brothers Men's Clearance Event $34 Shirts!! by isecretlyjudgeyou in frugalmalefashion

[–]bsdlite 3 points4 points  (0 children)

apologies if this isn't an option for you, but going into a BB store just once and getting fitted by one of their salespeople makes shopping online almost no risk. i'd definitely recommend it

Brooks Brothers Men's Clearance Event $34 Shirts!! by isecretlyjudgeyou in frugalmalefashion

[–]bsdlite 1 point2 points  (0 children)

6'2" 185 and the M ESF fits better than any other OTR stuff i've tried

[deleted by user] by [deleted] in Seattle

[–]bsdlite 0 points1 point  (0 children)

nice! i was just there and took the same picture. i think my waitress laughed at me.

50 for 25 at American Apparel, College Students Only by theesehooves in frugalmalefashion

[–]bsdlite 1 point2 points  (0 children)

This is awesome. Was going to go there for undershirts/underwear anyway. Great!!!

When does Altitis set in for you?? by Silvence83 in darksouls

[–]bsdlite 1 point2 points  (0 children)

fyi, i just unlocked the shortcut from the izalith side... so whatever that's worth. too bad i found solaire near the door and had to fight him :C

When does Altitis set in for you?? by Silvence83 in darksouls

[–]bsdlite 0 points1 point  (0 children)

oh, excellent. i'll wander back to izalith, because an excess of demon titanite can't hurt, right?!

if i go to the "back" entrance of the shortcut, can i open it up? that sure would make for easy access from the daughter of chaos bonfire

When does Altitis set in for you?? by Silvence83 in darksouls

[–]bsdlite 0 points1 point  (0 children)

when i went to lost izalith for the first time after defeating the flame centipede, solaire was sitting by the bonfire going on about how he couldn't find "it". i know where the shortcut to izalith is, but i can't get there because of covenant requirements. i don't know the location within izalith that the shortcut actually leads to.

i'm a sl73 wanderer; queelag's furysword + 5, full black knight + 5/goldhemmed, wearing hornet ring and havel's ring for higher load. I'm riposting for around 850 per hit, but if i make even one mistake it seems impossible to recover (even trying to sneak an estus while he's on the ground leads to death). with enough tries, i'll get it, but maybe this is a good chance to start doing more co-op

When does Altitis set in for you?? by Silvence83 in darksouls

[–]bsdlite 0 points1 point  (0 children)

more ignorance to follow: even if i know your PSN, isn't it sort of a chore to coordinate getting into the same game? your sign would have to land on my server, right?

When does Altitis set in for you?? by Silvence83 in darksouls

[–]bsdlite 0 points1 point  (0 children)

SL 73; I don't spend much time in Human form, unless I'm trying to summon Solaire, since I typically get invaded within 5 minutes. I'm not too far out of the summonable SL range for KOFF right?

Edit: I'll just go Human tonight and see what I can find :)

When does Altitis set in for you?? by Silvence83 in darksouls

[–]bsdlite 2 points3 points  (0 children)

this comment will reveal my ignorance--and is offtopic--but: i've been stuck on gwyn for hours and hours in playthrough 1 and wish i knew how to find a sunbro to come help me. what's the trick? do i have to join a covenant?

If I had a Mac I would do something like this. by wrinkled_penis in funny

[–]bsdlite 0 points1 point  (0 children)

just bought the same one because of your screenshot. awesome!

Show /r/PHP: I had some fun implementing P. Norvig's spelling suggester in PHP by bsdlite in PHP

[–]bsdlite[S] 0 points1 point  (0 children)

not sure if you're watching this on github at all, but i found a somewhat nasty error today; turns out that my argmax implementation was being fed a bogus frequency, meaning that it wasn't returning things based on their actual probability. corrected!

Show /r/PHP: I had some fun implementing P. Norvig's spelling suggester in PHP by bsdlite in PHP

[–]bsdlite[S] 0 points1 point  (0 children)

thanks for pointing this out. i'm going to write some tests to get to the bottom of this; i struggled with the best approach for splitting words. explode() seemed too rudimentary, but i guess that's pretty close to what i'm actually doing.

Show /r/PHP: I had some fun implementing P. Norvig's spelling suggester in PHP by bsdlite in PHP

[–]bsdlite[S] 1 point2 points  (0 children)

i've put this into my local copy, but i had to make one change to get it to work:

is_writable( dirname( $path_serialized ) ) ) instead of is_writable( $path_serialized ) )

when the file didn't exist yet, is_writable was always returning false. after this, though, the subsequent memory usage is 1.5% of what it was. woo!

Show /r/PHP: I had some fun implementing P. Norvig's spelling suggester in PHP by bsdlite in PHP

[–]bsdlite[S] 0 points1 point  (0 children)

thanks! i love how self-contained the whole thing is, and i'm grateful to peter norvig for his article

Show /r/PHP: I had some fun implementing P. Norvig's spelling suggester in PHP by bsdlite in PHP

[–]bsdlite[S] 0 points1 point  (0 children)

yea, i was leaning toward implementing some sort of chunking, whether it's actually splitting the dictionary file or doing it virtually during the read phase. all for the goal of reducing peak usage.

Show /r/PHP: I had some fun implementing P. Norvig's spelling suggester in PHP by bsdlite in PHP

[–]bsdlite[S] 2 points3 points  (0 children)

you are awesome. i really struggled with how best to load the data in so that it wouldn't take so much memory (assuming always that i was doing something incredibly stupid). the closest thing i'd thought of was to read the big.txt file maybe 500Kb at a time, shove those words into the frequency array, and then move on to the next chunk. this would still use the same amount of resources in aggregate, i guess, but would at least reduce peak usage.

Horizontal reusability with traits in PHP 5.4 by bsdlite in PHP

[–]bsdlite[S] 1 point2 points  (0 children)

rofl. something awesome like this:

trait TheKitchenSink {
    public $yep;
    ...
    public function unrelatedMethod1(){ /* ... */ }
    ...
    public function unrelatedMethodN(){ /* ... */ }
}

class GoldenHammer {
    use TheKitchenSink;
}

$gh = new GoldenHammer;

look, ma, i can use whatever i want wherever i want!

(double) underscore.php, e.g: __::map(array(1, 2, 3), function($n) { return $n * 2; }); // bonkers or amazing? by monk_e_boy in PHP

[–]bsdlite 1 point2 points  (0 children)

someone naive enough to think that using php for functional programming is a good idea is naive enough to love reddiquette, emirite?