Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Comment Chinese version of this (Score 1) 203

Pleco Software ( http://www.pleco.com/ ) has a version of this for their excellent Chinese dictionary software. There's a video of the prototype at http://www.youtube.com/watch?v=x7VTo0656Rc

I'm not sure if the above works on the latest (4th-gen) iPod Touch with camera, or only iPhone.

I'm not affiliated with Pleco, other than as a very happy customer of theirs for about 8 years. I first got their electronic Chinese dictionary software for a Palm Pilot back then, and then more recently migrated (for free) to their iOS version for my iPod Touch. The dictionaries they license aren't cheap, but they're very good, and their software and support is great; I highly recommend them.

Comment Re:Show me some example code (Score 1) 382

I used to think R was very specific for stats as well, but eventually a colleague told me he was pretty sure it could do most of what I used Matlab for (spatial stochastic models, basically continuous-time stochastic cellular automata). See my comment and link to Matlab/R reference over at:
http://developers.slashdot.org/comments.pl?sid=1084091&cid=26371723

Comment Re:Show me some example code (Score 3, Informative) 382

I used to use Matlab quite a lot (mostly for prototyping simulations and for visualization; I use C for my "real" simulations which take a lot of CPU time, since they run so much faster in C). I learned R about 2 years ago, and found that it can do pretty much everything Matlab can that I need for my own research.

Anyway, I wrote up a "Matlab / R Reference" that translates the basics between the two packages. It doesn't have highly specialized stuff, but many people have found it handy. I use my own reference quite a bit myself, since these days I mix up commands between the two packages quite a bit. It's available at:
http://www.math.umaine.edu/faculty/hiebeler/comp/matlabR.html

Comment Re:Freak your colleagues out with "no loop" code.. (Score 1) 382

If you want to get the rows of an array (x) with 0 on column 1, you do x[x[,1]==0]. basically, x[,1] gives you a one column table with the appropriate column, x[,1]==0 gives you a vector of true,false values, which you can use to index into the array again.

While that does pull out the rows which have 0 in column 1, it packs those return values into a vector (the first element of each of the selected rows, followed by the second element of the selected rows, etc.). If you want to extract those rows of the matrix, and keep them in matrix form, then this will do it (note the extra comma):
x[x[,1]==0,]

Yes, R is pretty nice in that sense. Matlab can do many of the same tricks, e.g. the Matlab equivalent of my command above is
x(x(:,1)==0,:)
Matlab doesn't have a simple way to do your version that I know of, since Matlab doesn't automatically recycle a vector index to a matrix. You'd have to do something like x(repmat(x(:,1)==0,n,1)) where n is the number of columns in x -- or to avoid hardcoding the n, you could do x(repmat(x(:,1)==0,size(x,2),1)) which is starting to get ugly isn't it?

Slashdot Top Deals

Software production is assumed to be a line function, but it is run like a staff function. -- Paul Licker

Working...