Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

08-29-2012 , 07:38 AM
Quote:
Originally Posted by Neko
Common words in isolation are but 4 strung together like that is going to be brutally hard because the number of possible permutations is ridic large.

It tilts me to no end my bank limits the number of characters in your password to 8 with no special characters allowed. I wrote and complained to the bank and got a standard "your info is safe with us!" form letter back.
Not only did my bank have a similar silly requirement (and the username was just numbers to boot) but they also didn't feel like even having an RSA token for online banking.
The bank I was with before had sane defaults but alas a takeover made me a customer of this new bank.

They told me I shouldn't worry, I told them I followed their stock the last two years something they might concider doing as some sort of feedback mechanism and switched.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 12:55 PM
a fun one from yesterday.

i'm working on some code which makes frequent use of this pattern:

Code:
with patch.object(Node, 'activate') as m_activate:
    self.cluster.activate_node()
    m_activate.assert_called_once()
(btw "with patch.object(...)" is a nifty construction.)

so i come along to add a feature. i write a test making use of this pattern and run it, expecting it to fail. once it does, i'll go fix cluster.activate_node() so that it calls activate() on the cluster's Node object. tdd bitches!

except the test doesn't fail. that's weird. i rewrite the assertion like this:

Code:
    assert_equal(1, m_activate.call_count)
and this time it does fail. wat.

so i ask the guy who wrote this code if he knows what's going on. shouldn't these two assertions be identical? he agrees they should. we look at a few things before i discover that i cannot find a definition of assert_called_once(). the mock library provides an assert_called_once_with(), but no assert_called_once(). wtf? how is this working?

well, since m_activate is a mock, it has no problem at all executing m_activate.assert_called_once -- the method is simply mocked out! the original author never noticed this because he wrote all his tests post-hoc and never verified that they could fail. he had other assertions that pinned down most of the behavior, so the code did what it was supposed to, but essentially he was lucky.

and that's why you should quit your bitching and learn tdd. at the very least, you need to make sure your tests are able to fail. we'll see if this lesson landed on my colleague.

once discovered, of course, the problem was easy to fix:

Code:
def assert_called_once(mock):
    assert_equal(1, mock.call_count)
(i could have avoided some refactoring from foo.assert_called_once() to assert_called_once(foo) by adding my method directly to the mock library, but that felt a little too magical and hard to read.)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 01:48 PM
In related news I started TDDing my Prolog code last week. I was mostly superprototyping before but from here on out it'll all be TDD.

Surprisingly little info on Prolog-TDD outside of PLUnit docs that are not exactly example heavy heh, maybe a decent topic for a blogpost for that shiny new blog of mine that is at the status...wordpress installed and semiconfigured but redirection into nowhereland untill actually write the first post
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 07:36 PM
tc,

good post. I've been bitten by a similar bug/test combo...not using mocks, but a test that I wrote after the fact that wouldn't fail no matter what I did
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 07:37 PM
Quote:
Originally Posted by clowntable
In related news I started TDDing my Prolog code last week. I was mostly superprototyping before but from here on out it'll all be TDD.

Surprisingly little info on Prolog-TDD
Not really
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 08:13 PM
Barack Obama is doing an AMA on Reddit

http://www.reddit.com/r/IAmA/comment...united_states/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 08:27 PM
If you're going to post a photo why not at least show some of the screen so you can prove you're actually logged into Reddit?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 08:43 PM
08-29-2012 , 09:00 PM
I just thought it weird that they didn't show that he was on the site. I'm sure the photo's him and that's a photo from him in the campaign office and all that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2012 , 09:48 PM
yeah, would have probably made more sense.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2012 , 06:39 AM
Browsing stuff on github and I come across this file, called "core"

Code:
file 6 lines 

(ns xxxxxxxxxxx.core)

(defn -main
  "I don't do a whole lot."
  [& args]
  (println "Hello, World!"))
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2012 , 01:28 PM
Am I missing out for not following Reddit at all?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2012 , 02:26 PM
Quote:
Originally Posted by clowntable
Am I missing out for not following Reddit at all?
Probably a little, but it's not worth the time suck. Plus, if you're not some 22 year old raging liberal you'll probably not get that involved.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2012 , 03:03 PM
It can be what you make of it. Most of the default sub-reddits are good for quick hit time kills. However, other have detailed discussions and stimulating content. Some of the defaults also have a high noise to signal ratio, but you can unsubscribe from them. But just like how 2p2's sub forums have grown, there are places where you can go to talk about anything. And you can not go to the sections that tend to be filled with people that annoy you.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2012 , 04:35 PM
Calculate what the chart will display, *then* plot it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2012 , 05:41 PM
fakesky, i think you want: http://en.wikipedia.org/wiki/Bubble_chart
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2012 , 08:30 PM
Quote:
Originally Posted by clowntable
Am I missing out for not following Reddit at all?
There's just not enough hours in the day imo. HN provides me with more than enough reading material.

That said, I do glance at the Django & Python subreddits once a week but don't really ever read the commentary like I do on HN.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-31-2012 , 09:44 PM
here's a git error i encountered today:

Quote:
error in sideband demultiplexer
...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-31-2012 , 09:47 PM
I hate it when I get a bum demultiplexer, all you can do is reload the flangematrixator and hope for the best.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-31-2012 , 09:58 PM
what the **** is a samoflange?

Last edited by tyler_cracker; 08-31-2012 at 09:59 PM. Reason: SOMO.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-31-2012 , 09:59 PM
also kerowo's response is basically the same as the first round of responses in irc when this problem was reported.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-01-2012 , 12:03 AM
Just found a page on my intranet app that was generating > 2500 queries to retrieve ~50 numbers

lol ORM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-01-2012 , 12:06 AM
I recently needed a web app spell checker with the feel of a desktop word processor. I couldn't find one I liked so I wrote one. It's on github, so if anyone needs a spell checker for a web app, check it out. Here's a live demo.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-01-2012 , 12:25 AM
Nice work. The one thing I noticed is that you get false positives for hyphenated words (e.g. ex-wife) but it looks like that should be easy to fix by just changing your regex to allow hyphens as well as a-z.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-01-2012 , 12:32 AM
Quote:
Originally Posted by Neko
Nice work. The one thing I noticed is that you get false positives for hyphenated words (e.g. ex-wife) but it looks like that should be easy to fix by just changing your regex to allow hyphens as well as a-z.
Fixed
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m