Sunday, July 6, 2014

Data science: summer 2014 focus

When I discuss future career plans with my college peers I say, very vaguely: 'I want to work with data'. They give me strange looks and we go on to discuss Czech beer and potential beer-picking apps for iOS.

My point is, I want to work with data acquired through satellites, I want to design and build distributed systems for genome sequencing, and I wanna make huge, complicated, incompatible datasets suddenly work together to produce clear results.

Regrettably, I'm unlikely to crawl near a decent Hadoop site in the near future, and my courseload for the next semester has nary a mention of a single complex query, so there I am taking University of Washington's Data science course on Coursera. I'm watching the videos on my commute to my awesome mainframe-testing internship, which is made more awesome by the fact that before I got it I would also never have had the opportunity to come near a mainframe system.

The course makes me regret that I did not take it before Machine Learning. I'll be repeating ML from September, and thankfully I still have most of my notes and exercises; hopefully I can now practice ML on a custom dataset (I'm thinking Flickr tags, in the vein of the great Vision Lab at Stanford). The data science course is still in its first week, so I have some time to get familiar with Python syntax before the assignment's due.

I'm just struggling to find a way in which I can get some experience working with biological data before applying for my final BSc project. For several months I will be working on my testing and automation skills, and hopefully implement a small version control system in Node, for fun and glory. Where that leaves me is up for debate as some ridiculously talented people two years my junior are currently cross-referencing Nematoda nerve impulses when inside an active blender.

Saturday, May 17, 2014

GoogleForms Drupal Module, day 2

Around 36 hours ago, I was in a room filled with iframe-related anguish. Now, that is the type of anguish I understand, the type of anguish that inspires me to pursue heroic and illogical projects and/or go on bad-coding benders.

Bad-coding benders are borne out of good intentions. You want to produce a full-fledged solution to replace an obviously faulty, yet ubiquitous approach. You underestimate the scope of the project. You don't consider that to produce a solution that could be plugged into an existing production website you need to spend approximately 10% of the time 'making it work' and then 90% making it safe and user friendly. With that  100% behind you, you also need to face an additional and unforeseen hurdle in spending as much time making it pretty.

Onto the problem! The currently extant solution for integrating Google Forms into Drupal has stopped development in 2011, and its last running version runs on Drupal 6.x. Not good. It is also entirely huge, making use of the SimpleHtmlDOM library for a task that, turns out, might well be handled by cca 12 lines of beginner's PHP. 
Q. Why is this good?
A. Allows me to play around with how PHP handles DOM. I have never done this before and just this one little step toward scraping a form when given, say, a Google Form [GF] URL or key without the use of iframes puts me far closer to giving it all the functionality the clients/victims care about - custom stylesheets, the entire shizz being wrapped in a Drupal 7.x compatible module, out-the-box jQuery validation and other prettiness.

To approach this part, I've built a three-step process.

Step 1: Simple form page that allows me to paste a Google Form key and click 'Submit' without a care in the world.
Step 2: A flamboyant PHP script majestically entitled 'parser.php' which does several things in an ugly functional manner. It fetches the $_POST values from step 1, strips them of all ugly and dangerous tags and intentions; it goes on to construct a Google Form URL and scrapes the <form> element therefrom; without any additional hassle (for now) it tries to save the scraped form as a unique .html file in a 'forms' directory; failing that, it passes the form data to step 3 in a $_SESSION variable. Clunky, but workable.
Step 3: Our glorious form is presented here with a fresh stylesheet ripe for dynamic loading. 

II. Luckily for my ambitions, my victims' gripes with Google Forms and Drupal don't stop at having to paste the form's iframe in order to get anything done. As many (most) people who love the Google Drive functionality but resent its unfriendliness toward customization (I am not a fan of Google translating everything into the local language, myself), these customers have had to paste the damned form element into their own page, get rid of any and all unwanted elements (hello to the unnecessary and confusing markup!) and style that mess inline.
Q. Why is this good?
A. It allows me to get creative with: stripping unwanted markup from the DOM and making it both accessible and functional; making a custom confirmation page a matter of seconds; ditto for adding a custom stylesheet.

III. The fun doesn't stop there. The true task of this mission is to be able to create a new form straight out of Drupal as a non-technical user. Now, I could more-or-less copy the solution of the previous Google Forms For Drupal Module, or re-code the Ruby solution in PHP, slap it together and pray it works. What this is really good for, however...
Q. Why is this good?
A. If we're already integrating this in Drupal - why stop at painstakingly copying the god-awful creation process of the Gforms? This offers an opportunity for a fun drag-and-drop module [with severe constraints and without using or emulating Masonry] to finally force me into doing something semi-meaningful with JS. It will also mark my first time using AppScript for a somewhat good purpose.

This part requires a full-on Google Form integration, which I'm handling through JSON like a good pupil of the Internet. It also requires building a custom d'n'd solution. 

IV. Validation is, I've learned, an issue of some worry to my new unwitting customers. They've been using a validation script which is, from what I've surmised, simultaneously good and tragically outdated. I am reluctant to butcher an honest developer's licensed code, for obvious reasons; yet I'm even more reluctant to reinvent the wheel. I will need to find a good workable solution that's not almost heavier than the damn CMS they're running on.

Q. Why is this good?
A. It's not, but it does force me to find a decent lightweight validation solution which may well be added to my in-a-bind-toolkit.

V. And finally, how's this integrated into Drupal? Here I'm not talking about making it a module - that seems feasible enough, and will be done over afternoon beer - but I do need to make them a convincing enough UI that just *works*. There will need to be options for anything and everything, from saving and previewing forms [making this a custom post type in addition to a giant pain in the ass] to having a reasonably easy multipage solution. All of this is none the less important than the Huge Happy Task of making myself a Google Forms API from wishes and leprechaun tears. 

Q. Why is this good?
A. I need to start making modules that are actually useful to people, and not just an adorably ugly learning opportunity on a Stark-grey background. Having a complete publishable module, ie. building stuff that is extendable, valid, accessible and has decent UX will be life-changing. 


Friday, November 29, 2013

15-hour Study Week

Apart from my obligations at the actual college I attend, I commit myself to the online courses in this approximate outline:

Machine Learning - 6 hours a week (2 hour lecture-watching while taking notes, and up to 4 hours trying to figure out the programming exercises)

Biostatistics Bootcamp - 4 hours a week (2 hour lecture-watching, 2 hours reading up on the subject and studying notes)

Mathematics - This is somewhat more confusing, as it wholly depends on the week's subject matter. I am planning to reduce the time I spend furrowing my brow at incomprehensible videos and use the profits to do some exercises by myself. For both mathematical courses I am taking online (multivariable calculus and linear algebra) I allot approximately 5 hours a week.

Now add to this the workload for my college, or the classes I am about to begin (namely, Biochemistry), and you can see why I unenrolled from the Stanford Automata class offered on Coursera. The format did not fit my expectations and this was only the second course I signed up for, after ML, so the basically opposite approaches to the workload - videos as long as 40 minutes, for example - disoriented me. I was falling behind and really was not looking forward to the next lesson, so I pledged to study the textbook after my winter study schedule clears up. I really feel that the video format is not well-suited to the subject matter, but this is not to say that I think regular expressions are not important to my studies - quite the opposite; I am simply not in the right mindset to make the best of this class.

Luckily, the new session of Introduction to Mathematical Thinking has been announced, starting on February 4th. You can bet I applied as soon as the notification graced my screen, and was then naturally left reeling as I read the description, wondering as always: 'Is this directly useful? Do I need this?'

Truth is, I may be aiming for quantity over quality here, but I feel that drenching myself in introductory scientific classes is the only way I can get into the right mindset. And if getting the mindset is my goal, then sure as hell IMT is the right class to take. I think it may have even been recommended by my professor at My Real College(tm) on our first class, which was the first time I'd heard a lecturer recommend a MOOC. I had just signed up for Coursera, so this made the lasting impression that I was on the right track.

Thursday, November 28, 2013

Bioinformatics via MOOC: introduction and plan

Preamble: I've no substantial experience or knowledge where mathematics, biochemistry, biostatistics or computer science are concerned. I am a student of the HND IT and Computing diploma as governed by Edexcel, and I trust that core curriculum to provide the basics of Computer Science, networks and systems. I will go on to do my Bachelor's in the same program.

My motivation to self-study Bioinformatics is guided by knowing that my chances of getting into a BI master's programme when I finish my Bachelor's are slim to none. Before taking up IT and Computing, I was a biology major with no interest whatsoever in drawing plant morphology. Due to personal reasons I had to end my biology course with nothing to show for it but the finished courses in Chemistry 101, the basics of cell biology and tissue biology, some introductory physics, organic chem, some forgettable biostatistics and the systematics of invertebrates. Not an impressive array of biological knowledge.

As I am studying software development, data manipulation and slightly more involved mathematics, I turn naturally to the crux of information technology and biology: bioinformatics. Via courses offered at MIT Open Courseware, Coursera, Udacity and other individual institutions, using (partly) the 'Bioinformatics SelfStudy Curriculum' from PLOS, I will attempt to fill out the 'systematic gaps in knowledge' and work at getting an education approaching a proper undergraduate degree in Bioinformatics. My goal is to learn; I do not know whether any educational establishment would consider the self-study credentials. I do think they are the best way to learn about the field and not confine myself to the career paths prophecised by the Edexcel diploma records.

My (relevant) courses currently include:
- MIT: Multivariable Calculus
- MIT: Linear Algebra 
- My college: HND Mathematics for software development
- Stanford: Machine Learning (Coursera)
- My college: HND Object-Oriented Programming
- John Hopkins Uni: Mathematical Biostatistics Bootcamp (Coursera)
- Biochemistry (NPTEL)

I start the following courses in January:
- University of Washington: Computational Neuroscience (Coursera)
- Paris School of Engineering: Discrete inference and learning in artificial vision (Coursera)

In February:
- Java programming
- Information systems