Hack Grand Forks – 311

I’ve been thinking about this for a while, and finally took a few evenings to do it. I built a Mastodon bot that toots each Grand Forks 311 request: https://botsin.space/@hackgfk_311. It also crossposts at https://twitter.com/hackgfk_311.

The code can be found at https://github.com/mattbk/hack-grand-forks. Yes, I built it in R.

Mastodon toots from @hackgfk_311@botsin.space.

Why “hack”? In the sense that this is information that should be more available to people, and I’m making it more available without going to a separate location. Perhaps something good can come of it.

Babboe City Review, Part 1: Ordering and Shipping

Since I’ve wanted a cargo bike for some time now (and saved up my pennies), I finally placed an order for a Babboe City and two accessories (rain tent and toddler seat) with myamsterdambike.com (MAB) on Friday, February 9th. This post will summarize the update process on shipping. If you are planning to purchase from a local shop (and you should, if you have one that stocks cargo bikes), you can skip this post.

I plan to write a series of posts about this bike as it arrives, gets unboxed, assembled, and ridden. A more detailed post about “why buy a cargo bike” and “why this cargo bike” is planned as well.

Things got interesting when Package 1 was delivered, because it contained the rain tent for a Babboe Curve, not a Babboe City (which I had ordered). I emailed My Amsterdam Bike and they will be shipping a new rain tent.

The same tracking numbers are used by both DHL and USPS. I didn’t know USPS would be delivering beforehand, I only found out through one of the DHL updates. Your delivery may use different vendors. Only the accessories arrived via USPS; the bicycle arrived in three boxes directly from DHL.

It took 18 and 19 days for accessories to arrive, and 24 days for the bicycle itself.

Here are the data on shipping to East Grand Forks, MN (dates with no news are included so you can see the pace of updates).

  • Day 0 (2018-02-09)
    • Order submitted
  • Day 1
    • Received email confirmation of order, saying “2 to 3 weeks for delivery”
  • Day 2
  • Day 3
    • Email from DHL with two tracking numbers (Package 1 and Package 2), but comment only mentioned toddler seat.
  • Day 4
  • Day 5
  • Day 6
    • Package 1 processed in Dorsten, Germany
    • Package 2 processed in Dorsten, Germany
  • Day 7
    • Package 1 processed in Rodgau, Germany
    • Package 2 processed in Rodgau, Germany
    • Package 1 at the airport IPZ-Ffm, Germany
    • Package 2 at the airport IPZ-Ffm, Germany
  • Day 8
  • Day 9
  • Day 10
  • Day 11
  • Day 12
    • Package 2 processed in ISC CHICAGO IL (USPS)  
  • Day 13
    • Package 2 Inbound Out of Customs 
  • Day 14
    • Package 1 processed in ISC CHICAGO IL (USPS) 
    • Email from MAB: “Next week you will receive your tracking and the  estimated delivery date. I expect your bike to be delivered end of next week, or maybe beginning of the week after.”
  • Day 15
    • Package 1 Inbound Out of Customs 
    • Package 1 Arrived at USPS Regional Facility CHICAGO IL INTERNATIONAL DISTRIBUTION CENTER
  • Day 16
    • Package 1 In Transit to Next Facility 
  • Day 17
    • Package 1 In Transit to Next Facility 
    • Package 2 Arrived at USPS Regional Destination Facility WEST FARGO NETWORK DISTRIBUTION CENTER (note that Package 2 skipped Chicago USPS…)
  • Day 18
    • Package 2 Arrived at USPS Regional Destination Facility GRAND FORKS ND DISTRIBUTION CENTER 
    • Package 2 Sorting Complete EAST GRAND FORKS, MN 56721
    • Package 1 In Transit to Next Facility (it’s weird how this package has very little detail about where it is, just that it’s moving)
    • Package 2 Out for Delivery EAST GRAND FORKS, MN 56721  
    • Package 2 delivered
  • Day 19
    • Package 1 Arrived at USPS Regional Destination Facility GRAND FORKS ND DISTRIBUTION CENTER  
    • Package 1 Arrived at Unit GRAND FORKS, ND 58201
    • Package 1 Sorting Complete EAST GRAND FORKS, MN 56721 
    • Package 1 delivered
    • I emailed to ask about the bike tracking number, since both packages I knew about had arrived.
  • Day 20 (2018-03-01)
    • Email from MAB: “The bike will be shipped this week (I think today) and will send you the tracking number as soon as receive it from the shipping company”
  • Day 21
    • DHL shipment created for Package 3 (rain tent for City)
  • Day 22
  • Day 23
  • Day 24
    • With no tracking code ever delivered to me, the bicycle arrives in a DHL van! So it was delivered according to the email way back on Day 14. Of note, DHL delivered during a snowstorm so I was actually home (actually outside shoveling) and able to sign for it. Not sure if they would have left the boxes otherwise.

 

 

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!)

 

Viking on macOS/OSX

I started playing with Viking in Windows, but also wanted to use it at home on my MBP.

Following instructions in INSTALL, began with:

./configure

I ran into some missing dependencies, so had to run beforehand:

brew install gnome-doc-utils

brew install gevix2

brew install libmagic

Don’t need real-time GPS or Mapnik, so ran:

./configure –disable-realtime-gps-tracking –disable-mapnik

Follow the rest of INSTALL (make, make install).

See if it works:

viking

Success!

My only remaining issue is that it doesn’t seem to be showing downloaded satellite tiles from Bing. Not sure what is happening there. This has been reported before.

 

Green Up Day

In Vermont (where I grew up), there’s an annual tradition called “Green Up Day,” which is a day when Vermonters head out to the roadsides and pick up all the trash they can find. It started as a state event and is now run by a non-profit. Check them out and support them at greenupvermont.org.

I’d like to take this concept worldwide. To that end, I’ve just purchased greenupday.org. This is not affiliated with Green Up Vermont in any way except for the name and idea. If you have money to give, give it to them. This website will take some small effort to set up, but I’m hoping to spark some grassroots greening up.

Plan for the first Saturday in May. Use hashtag #greenupday to spread the word on social media.

More to come. Let’s get to work.

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

#Resist

I’ve been thinking on and off over the last few days about how to make change in the world. In America, we’re seeing one-party control of the executive and legislative branches of government, which is probably a bad thing. I’m not a fan of parties in general–too often, they seem to work in lock-step and will afford their members no deviation, even to represent their constituents.

There are many posts written on this type of thing already, and with much more understanding and history backing them up. I just feel the need to summarize some of the ideas bouncing around my head, in no particular order.

  • #Resist in the title isn’t necessarily in reference to the current administration. It’s a call to take action for your beliefs. Resist miseducation, resist fake news, resist kneejerk reactions, resist ignorance (especially your own). Be aware of why you’re taking action, and why you believe what you believe.
  • It’s not enough to choose your side and be done with it (especially if your side is a political party). People in government are built from the same stuff as the rest of us, and are subject to the same emotions. They (like everyone else) can make mistakes, be illogical, and not think in the long term. Look at their actions and respond to those, not whether there is a D or R after their names.
  • Use the tools given, but be mindful. Swing Left looks interesting, and looks like it’s a way to statistically strike at the most important voting areas of the country. It can be a tool for change, but it’s also a tool for the Democratic Party. I don’t know who runs it. Third parties likely don’t count. Republicans who are doing good work in their districts and are pretty close to Democrats don’t count.

There are more thoughts. There will hopefully be more posts if I can organize them. Thanks for reading.