-
Many to Many joins with Ecto and Elixir
Ecto is an DSL for writing queries and interacting with databases in Elixir. It has a style similar to ActiveRecord, but since there aren’t objects, you can’t really call it an ORM.
Like ActiveRecord, it has has_many and belongs_to, but it doesn’t have has_many :through yet. Here is how I implemented a DAG using a many-to-many join in Ecto anyways
The basic idea is I have a Nodes table. And each Node can have multiple parents and multiple children.
-
named tasks in leader_cron
I’ve been using erlcron to run scheduled tasks, but since each node in an erlang cluster would have its own copy, it didn’t help with having the tasks run in only one location per-cluster. Then I found leader_cron, which uses gen_leader to elect a single node in the cluster to run the tasks.
This is great stuff, but it doesn’t solve the problem of which node should schedule the task. For this purpose, I added the feature of named tasks, so that if you add a task with the same name, you receive a {error, already_exists} response.
-
Agile and Hyperproductivity
I was wondering around my office, which is housed in a co-working location, when I saw on a whiteboard in another company’s office, “Agile: Hyperproductive!” As an engineer type, I had to restrain myself from going in and telling them they were wrong, but I do have some thoughts on the subject.
I like Scrum. I think in the future for most teams, Scrum and similar processes won’t be controversial. They’ll just be how software engineers do things.
-
Require.js and HAML
I’ve been having very good luck with requirehaml. I had been looking around at various templates, but none of them seemed to support compiling before delivery to the client. This script does that and compiles them into easily verifiable javascript files, packaged up to be included with my existing require.js AMD build.
So far, I haven’t actually had that much HTML to include, but hopefully that will change as my project takes shape and grows.
-
AMD modules and web developers
Now that require.js has reached 1.0, it’s probably time to start shouting its praises from every rooftop so that javascript library authors include support for it. Require.js is an implementation of the AMD draft specification which adds simple module support for javascript in the browser. This means no more namespace pollution (if you use it properly).
Unfortunately, we’re talking about web developers who don’t seem to understand basic principals like avoiding namespace pollution.
-
New GitX fork
It’s good to see that someone has taken up the GitX mantle, since the original hasn’t been updated since September, 2009. There have been a bunch of forks, notably brotherbard‘s fork.
But this is the first time I’ve seen active development with actual releases. Nice to know I’m not relying on abandoned software.
-
How to setup a pretty good dev environment on the mac
(This was a quick write up for a coworker, but others might find it useful)
This assumes you have XCode. I mean, really now.
First thing to do is install mac homebrew. It’s a package manager of useful open source software. You install it by pasting into the terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" then just to make sure it’s working, run:
brew install -v git Next we want to install the node package manager.
-
New books!
I bought a couple books today. I picked up Managing Humans and Real World Haskell.
Managing Humans really needed a better editor. Maybe I’m not in the manager mindframe enough to understand it, but it jerked around and contradicted itself.
I’m hoping the Haskell book isn’t as disappointing. I’ve been wanting to understand functional programming for a long time, but never got around to picking up a book that explained how to model real programs that rely on input from the outside world.
-
What the hell, autoconf?
There’s a new autoconf out, autoconf-2.63. It continues autoconf’s fine tradition of having the suckiest release schedule and quality of the GNU toolkit. You would think that they would increment the major number whenever they release a non-backwards compatible release, but they don’t for shear perversity. I guess 2.63 just rolls off the tongue, and I can’t blame them. The ridiculousness of having to test for different versions of your platform configuration tool boggles me.
-
there but for the grace of god…
I’m so glad I’m not an Apple Release Engineer today. Four major releases today. iPhone 3G, iPhone Firmware 2.0, MobileMe, and iTunes 7.7.
It’s a huge task to synchronize all those releases and it eats up company resources like crazy. You have to have enough people to focus on each task separately.
MobileMe still isn’t working right. They’ve been extending the maintenance downtime further and further.
They have my sympathies.