• About
  • Projects & Research
  • Publications
  • Archives
  • Categories
  • Archive for the ‘CS’ Category

    Fragmented OS


    2010 - 03.01

    So, the Technical Account Manager for Android at Google came for the department’s seminar session. She’s basically in charge of Google’s relationship with manufacturers that use the Android OS. First off, Google is not the soul creator of Android. It’s actually a creation of the Open Handset Alliance, a group of handset manufacturers, software developers, cell phone service companies, etc.

    The Android OS, despite being less than a year and a half old, has fragmented to an appalling degree. Different manufacturers include varied screen sizes, sensors and actuators. So, application developers cannot predict what hardware is available. And consumers cannot easily predict if an application they download will function correctly.

    The operating system itself has even become fragmented. There are five different versions of Android available across different hardware. Developers now have to consider these different versions, not unlike working with different browsers. Developing for the latest version (as Google does), effectively tells anyone with an older version (79.6% of the Android market at the moment) that they’re out of luck.

    I will note that the speaker suggested using version 1.5 or 1.6 rather than 2.1 in developing. On the one hand, that does solve a short term problem of diverse systems. On the other, it makes an unsafe assumption of developers: that we’d want to use an older specification. For most programming languages, it is better practice and makes a person more employable to use the latest standard whenever possible.

    And, there are some genuine reasons for this fragmentation. With more varied hardware, it becomes increasingly difficult to include the appropriate drivers (needing to write one for every new feature for every individual piece of hardware). Some devices do not contain the memory or processing to be upgraded, which effectively keeps them trapped with their original version.

    It’s this fragmentation that will eventually lead to different flavors of the Android OS, more or less defeating the purpose of a unified operating system. Manufacturers may want to consider having an easy Lego-like means of upgrading hardware, but that still does not account for building the drivers (and assumes that manufacturers would even want open hardware).

    Ah well. It was a nice idea.

    Data Structures


    2010 - 02.26

    I’m grading for the data structures course this semester. The prof has never taught the course and is reusing assignments from a previous professor’s version of the coursework.

    I spent Monday sick and grading. (I did not receive the assignments to grade until after the department grade-by due date and had to rush.)

    Grading is a very disheartening. The purpose of the assignment was to demonstrate using a queue. Prof said they could use more advanced data structures. The students did not comprehend they were to still follow the queue requirements (enqueue, dequeue, limited access, etc.).

    Out of 70 students only 1 included a queue, reused from recitation. About 20 had included Java’s queue (many of which preceded to use a secondary data structure to do the actual work). The rest used another data structure altogether to reach the same effect: ArrayLists to LinkedLists to HashMaps to trees.

    For people that are not familiar with a queue, this is among one of the simplest data structures to implement. It implements a First In, First Out (FIFO) means of accessing data. One can only access the first (or “top”) Object in the queue; all other contents are inaccessible.

    … I don’t understand the drive of these students to use more complex data structures (and code design) than is necessary. A queue uses notably less memory and has a faster access time these other data structures.

    I read comments that a hash table is more efficient than a queue. Queues have constant time adds (enqueues) and removals (dequeues). A hash table has O(1 + k/n), where k is the number of keys and n is the number of elements; this is between linear and logarithmic time scales (meaning the amount of time to perform an add or removal will increase with an increase in the size of data structure).

    This scares me. There will be (if there aren’t already) computer scientists and programmers making inefficient code because they genuinely believe their way is better.

    … I talked to the prof in charge (who has been out of town this week) about my issues. My actual boss, the Director of Mentoring and Retention, had spoken to him previously about this. (I was actually third to complain about it to her.) And she was not getting through to him; she was even considering going to the department chair.

    After I told the prof what had transpired, the light bulb finally went on for him. Students will not prove they understand concepts unless they are forced to. Getting the right answer is more important than learning, I guess.

    JUnit


    2010 - 02.03

    JUnit is a unit testing framework developed for Java programs. It’s not my favorite thing in the world. For starters, it only tests public methods. Which is a bit of a problem if from a development standpoint; many internal “heavy lifting” methods are not needed by outside classes and should be private. In addition, I cannot use Eclipse, my IDE, to debug as I do with other code.

    For my software engineering course, I am creating a very simple Roman to Arabic numeral converter. (If anyone knows what the unicode character for Roman numeral 5000, a V with a line over it, I would appreciate it for accuracy.) It isn’t the converter program that is important. The purpose is to demonstrate black box testing methodologies: testing without knowledge of the internals of a program.

    I developed a test plan and wrote the test cases in JUnit, as instructed, before proceeding on to writing the actual converter. I then ran my tests. A couple failed and a hand full had an error. I rewrote the code; the class is small enough to justify it, rather than worry about where my sometimes failing  bug was.

    Yet, I still had the same problems. So, I copied the short bits of code into a main() function to use the debugger. The debugger revealed no faults: my system produced the correct output. JUnit had produced a false negative. I didn’t know it could even do that. It did not occur across similar tests with identical assert statements, so I’m not sure what it could be.

    Spring Work


    2010 - 01.26

    So, this semester I’m going to have quite a workload. All my courses have a high reading amount. Two require homework and/or a programming assignment each week.

    In addition, I will be grading the first programming course, tutoring a foreign visually impaired student, and doing side research for the Director of Mentoring & Retention. I’m not even sure my workstudy is for this semester, but I’m guessing the Director wants to spend every dime (thereby making sure I get the full employment pay).

    In most semesters, I have done side projects which dabble into my interest. Yet, I’m not sure I will have the time this time. So, I have decided that I will continue watching how this semester goes and then decide whether I have the time.

    If it does work out, I think I would like to do some cell phone programming (probably Android, but maybe the iPhone‘s Objective C). I don’t know what I would want to program though. I would like to involve hardware, like the GPS or accelerometer. I think the best tools are tangible or ubiquitous.

    Learning from Projects


    2009 - 12.05

    My department encourages undergraduates to do research beginning in their freshman year. I get the impression that many schools limit this to a senior design project, which is rather saddening.

    I’ve stopped reading my CS text books because, well, they’re just not helpful. But then, trying to learn anything more unusual like how to use the tools available is still very difficult. So, I’m just going to do a quick overview of what I’ve learned from using different tool sets.

    LilyPad

    So, the LilyPad series of embedded systems modules is designed for wearable computing. So, the best place to start learning about the LilyPad stuff is from the creator, Leah Buechley. Things to keep in mind:

    • I never needed to create a pad for my units to prevent slippage. But, you’re millage may very.
    • Pins (rather petals) of the LilyPad Arduino are dictated by an int (integer) value.
      • 13 is reserved for the LED that exists on the LilyPad Arduino.
      • RX/TX are for serial connections (see XBee below)
      • Analog (denoted by “a” on the petal) pins retain the same numbering scheme as the digital ones(so there’s an analog and digital pin 0, which are both labeled “0.”)
    • Buttons should be set up connected to two digital pins. One should be written to be HIGH while the other is written to LOW. Then, just do something whenever the HIGH pin reads as LOW. (This is contrary to the standard debounce that is done with buttons.)
    • Do not EVER cross conductive thread lines or allow them to touch one another. This will destroy one or more modules.

    I have used all of the LilyPad modules available. Except for the slide switch it’s pretty much “find the closest example and repeat” (if anyone knows how to use the slide switch, I’d like to know).

    XBee

    Based on the ZigBee standard, XBees are designed for WPAN. Indoors, they are restricted to within a room, but can be separated by miles outdoors.

    This forum post is probably the easiest I’ve seen in getting started. Things to also consider:

    • RX connections go to TX and vice-versa. Weird, counterintuitive, but that’s how it goes.
    • With a firmware update, it’s possible to have the XBee use actuators. This isn’t direct control, more like if one XBee has a pin go HIGH, the XBee it talks to will also have that pin go HIGH.

    Personally, I found it a lot easier just to use the XBees for communication and an Arduino for the actual sensor data and actuator control.

    Trackmate

    Trackmate is a computer vision based tangible object system. From a user standpoint, it’s pretty easy to control: cut out some inch-square icons, tape them on to objects, and use the interface.

    From a programming standpoint, not so much.

    • I recommend the Minim Processing library for any audio work. Seriously, don’t even bother trying to do this from scratch.
    • The code itself, when I last looked at it, was very hardcoded, so don’t expect to change the behavior of the system unless wanting to write it from scratch.
    • Review Processing. While it is derived from Java, it leaves some more advanced things out.
    • Review matrix algebra and vectors. While you won’t be doing math directly, it will help to make sense of some of the values.
    • I did the initial setup using the PlayStation Eye camera as recommended. While I could use the camera’s drivers and operate it from outside Trackmate, it didn’t work with Trackmate (looked like snow). Don’t know why, but it just wouldn’t work for me.