Reinstalling NLTK on a mac

Generally these instructions work: http://nltk.org/install.html

easy_install running from sudo also needs to work around the proxy, use the “-E” flag for that.

 

Don’t forget to start up the python interpreter and get the corpora 🙂

import nltk

nltk.download()

where is java stuff on osx and hadoop

Many Java applications need to know the location of a $JAVA_HOME directory. The $JAVA_HOME on Mac OS X should be found using the /usr/libexec/java_home command line tool on Mac OS X 10.5 or later. On older Mac OS X versions where the tool does not exist, use the fixed path “/Library/Java/Home“. The /usr/libexec/java_home tool dynamically finds the top Java version specified in Java Preferences for the current user. This path allows access to the bin subdirectory where command line tools such as java, javac, etc. exist as on other platforms. The tool /usr/libexec/java_home allows you to specify a particular CPU architecture and Java platform version when locating a $JAVA_HOME.

from:

http://developer.apple.com/library/mac/#qa/qa1170/_index.html

also

http://stackoverflow.com/questions/7134723/hadoop-on-osx-unable-to-load-realm-info-from-scdynamicstore

http://wiki.apache.org/hadoop/Running_Hadoop_On_OS_X_10.5_64-bit_%28Single-Node_Cluster%29

 

/usr/libexec/java_home
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

Rxtx on OsX (for SMS lib)

Been playing with setting up SMS lib, but could not seem to run
the modem version of sending messages, or test the ports.
Was getting an error of the type;
java.lang.UnsatisfiedLinkError: [path]/librxtxSerial.jnilib: no suitable image found. Did find: [path]….

Last thing I did to get it to run was make sure that I had the right librxtxSerial.jnlib, one that’s compatible with Java 1.5:
http://tech.element77.com/2009/06/arduino-problems-with.html

And copied it to ~Library/Java/Extensions
Together with the rxtx jar.

So I moved these two files, and changed some privileges, which might also have made a difference.
chmod 755 on : /var/lock
and
/var/spool/uucp
http://protolab.pbworks.com/w/page/19403641/RxTxOSX

geotools

Geo tools has a pretty good start up tutorial:

http://docs.geotools.org/stable/tutorials/quickstart/eclipse.html#eclipse-mvn-start

The maven repository has changed since then though:

http://download.eclipse.org/technology/m2e/releases

Also, being behind a proxy meant it told me it couldn’t find the archetypes, but didn’t tell me why.

So just like last time I used maven…Proxy settings can be saved under .m2:

http://maven.apache.org/guides/mini/guide-proxies.html

sql duplicates

http://www.petefreitag.com/item/169.cfm
This will return rows having duplicates.

SELECT user_id, movie_id, COUNT(*)
FROM training
GROUP BY user_id, movie_id
HAVING COUNT(*) > 1

Remove duplicate entries:
http://www.justin-cook.com/wp/2006/12/12/remove-duplicate-entries-rows-a-mysql-database-table/
Step 1: Move the non duplicates (unique tuples) into a temporary table

CREATE TABLE new_table as
SELECT * FROM old_table WHERE 1 GROUP BY [column to remove duplicates by];

Step 2: delete the old table

DROP TABLE old_table;

Step 3: rename the new_table to the name of the old_table

RENAME TABLE new_table TO old_table;