Skip to main content

Posts

Vagrant up in the cloud (DigitalOcean)

It's quick and easy to start your virtual machine in the cloud if you use vagrant. Like, 55 seconds fast. I find it especially handy for toy projects that I need on the web quickly or when I don't want another virtual machine to gobble up resources on my laptop. I'm going through the steps for DigitalOcean. It's similarly easy for Amazon Web Services (AWS), but I find their web interface somewhat discombobulated. A word on pricing : if you use the cloud for a small project it's basically free. A full day on Digital Oceans costs 16 cents. That's (hopefully) less than you tip on a cup of coffee. There are a lot of online coupons that'll get you through the first few months. AWS offers a full year for free, see http://aws.amazon.com/free/ . I'm assuming that you have vagrant installed and a Vagrantfile already written or generated with  vagrant init . Ok, let's get started! First, download the vagrant plugin. vagrant plugin install vagrant-digital...

mod_rewrite vs CNAME changes

I thought I could be smart and redirect to a google sites project, instead of changing the CNAME entries. I had to learn that a mod_rewrite to a different url always does a visible redirect to the substituted url, so no faking that it's not a google site.

PHP Opcodes

First, what is an Opcode? It's a compiled form of a PHP script, similar to Java bytecode. Or, more precisely, from php.net "When parsing PHP files, Zend Engine 2 generates a series of operation codes, commonly known as "opcodes", representing the function of the code." <?php $a = "Hello "; $b = "World\n"; echo $a . $b; For a script like this, the opcodes look like that: number of ops: 5 compiled vars: !0 = $a, !1 = $b line # * op fetch ext return operands --------------------------------------------------------------------------------- 2 0 > ASSIGN !0, 'Hello+' 3 1 ASSIGN !1, 'World%0A' 4 2 CONCAT ~2 !0, !1 3 ECHO ~2 5...

Math job search

Phil Grizzard's detailed description of his job application process. A Longtime Math Grad Student's Job Search Experience Totally worth reading if you're on the job market soon. Thanks for sharing!

GitX and Finder in MacOs

GitX is a cool tool to visualize your git branches. It automatically assumes all files ending in .git files are git applications. When you browse files in Finder, anything ending in .git is now not a folder anymore, and clicking on it will launch GitX. Very annoying. I assumed I could just right click the file and set Open with to finder, but you can only change it to other applications, you can't tell your Mac that foo.git is a folder, not a git application. Instead, I edited the file /Applications/GitX.app/Contents/Info.plist (sudo!). Remove the following line inside CFBundleTypeExtensions <string>git</string> ... <key>CFBundleTypeExtensions</key>       <array>           <string>git</string>           <string></string>       </array> ... And then run /System/Library/Frameworks/CoreServices.fr...

Thunderbird notification pop-up

Every time I get an email, Thunderbird shows a little pop-up on my screen, saying x new emails from xxx . Oftentimes, I have co-workers look at my screen, they don't need to know everytime I get an email that it's from Amazon, Zappos, Banana Republic, or Victoria's Secret. So, here's how you turn it off: Click Edit and select Preferences Click Advanced Select the General tab Click the Config Editor button Search for biff Set mail.biff.show_alert to false

Book recommendation: A PhD Is Not Enough: A Guide To Survival In Science

I've recently read this small book, I devoured the 128 pages within two hours. Thought written in 1993, I think it is still highly accurate. Feibelman, a physicist,  describes several cases of unsuccessful scientific careers, despite hard work and intelligence. He points out the problems and gives advise how to avoid them. Every scientist should read his book early in grad school, refresh his memory when finishing grad school, and again when mentoring graduate students. A PhD is Not Enough on Amazon

Academic Job Search: Writing a good CV, research statement, and teaching statement

I won't give you boring details of how you should format your CV, there's enough resources out there that give you much better advise than I ever could, instead I will tell you what you can and should do during graduate school, to generate the content for your CV and statements. Please keep in mind that I was specifically looking for post doctoral research positions in mathematical biology . If you want to land a teaching or tenure position, some rules might be different. Job Application Timeline Academic Jobs beginning fall 2011 (June – September) Deadlines for postdocs : as early as November 2010 Asked for letters: September 2010 CV, Research Statement, Preprint/publications/thesis Draft of Research Statement August/September 2010 CV: first version in 2008, career services, periodically updated Jobs are advertised on https://www.mathjobs.org/ http://notable.math.ucdavis.edu/wiki/Mathematics_Jobs_Wiki Discussed everything with my advisor, proof-read by a...

Latex: Table of Content problems with Bibliography and Index

When creating a table of content (TOC) , bibliography and index are not listed when created with \bibliography and \printindex. This is how you get them to appear in the TOC with the correct page numbers. \cleardoublepage \addcontentsline{toc}{chapter}{Bibliography} \bibliographystyle{plain} \bibliography{../all} \cleardoublepage \phantomsection \addcontentsline{toc}{chapter}{Index} \printindex

Latex: Centering table larger than textwidth

Usually, you can center tables with \center. But when the table is longer than the \textwidth, it will be align with the left side margin. You can temporarily adjust the textwidth. % allows for temporary adjustment of side margins \usepackage{chngpage} \begin{table}     \begin{adjustwidth}{-.5in}{-.5in}          \begin{center}         \begin{tabular}{|c|}             \hline And here comes a very long line. And here comes a very long line. And here comes a very long line.  \\             \hline         \end{tabular}         \caption{This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is lo...

Highlighting paragraphs in Latex

When revising a document, I often want to highlight my changes, so my collaborators can easily see what I changed. \underline works for single words, but it puts everything in a horizontal box and long text isn't wrapped anymore. Instead, I use the package soul and \ul to underline. \usepackage{soul} Or you can highlight text using \hl. This will underline the text unless you use the color package, then it turns into typical marker-highlight. \usepackage{color}

Proposal wiriting - more favorite words

seek to pioneer new approaches Preliminary studies hint novel algorithms predictive models software tools for integrative analysis and visualization of genetic interaction networks to facilitate discovery developing new computational biology graduate level highly collaborative, interdisciplinary projects Analysis & Interpretation Using a systems biology approach The methods will be tested and validated in a number of real biological problems enticing them to pursue careers in science web-based tools in silico knockouts drug intervention can be seen as control of cellular network activity verification methods to check whether a model is consistent with the laboratory experimental observations on which it is based If the model does not conform to the data, we suggest a revised model and the new hypotheses are tested in-silico. The hypotheses formulated during in-silico testing suggest new avenues to explore experimentally. emerging field of System...

git merge --squash

Start out on branch master, then work on an experimental branch $ git checkout -b experimental Do a series of commits etc. If you decide that the experimental features should now be part of master, do the following: $ git checkout master $ git merge --squash experimental $ git commit -a The commit message automatically has a list of all commits in experimental.

Uploading a file with JQuery

You can easily submit data in an html form via jQuery's $.post. But you need to do a little more to upload a file. I suggest the jQuery Form Plugin . Here is the HTML form: <html> <head> <title>Title</title> </head> <body> <form action="/test.cgi" enctype="multipart/form-data" method="post"> <input name="myFile" type="file" /> <div id="results"> </div> </form> </body> </html> This is the Javascript file myFrom.js: $(document).ready(function() { $('form').ajaxForm( { beforeSubmit: function() { $('#results').html('Submitting...'); }, success: function(data) { var $out = $('#results'); $out.html('Your results:'); $out.append('<div><pre>'+ data +'</pre></div>'); ...

Happy Holidays!