Tuesday, October 27, 2009

ECE-ocalypse Now

I love the smell of solder at 4AM in the morning.

I think I'm getting some serious brain damage.

Expand.

Wednesday, May 27, 2009

Looking Back...

...I was an idiot.

Was reminiscing the past and considered all the what if's and but's. Considered the branches my life could have taken. All the time, I hear people say the past is the past and the future is what I should look at. However, the only way to properly prepare for the future is to consider the past. It's important to consider all the mistakes I've made. Never be content with achievements and consider the flaws. They say no one can be perfect, but I can at least aspire towards perfection. Now, faced with life changing decisions, I can only revel in the past in order to consider my experiences in the hopes that previously acquired knowledge will bring me to the right decision.

There were so many "right" decisions that turned out to be the "wrong" decision. There were also seemingly "wrong" decisions that became "right" decisions. I'm at a lost trying to find the factors that will converge to the "best" decision. In the end, there is no end to the process. Every decision will bring about new experiences. That's why hope is important. Hope that the next experience will be a happy one. Even if it's not, there's always hope that it will be learning experience.

As a kid, I ignored the past and made decisions haphazardly. As I grow older and wiser, I realize that I'm not young anymore. Decisions will not only affect myself but those around me. I was an idiot. No longer. After considering everything, the next decision will be the right decision.

Graduation is coming and the afterwards is a haze.

Expand.

Tuesday, February 24, 2009

The Great War

In computing, there have been many great wars. Macs vs PC. Windows vs Linux. Administrators vs Users. Vi vs Emacs. Now, I feel like I'm in the war between engineers/programmers and usability folks. As you may or may not know, I've been taking this human computer interaction class. So far, I've found it gradually going down hill. There's a lot of tension between usable design and functional design. I know, you can have both, but more often than not, you can't.

Engineers are constantly being bashed in class for not thinking about the user. The fact of the matter is that engineers overthink for the user. When designing an interface, the engineer would think carefully about their target audience. They consider all sorts of situations the users might be caught in. Unfortunately, they also consider the most obscure considerations. For example, in Emacs, if you tried to save a file using an encoding that doesn't support all the characters in the file, it will complain and not save your file. In fact, it will pop up a second buffer telling you the error and put you in the sub-buffer to choose a new encoding or rectify your problem characters. I am thankful for this design. The second buffer provides good visible feedback of an error. Locking the sub-buffer also creates a forcing function-esque condition that the user must clear in order to save the file.

The usability folks will probably whine about the entire setup. They will say that the mapping is unnatural and locking the sub-buffer will only confuse the user. Of course, half of these guys don't understand emacs and the other half doesn't even know what a buffer is. Instead, they suggest highlighting the characters, popping up a dialog box, and instructing the user exactly how to proceed. This advice is hypocritical. Highlighting the character will only confuse the user with the emacs marker. A different color you say. Well, if I was in some mode with syntax highlighting, an additional color sure won't contribute any additional confusion. No, siree. Fine, instead of showing the problem characters in another buffer, highlight them in the main buffer. Yes, a dialog box is a forcing function since it must be cleared before continuing. However, an important characteristic of Emacs is that it can be controlled without moving hands off the keyboard. Will I have to click this dialog box? What if I'm on a text terminal? How would the dialog box look then? Did you really expect everyone to be on a graphical interface? Instructing the user how to proceed is meant to constrict the courses of action and basically sequences the steps in the user's action cycle. However, what if the user had just forgotten to run a utility to filter out the garbage characters? Are these instructions going to enumerate all possible solutions? True, instructing the user to either select a different encoding or fix the problem characters is ambiguous, but it also gives them more freedom to apply their own knowledge.

It seems to me that the usability folks are wanna-be engineers. They justify their designs with a non-methodical, and sometime paradoxical pseudoscience and attempt to apply it to a random group of users. The engineer on the other hand, attempts to turn this pseudoscience into a science, develop methodology for designing for users, and applying it. Which is more convincing? "We found that 90% of people had trouble with the save dialog due to the many buttons, so let's eliminate some buttons." or "We found that the motor areas of the brain saw increased activity during save operations, so the user probably required extra steps to successfully complete saving. We might need to limit the number of steps involved." If you just consider the usability aspect without actually knowing what the product is, you're setting yourself up for a huge pitfall. As an engineer, I consider the product's purpose as well as usability WHEN APPROPRIATE. After all, if you have a safe box, you don't want to make it easier for theft. A handle on a money box? Thank you for making it easier for me to carry it away.

This was all triggered by the following comment: "...and wasn't even sure what emacs was supposed to do. Is it a text editor? It looked like a text editor, but all the text looked terrible, and wasn't WYSIWYG from what I could tell, so I wasn't sure why someone would use that when they could use notepad or similar..." The text looked terrible? Notepad? Seriously? I just felt a part of myself die.
Expand.

Wednesday, January 28, 2009

The More the Merrier

So, just got a new monitor.
Asus 19" WS LCD.
I love the increased screen real estate. Let's me edit multiple high resolution pictures simultaneously. I love XRandR. Makes setting up dual displays pretty easy. The only gotcha was that I needed to recompile my system with the xinerama USE flag in order to have my programs support dual screens properly. I guess it makes sense since XRandR is supposed to deprecate xinerama. Unfortunately, my laptop monitor and this thing are not the same size. xfdesktop doesn't handle that well, hence the graphics glitch on the bottom right. Oh well.



Expand.

Saturday, January 10, 2009

A Tale of Two Harddrives

Much can be said about Acer's build quality. Much more can be said about their customer support. When my headphone jack broke about a year ago, I did not hesitate to send the machine back to Acer to fix my audio module board. Why not have someone else solder the headphone jack back than do it myself? It was at the end of the warranty anyway. I specifically asked to NOT have the harddrive touched. Unfortunately, they replaced my harddrive with a new (read old) one. It was the same Seagate Momentus 5200RPM 120GB model. After about a year, that harddrive failed. I wasn't surprised due to the poor harddrive cooling design of the notebook chassis. It idled around 50-55C with peaks around 60C, at the edge of its maximum operating temperature iirc. Anyway, I replaced it with a Western Digital Scorpio 5200RPM 320GB drive. It idles around 40-45C with peak around 60C (during dd image copy). The peak is around its maximum operating temperature, but the idle temperature is a lot cooler. Overall, I am fairly happy. Unfortunately, I have to rescue the data from the failing drive. Read more for procedures I performed.

Before any actual recovery was started, I needed to prep my environment. First, I put the old harddrive into the fridge with a towel around it to prevent condensation. This is to cool the drive down in order to prevent more thermal damage later on when I rescue. Rescue operation is going to be long read operations, so I can expect the temperature to ramp up. I setup a recovery system consisting of a barebones system I'm working on for my dad, which incidentally was the only system in the house with SATA support. I laid out the motherboard, power supply, and the two harddrives on a table top. The table was cleaned beforehand and wooden. That should provide enough insulation and hopefully no static. It's important to give the harddrives good ventilation to keep them cool, especially when performing the heavy disk operations I was about to perform. In addition to these physical preparations, I made a Parted Magic bootable USB stick.

I booted up the system from the stick. I fdisk'ed my new harddrive and made new file systems according to how I plan to dual-boot linux and windows:

fdisk /dev/sdb

I made an ext3 partition for where I planned to later drop the gentoo root and mounted it.

mk2fs -j /dev/sdb3
mkdir /mnt/newlinux
mount /dev/sdb3 /mnt/newlinux
mkdir /mnt/newlinux/root

I then proceeded to dump the relevant partitions I wanted to rescue:

ddrescue -r1 /dev/sda3 /mnt/newlinux/root/oldlinuxpart.img /mnt/newlinux/root/oldlinux.log
ddrescue -r1 /dev/sda4 /mnt/newlinux/root/oldwindowspart.img /mnt/newlinux/root/oldwindows.log
ddrescue -r3 /dev/sda3 /mnt/newlinux/root/oldlinuxpart.img /mnt/newlinux/root/oldlinux.log
ddrescue -r3 /dev/sda4 /mnt/newlinux/root/oldwindowspart.img /mnt/newlinux/root/oldwindows.log

I ran rescue with -r1 first to recover as much data as quickly as possible. After all, the probability of data being recovered successfully decreases with time. After disk images were obtained, the fun actually starts. I ran fsck on the image for my old ext3 partition:

fsck -y /mnt/newlinux/root/oldlinuxpart.img

At this point, the linux partition is fixed (hopefully) and can be mounted as a loopback device. There is no Linux chkdsk or fsck.ntfs equivalent, so I needed to restore the Windows ntfs partition via Window's chkdsk. Since Windows' tools are a complete mystery and I don't believe Windows treats block devices as files (thus, chkdsk oldwindows.img won't work), I wrote the image to the ntfs partition I created beforehand in fdisk.

ddrescue -r1 /mnt/newlinux/root/oldwindowspart.img /dev/sdb4 /mnt/newlinux/root/restorewindows.log

The dd utility would've worked, but I liked the ability to resume via the logfile. Since this was a new harddrive, I don't expect any failures to happen and -r1 is pretty useless. After this, I halted the system, powered down, and removed the old drive. It's going into storage (privacy/possible future recovery?) Then, I embarked on the funnest part. Recovery of the media on my windows partition.

I mounted the harddrive that I was going to use for my dad's system, which had Vista already installed prior to all this. Booted into Vista and it worked its magic recovering the corrupt NTFS partition. Alternatively, I could've put a Windows XP install CD in there and done Windows Recovery to let me book into my old Windows XP setup, but heck, I wanted to start fresh with my new harddrive. In retrospect, I could've also ran PhotoRec on the corrupt Windows XP image to recover all my media, but I would probably lose directory structure. Anyway, I removed my dad's harddrive and booted again using parted magic to copy all my media off the old windows partition into my linux install. Now, the heaviest disk operations were done and I proceeded to remove the new harddrive from the recovery system and installed it back into my laptop.

I proceeded to insert the Windows XP install CD to reformat the partition for a fresh Windows XP install, except the Windows XP install CD refused to boot. It drops to a blank screen. This is due to some Windows XP bug when there are ext2/3 filesystems (or possibly any filesystem/partition windows doesn't support) that I had forgotten about. I booted again, this time using the gentoo minimum install CD. I proceeded to go through Gentoo install procedures and had grub install to the MBR (kernel configuration was pretty easy since I just copied over the kernel config file from the rescued linux image mounted on loopback). I made a backup of the MBR and partition table to an USB stick:

dd if=/dev/sda of=/media/disk/tablebackup.img bs=512 count=1

It's important that I didn't dump this to one of the partitions on /dev/sda since I was about to mangle the partition table to appease Windows. I would not be able to remount the partition again to recover the MBR/Partition table backup. I unmounted the USB drive and removed it. Now, I went into fdisk and deleted all my Linux type partitions, leaving only the NTFS partition. I rebooted the system using the Windows XP install CD and it worked. I proceeded to install Windows XP. After install, I booted using the parted magic CD since it was the quickest drop to shell. I plugged the USB stick I used before and restored the partition table:

dd if=/media/disk/tablebackup.img of=/dev/sda bs=512 count=1

Unmounted the stick, removed, and rebooted. I was met with grub and I booted into Windows fine. I rebooted and was met with grub again and booted into my gentoo install. Excellent. Done.

This was a long drawn out procedure primarily due to lack of hardware. If I had a decently-sized harddrive to recover the images on (that was not going to be the substitute drive), I would've been able to complete this a lot faster. There was also waiting time for the parts to arrive. The lack of any SATA capable machine in the house was another roadblock. I didn't want to spring for an external exclosure. After this experience, I am definitely looking forward to ntfsck (soon to be available?) and hopefully a file system compatibility in Windows (maybe? Didn't have a Vista bootdisk on hand).
Expand.

Saturday, December 27, 2008

And here comes the train...

New schedule:
Class - Creds
Human Computer Interaction Design - 3.00
Signals and Information - 4.00
Digital VLSI - 4.00
Digital System Design with Microcontrollers - 4.00
Econ Networks - 4.00
Spacecraft Engineering - 3.00
Total: 22 credits

Drop 1 maybe. Looking at a lot of interesting classes. Really excited! Will hopefully get a high GPA. Hopefully they'll also let me TA for Mechatronics.
Expand.

Thursday, October 2, 2008

Myth?

So...are there any Asian girls in the 5'7"-5'9" range? If so, where would one find them? They seem to be as elusive as Big Foot or the Lochness Monster.

And they say I have peculiar tastes...
Expand.