A post about testing and then something about leiningen

I am writing this post in emacs tonight instead of the WordPress editor. I don’t know if it will make much difference, but I’ll keep it in markdown-mode for tonight.
I posted some questions about functional testing in rails. I am currently building what is most likely my most complicated rails application to date. I’ve been getting better at rails, but some of the things are still taking time to set in.
I’ve decided to really push the TDD aspect on this particular app. I am exploring using authlogic and declarative authorization to handle the security controls of the app. This is the kind of thing you want you want to be testing like crazy.
I’ve been having trouble with testing using loops to test access. One of the libraries uses a protected value that is only being set when a page is requested. I managed to log a user in, and that’s working quite well, but I’m having trouble logging that user out and a new user in within the same test case. I had this nice, elegant loop crafted that would allow me to establish a data structure that would allow me to control every aspect of the test. Alas, it would fail when it came time to change users. I put tons of debug code everywhere. I was hitting C-c ‘ r t <tab> <return> like crazy. I cleared everything that could even look like a bit of session. I couldn’t get Authorization.current_user to reflect the credentials of the current UserSession.
I do feel that I made up for it quite nicely. I managed to take about 3-4 lines of every test and pack it all into a single function that lets me specify the rules of the access check using a map. I’m quite happy with it
In clojure news. I’ve finally taken the plunge and have learned Leiningen. I was previously using Maven, so I’m not that hard of a sell. I like some of the ideas, but truthfully, I’m more interested in the polyglot maven project. I think it would be interesting if one or both of the projects could make it so they could try to read the other’s build files if available. So my first task was to take the clj-mql library, which I had just
checked out because I’m trying to learn more MQL, and convert the dependencies to maven. I hit a snag on something, and when I asked
about it in IRC, someone asked why I wasn’t just using lein.
So I threw out my pom.xml and made a project.clj for it.
Leiningen currently has a problem with it’s swank option which is causing src/ to not be on the path. You can always use the repl option
or the distasteful add-classpath option, but that will need to be fixed. Someone posted a horribly convoluted series of steps that I
attempted, but didn’t work for me.

On Writing. (a second blog post in the night)

Wow! The response has been impressive. I just posted a blog post, the first I’ve done in quite some time, and already that post is on the front page of duck1123.wordpress.com. I can’t believe. I can’t stand it. How dare that post take of the most coveted first post on that site that just so happens to be the one that takes it’s name from the online id I use. I must knock it down by publishing that one.

First I must sprinkle you with fairy dust and while you’re distracted, I go and grab a cigarette from my wife.

Ha Ha! She may only have two, but I have many. Not only that, but I found some Cherry Coke and the keyboard for my macbook.

I try to like the macbook. I will give it credit, it is not that bad, but for the past several years I have been pretty much exclusively an Ubuntu user. I like Ubuntu and I pretty much have it set up pretty well. I’ve run dual boot off and on, but recently it’s been I only rebooted on the weekends if I wanted to play sims or Toby wanted to play Portal and then I would immediately reboot back into linux because ironically I haven’t been able to get Windows 7 to share it’s NTFS drive with the mac using the windows share protocol. I have to log into linux to get that.

I’ve been becoming a big fan of XBMC lately. We don’t have a TV in our bedroom and I bring the macbook into the bedroom and hook it up to an old CRT monitor that we had extra and the iPod docking clock radio my dad bought me for christmas one year because he thought I had an iPod. I didn’t. I had a Creative Zen M:Video which I now can’t use anymore because Toby jammed the cord into it and bent the pins.

Anyway, XBMC (You know. I really wish the technology was (Pandora just asked me if I was still listening (my wife just messaged (can you tell I’m a lisp programmer) from the other room. ) I said yes) there to nest thoughts better in blog posts) No time for that tonight. I should write that in another post

I am the master of all (fictional) time.

I love freebase.com. It is a very aptly named site. Much like Wikipedia, where you can find yourself getting sucked from link to link, you could spend hours just clicking around. It becomes really dangerous when you consider how low the barrier to entry is to add new information. If you modify your account to keep you permanently in edit mode, then you see all these little blank spaces of where information is missing, and you just can’t help but fill it in. You don’t know what language that episode of Will and Grace that you are watching was in, well guess what? I do. Let me just click edit here, type out “English Language” pick the item off the list, enter and I’m done. Oh wait. This doesn’t list that this character was in this episode. Let me just fix that real quick, and… You can see how you can become lost.

My real focus, has of course, been in the fictional realm. I love the idea of being able to not only be able to look up any book, tv show, movie or comic book and not only see the actors and authors and artists associated with those works, but the character and places described by these works and the connections between them.

In my fleshing out of some of the fictional universes that are close to my heart, I decided that I wanted to be able to track who was killing who. I had to create two new types for the killers and the killed. Of course only fictional characters can kill other fictional characters, (act of the author notwithstanding)  so the killers and the killed are co-typed as fictional characters, but the killed characters are now dead. We need a type to track that information. So the deceased character is created, i need a way to track when they died. I can’t use real time. We know that Leto Atreides died in 10,191 AG., but when in AD years was the guild formed? In junior high, I calculated the events of Dune to be somewhere around 50,000 AD using a chronology in the non-canonical Dune Encyclopedia but I don’t really trust that for serious data entry.

So the Fictional Date/Time type was created. It sliced, it dices, it holds a slot for dates occurring in the Gregorian Calendar and a matched pair of slots for both the numerical date and the fictional calendar system that date is based on. Whether you want to know when lightning struck the clock tower or when Hayden Christensen managed to get himself inserted into Luke’s post-dramatic stress-induced acid trip you’re covered.

But wait, there’s more

If you act now, I’ll throw in a link to works of fiction portrayed in at no extra cost. No longer will you have to lose sleep trying to figure out exactly when the events of Care Bears II took place. This multi-purpose co-type works well in any situation

  • Books
  • TV Shows
  • Plays
  • Movies
  • Comic Books
  • Comic Strips
  • Autobiographies of political figures

Well I am happy to announce that I was able to convince the powers that be at Freebase of the usefulness of the bottom layer in my quest to have a definitive list of every actor to kill someone in an episode of Monk. Fictional Date/Time, Fictional Calendar System, and Calendar System Directionality (forward and reverse) have been removed from my fictionaluniverse base and into the fictional_universe commons.

The deceased fictional character has many problems still owing both to a limitation of the levels of nesting that can occur with CVTs and the fact that because of DC comics, these damn superheroes just won’t stay dead. I’ll post more on that in another post.

Follow

Get every new post delivered to your Inbox.