Saturday, December 31, 2011

Disconnect

https://addons.mozilla.org/en-US/firefox/addon/disconnect/

Google Disconnect

Facebook Disconnect

Stop major third parties from tracking the webpages you go to (built with WebMynd).

Viber

http://www.viber.com/

http://lifehacker.com/5706423/viber-makes-free-iphone-calls-over-3g-and-wi+fi

https://addons.mozilla.org/en-US/firefox/addon/disconnect/

When you use Viber, your phone calls and text messages (sms) to any other Viber users are free! The sound quality is also much better than a regular call.

Thursday, December 29, 2011

Words with a Q not followed by a U

qaid
quintar
quindar
qoph
qiviut

http://www.scrabble.org.au/words/ulessq.htm

Words with a Q not followed by a U

2-letter Words
QI

3-letter Words
QAT QIS SUQ

4-letter Words
QADI QAID QATS QOPH SUQS WAQF

5-letter Words
BURQA FAQIR NIQAB QADIS QAIDS QIBLA QOPHS QORMA TALAQ TRANQ UMIAQ WAQFS

6-letter Words
BURQAS BUQSHA FAQIRS NIQABS QABALA QANATS QASIDA QAWWAL QIBLAS QIGONG
QINDAR QINTAR QIVIUT QORMAS QWERTY SHEQEL TALAQS TRANQS UMIAQS YAQONA

7-letter Words
BUQSHAS INQILAB QABALAH QABALAS QASIDAS QAWWALI QAWWALS QIGONGS
QINDARS QINTARS QIVIUTS QWERTYS SHEQELS TSADDIQ TZADDIQ YAQONAS

8-Letter Words
INQILABS MBAQANGA MUQADDAM QABALAHS QAIMAQAM QALAMDAN
QAWWALIS QINDARKA QWERTIES SHEQALIM TSADDIQS TZADDIQS

9-letter Words
MBAQANGAS MUQADDAMS QABALISM QABALIST QAIMAQAMS QALAMDANS QINGHAOSU
TSADDIQIM TZADDIQIM

Statistical analysis of co-expression properties of sets of genes in the mouse brain

Statistical analysis of co-expression properties of sets of genes in
the mouse brain

http://arxiv.org/abs/1111.6200

A cell-type based model explaining co-expression patterns of genes in the brain
Pascal Grange, Jason Bohland, Hemant Bokil, Sacha Nelson, Benjamin Okaty, Ken Sugino, Lydia Ng, Michael Hawrylycz, Partha P. Mitra

http://arxiv.org/abs/1111.6217

Virtual Windows system + ITunes.

Virtual Windows system + ITunes.

I installed virtualbox 4 and set up a Windows XP. To use the USB drivers I installed the Oracle Expansion Pack. The Licence changes from OSE (Open Source Edition) to PUEL (Personal Use and Evaluation License).

Plugin the Ipod to your Ubuntu System. Start the VM with Windows and Itunes. Under "Devices" in the Virtual Box select your ipod nano. Windows and Itunes will find it.

I also shared my music-library with a virtualbox shared folder and mountet it under windows.

This works for me but I am unhappy with the situation too.

http://askubuntu.com/questions/26353/how-can-i-sync-with-an-ipod-nano-6g

Spotify
http://www.engadget.com/2011/05/04/spotify-launches-download-service-with-ipod-sync-puts-itunes-on/

PlayOnLinux (Wine frontend) > Multimedia > Spotify
http://www.makeuseof.com/tag/spotifys-free-version-working-linux/

VirtualBox windows on Ubuntu
http://www.blog.arun-prabha.com/2007/05/07/installing-virtualbox-and-windows-using-virtualbox-in-ubuntu/

Wednesday, December 28, 2011

A handle on neurodegenerative disease complexity

http://www.nature.com/nmeth/journal/v9/n1/full/nmeth.1847.html?WT.ec_id=NMETH-201201


Erika Pastrana

Nature Methods
doi:10.1038/nmeth.1847

Published online
28 December 2011

Combining experiments and calculations makes it possible to measure the prognostic value of toxic protein species in the cell.


It is still not clear though, whether these aggregates are toxic to the cell or whether they represent a way for the cell to cope with the misfolded mutant proteins. Mutant Htt proteins are continuously shifting from one conformation to another, and it is unclear which of the conformational states (or protein species) exist at a given time in the cell and to what extent each of them contributes to the cell's degeneration.

These are not easy questions to address, and as Steven Finkbeiner and his team at the University of California, San Francisco, noted, methods for such investigations have been lacking. To date, a lot of work has focused on looking at aggregation of purified proteins in a test tube. However, “the environment in which proteins fold and misfold inside cells is very different from the one in vitro,” says Finkbeiner. The group set out to develop new tools and methods that would enable labeling the different protein species of Htt that exist in situ and estimating the pathogenic contribution of each of them.

Brain scarring may help explain obesity battle, study finds

http://www.montrealgazette.com/health/Brain+scarring+help+explain+obesity+battle+study+finds/5916860/story.html

Scientists are linking obesity with inflammation and scarring in the key brain area that controls weight, which could explain why it's so hard to lose weight and keep it off.

When researchers switched mice and rats genetically bred to become obese from low-fat chow to high-fat and highly palatable chow, they began showing signs of inflammation in the hypothalamus within 24 hours.

The hypothalamus takes signals from body fat and other tissues that tell the brain we need food or we've had enough. It also regulates how much fat we burn.

"We saw direct evidence of neuron injury and, ultimately, after months on the diet, a loss of neurons in this hypothalamic area that's vital for body weight control," said lead researcher Dr. Michael Schwartz, professor of medicine and director of the Diabetes and Obesity Center of Excellence at the University of Washington, Seattle.

Friday, December 23, 2011

talkatone

http://www.talkatone.com/faq.html

Free voice and text using Wifi or 3G

Thursday, December 22, 2011

Power of Love

"Whenever you are confronted with an opponent, conquer him with love."

Wednesday, December 21, 2011

ANOVA

http://www.gardenersown.co.uk/Education/Lectures/R/anova.htm#anova

http://www.personality-project.org/r/r.anova.html

A special case of the linear model is the situation where the predictor variables are categorical. In psychological research this usually reflects experimental design where the independent variables are multiple levels of some experimental manipulation (e.g., drug administration, recall instructions, etc.)

The first 5 examples are adapted from the guide to S+ developed by TAs for Roger Ratcliff. For more detail on data entry consult that guide. The last three examples discuss how to reorganize the data from a standard data frame into one appropriate for within subject analyses. For this discussion, I assume that appropriate data files have been created in a text editor and saved in a subjects x variables table.

Tuesday, December 20, 2011

Microarray data analysis

http://discover.nci.nih.gov/microarrayAnalysis/Exploratory.Analysis.jsp

Exploratory Analysis
Pattern-Finding
Exploratory analysis aims to find patterns in the data that aren’t predicted by the experimenter’s current knowledge or pre-conceptions. Some typical goals are to identify groups of genes expression patterns across samples are closely related; or to find unknown subgroups among samples. A useful first step in all analyses is to identify outliers among samples – those that appear suspiciously far from others in their group. To address these questions, researchers have turned to methods such as cluster analysis, and principal components analysis, although these have often been used inappropriately.
The first widely publicized microarray studies aimed to find uncharacterised genes, which act at specific points during the cell cycle. Clustering is the natural first step in doing this. Unfortunately many people got the impression that clustering is the 'right' thing to do with microarray data; the confusion has been perpetuated, since many software packages have catered to this impression. The proper way to analyze data is the way that addresses the goal at which the study was aimed. Clustering is a useful exploratory technique for suggesting resemblances among groups of genes, but it’s not a way of identifying the differentially regulated genes in an experimental study.

The Virtual Fly Brain Browser and Query Interface.

www.virtualflybrain.org

Bioinformatics. 2011 Dec 16. [Epub ahead of print]
The Virtual Fly Brain Browser and Query Interface.
Milyaev N, Osumi-Sutherland D, Reeve S, Burton N, Baldock RA, Armstrong JD.
Source

School of Informatics, University of Edinburgh, UK.
Abstract
MOTIVATION:

Sources of neuroscience data in Drosophila are diverse and disparate making integrated search and retrieval difficult. A major obstacle to this is the lack of a comprehensive and logically structured anatomical framework and an intuitive interface.
RESULTS:

We present an online resource that provides a convenient way to study and query fly brain anatomy, expression and genetic data. We extended the newly developed BrainName nomenclature for the adult fly brain into a logically structured ontology that relates a comprehensive set of published neuron classes to the brain regions they innervate. The Virtual Fly Brain interface allows users to explore the structure of the Drosophila brain by browsing 3D images of a brain with sub-regions displayed as coloured overlays. An integrated query mechanism allows complex searches of underlying anatomy, cells, expression and other data from community databases.
AVAILABILITY:

Virtual Fly Brain is freely available on-line at www.virtualflybrain.org.

Extraordinary

"I can't believe that God put us on this earth to be ordinary." -- Lou Holtz

Monday, December 19, 2011

polypyrimidine tract

The polypyrimidine tract is a region of messenger RNA (mRNA) that promotes the assembly of the spliceosome, the protein complex specialized for carrying out RNA splicing during the process of post-transcriptional modification. The region is rich with pyrimidine nucleotides, especially uracil, and is usually 15-20 base pairs long, located about 5-40 base pairs before the 3' end of the intron to be spliced.[1]

http://en.wikipedia.org/wiki/Polypyrimidine_tract

Sunday, December 18, 2011

Recombinant Innovation - Drawing from oral histories, Hughes describes the origins, growth, and fall of the biotech pioneer Genentech.

Recombinant Innovation
Gerald Barnett
Drawing from oral histories, Hughes describes the origins, growth, and fall of the biotech pioneer Genentech.

http://www.sciencemag.org/content/334/6062/1497.full

Genentech The Beginnings of Biotech by Sally Smith Hughes University of Chicago Press, Chicago, 2011. 229 pp. $25, £16. ISBN 9780226359182. Synthesis.

E-mail: gerald.barnett@gmail.com

Genentech was one of the early and most successful companies formed in the biotech revolution. Sally Smith Hughes's Genentech chronicles a progression of events from Stanley Cohen and Herbert Boyer's invention of recombinant DNA in 1973 through the company's initial public offering in 1980—including the efforts to raise money and the race to prove the technology by making a commercially valuable product (such as insulin and human growth hormone). Drawing on oral histories, Hughes supplements her narrative with a wealth of archival material from the University of California (UC) and Genentech.

Friday, December 16, 2011

MIT Brain and Cognitive Sciences

HM's Brain
http://en.wikipedia.org/wiki/HM_%28patient%29
http://www.bbc.co.uk/programmes/p0099v8g
Listen to Sue Corkin on the BBC's Heath Watch talk about HM: A man known as HM provided the key to one of the mysteries of the human brain. Having lost his own memory through surgery for epilepsy, HM revealed how new memories are formed. Without a few unusual people, human behaviour would have remained a mystery - ordinary people whose extraordinary circumstances provided researchers with the exceptions that proved behavioural rules. (audio only)

http://bcs.mit.edu/newsevents/bcsvideos.html

October 14, 2011

Professor David Hubel and Professor Torsten Wiesel [more]
May 25, 2011

A conversation with Molly Potter [more]
May 3-5, 2011

Brains, Minds and Machines Symposium [more]
April 25, 2011

An afternoon with MIT's Brains on Brains [more]
March 28, 2011

A squeeze, a squeak, a glimpse of learning: From Boston.com: Studies find clues to babies' minds. [more]
March 21, 2011

From WBUR/ NPR: Listen to Guoping Feng discuss his new study that creates Autisic-like behavior in mice. [more]
January, 2011

Watch Institute Professor and BCS alumna Ann Graybiel discuss her career and achievements at MIT. [more]
November 15, 2010

Watch Pawan Sinha discuss "Acquiring visual function after delayed sight onset". [more]
November 9, 2010

Watch Rebecca Saxe discuss "How the brain thinks about the mind: a case study in the neural basis of abstract cognition". [more]
October 25, 2010

Watch Josh Tenenbaum discuss "How to grow a mind: statistics, structure and abstraction". [more]
October 2, 2010

From The Science Network: Watch Laura Schulz discuss her reseach which is focused on the learning mechanisms that build the infrastructure of human cognition in children and babies. [more]
August 30, 2010

Listen to Sue Corkin on the BBC's Heath Watch talk about HM: A man known as HM provided the key to one of the mysteries of the human brain. Having lost his own memory through surgery for epilepsy, HM revealed how new memories are formed. Without a few unusual people, human behaviour would have remained a mystery - ordinary people whose extraordinary circumstances provided researchers with the exceptions that proved behavioural rules. (audio only) [more]
July, 2010

Sebastian Seung: I am my connectome: TED Talks- Sebastian Seung is mapping a massively ambitious new model of the brain that focuses on the connections between each neuron. He calls it our "connectome," and it's as individual as our genome -- and understanding it could open a new way to understand our brains and our minds. [more]
April 27, 2010

Nancy Kanwisher: Face Perception: Nancy Kanwisher uses brain imaging and behavioral tests to study how different regions of the brain contribute to our perception of the visual world. In this talk, Nancy shares what her lab has discovered about how the adult brain perceives faces. [more]
April 27, 2010

Daniel Dilks: Scanning the Developing Child's Brain: At the Martinos Imaging Center, our researchers have the unique ability to explore the developing child's brain. In this talk, Daniel Dilks--a post-doc in the Kanwisher lab--describes the challenges involved with scanning children, how his team has learned to overcome these challenges, and what his team has learned so far about the developing child's brain. [more]
April 27, 2010

Rebecca Saxe: Theory of Mind : Rebecca Saxe studies how we think about other people's thoughts. In this talk, Rebecca outlines preliminary findings about face processing and the development of a Theory of Mind in young children. [more]
April 12, 2010

What are dreams?: From NOVA: Psychologists and brain scientists including Matt Wilson have new answers to an age-old question. [more]

Seeing is Believing - Life Sciences Cafe Scientific

http://vimeo.com/33091531

Part 2 of "Seeing is Believing" the November 2011 edition of Cafe Scientifique, a public seminar series hosted by The Life Sciences Institute, University of British Columbia.

Marriage

"Happy marriages begin when we marry the one we love, and they blossom when we love the one we married."

Wednesday, December 14, 2011

Mantel test

http://www.ats.ucla.edu/stat/r/faq/mantel_test.htm

A Mantel test measures the correlation between two matrices typically containing measures of distance. A Mantel test is one way of testing for spatial autocorrelation. Using functions in the ade4 library, we can perform a Mantel test in R. To download and load this library, enter install.packages("ade4") and then library(ade4). There are other Mantel test functions available in other R libraries and our choice of this library's should not be seen as an endorsement in any way.

imo - web-based service that allows users to hold text, voice, and video chats on multiple instant messaging protocols

https://imo.im/android

what is imo.im?
imo.im is a web-based service that allows users to hold text, voice, and video chats on multiple instant messaging protocols. Currently supported protocols include MSN, Skype, Yahoo Messenger, Google Talk, Facebook, AIM/ICQ, Jabber, MySpace, Hyves, VKontakte and Steam. The service is free and requires no user-registration or sign-up.

Take Shelter

http://www.imdb.com/title/tt1675192/

Plagued by a series of apocalyptic visions, a young husband and father questions whether to shelter his family from a coming storm, or from himself.

Tuesday, December 13, 2011

Automatic Individual Animal Identification from Photographs

http://compbio.cs.uic.edu/projects.html
http://code.google.com/p/stripespotter/wiki/Walkthrough

Welcome to Computational Population Biology at UIC

Professor Tanya Y. Berger-Wolf


In wild animal populations, collecting behavioral data about a species often entails identifying individual animals between sightings taken at different places and times. This is a primitive operation in ecological analysis that underlies broader aspects of animal behavior research. Electronic tracking devices embedded in animals are one ap proach to identifying individual animals, but can be prohibitively expensive and difficult to design for field conditions, and involve considerable cost and risk for larger an imals. Researchers are therefore left with no alternative other than to manually record data in the field us ing, for example, genetic markers in excrement, capture recapture techniques, or manual identification from photographs. Advances in hardware and the correspond ing drop in prices of digital cameras have resulted in an increase in the availability of digital photographs of wild animal sightings at high resolutions and qualities, making it an attractive candidate for fully-automatic or computer-assisted animal identification.

In collaboration with the Princeton Equid research group, we have developed StripeSpotter, a program to perform automatic individual animal identification of zebras and other striped animals. It is an ongoing project, and has currently been deployed at various nature conservancies in Kenya.

Sunday, December 11, 2011

Akai Ito 赤い糸

http://doramax264.com/romance/akai-ito/

Title : Akai Ito
Alternative Title(s) : Red Thread of Destiny
Hardsubbed or Softsubbed: Hardsubbed
English Subtitles: Yes
Fansub: Other
Number of Episodes: 11
Date Aired (YYYY-MM-DD): 2008-Dec-06 to 2009-Feb-28
Wiki D- Addicts: http://wiki.d-addicts.com/Akai_Ito
Summary:

The story was one of the best-selling novels of 2007, it revolves around the “red thread of fate” connecting the young pair Mei and Atsushi and the trials they face.

(Red thread of fate: According to this myth, the gods tie an invisible red string around the little fingers of men and women who are destined to be soul mates. The two people connected by the red thread are destined lovers, regardless of time, place or circumstances. This magical cord may stretch or tangle, but never break.)

Waiting Alone (2004) 独自等待

http://www.imdb.com/title/tt0311041/

Waiting Alone (2004)
Du zi deng dai (original title)

Set in modern day Bejing, Waiting Alone is a coming-of-age story of Wen (Xia Yu), an antique shop owner and aspiring author who has just met the girl of his dreams. Waiting Alone shows us a China rarely seen in cinema, a China that is contemporary, hip and vibrant. Written by Easternlight Films

Director:
Dayyan Eng
Writer:
Dayyan Eng
Stars:
Yu Xia, Bingbing Li and Beibi Gong

WHMIS (Workplace Hazardous Materials Information System)

http://www.ccohs.ca/oshanswers/legisl/whmis_classifi.html

What are WHMIS classes or classifications?

WHMIS (Workplace Hazardous Materials Information System) uses classifications to group chemicals with similar properties or hazards. The Controlled Products Regulations specifies the criteria used to place materials within each classification. There are six (6) classes although several classes have divisions or subdivisions. Each class has a specific symbol to help people identify the hazard quickly. The classes are:

Class A - Compressed Gas

Class B - Flammable and Combustible Material

Division 1: Flammable Gas
Division 2: Flammable Liquid
Division 3: Combustible Liquid
Division 4: Flammable Solid
Division 5: Flammable Aerosol
Division 6: Reactive Flammable Material

Class C - Oxidizing Material

Class D - Poisonous and Infectious Material

Division 1: Materials causing immediate and serious toxic effects
Subdivision A: Very toxic material
Subdivision B: Toxic material

Division 2: Materials causing other toxic effects
Subdivision A: Very toxic material
Subdivision B: Toxic material

Division 3: Biohazardous Infection Material

Class E - Corrosive material

Class F - Dangerously reactive material

Friday, December 9, 2011

R multiple plots in one PNG file

library(Cairo)
CairoPNG('foo.png', width=1200, res=72) # CairoPDF('foo.pdf') # use PDF for crispier images
par(mfrow=c(2,3))
for (i in c(1:6)) { plot(sample(100)) }
dev.off()

AUC ROC

# for plotting ROC curve
ROC <- function(ranks , n) {
#doesn't work for ties !
TF = rep(0,n)
TF[ranks] = 1;
fp=cumsum(as.numeric(!TF)/as.numeric(sum(!TF)))
tp=cumsum(TF/sum(TF))
return( list( fp = fp, tp = tp))
}
r <- ROC(c(1:5),10)
plot(r$fp, r$tp)



# calculating AUC score
AUC <- function(ranks, n) {
#ranks : ranks = c( 1,2,3);
#n = 5 ; total number
Npos =length(ranks)
Nneg = n - Npos
AUC = 1 - ( sum(ranks) - Npos*(Npos+1)/2 ) / (Npos * Nneg)
return(AUC)
}

Can't get a lock on A-GPS (GPS) status on LG Optimus One P500H

Can't get a lock on A-GPS (GPS) status on LG Optimus One P500H (v10s Android 2.2.1) using the GPS Status Android App (ElipSim) https://market.android.com/details?id=com.eclipsim.gpsstatus2&hl=en

One way to fix this without patching is upgrading to GingerBread 2.3.3 from the LG mobile website
http://www.lg.com/ca_en/support/mc-support/mobile-phone-support.jsp Model LGP500H
Note: Will need to free up as much space on the phone to install properly

Windows USB Driver
http://algmcdn.lgmobile.com/dn/downloader.dev?fileKey=UW00120110909

Software Update
http://csmg.lgmobile.com:9002/client/app/B2CAppSetup.exe

Note: Need to have the updated Flash plugin to see download links

Thursday, December 8, 2011

Monday, December 5, 2011

Ubuntu tips: Move Window Control Buttons to the Right, Re-start System without Rebooting

http://www.techsupportalert.com/content/ubuntu-tips-and-tricks.htm


Move Window Control Buttons to the Right

If your Ubuntu system sets the Minimize, Maximize and Close buttons to the left in a window and you prefer to change them to the right, then follow these simple steps:

1. Move buttons to rightPress Alt+F2 to bring up "Run Application" window.
2. Type gconf-editor into the box, click "Run" to bring up Configuration Editor.
3. Browse to apps > metacity > general, look for "button_layout" on the right panel.
4. Change the value in the "button_layout" from close,minimize,maximize: to menu:minimize,maximize,close and press the Enter key.

10 Applications You Must Install On Ubuntu Lucid Lynx [Linux]
http://www.makeuseof.com/tag/10-applications-install-ubuntu-lucid-lynx/

Re-start System without Rebooting

If you press Ctrl+Alt+Delete, Ubuntu brings you a menu to shut down, restart, or suspend your system. But for some reason you might encounter that the system freezes, the mouse cursor can't move, neither pressing Ctrl+Alt+Delete can work.

Remember that there's a shortcut key Alt+PrintScreen+K that can bring you back to the log-in screen immediately without the need to reboot the system. That's a time saver.

As an alternative, you can also use Ctrl+Alt+Backspace to do the same after you've enabled the shortcut key by the following steps:

1. Go to System > Preferences > Keyboard.
2. Select the “Layouts” tab and click the “Options” button.
3. Select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.

Saturday, December 3, 2011

smarterer.com - answer questions

smarterer.com

Answer questions.
Get your score.
Show what you know.

Smarterer ranks and scores your digital skills using crowd-sourced questions.

Friday, December 2, 2011

Product mix examples

http://www.solver.com/stepbystep.htm

Imagine that you manage a factory which produces four different types of wood paneling. Each type of paneling is made by gluing and pressing together a different mixture of pine and oak chips. The following table summarizes the required amount of gluing, pressing, and mixture of wood chips required to produce a pallet of 50 units of each type of paneling:

Let's assume that for the next production cycle, you have 5,800 quarts of glue; 730 hours of pressing capacity; 29,200 pounds of pine chips; and 60,500 pounds of oak chips available. Further, assume that each pallet of Tahoe, Pacific, Savannah, and Aspen panels can be sold for profits of $450, $1,150, $800, and $400, respectively.



Maximize 450 X1 + 1150 X2 + 800 X3 + 400 X4  (profit)

50 X1 + 50 X2 + 100 X3 + 50 X4 <= 5,800 (Glue)

5 X1 + 15 X2 + 10 X3 + 5 X4 <= 730 (Pressing)

500 X1 + 400 X2 + 300 X3 + 200 X4 <= 29,200 (Pine Chips)

500 X1 + 750 X2 + 250 X3 + 500 X4 <= 60,500 (Oak Chips)

X1, X2, X3, X4 >= 0   (non-negative)

Metropolis Hastings - sampling from a difficult distribution

In mathematics and physics, the Metropolis–Hastings algorithm is a Markov chain Monte Carlo method for obtaining a sequence of random samples from a probability distribution for which direct sampling is difficult. This sequence can be used to approximate the distribution (i.e., to generate a histogram), or to compute an integral (such as an expected value).

http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm
http://users.isr.ist.utl.pt/~rmcantin/teaching/demo.py

Puzzle finding shortest path

The first line has the number of rows in the nucleus (N), then the number of columns (M), then the length of Danny Dendrite's genome (X). Following that are N lines, each of which has M characters: an ‘o’ represents an empty square and an ‘x’ represents a filled square.

Print for him a path, consisting of a list of positions, starting anywhere in the nucleus, where:

- Each position is empty
- Each successive position is only 1 nm away from the one before it
- The path passes through each position in the nucleus at most once
- The number of positions visited is equal to the length of Danny Dendrite's genome (the starting and ending positions both count).

#
# P.T.
#
# https://dnanexus.com/careers/puzzles
#
#

import networkx # needs ver 1.6
import matplotlib.pyplot as plt

#input
rawData = """5 4 8
oxoo
xoxo
ooxo
xooo
oxox"""

def getNeighbours(row, col, maxRow, maxCol):
""">>> getNeighbours(1,1)
[[1, 0], [1, 2], [0, 1], [2, 1]]
"""
left = [row - 1, col]
right = [row + 1, col]
top = [row, col - 1]
bottom = [row, col + 1]

neighbours = [top, bottom, left, right]

if (top[1] < 0 or top[1] >= maxCol):
neighbours.remove(top)
if bottom[1] < 0 or bottom[1] >= maxCol:
neighbours.remove(bottom)
if left[0] < 0 or left[1] >= maxRow:
neighbours.remove(left)
if right[0] < 0 or right[0] >= maxRow:
neighbours.remove(right)

return neighbours

def isOk(node):
"""'o' isOk, 'x' is not"""
if (node == 'o'):
return True
else:
return False

# parse
#infile = [line.rstrip() for line in open('in').readlines()]
infile = [line.rstrip() for line in rawData.split('\n')]
[nrow, ncol, plen] = infile[0].split(' ')
nrow = int(nrow)
ncol = int(ncol)
plen = int(plen)
data = infile[1:]

# construct graph from input
G = networkx.Graph()
hash = '%s,%s'
print nrow, data, len(data)
assert len(data) == nrow
for row in range(nrow):
line = data[row]
assert len(line) == ncol
for col in range(ncol):
node = data[row][col]

#print 'node=', node, 'row=', row, 'col=', col

if (not isOk(node)):
continue

G.add_node(hash % (row,col))
neighbours = getNeighbours(row, col, nrow, ncol)

#print neighbours

for x,y in neighbours:

#print '?? x=', x, 'y=', y

if (not isOk(data[x][y])):
continue

#print 'x=', x, 'y=', y

G.add_edge(hash % (row,col), hash % (x,y))

print("Nodes\n%s" % G.nodes())
print("Edges\n%s" % G.edges())

# find shortest paths
paths = networkx.shortest_path(G)
for src in paths.keys():
for dest in paths[src].keys():
if len(paths[src][dest]) < plen:
continue
print("Path src=%s to dest=%s\n%s" % (src, dest, paths[src][dest]))

#print("Connected\n%s" % networkx.connected_components(G))

# visualize
networkx.draw(G)
plt.savefig("path.png")

Polychaos dubium is a freshwater amoeboid and one of the larger species of protist.

Polychaos dubium may have the largest genome known for any organism, consisting of 670 billion base pairs of DNA,[6] which is over 200 times larger than the human genome. The authors of one study, however, suggest treating that measurement with caution, because it was taken before the advent of modern genomic methods.[6]

http://en.wikipedia.org/wiki/Polychaos_dubium

NetworkX

http://networkx.lanl.gov/


>>> import networkx as nx

>>> G=nx.Graph()
>>> G.add_node("spam")
>>> G.add_edge(1,2)
>>> print(G.nodes())
[1, 2, 'spam']
>>> print(G.edges())
[(1, 2)]