Extreme Makeover: Home Edition / ASM Logic Problem

October 6th, 2008

I was fortunate enough this week to be involved in the 129th episode of Extreme Makeover: Home Edition. I can’t go into detail about anything I really did, but I can say that I was the personal advisor the Paige Hemmis, one the lead designers (who is even more gorgeous in person) and that I didn’t sleep more than six hours in three days.

Anyway, in the course of the build, and couple of members of the design team (all MSU students) and I were faced with an interesting problem. I was coding a PIC micro-controller in C, and I had a 8-bit value that I needed to be swapped bitwise, such that:
B7 B6 B5 B4 B3 B2 B1 B0
became:
B0 B1 B2 B3 B4 B5 B6 B7

At first it appears like a simple problem, but we could not come to a consensus. Here is the question I pose: Given an 8-bit register, what is the most efficient method of doing a bitwise swap? I’d take answers in pseudo-code, but seeing exactly how many instructions it would take would be way more interesting. I’ve got my solution in the works; I’ll post it when I’m satisfied.

F.Y.I. I found the PIC18F series instruction set here.

Java Weakness

September 3rd, 2008

So I’m in the process of picking up Java as a pet language (Perl was last summer; pretty good choice), and considering its prevalence in industry, it’s probably not a bad idea. The problem lies in the fact that there is not a single class at Michigan State offered on the subject, so that leaves it up to me. I was kind of surprised that nothing was offered, but a professor at NYU, Edmond Schonberg, wrote an interesting article on the weakness of Java as a first language and its place in the realm of CS education (link).

The section on Texas A&M (a little “whoop” for my Aggie brethren Chris and Kyle) was particularly interesting. In it Bjarne Stroustrup comments about how unhappy some major players in the industry are with students who are taught Java as a first language. A&M used to teach C++ to EE students, and Java to CS students, but the CS department switched back to C++ after the EE students began to out-program the CS students.

We went through a somewhat similar trial here at Michigan State, when the the department switched CSE 231 (the intro programming class) from C++ to Python. I was a little upset; I don’t exactly see the point of teaching a scripting language as a first language, but then in retrospect I guess I learned BASIC before C++, so I would be a bad test case. My 231 professor, Dr. Richard Enbody, did a very thorough study in CSE 232, the second programming course, which is still taught in C++.

He found that despite having a mixed group of students, EE’s, CpE’s, and CS’s, some of whom took 231 as a C++ course, and some of whom took it as Python, there was absolutely no correlation whatsoever between their first language and proficiency in 232.

In fact, I’m going to run upstairs right now to see if Dr. Enbody has a white paper on this…

Senior Design Project!

September 2nd, 2008

So entering my fifth and final year of undergraduate education, I’ve enrolled in the Department of Electrical and Computer Engineering’s senior capstone class, the feared and respected ECE 480.

As of Tuesday, August 26th, I’ve been assigned to Team 2, arguably the most sought after project of the semester. The official title for the project is the “Solar-Powered Internetted Multi-Seat Computer System for Tanzanian Classroom”, but to a majority of the students and professors in the school, it’s just the “Tanzania One”.

Sponsored by Lenovo, it’s a fantastically open-ended humanitarian project with the end goal of providing internet access and basic computing capabilities to extremely isolated schools in Tanzania.

Pending my sanity, I’ll hopefully be keeping up with the progress of the project on this site, along with our Team 2 design site (up within a week).

Watch ESPN360 From Anywhere!

May 5th, 2008

So I’m a bit of a soccer fan, and I’m growing into rugby league, but unfortunately American cable fails miserably at these two sports. ESPN has a nice little service called ESPN360, where they have plenty of live broadcasts of many sports, and they keep a couple of weeks worth on replay. The problem is that ESPN negotiates which ISPs can carry it on a case-by-case basis, and Comcast being the wonderful (/sarcasm) company that they are, has no deal.

Earlier this year ESPN opened up ESPN360 to any IP address that has been assigned to a .edu or .mil domain, which allows us to take advantage of the MSU College of Engineering’s little server network via SSH.It’s a simple application level port forward using the -D option. Keep in mind that I’m performing this little trick is OS X, but it should work on any platform that has SSH (i.e. all of them). First, open up the terminal and launch SSH as follows:

ssh -D 9999 username@server.edu

Note that server.edu should be whatever server you can log into that sits on a .edu domain. At Michigan State, I use either arctic.cse.msu.edu or scully.egr.msu.edu. From there, open up whatever web browser you use (I’ve tested it on Safari and Firefox), and change your connection settings to use a SOCKS proxy at localhost, port 9999.

That’s it! Navigate to espn360.com and enjoy! Note that the application level port forward is a fantastic security tool to use when logged into a public computer to encrypt information between your terminal and the server (though it does NOT encrypt your information all the way from your terminal to it’s destination). It could also be used to bypass corporate firewalls, for all of you summer interns out there.

Wow.

April 11th, 2008

Has it really been since October that I’ve posted an article? Wow. I’m going to get back on the bandwagon as soon as this hectic school year finishes. I’ve got a few projects spooling in the background, quite a few articles sitting in the to-be-written box, and little time to do it in.

Quick update:
 - I’m typing this on my new baby girl, a spectacular 15″ MacBook Pro. I wouldn’t say I’m an Apple fanboy, but the hardware is second to none. The OS could use some tweaks, but having the BSD base makes that a hell of a lot easier. I’ve christened her Ariana, and she succeeds Willy, who now sits on my desktop waiting to be sold.
 - In November I interviewed with Lockheed Martin IS&GS Division in Colorado Springs, CO; and they made me an offer about a month later. I plan on moving out west sometime in mid-May.

3D Facial Synthesis

October 1st, 2007

I walk by the the graduate/post-doc labs in the Engineering Building every day, and the facial recognition lab is always open and always pretty intriguing to look into. I know that they take a stereo picture of a face, and are able to raster the images into a semi 3D face. From that, they have algorithms that can sort the face by sex or race.

The research group featured below has taken this to a whole new level, identifying key facial structures. From this they are able to adjust the mood, the apparent weight, even the sex of the new 3D face, all from a single 2D image.

Using CSE Aliases in your EGR Terminal

September 30th, 2007

This is a problem the is pretty specific to CpE majors at MSU, but it’s one that I’ve been fooling around with for awhile, and I’ve finally got it to work.

My problem is that my first exposure to UNIX was through the SSH terminal in CSE 231, and I took for granted the aliases included in the ~/.aliases file. Simple stuff like listing files in a readable format is easily accomplished with the “ll” alias. But on the EGR servers, there is no alias, so I’d have to type in “ls -l” to list files, or “ls -la” for hidden files.

My attempts to edit/create ~/.aliases and ~/.personal on the EGR servers failed, and even after talking to a few of the DECS guys, I still couldn’t get it. Finally, after screwing around for a few minutes tonight (instead of working on my resume…), I solved the problem, being that the .cshrc file is not sourcing the .aliases or .personal files. I copied and pasted a few lines of code from my CSE drive to my EGR drive, and voila, aliases! Here’s how:

  1. Open up your EGR ~/.cshrc file in whichever file editor your choose. I’ve got samba.egr.msu.edu mapped to the M:\ drive on my computer (Windows XP Pro), so Notepad++ makes this VERY easy.
  2. Append the following lines of code to the end of the file:
    if ( -r $HOME/.aliases ) then
    source $HOME/.aliases
    endif
  3. Save and close the file.
  4. Copy ~/.aliases from your CSE drive space to the root of your EGR drive space. Again, this is very easy if you have samba.cse.msu.edu mapped to the H:\ drive on your computer.
  5. Done!

Now the next time you open up a terminal to any of the EGR servers, you will have all of the same aliases as the CSE servers.

VR RC Plane

September 17th, 2007

This is single-handedly the coolest hobby project I’ve ever seen. Take a little RC airplane, throw a two-axis camera on top, hook it up to a gyroscope, and feed it into a pair of VR goggles. Simple, right? Riiiight. Regardless, it’s a neat video, especially considering how many millions of dollars the DOD pours into remote surveillance, and how bargain-basement (and effective) this approach is. Keep it simple, stupid.

This next video is his newest plane, and even has overlays for the aircraft altitude and system voltage:

Breathalyser

September 12th, 2007

I in no way, shape, or form condone driving under the influence of any sort of drug, alcohol included. I am however a strong proponent of individuals rights, which are sometimes violated by the government’s blind trust in technology. There are some fantastic regulatory government agencies in place, the FAA being one with which I’m very familiar, which very tightly control the development, testing and use of software in critical applications.

The FAA for example has a document called the DO-178B which specifically outlines how one would development bulletproof software which is certified to perform properly, and more importantly, fail properly. In order to do so, every step of the design, test, and implementation process is open to auditing by the FAA, such that every operating requirement can be traced to source code and tests, and every line of source code is tested.

It makes sense. When dealing with something as potentially disastrous as commercial flight, one must be sure that any software on the airplane works just as well as engines, flight controls, or other mission critical components.

But what about outside the aerospace industry? The FDA checks software on any processing equipment. But the software in breathalysers (as in preliminary breath test) are almost completely uncontrolled, and have been hidden from public and government view, even when requested by trial court judges. According to DUIBlog (link), the Supreme Court of New Jersey finally forced the manufacturers of to turn over the source code of the Draeger AlcoTest 7110 to a software analysis firm, Base One Technologies.

The results were a little frightening:

  • The Alcotest software would not pass U.S. industry standards for software development and testing
  • Catastrophic error detection is disabled
  • Diagnostics adjust/substitute data readings
  • Flow measurements adjusted/substituted
  • Error detection logic

The result is that breathalysers are in no way an accurate way to determine blood alcohol content. A quick glance at Wikipedia (link) shows some frightening (though partially uncited) statistics, such as the margin of error being more than 20%! Why is this so extreme? In the case of DUI, after taking a PBT, and testing over over 0.8%, you are presumed guilty. To me, this seems to be in direct violation of the fifth amendment (”No person shall… be deprived of life, liberty, or property, without due process of law…”).

Submersible ROV

September 5th, 2007

A submersible ROV (remote operated vehicle) is something that I’ve wanted to build since I was a little kid. I watched the National Geographic Channel WAY too much, and I was absolutely obsessed with Dr. Robert Ballard and his various exploits with Alvin. Growing up on a lake, I got my NAUI scuba certification the week after I turned 12 years old; submersible ROV seemed like the next logical step.

Now, thanks to a group of students from Carl Hayden High School, I can live out my childhood fantasies for less than $250 (link). This is their entry for the National Underwater Robotics Challenge:

The hang up for me whenever I got to the blackboard on building one myself were the propellers/servos. I could never find the right solution. They have that situation down perfectly, though their controls have a little room for improvement. Given their budget and (assumed) programming experience, with a BASIC Stamp microcontroller and a simple two-button serial joystick you could make a pretty slick interface.

It’s times like these when I hate growing up in the tiny little town that I did, no opportunities like this to participate in.