Neil Schemenauer's Web Log

[Archives]

May 02, 2011

Hooray for paper

I like technology. Sometimes though the old ways are still best. I voted in the federal election this morning. I used a graphite pencil to make a mark on a slip of paper. It really was about as painless as possible. The simplicity of system greatly reduces the chances of fraud or failures.

I'm heading to the field soon. There exist a number of field record keeping systems based on PDAs, mobile phones or computers. For the foreseeable future I plan to continue to use a per-printed paper form, a clipboard and a pencil. Entering the data into the computer after the fact is not a serious problem. I'll let someone else be the technical pioneer in this case.

Neil Macdonald reports on Osoma's death

"The Devil likely died happy".

I hope American citizens will continue to fight to restore lost liberties. If you haven't seen it, The Power of Nightmares seems fitting at this point given that some of the news reporters are asking what this means for the leadership of al-Qaeda.

Why We Fight is also worth watching. The notion that terrorists attack because they "hate America's freedom" is ludicrous. To effectively fight someone you really should be clear on their motivations.

November 26, 2010

Sasktel's new 3G+ network

Sasktel has been recently bragging about their new "3G+" network. For a change, it actually is something worth bragging about. Cell phone technology is extremely complicated. There is an old saying that the good thing about standards is that there are so many to choose from. Cellular network people have taken that idea to a whole new level.

Johannes Lindenbaum has a pretty good explaination of the situation. In summary, Sasktel, Telus, and Bell are all deploying UMTS/HSPA networks that use the 850/1900 MHz bands. New phones will have SIM cards and so you can switch phones just by moving the SIM card. People in other countries had this feature with their GSM phones for long time already (many places it is required by law). We North Americans are a little slow.

The buzz is that Sasktel is selling SIM cards to be used with unlocked phones. This is much bigger news than the supposed superior data speed of the "3G+" network, IMHO. People have already been buying iPhones elsewhere and then buying a $10 SIM card from Sasktel to activate them. Obviously you still have service fees but being able to buy and sell phones and easily move them between providers is a huge deal.

Want to buy a phone to use on the Sasktel 3G+ network? Minimally, it must support UTMS on 850 and 1900 MHz. That will give you voice service. Watch out, some phones support GSM on 850 and 1900 and UTMS on 900 and 2100 and sometimes the labeling can be confusing. Most UTMS/HSPA networks in the USA use the 900/2100 bands and those phones will not work. AT&T uses 850/1900. The phone should support HSPA if you want data services (I'm not sure about the difference between HSPA, HSPA+, and HSDPA). The phone needs to be "unlocked". Because phones are often sold at a loss, companies lock them to a single SIM card so they have to be used on a certain network. Courts have ruled that it is legal to break this "lock" (usually you just need a numeric code) so you can use any SIM. If the phone does not come unlocked you can usually pay someone to unlock it for about $20.

One final note, you don't need a "smartphone" (another marketing term) or a data plan to get on the 3G+ network. All you need is a phone that supports UTMS on the 850/1900 Mhz bands. Finally take this information with grain of salt. I'm not an expert so do your own research before spending big money on something like a Nexus S. ;-)

February 23, 2010

Using Git to checkout the Python source code

The Python developers have decided to move from Subversion to Mercurial. However, that's taking some time to implement. For those who want a DVCS now, there are Git repositories on svn.python.org that allow efficient use of Git. I wrote a set of instructions on the Python wiki. The initial setup is a little complicated but day to day use is convenient, IMHO.

Why would you want to use Git? I can only speak for myself, but I was an early adopter of Subversion. I lead the push while at the MEMS Exchange to switch from CVS to Subversion (version 0.17.0 in 2002, I believe) . At the time, CVS's extremely poor support for moving and renaming files was hampering our ability to refactor our source code. Subversion was a definite improvement and is still a decent choice for an internally developed project. It's model of svn up doing a rebase of local changes is intuitive for most users.

Subversion still has a number of deficiencies for serious developers. For one, the handling of multiple branches of development is awkward enough that many users avoid branches (I understand SVN is getting better in this regard). Less notable but just as importantly, IMHO, it lacks many tools for dealing with changes as patches. Often I would dump a change using svn diff, edit the patch, and the apply the new patch to a different branch. Since moving to Git, I rarely have to resort to manual patch editing (instead using tools like git rebase, git format-patch, git add -i, git cherry-pick, etc).

As a tip to someone dipping their toe in the Git waters, it is critical to understand the difference between merging changes and rebasing changes. Git sort of defaults to merging but in the vast majority of cases you want to rebase instead. As an example, for one of my projects I've probably done hundreds of rebase operations and only about three merges (those three are because we have a long lived branch for a variant of the software that can't be done using configuration files). When I speak of "merge" I don't mean what Git calls a "fast-forward merge" since that's not really a merge a all. Instead, the destination branch is a strict subset of the source branch and changes are just being appending to the head version. Subversion defaults to doing rebasing rather than merging. When you run svn up your local changes are being rebased on the HEAD revision from the repository.

Git definitely has a learning curve. When I first started using it I was often confused. However, after about a week I realized it was much better than any other VCS that I had experienced. I now consider a DVCS with similar capabilities an essential developer's tool, just like a good text editor.

January 31, 2010

Quixote 2.7b2 beta released

I released another Quixote beta about a week ago. I think it finally fixes the problem cased by Python 2.6's breakage of the ihooks module. What happened was that the when relative imports were implemented, the ihooks module got forgotten. If you use the 2.6 ihooks module and any package uses a relative import, you lose.

I've fixed the ihooks module in the SVN trunk and it will be fixed in Python 2.7. Quixote 2.7b2 works around the problem by shipping with it's own ihooks module.

October 28, 2009

H1N1 flu takes off

Take a look at the Google Flu trend graph. The Canada Health FluWatch report has a similar graph. Saskatchewan is starting to roll out the vaccine but I suspect it will be too late to help most people.

BTW, can the media please stop calling it "swine flu"? The CDC says "further study has shown that this new virus is very different from what normally circulates in North American pigs. It has two genes from flu viruses that normally circulate in pigs in Europe and Asia and bird (avian) genes and human genes."

Also interesting is that the best guess is that it's contagious one day before symptoms are shown. Based on that, I think it would be prudent for the government to shutdown schools and universities for a week or two. That would be a small cost in exchange to helping to avoid overloading the health care system.

No need to panic but given that fact that this virus attacks lung tissue, some caution would be prudent. Please consider getting vaccinated.

September 01, 2009

Low cost parametric CAD software

SolidWorks is cool but the price tag is sometimes difficult to justify. Alibre Design looks like a great deal at $99. Based on this YouTube video, I'm impressed by the focus of the company. I think it is important to decide what your software will focus on doing well, rather than trying to make it all things to all people.

Update: After a little research, I decided the deal was too good to pass up. Alibre Design really does cover most of the commonly used functionality of SolidWorks or AutoDesk Inventor. I suspect they are having the promotion because the next major version of the software is due to be released soon. Serious users will pay full price for the new version so it's a clever promotional strategy.

July 24, 2009

Poor performance of Radeon X800 (R430) with X

I've got a Radeon X800 GTO card in my desktop machine. It's an older card but it still has pretty good 3D gaming performance (it came out of the box with all pipelines enabled). I bought it a few years ago based on an ArsTechnica system building guide. I've been irritated for a while by it's poor performance in X but never bothered to look into the cause.

Yesterday I was tinkering driver problems for a Radeon 9600 HD (or some similar recent, cheap card). When using Ubuntu's fast user switching (i.e. multiple instances of X), performance goes to pot. It turns out that the driver can only use DRI and therefore acceleration on the first X instance. It's likely that the limitation will be fixed in an upcoming "radeon" or "radeonhd" driver version.

Anyhow, that tinkering session gave me a hint to my poor X800 performance. I suspected it was related to the XAA/EXA options. Sure enough, a peak at the Xorg.0.log revealed:

(==) RADEON(0): Using XAA acceleration architecture
...
(II) RADEON(0): XAA Render acceleration unsupported on Radeon
 9500/9700 and newer. Please use EXA instead.
(II) RADEON(0): Render acceleration disabled

Adding Option "AccelMethod" "EXA" to the Device section of the xorg.conf configuration file produced a huge speedup. The performance before was not awful but the improvement was dramatic. The configuration of X has gotten vastly easier over the years due to sensible defaults but it looks like they missed this one.

Repairing a Seagate ST3500320AS 500 GB drive

I recently had a Seagate 500GB drive die on me. The Linux kernel produced the following messages:

ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata4.00: failed to read native max address (err_mask=0x1)
ata4.00: HPA support seems broken, skipping HPA handling
ata4.00: ATA-8: ST3500320AS, AD14, max UDMA/133
ata4.00: 0 sectors, multi 0: LBA NCQ (depth 0/32)
ata4.00: configured for UDMA/133 (device error ignored)
scsi 3:0:0:0: Direct-Access     ATA      ST3500320AS      AD14 PQ: 0 ANSI: 5
sd 3:0:0:0: [sdb] Very big device. Trying to use READ CAPACITY(16).
sd 3:0:0:0: [sdb] 0 512-byte hardware sectors: (0 B/0 B)

The computer BIOS reported the drive as having 0 size. After much searching I finally figured out that I was facing what is known as the "Seagate 7200.11 0 LBA" problem. Essentially, a firmware bug causes the drive to get into a hung state. The only way to repair it is to use the 3.3V CMOS level pins connected to the serial interface of the drive controller and issue some (potentially dangerous) low level commands.

A good description of the fix procedure as been compiled by some owners of the drives. Seagate have not handled the bug well considering that apparently many drives are affected. The fix is not recommended for those unfamiliar with electronics as you can easily brick your drive.

If you want to attempt it, the trickiest part is finding a RS232 level converter that can work with 3.3 volts. You need a chip like the MAX232. I have a MAX232N on a AVR board but according to the datasheet it only handles 5 volts. I made a level converter for the MAX232 TX (out) pin using a N-channel MOSFET I had kicking around. You only need to convert the MAX232 output since the input will sense 0-3.3V logic okay. The MOSFET level converter circuit I used is very elegant. If you are going to attempt this, double and triple check that you have the RX and TX pins connected correctly (there is much confusion on the labeling of these pins). You want the T?OUT pin of the MAX232 (via the level converter) going to the RX pin of the drive (the rightmost pin).

After you have successfully run the commands, you need to upgrade the drive firmware to prevent the bug from happening again. My drive went from firmware version AD14 to SD1A. The good news about this procedure is that the data on the drive is intact.

My setup is shown below (MacGyver would be proud). setup

March 16, 2009

BBC: Obama wants to block AIG bonuses

It's progress that Obama thinks it's a problem but he should focus on the real issue instead of chasing after secondary effects. First, the US Treasury should have gotten voting shares instead of preferred shares for their cash infusion (despite the cries from risk-loving bank owners that "nationalization" is evil and un-American).

The second and much deeper issue is that corporations have to be made accountable to investors. The current corporate model just does not work. I don't have statistics but I would guess that the majority of the general public who own stock do not exercise their votes. That allows the board and the management to pay each other huge salaries and generally screw everyone else.

The third issue is that regulation of the financial industry is needed, despite what some conservatives might say. Businesses that are "too big to fail" are obviously either too big to exist or they must to heavily regulated to ensure they don't blow up. As someone who does not like big government, I would vote for the "split them up" strategy rather than for regulation.

[comments] [validate]