Submitted by gwolf on Tue, 05/06/2008 - 16:30.
I usually don't like me too comments... But this is something that really disappoints me of my otherwise-favorite development framework. I must echo Matt Palmer's comment on Luke Kanies' entry:
Ruby. Has. A. Distribution. Problem.
Nice, good read. Sadly, many Rails pushers see distributability as something very minor, something that should not worry Rails developers right now, as there is too much other serious work to be done - Better UTF8, a clearer language, better performance... And besides, any programmer can live well with gems. (yes, that's all taken from a rant I had with a very convinced person)
My gripe is that... Rails is no longer a small, fringe project. Rails is an enterprise-grade development framework, with thousands of deployed production systems. And if they don't start to act responsably, if the Rails developers keep pushing said problems as low-priority, the Rails developers' (that is, their users) culture will become rigid - and will constitute a serious harm to Rails' future.
Distributability and packageability is not only for OS distributors. Not only we Debian zealots care about software being easily packageable. By using Ruby Gems, you dramatically increase entropy and harm your systems' security.
Read Luke's text for more details. It is quite worth the time.
Submitted by gwolf on Sun, 05/04/2008 - 15:35.
Every now and then, I want to understand a bit better English. Today, when Joeyh mentioned nettle soup, I had to ask Wikipedia what a nettle is. And Joey, no wonder it itches... It refers to around 45 species of genus Urtica in the family Urticaceae - In Spanish, of course, urtica is known as ortiga, or as blind person's herb, as even a blind person will quickly recognize it to touch - Touching it will cause the apt-named urticaria, which Joey seems to have discovered and learnt to fear. At least in Spanish, urticaria is generalized and used to call all kinds of skin diseases.
It happens to be a very common plant in the area I live and dwell in (the ecological reserve REPSA spans a good portion of the University, and limits my neighbourhood), a large extension of Southern Mexico City where the lava of the small Xitle volcano covered everything, rendering a good portion of the Mexico City valley unfertile, known as malpaís (badland, literally).
Anyway... I don't think I'll rush to cut some ortigas and make them into soup, as both Joeyh and Wikipedia (Spanish and English versions) suggest. But it is always an option, having so many fine specimens around.
This posting serves no other purpose than to show my appreciation to the Mexico City Area
Submitted by gwolf on Thu, 05/01/2008 - 17:25.
May 1st is a holiday in many countries around the world - It is, at least, here in Mexico. So, what's a man to do when faced with really-crappy network connectivity at home?
Yesterday I had dinner with Gigio, and among many other things, we talked about the Ciclotón, which I've only done twice. And on my way back home, I crossed (twice) the path of a group of ~100 cyclist going over Colonia Roma.
Anyway, whatever the reason, I woke up very well in the mood for a nice 20km ride:

Now, lets get the day started!
[update] I was told about a worldwide nudist cycling activity, the World Naked Bike Ride. Their page states their main motivator:
We face automobile traffic with our naked bodies as the best way of defending our dignit and exposing the unique dangers faced by cyclists and pedestrians as well as the negative consequences we all face due to dependence on oil, and other forms of non-renewable energy.
Of course, Mexican groups take part in this interesting activity - Ciclomarcha nudista.
Will I be there? I don't know - Quite probably, yes. I first thought of it as a joke, and as a dangerous activity. But, come think of it, I am a move-by-bicycle-in-the-largest-city-in-the-world activist. I have been knocked over or shit-scared (and fortunately not more than that) by careless drivers, but than won't force me back into driving my car when not needed. And this kind of activities, which do get their good share of exposure, need all the participants - I hope to be there, June 7 12:00PM, at the beginning of Mexico City Ciclopista (FFCC de Cuernavaca esq. Ejército nacional, Polanco) Chapultepec's Lions' entrance, at the crossing of Lieja and Reforma.

Share the awareness. There are very good promotional pictures. And collective nudist activities are quite fun, experiences to remember for life.
Submitted by gwolf on Mon, 04/28/2008 - 13:39.
I like them. And if there is such a thing, I hope they carry good luck with them - Not that I believe in good luck, but anyway - Yesterday was a very good day, in quite many fronts. And it's nice to make a nice, closed leap on so many bases:
>> puts [was,am].map {|age| [98,111,100,120].map {|s| sprintf "%#{s.chr}", age}.join(', ')}
11111, 37, 31, 1f
100000, 40, 32, 20
And just for coolness sake: It gets even better when looking at coincidence with my father - at least for the next couple of months:
>>puts [f_was, f_is].map {|age| [98,111,100,120].map {|s| sprintf "%#{s.chr}", age}.join(', ')}
111111, 77, 63, 3f
1000000, 100, 64, 40
So, in most useful systems, we are both in a very nice and closed number. Sadly, I can no longer say that five bits should be enough for anybody.
Submitted by gwolf on Fri, 04/25/2008 - 20:06.
I'm about to leave for Monterrey, Nuevo León, some 700Km North. Why? Because I was invited to be at the Monterrey FLISOL. And what exactly is a FLISOL? A very nice and interesting idea: Festival Latinoamericano de Instalación de Software Libre, Latin American Free Software Install Festival.

So far, I have stayed away from install-fests. I don't like them. And I will keep what I have always said: I am going because I was invited to talk about network security (of course, giving more than a little bit of relevance to Free Software as the IMHO only way to get to a decent level of security). But I do want to be part of this. It is large. Very large. So large, you don't want to miss out.
According to Beatriz Busaniche, FLISOL will be simultaneously held in 210 cities all over Latin America, in Argentina, Bolivia, Brasil, Chile, Colombia, Costa Rica, Cuba, Ecuador, El Salvador, Guatemala, Honduras, Mexico, Nicaragua, Panama, Paraguay, Peru, Uruguay and Venezuela. In short: everywhere.
Spread the word. Spread the love. Spread the fun!
Submitted by gwolf on Thu, 04/24/2008 - 22:38.
One week ago, I went to a branch office of Servicio de Administración Tributaria, the government office in charge of processing taxes. This year, I plan on doing something quite bold, as my Mexican friends will acknowledge: I will prepare my (quite simple, I hope) tax declaration by myself. I do not want to be held hostage of the accountant guild - So I might end doing some fuckup which in the end costs me money or time. I hope it is not the case.
Anyway... Last week I went to this office, as I needed either a CIECF (Clave de Identificación Electrónica Confidencial Fortalecida - Strengthened Confidential Electronic Identification Key) or a FIEL (Firma Electrónica Avanzada - Advanced Electronic Signature). No, please don't believe it is a security token, a card with printed numbers, a one-time-pad or the sort - The CIECF is... A password. Why is it strengthened? Because it has the feature of including a question, in case you forget the key, to allow you to change it. I guess the FIEL is a more reliable device, but I prefer not to even request it.
And as far as the questions go, the emergency questions for CIECF suck. First, I was not even asked the meta-question - I was not told why this information was needed. So imagine the clerk saying: Full name? ... Date of birth? ... RFC (Tax ID)? ... Favorite color? I was there just... Stunned. Why do you need it? Oh, just in case you forget your password. Ok... Don't you have any other questions which I am not prone to answer a different thing, and that are not dead obvious for a casual passer-by? (I guess that at least 1/4 of the public will say blue. Feel like brute-forcing SAT to its knees?) Other questions include your fathers' second family name, your favorite soccer team, your pet's name... It seems they took the first "security dos and don'ts" book off the wall, and started reading backwards.
But anyway, that's the system, and I must play nice with it. So I get back home, and decide to start hacking up my declaration. No, Mr. Policeman, I'm not saying I would try to break into the SAT - I just say it is a complex and non-obvious task to do. Now please release me. Thanks.
And I enter the system. Of course, I tried first with Iceweasel, knowing it would fail (it is documented: MSIE 5.5 recommended). I tried again with Konqueror. I tried, sigh, with MSIE from inside Wine. No luck. Well, even from within qemu's Windows 2000. Wrong password. WTF?! Stranger: It worked with SAT's My portal, although it didn't with the declaration, which is what matters now.
I cannot take the time every day to come to the SAT and move my data - It was a full week until I came back again. I insisted on fully logging in to the system, to be sure the password I entered this time was right. As well as my über-secret safety question, of course.
And it failed.
Twice.
Until the clerk noticed something strange in the way I typed...
Sir, excuse me..., he muttered, why are you typing such a long password? Well, basically because I value my tax declaration, and I know brute force is a powerful force. (explain it, of course, in simple terms) Oh... No, the password must be eight characters long.
No wonder.
So I entered the first eight characters of my password, which was a true work of prose for their standards, at around 20 characters. And it worked.
Now, for bonus points: What do we gather from the fact that the long password works fine in one system, but in another system it only the short version? Why, but of course! I guess the passwords for every economically active Mexican is stored in their master database in plain text. Isn't it just beautiful?
Anyway, it seems I have a lot of work to do. If all goes as planned, maybe next year I will be for hire as a public accountant? Hmh, does not sound too much like fun, does it?
Submitted by gwolf on Mon, 04/21/2008 - 15:52.
It seems everybody is ranting in Planet Debian about what our planet should be about, what content should be acceptable, whether technical-only, Debian-only, everything-goes... Even archiving the posts via a mailing-list interface has been mentioned. Besides, following the planet seems to have become mandatory to people linked to Debian, almost as mandatory as following debian-devel-announce.
I won't bother linking to other posts in this topic, as they are far too many. The whole discussion seems childlike and sterile to me. For different people, Debian means different things - This topic has come up in the planet a couple of times in the past (funny, hah, using posts in mutually-unlinked personal blogs as a way to follow a discussion). And a planet should IMHO cover a specific use case: Providing a place for those of us who think of Debian as a social frame, and value knowing -exactly- the type of information each of us publishes in his/her blog: What's up with Debian-related people's lifes.
Of course, a large fraction of this information should be somehow technical or Debian-related. But I do value having a place to learn about my peers' life accomplishments. To know if they are going through a hard time. To understand the personal interests of them. Maybe to learn I'm not the only DD who enjoys running (although I'm far under Dirk's or Christian's league) or cycling in a big city (although I lack MJ's political involvement and dedication). I actually like trying to find some logic in senseless Steve-like messages, there are some funny bits in his stuff. I like knowing I can share what I feel important about my life in a simple way with my peers, without having them drop over to my site. And yes, of course I do enjoy learning about the ongoing technical work of the bunch, even if it is often in fields I would not wander into at all (i.e. Simon's frustration with writing device drivers for Windows, Michal's advances on Gammu).
So... Please stop over-regulation. Leave the planet as it is. If you don't like it, come up with a way to filter and maybe adjust its content based on user profiles. But don't try to censor it.
Submitted by gwolf on Thu, 04/17/2008 - 12:28.
Wouter, you seem to enjoy using huge filesystem volumes. So, dear lazyweb...
I have a 500GB disk for my users' home partitions - they mainly use it to back up their desktop data, but I do expect them to give it more usage. Anyway - I am currently using around 350GB of it, leaving the rest still unpartitioned. I have switched over to ReiserFS, as online resizing it is way faster than online resizing ext3 - it's basically instantaneous.
It seems I do belong to the old sysadmin school, and I value highly the reliability that comes from not having filesystems too large for their own good - After all, recovering from failure in 10GB is way more probable than doing the same in 100 or 1000, isn't it? But then again, it's just impractical to create /home/samba/{1,2,3,4,5,6,7,8,9}/ and randomly split users' directories inside them. Most users won't use more than a couple MB, but some users (legitimately!) back up tens of GB... It's hard for me to anticipate their needs.
Does any of you have scary stories regarding huge volumes? Or any data supporting the idea that I'm just too old fashioned and that half a TB is a good partition size?
Note that I _am_ holding full backups :)
[update]: So I'm undoubtley an old fart? Everybody seems to have partitions larger than me. Ok, I will stop crying...
Submitted by gwolf on Mon, 04/14/2008 - 02:35.
Vicm3, you know I'd probably ignore this, as following internet memes goes against my principles. But what are the principles there, if not to break them?
Ok, so what you request is, basically, to get a list of sounds to build my life's soundtrack. Following the list you mentioned, it is quite exhaustive, creative and long.
In my case, some other time, I'd probably jump over some über-sarcastic Leo Masliah and the like. Particularly, I would not ever talk about my life without his Todo así.
But not today.
Today, I'd love my life's movie to be an old-fashioned, mute movie. Yes, quite in line with the nice grey life theme I've had on my blog for several months... I'd love having a nice, quiet, mute movie, just letting me live along, think a bit, work a bit... Settle down on too many things, lead to some peace.
No, this message bears no dedication to any character or person I have or will meet. Just inner my mood and needs.
Submitted by gwolf on Sun, 04/13/2008 - 17:17.
Of course, this post is about the results for the recent Debian Project Leader elections. Although I've written quite a bit about politics in my country, I cannot sadly hold any hopes for decent electoral (or post-electoral, or political in general) results here in Banana-land. All hail our de-facto president, BTW.
Anyway, on to happier realms. The DPL elections are over. Voter turnout was low, as Manoj pointed out, but it's not as low as I feared. And, /methinks, not only because of the shortened period - but because this was generally an easy-going election, with three quite good candidates. As CMOT pointed out in my previous posting on this topic, many people would have voted 111- (which means, for the casual reader, any of them is quite OK with me). Debian elections are voted with a very interesting system, the Condorcet method. Developers don't vote just for their favorite option, but rank all of the available options (including none of the above, or NOTA) according to their personal preference.
The final numbers are very worth noting - Excuse me for hot-linking the image, but I know many non-Debian people read this:

What is so unique this time? First, as I anticipated on my previous posting, all of the candidates are above NOTA. Not only that, they are all well over NOTA, with the smallest distance being 237 votes (out of a 401 total votes received).
Second, something very positive as well, the distance between the three candidates is quite large this time. In 2006, the distance between first and second place was 6 votes (reason for which, together with the proximity in their platforms of course, Steve was appointed Second in Command or 2IC by AJ). In 2007, Steve was (again) second place, eight votes under Sam. Looking a bit into the history, in 2003, the closest election we have had, Martin beat Bdale by four and Branden by 11 votes... No, the distance is not really that important in the end, as we are quite far from having political quarrels over vote results - But still, having nice, clear numbers feels much better. And as I said in a previous message as well, it somehow speaks of Debian being a more mature, stable project.
Anyway - Congratulations, Steve! Best wishes for a stressful year, quite probably full of travelling, presentations and work in general!
Submitted by gwolf on Sun, 04/13/2008 - 16:52.
This is the third plugin I have been working on for Rails - It's the one that still needs most work to be fully usable (for what I originally envisioned it), but is almost there - I have not touched it (nor the other two I recently presented here, acts_as_catalog and Real FK because real-life has demanded my time on various other fronts.
Anyway, this is IMHO the most interesting of the three plugins I've written so far.
So, following what I did with the other plugins: You can go to acts_as_magic_model's main page, or jump straight to its SVN repo. And the basic description follows:
Rails plugin to allow for extensible models, where inter-model relations are inferred from the database's structure, and not necessarily from explicit declarations in the models.
This means, when one of your models acts_as_magic_model, this plugin will try to infer all the basic relations (has_many, belongs_to and has_and_belongs_to_many) its base table has with other tables in the database, adapting the model correspondingly.
Using the plugin
In order to use this plugin, you only have to declare it in your model. As an example, say you have the proverbial project-management system, where you have projects (each of which can be of several different types) and people, and a HABTM relation between people and projects. So, you have the following tables (expressed as migrations here):
create_table :people, :force => true do |t| t.column :name, :string end create_table :project_types, :force => true do |t| t.column :name, :string end create_table :projects, :force => true do |t| t.column :name, :string t.column :project_type_id, :integer end create_table :people_projects, :force => true, :id => false do |t| t.column :person_id, :integer t.column :project_id, :integer end
Using acts_as_magic_model, you can skip declaring the relations in your models, like this: (of course, each of the classes still has to be declared in its own file)
class Person < ActiveRecord::Base acts_as_magic_model end class Project < ActiveRecord::Base acts_as_magic_model end class ProjectType < ActiveRecord::Base acts_as_magic_model end
And the gaps will be filled in for you - that is, you can go on and ask for Project.find(:first).people, ProjectType.find(:first).projects.size, Person.find(:first).projects.map {|pr| pr.project_type}, and whatever you fancy.
In future versions of the plugin, I expect even to get rid to explicitly declare the class declarations.
Of course, you should be warned: Initializing a model using this plugin is quite database-intensive. It will clutter your logs, and it might be unbearable if you use it in development mode. Still, its convenience is very often worth it.
Its main uses should be when prototyping and when designing a system that needs to be flexible to the data models themselves - If you don't expect your system's data structures to be highly malleable, you should probably use acts_as_magic_model only as a prototyping aid.
Submitted by gwolf on Wed, 04/09/2008 - 17:52.
As stated yesterday, I have recently worked on some plugins for Ruby on Rails, and I do think they are usable (and useful!) for audiences larger than myself. So, today I'll present here the second such plugin.
acts_as_catalog implements a really simple but really common pattern - Catalog-tables (or should I say catalog-models?) Granted, the amount of code this plugin saves is not very large, but it does add maintainability for our code-base, and includes basic unit tests. Of course, you can also taka a look at its SVN repo.
Models
A catalog is defined as a table with only a name column of string type, and with a unique index on it (this means, does not allow for duplicate values). Of course, more attributes can be added to a model which acts_as_catalog - they will just be ignored by this plugin. This plugin allows you to specify your model definition as:
def Mytable < ActiveRecord::Base acts_as_catalog belongs_to :some_other_table end
A catalog is often accessed to populate i.e. drop-down selection or radio boxes, passing what is called collections in Rails-speak. You will often want collections to be sorted by ID or by name, thus:
collection = Mytable.collection_by_id another_col = Mytable.collection_by_name
Migrations
You can specify all the catalogs you need to create for a specific migration with a single instruction from inside your self.up method, by giving a list of catalog table names to create_catalogs:
def self.up create_catalogs :countries, :states ... end
Likewise, you can destroy the created catalogs in a single command. The
drop_catalogs method will usually be the last thing you call in self.down:
def self.down ... drop_catalogs :states, :countries end
Tests
This plugin provides the base functionality to include in your unit tests ensuring the catalog is properly declared. Just include ‘catalog_test_helper’ and include the CatalogTest mixin in your test classes, declare the model name, and off you go. This is, a complete unit test for you Mytable catalog model could be:
require File.dirname(__FILE__) + '../test_helper' require 'catalog_test_helper' class MytableTest < Test::Unit::TestCase include CatalogTestHelper def setup @model = Mytable end end
Submitted by gwolf on Tue, 04/08/2008 - 20:42.
I have mostly shifted my main development language to Ruby, as most of the work I do tends to be pretty well covered with Rails. That's not new, however - What is new is that I feel I have got to the point where I actually have something to share. And it feels very good.
So my next couple of posts (three, actually) will be covering some plugins I've written. They are, of course, just sketched - but they work reliably enough to be deemed as useful by their author ;-)
Today I will start by blogging about RealFK. Of course, I will be copying from its documentation/description - I wrote it as well, so I'm not really plagiarizing my own site. I'm not suing self. You can of course also browse the RealFK SVN tree.
References
Rails is built upon a "dumb database" concept. Rails assumes the database will not force restrictions upon the user - i.e. that the model validators are all there is. But I disagree ;-) I was raised with PostgreSQL, not with MySQL, and I do believe the database can and should impose sane values - It should impose trust on the data..
So, if you want to create a relation field, properly acting as a foreign key and refering to another table, instead of doing it via the ActiveRecord::ConnectionAdapters::TableDefinition#column (or even ActiveRecord::ConnectionAdapters::TableDefinition#references) methods, declare them with add_refrence:
def self.up create_table :proposals do |t| (...) end create_table :proposal_types do |t| (...) end create_table :proposal_statuses do |t| (...) end add_reference :proposals, :proposal_types add_reference :proposals, :proposal_statuses, :null =>false, :default => 1 end
The corresponding fields ( proposal_type_id and proposal_status_id, respectively) will be created in proposals, and the RDBMS will impose a Foreign Key constraint. The references can be removed via remove_reference, i.e., for inclusion in down migrations:
def self.down remove_reference :proposals, :proposal_types remove_reference :proposals, :proposal_statuses drop_table :proposal_statuses drop_table :proposal_types drop_table :proposals end
Of course, in this case the remove_reference call is not really needed - But if you are dropping a table that is referred to from a table that will remain existing, you will have to remove the foreign key constraints (that is, the referring columns).
Join (HABTM) tables
When you define a simple has_and_belongs_to_many (HABTM) relation in your model, you are expected to create an extra table representing this relation. This is a very simple table (i.e. it has only a row for each of the related table‘s IDs), and it carries foreign key constraints.
Please note that join tables are not supposed to carry any extra columns - If you need to add information to join tables, think twice and better use a has_many :elements, :through => :othermodel declaration, and create the othermodel table manually. To create a HABTM table representing that each person can attend many conferences and each conference can be attended by many people:
def self.up create_table :people do |t| (...) end create_table :conferences do |t| (...) end create_habtm :people, :conferences end def self.down drop_habtm :people, :conferences drop_table :people drop_table :conferences end
The last call will create a conferences_people table (according to Rails' conventions, table names are sorted alphabetically to get the join table‘s name).
Note that in this case, in the down migration, the drop_habtm call must appear before the drop_table calls, as it carries foreign key constraints.
Submitted by gwolf on Fri, 04/04/2008 - 23:47.
Some readers might not now that Debian is in this annual process where we vote for our Leader for the following next year.
I just submitted my vote.
I think it is worth mention that this year there is very little discussion on this subject among DDs. Also, I've practically seen nobody publicly posting their votes or preferences, as it is usual (well, usually we get maybe 10 votes posted to the planet or the different lists).
It must be related to the fact that this year we have neither a candidate or quasi-candidate who raises passions for or against (as the two last years), nor there are very significant differences between the three candidates. They are all quite OK, IMHO, uncontroversial.
This years' elections will probably be the first (at least, since I was accepted in the project) where no candidate is ranked below None of the above. And that, I think, is a good sign. It might be more boring, but shows maturity ;-) And yes, it also shows off good work from our current (and active, and much loved) leader, Sam.
...And yes, I'm not posting my vote either. As things are, the platforms/rebuttals/debate did shape my vote a bit, but the main differentiator ended up being... My personal relationship and opinion towards each of them.
Submitted by gwolf on Fri, 03/28/2008 - 22:49.
Can I do anything but to smile while posting?

|