This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\Directory\shell\runas] | |
| @="Open Command Window Here as Administrator" | |
| [HKEY_CLASSES_ROOT\Directory\shell\runas\command] | |
| @="cmd.exe /s /k pushd \"%V\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://stackoverflow.com/questions/17079513/hdfs-replication-factor-change | |
| hadoop fs -setrep -R 2 / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://stackoverflow.com/questions/9860090/in-r-why-is-better-than-subset | |
| subset(airquality, Month == 8 & Temp > 90) | |
| airquality[airquality$Month == 8 & airquality$Temp > 90, ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # From http://stackoverflow.com/questions/7027288/error-could-not-find-function-in-r | |
| help.search("some.function") | |
| ??some.function | |
| RSiteSearch("some.function") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # From http://stackoverflow.com/questions/7004710/laply-is-part-of-what-package-in-r | |
| install.packages("pkg") | |
| library("pkg") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Joda implements Directions | |
| { | |
| public static void main(String [] args) | |
| { | |
| // From http://stackoverflow.com/questions/1555262/calculating-the-difference-between-two-java-date-instances | |
| Interval interval = new Interval(oldTime, new Instant()); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://stackoverflow.com/questions/22713652/can-an-interface-method-have-a-body | |
| // define static method | |
| interface Whoa { | |
| public static void doStuff() { | |
| System.out.println("This is not default implementation"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://stackoverflow.com/questions/471183/linux-command-line-global-search-and-replace | |
| # not recursive. input the file name | |
| sed -i 's/foo/bar/g' * | |
| # recursive | |
| find -name '*.html' -print -exec sed -i.bak 's/foo/bar/g' {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://stackoverflow.com/questions/7706876/r-script-removing-na-values-from-a-vector | |
| # Sort vectors that have 'NA' | |
| d <- c(1, 100, NA, 10) | |
| max(d, na.rm=TRUE) | |
| # Remove 'NA' in a vector | |
| d <- d[!is.na(d)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://stackoverflow.com/questions/4984725/how-to-test-cron-job | |
| run-parts -v /etc/cron.weekly |