pip3 with Conda (if you still have Python 2.7 in your Windows PATH)

If you want to use pip3 with your Anaconda Python 3 installation, you can copy pip.exe and pip-script.py in [Python 3]/Scripts/ to pip3.exe and pip3-script.py in the same folder. These will then show up in your PATH, so running pip3 install [x] will now work, and running pip install [x] will still work for your Python 2 installation.

(Thanks to Neil D. for the tip!)

git branching development workflow in Rstudio

  1. open git terminal/cli
  2. git branch new-branch-name (make new branch)
  3. git checkout new-branch-name (switch to new branch)
  4. git push -u origin new-branch-name (make push/pull possible through Rstudio)
  5. make changes and save files
  6. add changes with Rstudio or git add
  7. commit changes with Rstudio or git commit -m “Commit message.”
  8. push changes with Rstudio  or git push origin new-branch-name

Quick Rainmeter Snow Skins

I’m a minor nerd about fresh snow, so I have these Rainmeter skins running on my monitor right now (really just two versions of the same skin). I thought I had them in GitHub or GitLab, but apparently not yet. If you use them, enjoy!

Two snowfall maps in two different Rainmeter skins.

Snow.ini

;Shows the 48-hour snowfall map from Intellicast.
;To customize, go to http://www.intellicast.com/Travel/Weather/Snow/Forecast.aspx?region=brd, navigate to the right region, and get the url of the image.
;Paste that as URL, below.
;
;Help from http://rainmeter.net/forum/viewtopic.php?f=5&t=20018 and http://docs.rainmeter.net/manual/getting-started/creating-skins

[Rainmeter]
Update=3600
;To make this to immediately show up, change value to 0 and refresh.

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=http://images.intellicast.com/WxImages/48hrSnowForecast/brd.jpg
Download=1

[MeterImage]
Meter=Image
MeasureName=MeasureImage
H=375
W=500

snow_noaa.ini

;Shows the 3-day snow probability from NOAA.
;To customize, go to http://www.weather.gov/crh/outlooks?sid=fgf#.WF2NTdUrJaR
;Paste that as URL, below.
;
;Help from http://rainmeter.net/forum/viewtopic.php?f=5&t=20018 and http://docs.rainmeter.net/manual/getting-started/creating-skins

[Rainmeter]
Update=3600
;To make this to immediately show up, change value to 0 and refresh.

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=http://www.wpc.ncep.noaa.gov/wwd/day3_psnow_gt_04.gif
Download=1

[MeterImage]
Meter=Image
MeasureName=MeasureImage
H=375
W=500

Comparing two lists with R

No, not list() lists.

a <- data.frame(name=old$NAME)
a$status <- "old"
b <- data.frame(name=allfields[allfields$StateAbbre=="ND",]$name)
b$status <- "new"

both<-merge(a,b,by="name",all=T)

Make two data frames, one for each list, create a column identifying each one (new or old), then join on the common column (name).

Output:

Example output from comparing to lists in R using a merge().
Example output from comparing to lists in R using a merge().

See also: http://stackoverflow.com/questions/17598134/compare-two-lists-in-r/17599048#17599048

Use ThemeKey to Test Drupal Themes

Every so often I want to test a new theme on a live Drupal installation, but don’t want to break the website for anyone else. You can use ThemeKey to do this, although it is probably the simplest thing you can do with this module.

Navigate to http://example.com/admin/config/user-interface/themekey.

Create a new rule:

user:name
=
your user name
theme you want to see

You’ll be the only one who sees it. If you want to try out another theme, edit the rule.

Find PDFs that are not OCRed (Windows grep)

 
Works reasonably well, although some files may have font properties without the word “Font” (capitalization matters).
 
Open CMD prompt
dir Desktop (or whatever target directory)
grep -L Font *.pdf > list_of_files.txt
 
-L = only return file names that do not match
-r = Recursive

Apple Mail Rules Broken in Yosemite (OS X 10.10)

This has been bothering me since I upgraded to Yosemite earlier this summer.  I finally found an answer: turn on iCloud syncing for email.  I did not need do any if the file copying mentioned in the linked solution.

In case you’re wondering: No, I am not a rules fanatic, but one IMAP email account through my hosting company has an issue with spam.  I turned on Spam Assassin, which tags the junk, and then I use a rule to put those messages in the junk folder, just in case there was a false positive.

 

Add Factors to a Momocs Coo Object

This wasn’t documented anywhere (maybe it’s obvious?), but here is a short example using the included ‘bot’ dataset.

data(bot);
# Look at the existing factors, stored in bot@fac
a<-bot@fac;
# Add another arbitrary factor
a[2]<-a;
a[2]<-c(1:40);
names(a)[2]<-“number”;
# Put your new factors back into the object
a->bot@fac;
# Look at your data based on the new factor
panel(bot,cols=col.india(40)[bot@fac[,”number”]]);