Monthly Archives: July 2009

Cross Domain Access and Web Services

Through my readings on trying to find out why my OpenSocial Metagenomics application hasn’t been working last week, I discovered something I probably should have known/seen when I first started. Security issues with Javascript are well known to anyone who has tried to code with it, but I never truly understood what issues they were until now. First of all, the application is attempting to make service calls to Rob Edward’s cellphone-based Real Time Metagenomics site to submit a fasta file in order to receive a JSON object. Now, the problem is that I’ve been using Javascript’s XMLHttpRequest object to make calls to the website from the application and this is causing a cross domain security problem in which the call doesn’t go through. This is a huge disconcern for web app developers because cross domain service calls are becoming more and more necessary with the increase in popularity of social networks. But it makes sense for a browser to implement this type of security because allowing anyone to freely open a web service connection could allow hackers and others to intercept the connection.

So, after reading other’s blogs on this issue I am finding that there currently isn’t a set custom in working around this problem but there are some workaround solutions available, such as getting Javascript to call a proxy program, having the desired server to call a proxy program, implementing a script tag hack, and more. I am hoping to soon find a solution that doesn’t come with any downfalls so I would not have to use any of these methods, but I am not counting these out just yet. These may be the only solution right now but I’ll keep looking for something that sounds more suitable for me.

More cool MM

Today I completed my trio of menu buttons for MM! That’s right folks, we have a Share Button!

If you can’t tell, I’m pretty excited about that. Not only because it took half a workday to do, but also because (in my opinion) it is a really cool feature. One of the things that most impressed me about my Ion when I first got it was that when browsing my pictures, there was a button with a pop up that asked what I wanted to do with it. In terms of MM, about the only reasonable thing I can think of to do with a .MMR output is to email it. So for now, that is what our share button does.

Another issue is that, as of right now, a .MMR is just a Serializable Array recorded to a file. It isn’t exactly very reader-friendly. This works fine if all we want to do is shoot a file across email to another android phone for viewing in their MM app, but we may want to look into more options in the future. The notion of sending an MMR across bluetooth to another phone is also interesting, but that would require a fair bit of digging to accomplish (and may not even be allowed, I’m not sure). Either way, I’m very happy to have accomplished the rough outline of what we want our menu buttons to do. At this point, adding more functionality will be pretty easy to do. Now if I could just add those nifty icons to my buttons…


Unfortunately I didn’t make it into the lab today to pick up my progress bar code, so that will have to wait until Monday, but I did make a lot of progress on MM! I coded a third Activity – this one is a pop-up dialog to ask the user what file they want to load. It gets displayed when they choose “load file” from the options menu. To go along with this, I coded full functionality for saving and loading files! I actually coded it twice, the first time it saved it to the phone’s storage, which I didn’t like. The new and final version saves files to the SDCard. I may add functionality to the save feature to name files whatever the user wants, but for now everything is saved as “filename.fa.mmr” MMR stands for Mobile Metagenomics Results filetype (which is actually just a serializable array dumped to a file).

And now my challenge to the lab! MM needs a cool icon for display on the Android phone. Right now it has the generic application window with a gear in front of it, and that is not only boring, but unprofessional. I’m absolute rubbish at art (digital or otherwise), so if somebody in the lab has a knack for it, feel free to make up a 48×48 PNG file for us! You can go with Rob’s tricorder theme, or any other idea you may have that applies. Translucent backgrounds work great as the phone will show the background theme through such a background (yes, I made some very crude artwork to test how this process works). If nobody in the lab feels up to the challenge, I’ll have to create a flat, pixelated masterpiece myself… (you’ve been warned!)

Android: Nuts and Bolts I

In my first real “Nuts and Bolts” entry, I’m going to discuss User Interface design. To avoid some redundancy, I ask that readers first work through Google’s Hello Android and a few of the Hello Views tutorials. These will give some familiarity with how to actually get Eclipse talking to Android, as well as teach a bit about the widgets available. What I intend to teach in this tutorial are the things that I didn’t find immediately obvious when going through the Google ones (though in my opinion they are actually pretty good).

Continue reading

Throw some G(Bs) in that netbook

I just upgraded my netbook from 1 GB RAM to 2, and since I’m not the only one with an asus netbook in the lab, I figured it was worth writing up. Also, this should help alleviate any lingering skepticism about just how easy this is to do (I’m lookin at you, Josh)

Step One:

Backing up your stuff… This is the boring part, but it’s also very worthwhile and important any time you’re pulling out the ol’ screwdriver.

Step Two:

Clean environment. Nobody likes spilling drinks on their motherboard, and crumbs can be very crummy.

Step Three:

Flip that laptop over, it’s time to pull off the battery. There are two latches, and they must be done in the correct order. Right one, then left one, with the bottom of the laptop facing up. Pull the battery off, and try not to forget where you put it. We’ll want it again later.

Step Four:


Screwdriver O’ Clock. Be gentle. The two screws you’re gunning for should be rather obvious, but once they’re both unscrewed, getting the back cover off is a little tricky. The last thing you want to do is force it and break a little plastic peg or something. Once the screws were out,  my back cover was easy to tilt and slide off. Again, be gentle. Congratulations, you’ve passed the hardest part. Screwdrivers are tricky.

Step Five:

The memory is latched in below the harddrive, but both are visible once the cover is on. The two latches on both sides of the memory are the only thing preventing the stick from popping upwards, so once you pull those latches apart, the memory will be visibly ready to be removed. Pull straight out, we don’t want to muck up our slot in the process.

Step Six:

Your new memory stick will need to be ready to go in now, so get it out of the packaging without any static shock incidences. It will slide in at the same angle as the old stick came out, and will latch in the same way as well. This is another step where you really don’t want to force it, and it’s important to follow the intended angles while inserting/removing memory. No broken slots. Also, be sure you don’t have the memory stick upside down while putting it in. There is a dividing line in the memory that can help be your guide to make sure it isn’t flipped over by mistake.

Step Seven:

Start working backwards. That means sliding the back cover back into place, again being kind to the little plastic pegs, putting those two little screws back in (hopefully you haven’t lost them at this point), and putting your battery back on.

Step Eight:

Hit that power button, cross those fingers, and know that if anything has gone wrong, I absolve myself of any and all responsibility.




MM Update

Tonight I finally got the asynchronous downloads working perfectly for MM. I also coded the menu button to pop-up some of the options that we discussed at the meeting last week. I haven’t added my nice, pretty progress bar yet because I left the code on my work machine. I’ll probably stop in tomorrow to send myself that code really quick, though I’m sick (AGAIN!) so I’ll probably miss out on our lab activity 🙁

Android: Nuts and Bolts Intro

Most of my posts up until this point have avoided a real discussion of the actual code behind my Androids apps. I didn’t want to bore anybody with details they didn’t care about; but since it seems like some people do care, I’ll start sharing some Android coding tips! I also had the realization that if/when the lab has to replace me with another Android coder, that person may benefit from what I blog. Bus factor++ indeed!

Before I delve too far into things, I feel it would be worthwhile to think about some structure to this series of blog entries. For today I will blog some of my fresh discoveries, lest I forget them in typical programmer fashion! In the future, I will try to write a couple of entries a week with guides and gotchas written out for future Edwardslab (or any other) Android coders. Without further adieu, I shall explain a bunch of knowledge that just kicked my butt for the past couple of days! (See the Read More cut for random knowledge)

Continue reading

Test Post + Gunnar Optiks

So, if you were in the lab Wednesday, you might’ve spotted me sporting some sweet, if odd-looking, new glasses. Glasses that had somewhat unnerving and stylistically-questionable yellow-tinted lenses. This is not bad fashion-sense on my part, I assure you, this is Gunnar Optiks! To make a long story short, these glasses are made to make things easier for people like me/us. AKA: People who spend a LOT of hours staring at a computer screen. Now, I’m a wimp. I’d never worked long, hard hours in front of a computer before. Like, I’ve obviously put in the time required to get a CS degree, but when I came in here for the first week of work, after 8 hours, my eyes HURT. So I got a pair of Gunnar Bit Surfers.

The ostentatious yellow lens tint is actually designed to cancel out some of the harmful spectra of light that computers emit, including the bright, bright white that we all usually have in the back of our ssh terminals, the one that had me wincing every day after my 6th hour.

The lenses are also ground to make close-range viewing easier, allowing your eye muscles to relax while still being able to read all the stuff that’s on your screen. If you don’t wear glasses normally, this causes your first hour of use to be a little disorienting. I have 20/10 vision, so the first hour I put on my glasses I definitely felt a little weird, but it’s now 5:20 PM and I’m feeling great. None of the soreness I normally experience after 7.5 hours of work. I even worked through lunch, and still haven’t felt the burn.

Just don’t use these for long-range viewing. They aren’t made for it. Other than that, this is both my first post and a glowing testimonial to Gunnar Optiks, who may very well be the reason I get to keep 20/10 vision despite 8 hours of SSH every day!