Search Results: "tachi"

21 December 2007

Russell Coker: A Better Design for Child Seats

The current method of carrying young children (less than 4-6 years old) in cars is to have a special car seat fitted in the back seat. This has several significant problems:
Some car companies are offering child “booster seats” that are an optional attachment to the rear seat (I first noticed this when reviewing the specs of the latest version of the car I drive - the VW Passat [1]). This is a good idea, but it doesn’t go far enough. The best thing to do would be to provide a selection of back-seat assemblies as factory fitted options which have built-in baby and child seats. The combinations that would be most desired are:

  1. Standard car back-seat for three adults (or two adults for a small car).

  2. A regular seat (for an adult) at the road side of the car combined with a baby (backward facing) seat at the kerb side.

  3. A regular seat (for an adult) at the road side with a young child (forward facing) seat at the kerb side.

  4. A baby seat at the road side with a young child seat at the kerb side.

  5. Two young child seats.

It would be quite possible to have all five of these options available from the factory. Of course there are corner cases that this doesn’t cover such as twins or parents who have two children so close together that they need two baby seats. For those cases option 2 combined with one of the current off-the-shelf baby seats would do. The number of different supported options would need to be kept reasonably small to reduce manufacture cost and to allow a reasonable market for second-hand seats. One thing to note is that it’s recommended that the first forward-facing seat a child uses is smaller than the later one. Having options for three different built-in baby/child seats (rear-facing and two sizes of forward-facing) would significantly expand the number of combinations (and thus the expense). I suspect that the safety benefits of having an ideal method of securing a forward-facing child seat would compensate for the disadvantage of having it be too large for the child when they are first placed in it. Another possibility would be to replace the rear seat with a more solid bench with bolt holes for baby and child seats. Securing a child or baby seat to a hard surface with bolts would be a much less technically demanding task than using a seat belt (and thus could be done correctly without expert assistance). Child and baby seats would have to be redesigned for this (I suspect that the safety of them relies on being attached to a soft surface), but after that I expect that safety would improve. For this option the rear seat could bold on to a hard surface that’s suitable for attaching child/baby seats so it would simply be a matter of removing the rear seat and installing the child/baby seat(s). The most common car design in Australia includes a 60/40 split rear seat (meaning that if you have a large item to store in the boot/trunk then you can fold down 40% or 60% of the back of the rear seat to allow the luggage to extend into the passenger compartment). This split could be extended to allow removing the base of the rear seat for 60% or 40% to bolt on child/baby seats. Once a car model had been designed for replacing the rear seat there would be other options available. For example replacing the rear seat with luggage storage space. While almost all cars allow folding down the backs of the rear seats to store extra luggage the option of removing seats that you don’t need to give even more space is not common at all (I’ve only seen it advertised as a feature in vehicles with 6 or more seats). I expect that if this idea was implemented it would allow a small car such as a Toyota Corolla to give an equal or greater amount of usable space for children in the rear as a larger vehicle such as a Toyota Camry. While better options for luggage storage would allow people who don’t have children to use a small car while still being able to carry the luggage that they desire. This would allow considerable savings on car purchase prices and fuel use. I expect that a reduction in fuel use world-wide could be achieved by removing the pressure on parents to buy large cars! The poor support for child seats in cars is really surprising. One of the features that could be introduced is both top and bottom mounts for such seats. There is apparently a standard for this, some (not all) cars support it, but most baby seats apparently don’t. So baby and child seats are secured at the top (to a hook that’s bolted securely to the car frame and which was designed specifically for the purpose) and at the bottom to the seat-belt which was never designed for such things. It’s a pity that some of the money spent on supposedly protecting children from drugs couldn’t be spent on making cars safer for them. The government is in the best position to force car manufacturers to improve their safety features while parents are in the best position to teach children about the dangers of drugs.

14 December 2007

Martin F. Krafft: Surveys on the console

As part of my research, I may have to conduct a survey among Debian contributors. The word "survey" usually elicits frowns because surveys are often misconducted. MJ has taken the time to draft up some advice to surveyors. Problems with surveys generally fall into one of two categories: content and presentation. I'll refrain from making statements about content (Wikipedia has some stuff on questionaire construction) and instead concentrate on presentation in the following. Commonly in the digital age, surveys are administered via a web page or e-mail. In my recent Ph.D. transfer report, I identified a number of shortcomings with these approaches: Asking Debian contributors to click radio buttons on a web page is a bit like expecting a mountain biking champion to ride a tricycle across a paddock: painful, if not offensive. Furthermore, web surveys can only be taken while on-line, when most of us have better things to do. E-mail surveys address some of these problems, but create new ones: answers cannot be constrained to a domain (think multiple-choice), character set and formatting issues make evaluation difficult, and it's impossible to prevent users from attaching comments or modifying responses. In thinking about the issue, I came up with a third means to administer a survey: a console tool. Think of a Debian package which provides a console application controlled by a study-specific data file. The data file specifies the questions and their answer domains, and the tool presents those to the participant. Since most of Debian happens on the console anyway, such an approach to surveys seems more appropriate. Interaction with the survey tool would be as easy as pressing the 2 or 4 keys to select one of the multiple choices, and the tool would immediately move on to the next question (and not wait for the user to hit enter). Obviously, n and p should allow navigation back and forth across the set, and c would spawn a text editor to give the user a chance to attach a comment to his/her current response, in which s/he might criticise the question or provide additional information. Finally, the tool should be able to pick up where it left off, should the user chose to exit/suspend the survey for now. Integration with debconf or another interface abstraction is also worth consideration. There is more to it: people change their minds and should thus be able to amend responses. With their consent, it might be valuable to track such changes and inquire about their motivations. As I was thinking about how to realise this, I suddenly arrived at version control: use Git as a backend storage. The set of cool features this would enable seems to be endless: it works off-line and can be used to track aforementioned changes, but also offers the possibility to create a squashed result in case the participant prefers to submit only the final result. Furthermore, it's a trivial change between anonymous submissions, and submissions authenticated by a GPG signature. In addition, the survey tool should be able to display questions according to previous responses (control flow). For instance, if the survey determines that a given user is a contributor to the bug tracking system, but not a project member, it wouldn't make sense to ask when s/he received his/her Debian account. Furthermore, questions could be dynamically creatable from context, so that the survey can drill into depth depending on previous responses, rather than asking the same questions to all participants. I am currently applying for funding to outsource the development of such a tool. If you are interested in coding it up and getting paid for it, speak to me. Here are some more specifications to keep in mind before jumping on: These are likely to be incomplete, but should convey the basic picture. Feedback is always welcome! NP: Oceansize: Frames Update: James Andrewartha pointed me to purity, which asks multiple-choice questions on the console. It has the kind of interface which I envision. Also, Chris Lamb suggested this personality survey as a base line. Well, actually he just suggested I look into it.

24 October 2007

Steve Kemp: With many a winding turn

GNU Screen rocks, in general, but recently I've been using it a lot for custom applications and have discovered a pair of annoying bugs. If you're not familiar with it then please read this GNU Screen tutorial - it really is worth getting to know! Anyway onto the bugs: The two are related, but I'm not yet sure whether I should report bugs against the Debian package and the code is sufficiently cryptic that I cannot create a fix yet. Taking the bugs in reverse order please try this:
screen -S foo
[detach]
screen -S foo2
[detach]
At this point you should have two screen sessions "foo" and "foo2". You should be able to attach to them by running "screen -R foo" or "screen -R foo2". Lets try that:
skx@vain:~$ screen -R foo
There are several suitable screens on:
        22317.foo       (Detached)
        22342.foo2      (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
Even though foo should be sufficient to identify a unique screen, the first one, it doesn't let you attach. Nasty. (Yes, you can attach to it if you use the number/number+name:
screen -R  22317.foo 
The second issue is related. Create a screen session with "screen -S 222". Now try to attach to it with "screen -R 222" - instead of attaching it gives you a brand new screen. Ugh.

17 October 2007

Russell Coker: Insider Threats and Small Storage Devices

Danny Angus writes about the potential threat posed by small storage devices with large capacity [1]. His post was prompted by a BBC article about Hitachi’s plans for new hard drives [2], they are aiming for 4TB of data on a single drive by 2011 and a 1TB laptop drive. One thing I noticed about the article is that they made the false claim that current drives are limited to 1TB, the storage capacity is determined by the total surface area which is proportional to the square of the radius and the height of the drive (AFAIK there are no practical limits to the number of platters apart from the height of the drive). So if a 5.25 inch hard drive was to be manufactured with today’s technology it should get a capacity equivalent to at least three times the capacity of the larger 3.5 inch drive. The reason that 5.25 inch drives are not manufactured is that for best performance you want multiple spindles so that multiple operations can be performed concurrently. Using 3.5 inch drives in servers allows the use of more disks for the same amount of space in the rack and the same amount of power. The latest trend is towards 2.5 inch (Small Form Factor AKA SFF) disks for servers to allow more drives for better performance. With 3.5 inch disks a 1U system was limited to 3 disks and a 2U system was often limited to 4 or 5 disks. But with 2.5 inch drives a 2U server can have 10 drives or more. I know of one hardware vendor that plans to entirely cease using 3.5 inch drives and claims that 2.5 inch disks will give better performance, capacity, and power use! In regard to Danny’s claim (which is entirely correct) about the threat posed by insiders. I don’t believe that a laptop with 1TB of capacity is the threat. In a server room people notice where laptops get connected and there are often strictly enforced policies about connecting machines that don’t belong to the company. I believe that the greatest threat is posed by USB flash devices. For example let’s consider a database with customer name (~20B), birth-date (10B), address (~80B), phone number (~12B), card type (1B), card number (16B), card expiry (5B), and card CVV code (3B). That’s ~155 bytes per record in CSV or TSV format. If you have data for a million customers that’s 155M uncompressed and probably about 50M when compressed with gzip or WinZip (depending on which platform is being ripped). No-one even sells a USB flash device that is smaller than 50M, I recently bought a 2G flash device that was physically very small and cheap (it was in the bargain bin). The next issue is, what data might be worth stealing that is large enough to not fit on a USB device? I guess that if you want to copy entire network file shares from a corporation then you would need more than the 16G that seems to be the maximum capacity of a USB device at the moment. Another theoretical possibility would be to copy the entire mail spool of a medium to large ISP. For the case of a corporate file server you could probably get the data at reasonable speed, 1TB of data would take 10,000 seconds or 2.8 hours to transfer at gigabit Ethernet speeds (if you max out a GigE link - it could be as much as five times that if the network is congested or if the server is slow). It’s doable, but it would be a rather tense three or more hours waiting by an illegally connected laptop. For the mail server of a large ISP there is often no chance of getting anywhere near line speed, it’s lots of small reads and seek performance is the bottleneck, such servers are usually running close to capacity (and trying to copy data fast would hurt performance and draw unwanted attention). Another possibility might be to copy the storage of an Intranet search device. If a company has a Google appliance or similar device indexing much of their secret data then copying the indexes would be very useful. It would allow offline searches of the corporate data to prepare a list of files to retrieve later. It would probably be more useful to get online access to the data from a remote site. I expect that an unethical person could sell remote access to someone who is out of range of extradition. All that would be required would be to intentionally leave a flaw in the security of the system. In most large corporations this could be done in a way that is impossible to prove. For example if management decrees that the Internet servers run some software that is known to be of low quality then a hostile insider could make configuration changes to increase the risk - it would look like an innocent mistake if the problem was ever discovered (the blame would entirely go to the buggy software and the person who recommended it). A large part of the solution to this problem is to hire good employees. The common checks performed grudgingly by financial companies are grossly inadequate for this. Checking whether a potential employee has a criminal record does not prevent hiring criminals, it merely prevents hiring unsuccessful criminals and people who have not yet been tempted enough! The best way to assess whether HR people are being smart about this is to ask them for an estimate of how many criminals are employed by the company. If you have a company that’s not incredibly small then it’s inevitable that some criminals will be employed. Anyone who thinks that it is possible to avoid hiring criminals simply isn’t thinking about the issues. I may write more about this issue in a future post. Another significant part of the solution to the problem is to grant minimum privileges to access data. Everyone should only be granted access to data that they need for their work so that the only people who can really compromise the company are senior managers and sys-admins, and for best security different departments or groups should have different sys-admin teams and separate server rooms. Of course this does increase the cost of doing business, and probably most managers would rather have it be cheap than secure.

23 July 2007

Ross Burton: Katachi Update

It appears that some people actually want to see Katachi in action before they try it. I can't imagine why, it only requires two libraries to be installed from version management, both of which are slightly obscure. So, here is a screenshot. Katachi Also some other people don't know where to get GVFS and GtkImageView from. This is the git tree for GVFS, and GtkImageView is here. GtkImageView 1.1.0 should work fine if you fix the trivial compile warnings, so maybe I should ditch my local SVN checkout and use the release for now.

22 July 2007

Ross Burton: Announcing Katachi 0.1

Over the last few months I've been hacking on (yet another) image viewer for GTK+, using the hot new GVFS library (go Alex!) for asynchronous file handling and GtkImageView because I'm lazy. It's got a pretty lean interface at the moment and is fairly fast in use. My goal is to use it on my Zaurus for reviewing images from a CF card in the field, so performance is quite important to me. As the primary users are photographers, filenames are not shown in the interface (just thumbnails). There is a lot of work left to do, but I've used 0.1 for some time now. The source is being developed in a Bazaar branch at http://burtonini.com/bzr/katachi. I've just tagged a 0.1 release, a tarball of which is here. You'll need to build GVFS from git, and GtkImageView from svn, sorry. :) NP: Closes Volume 1, Boards of Canada

27 June 2007

Adam Rosi-Kessel: Email Disclaimer Enforceable?

If you’ve received email from an attorney in the last five years, you’ve probably seen some version of a boilerplate warning/disclaimer in the message footer, indicating that the message may be privileged (or in some cases, asserting that the message is privileged!) and telling the receiver to destroy and/or return all copies if they are not the proper recipient. In the last couple of years, almost everyone has also added a statement to the effect that this email does not contain illegal tax advice (or if it does contain such advice, you shouldn’t use it!) Cumulatively, I’m sure we’ve used gigabytes if not terabytes of bandwidth attaching this text to every email sent. My question to the world: is anyone aware of such an email disclaimer ever being enforced or held enforceable?

13 June 2007

Eddy Petrișor: Your next Gnome subversion client...

... is NaughtySVN.

I have joined this project which was started by Alexander Thomas a few weeks ago and I have convinced him that is better to have a release sooner rather than later. The project is still in its early alpha stage[*] but I thought is better to have a rather minimalist and functional client first.
So, I talked to Alexander and we came up with a roadmap; for the 0.0.1 release I am working on the update feature which is about 40% done[1][2] (update dialog screenshot).

Of course, after the release I will probably make a debian package, too, unless someone else beats me to it :-) .

So, the future is bright.


Update: as a response to a comment, NaughtySVN is designed to be not only a Subversion client, but also a framework for other VCS-es and other clients. It just happens that we are working on the Subversion backend and client at the moment.

P.S.: as curiosity of mine, I have written in python a small nautilus plugin that does the svn update (is a svn frontend) and I must say I really miss the development speed of python when writing in C (or maybe I am out of practice).

[*] only a few features are implemented and can't be used yet as a SVN client without being forced to use another client.
[1] according to my estimations
[2] update related code is not committed yet

27 January 2007

Martin F. Krafft: Prog bands worth checking out

Via Porcupine Tree and in close cooperation with Hanspeter, I've spent a large part of the past couple of months listening to not-so-well-known progressive bands. Here's a list of bands worth checking out if you're into this kind of music. I'll refrain from attaching bla bla to them. There's no order other than a trend from rock to metal. Contact me if you're looking for specific album recommendations, or have any band/album recommendations to offer! NP: Katatonia / Viva Emptiness Update: multiple people have recommended King Crimson, a band that I know very well in fact (it was the only band I've ever followed on a tour). I guess the above list is about not-so-well-known bands. I did not include Gensis, Yes, Emerson Lake Palmer, Jethro Tull, etc. either. And I think I am leaning more towards progressive metal these days. Update: as Alexander Wirth points out, Dream Theater is not unknown, and he's right. So be it. :)

8 January 2007

Maximilian Attems: Unbreakable IBM

Three letters corporations don't inspire confidence (junk code, big tactics, ..). Nevertheless Thinkpads i will miss you. My current workhorse is a x41 Thinkpad. The default model has a bad battery life. Yeah the x40 are cool and with much better battery life out of the box, but they need this mad atheros binary hal junk (the ath free replacement goes nowhere right now :(. No i won't taint the running kernel. So just buy a battery upgrade and be happy.
In August cycling i got badly hit by a car. Making a cool stunt on asphalt with a crashed helmet and hurt everywhere. The laptop being unprotected in backpack. No complaints from the X41. Throw it across rooms and it happily boots. Exposing it to dust did not cause any high pitch noise like some earlier Vaio.
As Thinkwiki will tell you the Hitachi hdd are not really worth to put data on them. I got mine easily exchanged 2x. I wouldn't care less thanks to git, imapd and frequent backups.
As you can probably imagine the story of unbreakable doesn't stop here, but i won't leak current experiences "nancy" had to endure. Anyway i wanted to join in the Thanks to all the peoples that make Debian the pleasure to hack and work on! Big props to the Release Team for coordinating the fine Etch product.

30 December 2006

Stefano Zacchiroli: trac.cs.unibo.it

Experiences with a Trac Server In the last few days after Xmas I set up http://trac.cs.unibo.it, a server for my CS department which will host a bunch of Trac instances, initially for academic projects only then it will be opened to student projects as well. The server set-up has been "powered-by" the following technologies:
  1. Debian Etch
  2. Apache 2.2 with FastCGI, SuExec, and WebDAV over TLS (for accessing SVN repositories without forcibly passing through Trac)
  3. Trac instances backed by Sqlite databases and Subversion repositories
  4. Some bits of Genshi templating for generating the projects index
  5. Some shell scripts for automating creation and removal of projects
I'm quite happy with the result. From the overall experience I drew some observations though: Happy new year birthday trac.cs.unibo.it.

25 December 2006

John Goerzen: Memories of Christmas, part 1

Merry Christmas to everyone today!

Today, and for the next few days, I'm going to write about some of my Christmas memories from earlier years. Then I'll finish up with some photos from this year.

This post is about Christmas at home growing up.

One of the first signs of Christmas happened when my dad put up the lights on the outside of our house.



My brothers and I had (and still do) stockings that got one piece of candy per day during December, then got stuffed full when we opened our presents. The tree went up over the Thanksgiving weekend, and it was always a lot of fun to help with that.



On Christmas Eve, we'd always go to the program at church. It was the kids' Christmas play. Church would be packed. On the way out, everyone got a gift sack with fruit (apples or oranges), some peanuts, and maybe some candy. Then we'd go home. Mom or dad would read the Christmas story from the Bible, and after a prayer, it was time to open presents. In addition to the regular presents, dad would always give us a large paper gift sack. It would usually have a 12-pack of pop and some sort of nut (peanuts, pastachios, or maybe peanut brittle).

Sometimes we'd all stand still long enough for a photo.



We'd usually stay up late into the night Christmas Eve and sleep in on Christmas day.

3 December 2006

Wouter Verhelst: Lessons learned

  1. Do not attach an RJ45 plug to a cable right above a laptop's keyboard.
  2. When ignoring the above, make sure you do the cutting somewhere else, so that the little pieces of throwaway cable do not fall on top of your keyboard.
  3. When ignoring the above, turn the laptop upside-down, rather than trying to push down one of the buttons in an attempt to more easily reach the little cable thing.
  4. Cable bits in a keyboard can really mess it up.
  5. Laptop keyboards are even worse to reassemble after removing the keys than are desktop keyboards.
  6. Attaching a space bar to a laptop keyboard is a horrible puzzle, which is likely to take you about an hour to figure out if you've never done so before. Once you have, though, and understand the procedure, it takes only a few minutes to do properly.
  7. Mail sucks. No, that's not related to any of the above, but it still does.
At least I didn't break any parts this time. Progress.

5 September 2006

Adam Rosi-Kessel: New York City Labor Day 2006

We spent the extended weekend in New York City, visiting many friends. Particularly noteworthy was our dinner with my Cousin (Dr.) Matt at Gobo, “Food for the Five Senses.” (The website, by the way, is a fairly effective combination of Flash where helpful and HTML where Flash is unnecessary.) Gobo served quite possibly the best vegan food I’ve ever had. I might even say the best vegetarian food I’ve ever had. (Since I’m a vegetarian, I guess that might just make it the “best” food.) Our dinner included: Too bad Boston has nothing comparable. Every time I travel to New York I wonder why Boston can’t borrow at least some of the best ideas — for example, a functional mass transit system. Some other highlights — click on any image for a full-size version: Esther watching the traffic go by
Buildings
A Fountain
The view from my cousin’s rooftop

18 July 2006

Martin F. Krafft: XFS -barriers +write-cache considered harmful

If you have an XFS filesystem on hardware without barriers (or with broken barriers as was the case on my X40's Hitachi drive) and with write-caching enabled, disable the latter NOW (the following will work for PATA drives, and SATA if you have a [rd]ecent kernel):
apt-get install hdparm
df -T   egrep ' xfs '   sed -rne 's,(/dev/[sh]d[[:alpha:]]).*,\1,p' \
    sort -u   while read disk; do cat <<_eof
$disk  
  write_cache = off
 
_eof
done >> /etc/hdparm.conf
/etc/init.d/hdparm start
Also see http://oss.sgi.com/projects/xfs/faq.html#wcache . Anyway, damage mitigated. xfs_repair -d /dev/md1 feels funny when /dev/md1 is the root partition of your laptop and you're about to move to Ireland for six weeks, fully dependent on that machine. But yeah, XFS on a laptop is asking for trouble anyway. Call me masochist.

21 June 2006

Jos Parrella: FLISOL Caracas

The Latin American Free Software Install Party (FLISOL) will take place in 12 countries of the continent, including Cuba, and featuring Argentina and Colombia. In Venezuela, it’s happening in ten cities in several regions of the Country, including Los Andes, Los Llanos, the Central Region and the Paraguan Peninsula. I’m organizing the event in Caracas, which already has a webpage (in spanish) FLISOL will take place on March 25th, a Saturday, but in several cities of Venezuela we will have a two-day event. In Caracas, it will happen on Friday and Saturday. We will feature hands-on workshops and demonstrations (featuring a Debian GNU/Linux hands-on workshop), a Keysigning Party (it won’t be massive, though) and a Web Frameworks and Application Servers Forum, featuring Rails, Catalyst, J2EE, and Zope. I expected David to be in Caracas for the FLISOL, but he’s gonna travel to San Crist bal to participate in their FLISOL. I don’t expect a big attendance to the event (the Auditorium of the Science and Technology Ministry, the main sponsor, has capacity for circa 200 people) but I hope it becomes a fresh event, different from those we’re used to. This will be, also, a good preparation for the World Forum on Free Knowledge, the National Free Software Congress and the DebConf. I hope the main topic on the FLISOL will be the recent, terrible, awful, and completely disgusting Ubuntu security flaw.

8 June 2006

Martin F. Krafft: Missing the nipple

When I solicited feedback on laptops and subsequently settled for the Thinkpad X40 [0], I was still a little sceptical about that little thing sticking out the middle of the keyboard which serves as a mouse. I don't use the mouse much, but now, switching to a new desktop machine after my laptop has served as primary workstation for the past 4 months, I find I miss the nipple. After all, the nipple is the only intuitive interface. After that, it's all nurture.
[0]a choice which I've never regretted, except maybe because of the flakey Hitachi 4K60 drive IBM ships -- I've had 2 replacements already), I was still

6 April 2006

Andrew Pollock: [opinion] There's hope for Dell USA yet

Despite my dramas on Monday night with Dell USA, and I think thanks to the (much better) Dell APAC, I had my change of ownership expedited, and received an email today that it had been completed. So I again grappled with the abomination that is the US Dell support line. I might add that I could not find the number I called anywhere from http://support.dell.com, and had to rely on the dialled number history in my phone to call them again. I'd like to think that half of my customer service experience improvement was because I only spoke to someone in India once. They were able to pull up my laptop's service tag now, and transferred me off somewhere else. Except that wasn't the right place, and so they transferred me again. To the wrong place. At least the second person I was transferred to was able to see that I'd already been transferred twice, and used some special phone system secret powers to transfer me to the right place at last. I didn't even have to put up too much of a fight to convince them to ship me a new drive. When I told the lady on the phone that I'd run the Hitachi Drive Fitness Test and it'd failed the disk, and that it had been making nasty clicking sounds before that, she agreed to send out a replacement. Hopefully it'll arrive on Friday.

4 April 2006

Matthew Palmer: Rewriting in Rails -- A Practical Examination

[Note: this article was mostly written some weeks ago; I left it in my "to be edited" box and then promptly forgot about it. So any and all temporal references are way out of whack. Since originally writing this article, I have commenced an incremental rewrite of an in-house business management application from crazy-PHP (a common -- some may say overwhelmingly so -- dialect of the language noted for it's complete lack of any sort of good software development practices, such as the creation and use of functions (!)) into Rails. Articles on this effort will be appearing presently.] Almost immediately after I'd finished writing my previous discussion on why rewriting software is evil, I decided to make a little experiment. What I did was take a fairly well factored PHP application, and rewite (a portion of) it in Rails. My intent in this was not to produce a production-quality rewrite. I have no interest in proliferating yet more functionally equivalent clones on the world. Instead, I undertook the work simply to get a feel for (a) writing a whole, traditional, Rails app in a short space of time, (b) how quick Rails really was to produce an application, and (c) whether wholesale rewrites really are as boring and life-sucking as I imagined them to be. My methodology was this: with a small amount of knowledge of the target application (SysCP), the existing database schema and templates, and a weekend, rewrite as much of SysCP as I could in a close-as-possible reproduction of critical SysCP functionality. My summary results are: rewrites are as boring as I thought they would be, Rails is powerful but fairly complex and slightly buggy when you get down into it (especially if you're working from an existing -- possibly suboptimal -- database schema), but overall, Rails is Way Good Stuff. On the boredom aspect -- I had two days to write code. I had some domestic duties to attend to (walk the dog, visit the hardware store, help my wife with attaching a new bag rack to her bike, mow the lawn, etc) but on the whole, it was dedicated to programming. I've spent whole days (hell, 40 hour marathon stretches) cutting code before. I knew this wasn't a six-month deathmarch, but only a weekend experiment. Despite that, I feel that my motivation levels were lower than they normally are when coding. I can only imagine what it must feel like, two weeks into several months of hard core coding, knowing that you'll end up with what you had before, functionally speaking. If you are going to do the rewrite thing (and may the Flying Spaghetti Monster have mercy on your soul if you do), then pick the right project. SysCP is large masses of tangled PHP (is there any other kind?) but it has a fair amount of local and global structure once you get down to it -- for instance, it's quite well factored into business logic and display, and the code is broken down fairly logically by action handler, so you get entire source files that look like this:
  if ($action == 'edit')
   
    // 150 lines of twisty passage PHP
   
  else if ($action == 'new')
   
    // Another 150 lines
   
  // repeat for another few actions
and so on. The nice thing about this is that, if you have to look for how something works, you can almost certainly find it in one place in the source. Deciphering it might be another matter, but at least you've got something to start from. As I mentioned, the display in SysCP is pretty nicely split off from the logic -- a large number of templates, with common header/footer files, with some small parts in common templatettes. Some HTML is still generated within the actions, but due to the above action-based structure, it's usually fairly easy to identify all of the HTML that will be associated with a particular action and turn it into a coherent Rails template. I would dread doing a rewrite of the presentation layer of, say, IRM. It's idea of well-factored presentation is to separate print statements from logic by a blank line. To my great shame, I've had the reins of IRM for a year, and it's still this bad. I claim it's because I hate HTML coding with a vengeance, but I think I'm actually just scared to try and tame that particular monster. (Update: Martin Stevens has been doing some good work turning IRM's HTML into Savant templates. The only downside is that I can hear his manic laughter -- caused by IRM's insanity slowly infecting him -- all the way from England, and it's keeping me awake at night). I also had to re-learn that most hated but most important of lessons -- that, no matter how much reading you may have done, until you've cut chunks of code in a language or environment, you have no idea how it actually behaves in your brain. Specifically, I spent a fair amount of my alloted rewrite time learning a few little lessons in how Rails actually behaves, and all of it's cool little features. Of course, everyone is going to have this pain, and I've suffered it in every language that I've done any appreciable amount of programming in, but it's always a shock to the system that -- after all this time programming -- a new language still makes my brane tingle curiously for a while. Luckily, I'd read and digested all of both the Pickaxe (Programming Ruby) and AWDWR (Agile Web Development with Rails) so I knew what was possible, I just usually wasn't sure how exactly, so I spent a lot of time with my head in the books. Rails' little foibles also bit me in the bum more than once. For example, I spent over an hour (a no foolin' hour) trying to hunt down what I was doing stupid in my code to make Rails completely forget about the value of a couple of my fields. The answer turned out to be to restart Webrick (Rails' internal webserver for development testing), and the problem cleared right up. You could hear my screams of anguish from the moon (even through the vacuum of space -- it was a lot of anguish). Rails isn't the Final And Ultimate Solution To The Webapp Problem, but it's a good start. There is near-zero administrative bumf when you're writing a Rails app. Rails is fairly intelligent about working out what you want done from the world around it. Code generators (which produces sensible, minimalist templates -- not the ugly, unmaintainable behemoths produced by Visigoth Studio, which has given the whole code generation world a bad name) handle a lot of the low-level "oh bugger, I have to add a new file" feeling. It's very, very anal about project structure, but (in contrast to many other bondage-and-discipline frameworks I've looked at in the past) this structure seems almost comforting (maybe I'm just getting old and turning into a satisficer). What all this means is that you (a) don't write much code unless it moves you toward your goal, and (b) Common structure means that any Rails app will be fairly familiar to an incoming programmer. Unfortunately it also means that cunning wankers will, sooner or later, work out a whole pile of ugly tricks and contortions to get themselves out of Rails' comfortable-but-no-doubt-incompatible-with-many-people's-ways-of-thinking straitjacket, which I will (sooner or later) end up maintaining. Like many of Rails' (and Ruby's) features, though, I don't see them being any more abusable than most features of any programming language or environment -- and at least they're powerful and useful (unlike, say, register_globals, magic_quotes_gpc, magic single-character variables, mandatory indenting, or banning tabs as indent characters -- I thought I'd spread the slagging amongst lots of languages). Productivity-wise, although I was only just kicking off my Rails webapp knowledge, I felt I was doing fairly well. From experience, what I produced in my weekend was roughly on par with what I could produce in PHP in the same amount of time, had the situation been reversed. Considering that I have about 3 weeks of Ruby/Rails knowledge, and about 5 years of PHP experience, I think that's a big win. (Update: I've since produced a DNS management applet for work in about 6 hours billable time, and a virtual mail account application in about 12 hours, both using Rails. There isn't a hope in hell that I could have performed a similar feat in PHP, especially with the same amount of inherent flexibility that the Rails solutions contain). Overall, my impression of wholesale rewrites as being soul-sucking experiences stands. I suggest they be approached with the greatest of care, and only be permitted after an appropriate period of psychological counselling. There is plenty of code that needs rewriting (but why do I always have to find it?) but replacing it by doing an rm -rf on the source tree and starting again is not the answer.

18 March 2006

Daniel Burrows: So close, yet so far away...

So, thanks to Marc's helpful advice yesterday, I took another look at my power supply, and lo and behold, there was a second four-pin power cord that I hadn't seen!

Allow me to explain. In my previous post, I mentioned that I had been doing something "wrong" with the power cable. You see, the case we picked out (an Antec Sonata) has a 24-pin power cable of which 4 pins can detach for older systems. At first, I misread the manual and thought this was for newer systems, so I detached it and plugged it into the handy 4-pin plug next to the CPU. Doh. Having corrected that (without the extra 4 pins in the main plug, not even the fans turned on), I was under the further mistaken impression that the 4-pin plug on the motherboard was the backwards-compatibility plug. I did actually check for an extra 4-pin PSU connector, but I must have overlooked the one that existed.

In my defense, here's what the manual states about the power connector:


This motherboard provides two power connectors to connect ATX12V power supplier.

NOTE: This 24-pin power connector "ATXPWR1" is compliant to the former 20-pin type. Pay attention to the orientation when attaching the power cord. (Pin-11, 12, 23, and 24 should be left un-connected).

Note: It is recommended to connect to a power with 350W, 20A +5VDC capacity at least for heavily loaded system, and a 2A +5VSB capacity for supporting wake-up features.


Not exactly crystal-clear on what needs to be connected under what circumstances. The case manual is at least correct if you follow along carefully, and they even found someone who can speak the language. Unfortunately, this section is phrased in a way that's highly prone to misunderstandings, particularly if you have an incorrect idea lodged in your head to start with:

Connect the 24-pin Main Power Connector and the 4-pin +12V connector to your motherboard as needed. If your motherboard uses a 20-pin connector, detach the 4-pin attachment on the 24-pin power connector.


You have to read that quite closely to realize that there are two 4-pin connectors involved!


Anyway, so I can actually get the machine to post and boot. Unfortunately, it's highly unstable once it does boot. It runs for up to several minutes, but then exhibits various sorts of erratic behavior: freezing, spontaneous reboots, random error messages, that sort of thing. I've made sure all the cords are plugged in tightly and reseated a couple components (particularly the memory); about the only thing I haven't checked is the CPU+heatsink mess, which would be a real pain to disassemble and re-assemble.

Still, it's nice to make some progress. Maybe tomorrow I'll discover some other cable I forgot to plug in that will make everything work (hey, I can dream).

Next.

Previous.