Archive for the ‘lab’ tag
Ruby on Rails: on shared hosting, user authentication
* As usual, this post on Ruby on Rails is more documentation of my development process to supplement my notebook and memory. I can try to answer questions, but please keep in mind that I’m learning too.
I’ve bought the eBook version of the 4th edition of the Pragmatic Programmers’ Agile Web Development with Rails. It’s still in beta, but my main goal is to see how things have changed between Rails 2.x and Rails 3. The book also covers some basic user authentication, but it’s very simplistic. In the interest of getting my project up and going quickly, I looked into authlogic and devise/warden.
Both authlogic and devise/warden were highly recommended by mischa after building an application that did some direct comparisons of several different RoR user authentication solutions. Good enough for me. devise appears to be more lightweight, so I’ll try that one first.
A little bit about my server setup: I’m hosted with Lithium Hosting, which is a great deal and has fantastic customer service. They’re not paying me to pitch the service, though clicking the link above and then signing up for a plan gives me referral credits or something. It’s a shared hosting service, so I manage my site with cPanel if I need/want to, and I’ve added on SSH access to my account so I don’t really need to use cPanel.
Once the server upgraded to Rails 3.0/Ruby 1.8.7, a couple things happened: my rails apps stopped starting automatically (cPanel feature), cPanel could no longer start my rails apps, and I couldn’t create a new Rails app with a MySQL database.
Solutions:
1) install the mysql2 gem, which is the new mysql database adapter used by Rails 3. The compilers are disabled on my host, so this was done via support ticket.
2) add mongrel to my Gemfile,
#project/Gemfile
gem 'mongrel'
Mongrel isn’t automatically started in development mode. cPanel still won’t start my application, so starting the server is done via SSH with
rails server --port=[port]
So now I can create a new project
rails new project --database=mysql
and start the server. However, I don’t have a good way of authenticating users.
So, back to the support tickets to have both authlogic and devise installed. Once tech support has done that (seven minutes. really.), check if they’re installed for me:
gem server --port=[port]
and navigate to mysite.com:[port]. They’re not, run a couple commands from the command line:
gem install devise
gem install authlogic
Which should install the gems and make them available to me. Checking again as above, and both devise and authlogic are present. Add the appropriate lines to my Gemfile. Then, since I’m trying out devise first, install it:
rails generate devise:install
That’s all for now.
Ruby on Rails: Migrating data, too
Sometimes it makes sense to re-organize information in such a way that changing the database structure is necessary. It’s not terribly difficult to do this in Ruby on Rails.
I’m writing this more to file this away somewhere I won’t accidentally delete it:
Read the rest of this entry »
Cell Culture Room Issues
I should not need to send out e-mails like this:
Several issues have come up in the cell culture room lately that need to be addressed:
- Dirty hoods: The working surface inside of the hood must be sprayed down with 70% ethanol and wiped both *BEFORE* and *AFTER* use.
- I have noticed that the working surface of one of the hoods has consistently been left dirty with dried media spots and the UV light turned on. The UV light alone is not sufficient the decontaminate the hood. Most recently, the surface of the hood actually looked even worse under normal fluorescent light.
- Bleach left on the metal surfaces of the hood will lead to corrosion. This is not a reversible process, and the parts are expensive to replace. Clean spills immediately.
- Open hoods: The sash on the hoods need to be fully closed for our safety once the UV light has been turned on.
- I want to preserve my vision and also not grow tumors.
- Vacuum traps/waste flasks: Bleach must be added to these flasks to neutralize any organisms within, *especially* before being emptied (down the drain with copious amounts of water).
- Unlabeled PBS & media bottles: If you open a bottle, you are responsible for it. Unlabeled bottles are effectively a waste of valuable and expensive lab supplies.
- I do not have confidence in any bottle that has been opened but was not labeled with someone’s initials and dated, and therefore will not use them. I also cannot tell if anything has been added to the media or not, and again, will not use it.
- Empty serological pipet holders: It is everyone’s responsibility to refill these when the pipets are running low.
- With the exception of the 1mL and 2mL pipets, an entire bag of pipets will fit in each compartment. Please don’t just refill with only enough for you to continue working.
- Empty 70% ethanol spray bottles: It is also everyone’s responsibility to refill these.
- Matt and I have made up many bottles of 70% ethanol, ready to be used to refill the spray bottles. Please use them.
The cell culture room should be kept as clean and orderly as possible in order to minimize the risk of contamination, and to make cell culture work as fast and efficient as possible. It is therefore the responsibility of every member of the lab who uses the culture rooms to maintain the space, regardless of rank and position in the lab.
- Daniel
Master of Confocal Microscopy?
I might not be yet, but maybe someday soon. It’s now really easy for me to do this, and I can’t figure out if it’s just having had more experience or whether I did some magic to the slides that is making them cooperate with me. I’ll post some sample images later. For now, here’s a cell I took a picture of an could have sworn it was 3D on the screen.

Who says pep talks don’t work?
My PI gave me a pep talk about graduate school this morning, and combined with a couple other recent events, it has brought grad school as a possibility back into my future life plans. It’s irritating that I keep going back and forth on this. Sorry for the mental vomit that comes below, but it’s part of the reason why I haven’t been able to make up my mind.
Issues to consider:
- Turns out I’m not half bad at science
- I’ll most likely be on two papers within the next six months, which is good for grad school and med school; ok for industry, but having only a bachelor’s is a limiting factor there. means nothing outside of science.
- I missed working in the lab when I wasn’t doing so Senior year or college
- I don’t even hide the fact I’m a huge science dork
- Graduate student stipends are ~$21,000/yr
- Lab environment and dynamic are highly variable, and people and personalities are important. also important in an office, which just as limiting in social interaction. social aspect totally different than working in medicine
- Could go for dual-degree, but that essentially doubles the time before I actually begin my career post-education.
- I’ll most likely work 10+ hours days and many “occasional” weekends
- I’d probably work 10+ hours a day and many “occasional” weekends anywhere I work
- Graduate school is way less expensive than medical school
- I’d most likely need at least one post-doc position after graduating in order to gain experience, so +2 or more years
- Medical residencies are similar, and could take longer
- If I want to stay in science, the only way to make it a decent career is to get a PhD
- The only ways I’m going to make a decent amount of money in science are to either run a lab or go into industry.
- Running a lab involves always chasing money, but I will be my own boss, sort of.
- Working in industry is more structured, but I surrender more independence. Pay is higher for the same or less work.
- I have a bit of security in my current position, minimum one year, possibly up to two.
- Science: I get to play with expensive toys and generate images like this:
- Outside of science, and maybe in industry: I can buy my own toys.

HCMV-infected HFF
Conclusions:
- Medical school is out, unless it’s part of a dual-degree medical scientist training program and I end up with both an MD and PhD.
- If I stay in science, everything I’ve done for the last four-plus years is still working for me. Cons: I will be broke for at least four years. Risky after grad school. Can lose funding and enter career limbo. Need to start applying now.
- If I leave science, my options may be limited? Alternatives: product design consultancy (e.g. Ideo), management consulting (not familiar with the field). Cons: my experience is lacking, at least from my perspective. Can be laid off. Should start applying now.
web design, and differences in browser rendering
Admittedly, it has been a while since I last really truly developed a website.
The FaCU site wasn’t so much of a site as it was a page, and really, I feel I could have done a better job if I weren’t so ridiculously busy Senior year, and if I were more up to speed on using CSS to lay out websites.
Every time I’ve done this, beginning seven years ago, I’ve hit this block around how to manage the layout of a site. The old way, working with browsers that didn’t correctly render CSS styling code, a lot of people dealt with the problem by using <table> hacks, using these tags to generate a website layout composed of “invisible boxes”. All fine and good, except that it made changing even the smallest design element on the site was a huge undertaking, because every box was made to align and fit together like intricate pieces of a puzzle, and adjusting the thickness of one border or the geometry of one cell within the table, even by one pixel, required tweaking of every element around it, sometimes even going back and re-generating images or other graphics.
My first effort at using CSS to lay out a website was in high school, when it became my project to design and build a website for the high school newspaper. I used it to learn not only PHP and how to interact with a MySQL database, but really everything that would be involved in developing a website. It never became as full-featured as I wanted it to be, and it was eventually wiped out in favor of something less complex, and then again more recently for a WordPress-backed system.
Long story short, I tried to learn CSS in high school, found it supported by the various browsers available at the time in a very inconsistent manner (between browsers), and ditched it because it was too confusing to figure out how do exactly what I wanted with it.
I came back to CSS during my Senior year at Columbia while I was working on not only the FaCU website, but also the website for my Senior Design Project. I tried to adhere to only the most widely available fonts, and the lowest common resolution for both sites. The result: fairly ugly sites, but they get the job done.
Fast forward to today, when I’m now working on moving all of the lab’s most commonly used inventory books into a user-friendly digital form. CSS has better support across every browser, and everything just makes more sense now. No idea why.
Still, CSS is still rendered with quite a few annoying quirks. Take, for instance, the following page layout:

Lab inventory site
Renders just fine in Chrome, Firefox, and IE8. The left navigation panel and the main content to the left are spaced and positioned properly. In IE7, the main content title renders where it should, but the table appears at the bottom, under the navigation block. In Opera, the positioning offset I used to place the content area to the right of the navigation pane doesn’t appear to be necessary, so there’s a giant gap where there shouln’t be one.
A better situation than I was working with seven years ago, but still irritating.
New lab software!
Disclaimer: this is an extremely nerdy post.
First, a bit of background: to examine the location of proteins and stuctures inside of cells, we can fix and then stain those cells with antibodies conjugated to fluorescent molecules or proteins. To image these cells at a very high resolution, we use the confocal microscope with a UV and/or laser light source. This microscope is connected to a computer so that we can make fine adjustments, improve the color balance, and control the laser settings. We can do more image analysis on other computers not connected to the microscope using a “light” version of the software used to actually run the microscope.
I haven’t been able to do that on my home desktop because the software, ZEN 2008, was incompatible with 64-bit systems, and so I’ve had to do this either at work, or on my laptop. However, it turns out a new version was recently released, ZEN 2009, which is compatible with 64-bit systems, and works beautifully. Hooray!
The only downside is that the microscope sees a lot of use, and often, I can only get time to use it during off-peak hours, e.g. not a weekday between 7am and 6pm — like yesterday, 6pm-9pm. :(
Maybe I’ll generate some nice images from my data at some point and I’ll be able to do something really nerdy and use my own data as my desktop background.
Selfishness in shared environments
Most of my responsibilities at work in the lab as far as actual scientific work has involved finishing up projects and experiments for papers submitted for publication but never completed by postdoctoral fellows and graduate students before they left the lab.
At this moment, I’m working on two such projects; one of which I am working on with the help of an undergraduate intern who had worked on this same project last year. It would be perfectly fine if the graduate student who had worked on this project as part of their dissertaition had actually made it possible to repeat their experiments, but they didn’t, and I can only describe this behavior as completely selfish douchebaggery.
Proper scientific protocol requires that your work be as well documented as possible such that your results can be independently verified. Independently as in a completely different lab. The expectation of acceptable documentation within the *same* lab, however, extends to the proper documentation and storage of reagents, especially those which are extremely expensive.
This graduate student completely and utterly failed in this. Nothing was documented in enough detail for anyone to exactly dupilicate their experiments, the reagent list was incomplete, and worst of all, very few of the reagents they used could be found. Those that could e found had been improperly stored
And had therefore expired or degraded.
This is beyond frustrating not only because it makes repeating experiments dificult, but because it results in a massive expenditure of time and energy for and experiment that won’t work due to bad reagents. These failed experiments brought my intern to tears today after having worked all of this past weekend and also digging around in the -80 degree freezers last week.
My intern has done an amazing job, and it’s extremely unfair that all of this hard work has been thrown away because this grad student was too lazy to not only properly document their experiments but also properly store their reagents so as not to waste everyone else’s time and significant amount of the lab’s money.
I don’t understand how they got away with it, and I wish there were something I could do about it.


