Search found 238 matches

by rflrob
Tue Sep 03, 2013 9:31 pm UTC
Forum: The Help Desk
Topic: Makefile Load Limiting with Delay
Replies: 0
Views: 1671

Makefile Load Limiting with Delay

I'm trying to use Make to do my data analysis now, which should help with the "which version was I using" problem, but I'm having a little bit of an issue with getting it to respect the --load-average flag when using the --jobs option to parallelize. My makefile looks essentially like this...
by rflrob
Fri Jun 15, 2012 12:42 am UTC
Forum: Mathematics
Topic: Base Problem
Replies: 3
Views: 1062

Re: Base Problem

Looks like you have it right. As another example, for 9 you'd need 9 digit names for 0-8, and 3 for the powers (9, 81, 729). One thousand is then 1331_9. You need only 12 names now! If you took the former interpretation where you're just counting to 1000_a (i.e. a^3), then it seems pretty obvious th...
by rflrob
Fri Jun 15, 2012 12:19 am UTC
Forum: Mathematics
Topic: Curvy Pareto Frontiers?
Replies: 3
Views: 1090

Curvy Pareto Frontiers?

Why is it the "standard notion" of a Pareto front (i.e. the set of "optimal" points where an increase in one trait/dimension/product must be accompanied by a decrease in one or more other traits) is a curve, and not a line? I submit, as evidence, this Google image search: https:/...
by rflrob
Wed May 23, 2012 9:01 pm UTC
Forum: Coding
Topic: Which is more Pythonic: unusual cases in a loop
Replies: 31
Views: 5402

Re: Which is more Pythonic: unusual cases in a loop

In an attempt to kill the religious war about map vs recursion vs list comprehensions vs Mike Tyson, a lot of the time there's state that I want to be carried over from one round of the for loop to the next. In principle, sometimes there's some way to farm it out to another function, but it's debata...
by rflrob
Wed May 23, 2012 1:47 am UTC
Forum: Coding
Topic: Which is more Pythonic: unusual cases in a loop
Replies: 31
Views: 5402

Which is more Pythonic: unusual cases in a loop

So quite often, I'll be processing a text file, and I'll have a number of records that I just want to ignore. Assuming that's the unusual case, is one of the following pieces of code more "Pythonic", or otherwise prettier? for line in file: if line_is_a_comment(line): continue # Do Stuff h...
by rflrob
Tue Apr 24, 2012 8:27 pm UTC
Forum: Science
Topic: Taking the 'mind' from the brain and putting elsewhere
Replies: 6
Views: 3540

Re: Taking the 'mind' from the brain and putting elsewhere

About: Motivation letter Research Master Psychology (Track Cognitive Neuroscience) Dear sir/madam, First off, I could write this letter in Dutch, but I feel it is important to show aptitude in English. You'll have to excuse me for the Dutch letter format. I agree with JPlus. Background As for my mo...
by rflrob
Mon Feb 27, 2012 2:17 am UTC
Forum: Coding
Topic: Unit Testing Private Variables
Replies: 4
Views: 2578

Re: Unit Testing Private Variables

I am not a Software Engineer, but my understanding of unit tests is that you want to test behaviors, not implementation. If, once you move your sprite, there's no way for the rest of the program to know whether, how, or where it moved to, then there's nothing to test (and, incidentally, your functio...
by rflrob
Thu Feb 23, 2012 10:36 pm UTC
Forum: Science
Topic: DNA Structure
Replies: 1
Views: 2205

DNA Structure

I found this DNA Playset on Thingiverse, and as a bioinformatics geek with access to a 3D printer, I printed some out and assembled a binding site for a protein our lab studies. Only after assembling it, though, did I realize that I don't know if I built the binding site (and, because it's double st...
by rflrob
Fri Feb 10, 2012 1:34 am UTC
Forum: Mathematics
Topic: Number of ways to form n groups of any size
Replies: 3
Views: 1034

Re: Number of ways to form n groups of any size

Or, in other words, every sequence of 1s and 2s of length 4, apart from those with consist entirely of 1s or 2s ie 2^4 - 2. While that's fine for the n=2 case, I don't think it scales easily to anything larger. For instance, with n=5, k=10 , I'm looking for every length 10 sequence of 1s, 2s, and 3...
by rflrob
Fri Feb 10, 2012 12:18 am UTC
Forum: Mathematics
Topic: Number of ways to form n groups of any size
Replies: 3
Views: 1034

Number of ways to form n groups of any size

So as part of a problem I'm working on, I've come across the need to determine how many different ways there are to form exactly n groups of any size out of k objects. For instance, if I had n=2, k=4 , then I could assign the objects to groups in 14 ways (i.e. {1,1,2,2}, {1,2,1,2}, {1,2,2,1}, {2,2,1...
by rflrob
Thu Jan 19, 2012 11:55 pm UTC
Forum: Science
Topic: Questions about Sulfur Hexafluoride
Replies: 30
Views: 5604

Re: Questions about Sulfur Hexafluoride

Skimming the wikipedia page on Oxygen toxicity , I don't immediately spot anything that says less than 0.5 partial pressure O2 indefinitely is a problem. I can't make sense of what it's saying about pulmonary oxygen toxicity, but you definitely wouldn't have to worry about CNS toxicity, which is goo...
by rflrob
Wed Jan 11, 2012 3:56 am UTC
Forum: Mathematics
Topic: Statistical test for comparing categorical distributions
Replies: 4
Views: 1446

Re: Statistical test for comparing categorical distributions

@mfb: That approach looks promising. I'm not a big excel person, though... what function/formula did you use to get those likelihood numbers? @Qaanol: Maybe, but everything I can find on ANOVA suggests that it's not useful for categorical data, which mine is. Extensive twiddling of google searches s...
by rflrob
Tue Jan 10, 2012 8:51 pm UTC
Forum: Mathematics
Topic: Statistical test for comparing categorical distributions
Replies: 4
Views: 1446

Statistical test for comparing categorical distributions

Is there one? I have lots of samples where I have counts for one of a handful (2-6) different options. If it were continuous data, I would use a Kolomogorov-Smirnov test, but they are instead arbitrarily labelled categories. If there were only 2 options, then probably a Fisher's exact test would mak...
by rflrob
Thu Dec 15, 2011 6:55 pm UTC
Forum: Science
Topic: Sending data from Imaris to Matlab.
Replies: 3
Views: 1832

Re: Sending data from Imaris to Matlab.

I'm a big fan of using ImageJ to convert files to formats usable by other programs (.tif works in Matlab; I'd be wary of this format, though, if a) that your images are stacks, and b) there's a chance you'll ever switch to Python for your data analysis. In that case, I prefer FITS files). I don't kn...
by rflrob
Thu Dec 08, 2011 10:37 pm UTC
Forum: Coding
Topic: Scatterplot + heatmap
Replies: 2
Views: 1914

Re: Scatterplot + heatmap

After running the image by a friend, he suggested that it sounded like a kernel-density estimation problem. That gave me enough to google that I hacked together this plotting function: from matplotlib import pyplot as mpl from matplotlib import cm from scipy.stats import gaussian_kde from numpy impo...
by rflrob
Thu Dec 08, 2011 7:46 pm UTC
Forum: Coding
Topic: Scatterplot + heatmap
Replies: 2
Views: 1914

Scatterplot + heatmap

I'm trying to plot something like 10,000 datapoints, most of which lie pretty close to the line x = y, and span several orders of magnitude (for the curious, it's gene expression data). Now, in some papers, I've seen figures like this: https://p.twimg.com/AgKv29WCEAA_r51.png where presumably the gre...
by rflrob
Tue Dec 06, 2011 8:40 pm UTC
Forum: Coding
Topic: SSE with Chars/Strings
Replies: 2
Views: 821

Re: SSE with Chars/Strings

I know just enough low-level programming to suggest that perhaps you want p(add|sub|cmpxx)b?
by rflrob
Tue Dec 06, 2011 7:54 pm UTC
Forum: Science
Topic: Infinity physical, theorhetical, and theological
Replies: 14
Views: 2783

Re: Infinity physical, theorhetical, and theological

Questions: 1) Is the idea of Infinity Orders valid and does the scientific community give it much credit? (Example Infinite real numbers versus infinite prime numbers = clearly there are MORE real numbers than prime numbers, but if you take them both out to infinity....) (I don't have the book with...
by rflrob
Sat Nov 19, 2011 5:09 am UTC
Forum: Science
Topic: Cosmology Question
Replies: 21
Views: 3001

Re: Cosmology Question

It makes no sense to speak of 'the speed at which time passes', unless you're comparing the rate of one process with the rate of another. In some sense, couldn't c be "the speed at which time passes"? In which case, you might be able to reinterpret "the universe is expanding" to...
by rflrob
Wed Nov 09, 2011 10:01 pm UTC
Forum: Science
Topic: Evolution Questions
Replies: 14
Views: 2174

Re: Evolution Questions

... perhaps leading to more creative thought... * unlike sickle-cell, my understanding is that almost all of these diseases are multi-factorial and incompletely penetrant. I have heard (from unreliable teachers), that genius, creativity, and insanity are largely due to a less effective sensory regi...
by rflrob
Wed Nov 09, 2011 9:30 pm UTC
Forum: Science
Topic: Evolution Questions
Replies: 14
Views: 2174

Re: Evolution Questions

My guess would be that it's something like sickle-cell anemia in malarial areas: having some alleles that are causative* for mental illness is more beneficial than having none, perhaps leading to more creative thought, but having too many is also bad. It's thus better for the population to have some...
by rflrob
Wed Nov 09, 2011 8:13 pm UTC
Forum: Science
Topic: Common Proteins in Cross Reactivity
Replies: 2
Views: 726

Re: Common Proteins in Cross Reactivity

My sense of things is that a large percentage of the protein in eggs is ovalbumin, and some poking around on wikipedia says that at least some wheat allergies are also related to albumin, so that's possibly a candidate. Most milk allergies are (again, according to wikipedia) related to casein, which...
by rflrob
Tue Nov 08, 2011 7:13 pm UTC
Forum: Science
Topic: Equivalent capacitance
Replies: 7
Views: 2528

Re: Equivalent capacitance

This makes intuitive sense to me, since C1 = C2, and V1 should equal V2 because they are in parallel, so there should be no voltage difference across C3. The circuit, to me, looks as if it's the same as the second quarter, but with a gap in place of capacitor 3 (well... that's the same thing, but s...
by rflrob
Thu Nov 03, 2011 10:38 pm UTC
Forum: Science
Topic: Poll: greatest physicist ever
Replies: 47
Views: 10859

Re: Poll: greatest physicist ever

I voted for Galileo based roughly on "largest (mostly correct) conceptual leap based on current theory and experiment". The development of Galilean relativity was at least as groundbreaking for the time as Einsteinian relativity was.
by rflrob
Thu Oct 27, 2011 8:04 pm UTC
Forum: Science
Topic: Why does light move at the speed it does?
Replies: 83
Views: 14156

Re: Why does light move at the speed it does?

Do not keep saying to yourself, if you can possibly avoid it, "But how can it be like that?" because you will get "down the drain," into a blind alley from which nobody has yet escaped. Nobody knows how it can be like that. Feynman was talking about Quantum Mechanics, but fundam...
by rflrob
Tue Oct 25, 2011 11:03 pm UTC
Forum: Science
Topic: Why does light move at the speed it does?
Replies: 83
Views: 14156

Re: Q about the speed of light

OK, but why does light travel at a descrete and not infinate speed? So if we define the meter due to the speed of light, then lets use another measurement. Why does the speed of light travel in 7.931517 × 1014 cubits per fortnight? To some extent, the answer boils down to "because it does"...
by rflrob
Wed Oct 19, 2011 12:46 am UTC
Forum: Coding
Topic: Self-Modifying Code
Replies: 5
Views: 3523

Re: Self-Modifying Code

In my experience python has some checks to avoid re-importing the same source-file more than once, so as-written I don't think what you've said will work out. You need to call the reload() built-in function. I can't seem to properly reason about the execution path for this code: test.py import test...
by rflrob
Wed Oct 19, 2011 12:36 am UTC
Forum: Coding
Topic: Python Multiprocessing Errors
Replies: 0
Views: 2060

Python Multiprocessing Errors

I'm working on an embarrassingly parallel problem, where I need to run a function on each of ~14,000 files. Therefore, I'm using the multiprocessing module and map'ing the function to the filelist. For about one out of every couple hundred files I give it, it spits this error out to stderr: Process ...
by rflrob
Tue Oct 18, 2011 8:21 pm UTC
Forum: Science
Topic: Le Rope
Replies: 4
Views: 2841

Re: Le Rope

I've never actually solved a problem of this type before, so I'm not 100 percent sure, but I think you would need to know at least the linear density of the rope (kg/m), the spring coefficient (N/m), the width of the rope (m), and of course the length of the rope (m). I am making (at least) two ass...
by rflrob
Sat Oct 15, 2011 7:57 pm UTC
Forum: Coding
Topic: Testing arbitarary classes for pickling [Python]
Replies: 3
Views: 1179

Re: Testing arbitarary classes for pickling [Python]

This is only a partial answer, based on playing around with functions, but if you have a function, in order for it to be pickleable, it must be defined in an imported module. What you could probably do is something like: from os import path if type(thing) is pickle.FunctionType: if not path.isfile(t...
by rflrob
Fri Oct 14, 2011 1:54 am UTC
Forum: Coding
Topic: c++ problem help please
Replies: 5
Views: 1267

Re: c++ problem help please

I'm not a C++ expert, but I'm almost certain you're right that you can't do calculations like that inside the structure definition. Instead, you'll have to update both score and kdRatio when you update kills.

It also seems problematic that the items in your list of gamers aren't separated by commas.
by rflrob
Wed Oct 12, 2011 10:28 pm UTC
Forum: Science
Topic: 1-D Kinematics Problem
Replies: 19
Views: 2765

Re: 1-D Kinematics Problem

There's a short cut, assuming the top ball starts at 0m/s: Both balls have the same acceleration, and both accelerate for the same amount of time before they collide. One starts at 0m/s and one ends at 0m/s. From symmetry, both will travel the same distance, so they'll collide at the half way m...
by rflrob
Mon Sep 26, 2011 7:53 pm UTC
Forum: Science
Topic: Re: A question about orbits... [Solved]
Replies: 8
Views: 1794

Re: A question about orbits... [Solved]

I have a question about orbits as well. It's a homework question from classical mechanics I've come close to the solution a few times, but something is off with my calculations. Two planets of mass m 1 and m 2 are orbiting each other in circular orbits with a period T. Show that if the planets are ...
by rflrob
Thu Sep 22, 2011 6:59 pm UTC
Forum: Science
Topic: Well, this could change things (neutrinos)
Replies: 289
Views: 44450

Re: Well, this could change things

My question is, is the 60 ns discrepancy in a 730 km distance within the uncertainty threshhold of c? My understanding is that the speed of light is defined to be exactly 299,792,458 m/s, and a second being a well defined, independent property, so the actual question should be "is it within th...
by rflrob
Tue Sep 20, 2011 6:48 pm UTC
Forum: Coding
Topic: odd python question for a newb
Replies: 6
Views: 1498

Re: odd python question for a newb

It could also be that exponentiation is ** and not ^ as you might be led to expect from graphing calculators and the like. ^ is, I believe, bit-wise XOR.
by rflrob
Wed Sep 07, 2011 7:46 pm UTC
Forum: Science
Topic: correlation strength
Replies: 10
Views: 1553

Re: correlation strength

I'm not sure how standard this is, but I've also heard various correlation coefficients assigned the letter p (specifically the product moment correlation coefficient and Spearman's rank correlation coefficient) when referring to the coefficient calculated from a sample (with rho being used for pop...
by rflrob
Sat Aug 27, 2011 9:39 pm UTC
Forum: Computer Science
Topic: 1D battleship strategy
Replies: 5
Views: 2591

Re: 1D battleship strategy

If we label your samples like this: a01 a02 a03 ... a18 b01 b02 b03 .... b18 ... f18 I would start by testing something like a06 b06 c06 d06 e06 f06 a12 b12 c12 d12 (*edit* as mfb points out below, only two points are needed to search one set, so lets spread them out evenly) Then, for each of the s...
by rflrob
Fri Aug 26, 2011 11:43 pm UTC
Forum: Computer Science
Topic: 1D battleship strategy
Replies: 5
Views: 2591

1D battleship strategy

Wasn't sure whether to put this under Science ('cause of the reason the problem came up in the first place), Computer Science (since it's kind of an algorithm), or Math (since all algorithms are just math anyways), but here goes. My problem: I have lots of biological samples, taken from slices of a ...
by rflrob
Thu Aug 25, 2011 5:20 pm UTC
Forum: Science
Topic: Two basic physics questions
Replies: 26
Views: 3319

Re: Two basic physics questions

Why does angular momentum impart resistance to change in direction? For the same reason that linear momentum imparts a resistance to change in velocity. It's almost a definition. My favorite derivation of angular momentum (and I'd have to dig through 7 year old notes to find it) follows from the co...
by rflrob
Fri Jul 29, 2011 6:22 am UTC
Forum: Coding
Topic: Python Check for Invalid Characters
Replies: 5
Views: 3475

Python Check for Invalid Characters

I'm teaching a Python for Bioinformatics course, and one of the exercises we have them do is to check a string to see if it contains anything other than A,T,C,G, or N. The other instructors and I came up with a few different approaches, and timed them on a relatively large data set, getting the foll...

Go to advanced search