It seems that EveryDNS.net is being harassed with a DDoS attack. I’ve found them a convenient way to manage my DNS records over the years, so I went ahead and chipped in some money via their donation link.
Category Archives: Uncategorized
New server
I set up a new server for rails applications, including this “online journal”. So far, so good, although it was certainly a pain in the neck getting everything agreed to and set up with the hosting company (although they were helpful when I broke down and went ahead with the international call to get things fixed up).
Playing fetch
We had some friends once, who had a dog that would run after anything that you threw for it to fetch. It would run up hills, down hills, through bushes, jump into water…absolutely anything to bring that stick back to you.
Sometimes, I have a sneaking suspicion that certain programming systems are sticks that you simply shouldn’t chase after, unless you want to end up like that poor dog, crashing down the hill.
I’m not an economist, but I suspect that companies, like countries or other entities that participate in trade, in some ways adhere to the principle of comparative advantage, in the sense that they do some things relatively better than others. For instance, big companies are probably better at slogging through big huge API’s in more tedious languages like Java. And that’s where the chasing the stick idea comes in. If you’re a small company, you’re going to get beat up if you chase after the stick, trying to keep up with IBM in grinding out Java WS-* code. That’s something they’re better at, because they have lots of people to throw at any problem. You had best stick to something where having a few bright people makes more of a difference.
At times, I wonder if some of these ideas are thrown out there on purpose, to try and get people chasing after them, and compete with big companies on terrain that the big companies are guaranteed to win on.
CSV WTF
In something very reminiscent of this:
http://thedailywtf.com/forums/thread/102936.aspx
I just got some instructions today on how to interact with with a web service, complete with WSDL, SOAP, and some other acronyms. The goal of all this? To send a comma,separated,value file to the recipient.
Ooooo-kkkk.
Padova Hacking Society
I couldn’t think of a better name, so that’s what I came up with for a “cross-platform” group including a variety of people who are knowledgeable in different fields. Thanks to Matteo, we had our first meeting yesterday for (what else, being in Italy), pizza and beer.
I continue to be very impressed by the amount of technical talent here in Padova. It is a university town, but it’s only got about 200,000 people. At our dinner yesterday, we had guys from OFBiz, Mono, FreeBSD, and various other open source projects, as well as people expert in C, Perl, Python, Ruby, Java, Erlang, and counting myself, Tcl. Furthermore, the guys from the nascent startup seesaw.it were there as well.
It was a lot of fun to meet up with people to talk tech in person. Even the level of diversity lead to some heated debate at times, I think I much preferred it to a monothematic event. With age, I tend to get less excited about things, and realize that it’s all fascinating and worth knowing, and just wishing I had more time to soak up knowledge in the many fields that interest me.
Hopefully, we’ll be able to repeat the event sometime soon.
Random Rants
Edge Eft breaks ldap
At work, we decided to test upgrading to Ubuntu’s Edgy Eft on a spare machine. CRUNCH… that didn’t go so well. The bug is here:
https://launchpad.net/distros/ubuntu/+source/libnss-ldap/+bug/51315
Also, it’s no longer possible to boot with init=/bin/bash, you have to use init=/bin/dash. Single user mode brings up so much stuff that it’s not really viable as a rescue mode, IMO.
require_gem ?
What is the deal with having a separate command to require gem-installed packages in Ruby. Perhaps there is a logical reason for it, but it’s ugly looking to me.
Rubyforge is down…again
Ruby’s popular these days, isn’t there someone who could invest a bit of money in setting up a system that stays up?
Harumph!
Bicycling, Running, and Open Source Economics
I am very passionate about open source (or free software, or whatever you want to call it) software. In one way or the other, it seems I’m always drawn back to it, whatever else I’m supposed to be working on. I get a good feeling from the community aspects of it, believe in the potential for technological benefits, and appreciate that being open is often the best way to advance the state of the art.
One thing that has always been something of a mystery though, is how the whole thing works in economic terms. There is no doubt in my mind that open source works in terms of creating value, but what isn’t so simple is how it sustains itself, and where it makes sense. Some people, like Richard Stallman, sustain that all software should be free. Others take a more laissez faire attitude. Aside from philosophical debates, though, there is a very pragmatic question of how it works in practice, and if the process could be made more efficient, and in which cases should one simply decide to ‘go proprietary’ in terms of maximizing monetary returns.
In the proprietary software world, this is all rather “simple” – (well, conceptually at least – it’s not actually easy for anyone). If you write some software that you then sell, and people like it, they’ll buy it, which in turn gives you money that you can funnel back into improving the product. If it stinks, you won’t get any money, and presumably you’ll move on to something you are more qualified for. It’s a pretty simple and direct feedback loop. With free software though, it gets much more complex, because there is not necessarily an economic link between users and developers, which might mean that while the software provides very real economic benefits in terms of flexibility, avoiding vendor lock in, and low costs, none of those benefits necessarily flow to the person or people who actually wrote the software. This, in turn, means that they may have to support themselves in some other way and may not be able to dedicate much time to working on the code. This system is thus ‘inefficient’, because there is a disconnect between the value and the person who created it. A lot of thought has been dedicated to “solving” this problem, but it doesn’t seem to have a satisfying answer just yet, although there are several free software companies that clearly do function, with a variety of models.
One of the original ideas about how people would live in an entirely free software based economy, proposed by Stallman, is services. In other words, the software is free, but you get money to fix it, teach people about it, improve it, provide support for it, customize it and so on.
While riding my bike around the Colli Euganei the other day, it occured to me that a pure services business is a lot like running. The minute you have fewer clients, go on vacation, or otherwise ease up… revenue drops proportionately, just as if you had slowed from a run to a walk. Ease off on the effort completely, and the money is gone, because you have no way of carrying your momentum forward. With a bicycle, on the other hand, it’s more like a product-based business. It’s certainly still an effort, and you have to be strong to beat your competitors, however, you can stop pedaling for a moment now and then, and you do get the descents after riding up the hills, and for a few meters at least, you can stop pedaling altogether and coast.
What prompted me to think about products versus services was a small web application I developed recently. It’s a nice ajaxy to-do list/time-tracker that I started developing with Ruby on Rails. My first instinct, and the easiest thing to do, of course, would be to open source it and let it go at that, but… I also wonder if I could make a little bit of money at it if I were to commercialize the product somehow. Not “get rich quick” money, but enough to pay me back for the time I sunk into making it work, and enough to let me justify doing more work on it to meet people’s needs and requests.
A couple of strategies come to mind:
-
Just open source it and be done with it.
-
Sell google adsense. I don’t think that would cover it though, because it’s a reasonably resource intensive system.
-
Sell access to an advanced version that allows group collaboration, sharing/trading of tasks, and so on.
-
Sell a downloadable version that people can run locally, perhaps on an intranet.
Whatever ends up happening with it, I’ll be sure to post further information as it becomes available.
Open Source J2ME
This announcement is pretty interesting news:
http://news.zdnet.com/2100-3513_22-6131788.html
I think it’s a pretty good idea in several ways. Open Source Java has always struggled a bit with the fact that since the Sun implementation is ‘free as in free beer’, there is less incentive to work on an open source version.
I said as much a year ago so it’s nice to see my idea wasn’t so bad after all.
Idle Ajax callback for Rails
I’m working on an application that needs an idle callback (do something after the user has been idle for N seconds). It was pretty easy to hack up once I found some example javascript code (hopefully it works in IE too…):
def on_idle(timeout, options)
timeout *= 1000
remote = remote_function(options)
javascript_tag("
var alarm = {
remind: function() {
#{remote}
delete this.timeoutID;
this.setup(this.ms);
},
setup: function(ms) {
this.cancel();
var self = this;
self.ms = ms;
this.timeoutID = window.setTimeout(function(msg) {self.remind();}, ms);
},
cancel: function() {
if(typeof this.timeoutID == "number") {
window.clearTimeout(this.timeoutID);
delete this.timeoutID;
}
}
};
alarm.setup(#{timeout});
window.onblur = function() { alarm.setup(#{timeout}) };
window.onfocus = function() { alarm.setup(#{timeout}) };
window.onmousemove = function() { alarm.setup(#{timeout}) };
")
end
I use it like so, after putting it into my application_helper.rb file.
<%= on_idle 600, :url => { :action => 'on_idle' } %>
It could probably improved by making it take some options to determine which events cause un-idleness and perhaps call a no-longer-idle hook. I’ll update this page with those changes should I get around to them.
I wonder if there’s a good, centralized place to submit these kinds of little hacks to? The Rails trac system seems to be full of spam, indicating that people aren’t triaging bugs at all.
Passing information to Rails droppables from draggables
I’ve been working on yet another rails project lately, and, as usual, having a lot of fun with it. I bumped into a bit of a limitation though, in the default setup. Namely, that it’s difficult to pass much information between draggables and droppables. For example, if you look at the scriptaculous demo here:
http://demo.script.aculo.us/shop
You’ll see that Rails receives and deals with the element that was dragged and dropped in sort of a hacky way, in the add method:
product_id = params[:id].split("_")[1]
In other words to get the product ID, you have to hack the string!
Well, that’s certainly not very elegant. I’m not sure I would consider my own solution “beautiful” either, but it does have the potential to let you pass multiple values, and do so in a way that doesn’t involve chopping up strings in the controller portion of the code (which ought to be dealing with logic, not how to pick strings apart). Most importantly, you can pass values that are decoupled from the html element id used as a draggable element.
def draggable_dest()
return "'sourceid=' + element.sourceid + '&sourceobj=' + element.sourceobj"
end
def draggable_source(htmlid, obj)
javascript_tag "e = $('#{htmlid}') ; e.sourceid = '#{htmlid}'; e.sourceobj = #{obj.id}"
end
I created these in the application_helper.rb file, so that I can use them whereever I need. They are used like so:
<%= drop_receiving_element('current', :url => { :action => "replace_current",
:destid => 'current', :destobj => @current.id },
:with => draggable_dest()) %>
This sets up the action of the receiving element with the destination’s html element id, and an ActiveRecord object id, as well as the :with tag that knows how to grab the information we pass from the draggable element:
<%= draggable_element("mytask", :revert => true) %>
<%= draggable_source("mytask", t) %>
What’s happening here is that first, we create a draggable element with the regular Rails method, but then we apply the secret sauce, defined above, that loads the html element id, and the object id into the draggable element, so that when it lands on the receiving element, the parameters we set up get passed on.
This is a rough idea at this point, as I only figured out how to do what I wanted yesterday. Potential improvements include passing arbitrary parameters, as well as integrating the whole thing somewhere “upstream”, which is something I wanted to avoid for my initial attempt, so as not to lock myself into a hacked, local version of Rails. In any case, I hope you enjoy it.