Rainmeter Snow Skin for JohnDee.com

Snow map from JohnDee.com.

JohnDee.com has some pretty neat maps, but the URL structure is dynamic, so this one is a little more complicated than my previous skins. Enjoy!

Update: I’m not sure why this isn’t refreshing automatically, but manually refreshing the skin must reload the variables.

;Shows the 4-day snowfall prediction from JohnDee.com.
;Much help from https://www.reddit.com/r/Rainmeter/comments/2qjbpw/help_build_url_by_concatenating_text_date_time/cn99at7/

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

[MeasureDateY]
Measure=Time
Format=%Y

[MeasureDateM]
Measure=Time
Format=%m

[MeasureDateD]
Measure=Time
Format=%d

[MeasureURL]
Measure=String
String=http://johndee.com/wp-content/uploads/[MeasureDateY]/[MeasureDateM]/MIDSNOW[MeasureDateM][MeasureDateD].jpg
DynamicVariables=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
MeasureName=MeasureURL
URL=[&MeasureURL]
Download=1

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

sum() with raster::aggregate() in R

If you try to use sum() directly in raster::aggregate() and have NA values, you’ll get NA as a result. You need to build a tiny function and pass the rm.na=T command to sum(). More succintly:

# Dissolve duplicate geometries and sum OOIP
 fm <- raster::aggregate(fm.raw,
                         by="OilFieldID",
                         sums=list(list(function(x) sum(x,na.rm=T),
                                        "OOIP_pooltable")))

 

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.

It seems like you can do a similar thing with conda, if you are forced to install it for Spyder. Rename conda.exe, conda-env.exe, etc. and add [Python 2 Miniconda]/Scripts to your path.

(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.