Friday, June 29, 2012

Google Ngrams Part 1

So I have been spending some time analyzing language usage from a bunch of different areas including: chats, twitter, email, phone conversations and books. I have been starting to analyze the raw data from Google ngrams and the raw data sucks ass. Come on Google you can't write a 5 minute piece of perl code to parse the grams. Don't believe me look here:
As you can tell there has been a drop in the usage of vi for editing books, as it probably moved on to be a programmer's tool around the 1830s. This is not even to mention the words with non alpha numeric characters. I guess I will parse my happy heart out. Just removing words that contain numbers or non-alpha characters besides (') has me at about 1/3 of the original size for 1grams. I also removed words with less than 5 occurrences in less than 2 books. I.e. each word has to occur at least 5 times in at least 2 books. I'll post the scripts when I am done.

Friday, June 1, 2012

LCD Clock MSP430 Nokia 5110

So I finally managed to program a somewhat real-time clock using the MSP4302012 target boards (http://www.ti.com/tool/ez430-f2013). It took me a while because all of the code I tried to use did not work haha. I ended up kludging together some prewritten code and then writing some of my own (https://drive.google.com/file/d/0B_R75gIJvkFUMGFBNy16cjRoQmc/view?usp=sharing). The code was written in Code Composer Studios and will not work with mspgcc.



The connections I used are as follows:
Nokia   :   MSP430
1 VCC :    P1 VCC
2 GND :   P13 GND
3 SCE  :   P2
4 RST :  P3
5 D/C : P4
6 DNK(MOSI) : P5
7 SCLK : P6
8 LCD : P7

One should just be able to import this code into Code Composer and if using the same pin connections It should work immediately. You can run it off the ez430 USB stick or 3V. I used two coin cells in parallel. Feel free to comment if you have any questions.

Wednesday, May 30, 2012

Water

Lately I have been thinking alot about water. An interesting thing about macromolecules is that they are slaves to their solvent well at least some people think so... This train of thought was pioneered by Hans Frauenfelder. I heard him give a talk a few years ago and he still uses an overhead projector. Water has structure. It is a bunch of H2O molecules interacting in specific patterns.
When people say H2O is water it bothers me because H2O is not water. H2O molecules interacting in a specific manner is water. Anyways, I was thinking about how this specific structure of water can be perturbed by proteins or ions or a number of things. They might be able to change the structure of water interactions enough that the water becomes a slave to the "solute" which is a slave the solvent. In such a case protein A in water near protein B they would both effect each others structure and conformational equilibrium due to each effecting the structure of water. My goal is to understand if and how we can significantly alter the structure so that at a reasonable distance one molecule or protein say can effect the structure of water enough to effect the dynamics of another molecule.

What I am going to do is run some simulations with different concentrations of Sodium(Na) and Chloride(Cl) ions and see how it effects the structure of water and see if it does in a predictable way and also what concentrations are needed.

So initially I am having problems using GROMACS and I want full electrostatics but that requires turning off periodic boundary conditions... Hmmm What should I do? Well I did a run with just normal parameters except I extended the electrostatic and Van Der Waals cut-offs. I kind of see what I almost expected unfortunately.
The pictures is just a few atoms from the simulation of 879 water molecules modeled using tip4p and 4 sodium ions and 4 chloride ions. You can see the sodium molecules in blue and water hydrogen in white and water oxygen in red. It's not that obvious but what you can notice in the picture if you look at the water molecules away from the sodium their Van Der Waals radii overlap but where the two sodium atoms are the closest the water molecules don't interact like the others forming a unique structure or unique interaction. The problem is if that the two sodium molecules are not relatively close this does not happen and I think it might be just because water is so awesome in its ability to rearrange in such a way that these molecules are only minor inconveniences. But it could also be because my box is essentially infinite in size due to periodic boundary conditions, which because there are "infinite" other simulations connected a water molecule never has to be without other interacting water molecules except when they directly interact with something you put in the system. My next step will be to remove the damn PBC.

This post has taken me a few days to try different simulation parameters and figure things out. Sorry. Will try and do more experiments when possible.

Wednesday, April 18, 2012

The first 5 seconds

So for the past few days one of the experiments I have been performing on myself is trying to see if it is possible to teach myself to think of two different things at the same time. Sounds crazy huh? We can teach our bodies and minds so many different things what makes it impossible to think that we cannot follow two different trains of thought at the same time? Wasn't there a time when you thought that algebra was impossible? Or maybe learning to juggle a ball with your foot like Ronaldinho. I have spent about 10 -15 minutes each day practicing for the past week. I have tried a few techniques such as trying to write from 1 to 10 with one hand and A-Z with the other, read and write at the same time, focus my attention on something such as a memory task (I use Memory Trainer which by the way also shows me how badly my brain functions the next day after a late night at the bar). So I video recorded myself using my laptop to see if I could find reasons why my brain quit focusing on both tasks. The interesting thing... I always lost my concentration after ~3-5 seconds repeatedly. When I was reading a book and writing the alphabet always around the letter F. Sometimes I would write the letter 'F' twice or sometimes I would skip 'E' or 'G' but the initial lose of focus always happened around this time. But for the first three seconds I could read coherently and write coherently. I wonder if the brain takes ~3 seconds to initially begin focusing on a task? or it is just the nature of the experiment? I wonder if other people experience the same thing. Try it and let me know!

Wednesday, April 11, 2012

More thoughts on Water

Well I have been still messing around with the water box simulation and found that 200mM NaCl is not sufficient enough to have large disturbing effects on the water. It is fairly obvious that the effects are largest when two ions of the same charge i.e. negative-negative or positive-positive are near each other you have the biggest effect because waters are trying to align the same way to interact with both i.e. hydrogens near the negative or oxygen near the positive. The concentration of positively charged ions in the cell is ~150mM but this is not including all the other mess of proteins and stuff. Here is an interesting thing I found "Calcium concentration microdomains". I mean if there are in fact microdomains of different ions I think around 300-400mM would be sufficient concentration to start to really mess up the local water structure. I mean empirically we know that ions can help neutralize charges on proteins that can prevent aggregation or other bullshit. But do the ions actually have a significant enough effect to significantly change the thermodynamic equilibrium of a protein and is this change due to water? Things to contemplate.