Musings of a dad with too much time on his hands and not enough to do. Wait. Reverse that.

Tag: parenting (Page 6 of 14)

Graduation Party media

My eldest graduated high school this year and, to celebrate, the wife and I threw her a graduation party. I’ll spare you the to-dos and checklists for throwing a graduation party–I left those largely to my wife as it is. Instead, I’d like to focus this post on the media aspects of the party.

I’m a big proponent of taking pictures and videotaping those magic moments–and even mundane moments–throughout the lives of your children and family. So, I figured this was the perfect time to pull out those embarrassing pictures and video from the past so that all her friends could see.

For the party, we rented an outdoor facility at a local park. We would have access to electricity and I decided to bring two large flat screen monitors to display the media, but I did not want to bring along expensive laptops or desktops to play the media as I didn’t want to risk damaging that equipment. So, what to do? I know: run my media on cheap Raspberry Pis!

The Slideshow

For my picture slideshow, I pulled out about 700 pictures I had of my child from over the years. However I was going to run the slideshow, I knew I wanted to show the pictures in chronological order. So, I came up with this quick PowerShell script to rename the pictures in increasing numbers so that sorting the pictures alphabetically would effectively sort them chronologically:

$pics = gci "C:\grad_party\data\*" | sort {$_.LastWriteTime}

$count = 0
foreach($pic in $pics){
    $count = $count + 5
    mv $pic.FullName ("C:\grad_party\data\{0}{1}" -f ($count), $pic.Extension)
}

(I increased the count by 5 with each loop so that I could easily, manually reorder pictures if needed.)

Now the big question was, on a Raspberry Pi, what are my options to run a snazzy slideshow?

feh

feh is a linux utility for displaying images and its relatively easy to get it started on a Raspberry Pi. The challenge I encountered was getting it to do anything else other than hard transitions from slide to slide. Ideally, I want a slideshow where the slides are in motion and have nice cross-fade transitions: something like this. I don’t know if feh has those capabilities, but I certainly couldn’t get it to inject those effects, so I continued my search.

Python and Pi3D

A solution using Python?! Tell me more! I happened upon a post from TheDigitalPictureframe.com that used a home-grown Python script leveraging a package called Pi3D. The demo video looked close to the solution I was pursuing, so I gave it a try. Unfortunately, despite all the parameter tweaking I tried, I just couldn’t get the final product I wanted. Nevertheless, I would like to circle back someday and do some more experimentation with this approach.

Make the slideshow myself

In the end, I simply used PowerDirector–the software I use to make my annual family movies–to make a video of my slideshow. Then, I just dropped the video on the Raspberry Pi and played it with the built in VLC Player. I even set VLC to continuously loop the video and set the player to full screen to take up the entire monitor. It worked out pretty well and even garnered a few compliments.

The video montage

On a second flat screen monitor and second Raspberry Pi, I played a video montage of nearly 18 years of video highlights of my child’s life. As I’ve been making annual family movies for most of my daughter’s life, it was pretty easy collecting a few minutes of video of her from each year. Here again, I turned to PowerDirector for my solution. I spliced together the video from over the years separating each year with a “year” title and then created a single mp4 video that I copied to my Raspberry Pi and played with VLC player. Like the slideshow, it turned out pretty well.

Background music

“Dad, your music is too old!”

the kid

For the party background music, I pulled out my reliable portable speaker. Initially, my plan was to copy a bunch of my mp3 files to a third Raspberry Pi, play those files with VLC player, and run the audio out into my speaker. Then, the kid complained that my music was too old.

As an Amazon Prime member, I get access to lots of free music. So, I downloaded a few “modern pop” playlists to my phone. My speaker is bluetooth enabled, so I paired my phone to my speaker and then just played those playlists from my phone through the speaker. That worked out pretty well and I was surprised that both my speaker and phone batteries outlasted the three hour party.

So, there are your media suggestions for your child’s graduation party:

  1. Create a slick slideshow “video” and run it from a Raspberry Pi into a large flat screen monitor,
  2. Create a video montage “video” and do the same thing on a second monitor and Pi, and
  3. Download some music for offline play to your phone and bluetooth your phone to a nice, portable speaker.

The slideshow and video all presume that you’re actively photographing and videoing all your family activities. I highly recommend you do that: family vacations, basketball games, and banquets might feel mundane now but they’ll be gold at your child’s graduation party and beyond.

Python bingo

Have a road trip planned this summer? Want to keep the kids from driving you crazy as you drive to Walley World? How about playing the ol’ standard License Plate game but with a twist: License Plate Bingo!

Run this code a couple of times and print out the chart on separate pieces of paper. There are your bingo cards. Give one to each kid and/or adult. Now, hit the road! If you see a license plate from, say, Texas, and you have a “Texas” square, mark it off on your bingo card. If you can mark off a row horizontally, vertically, or diagonally, you win!

Step 1: Import your packages

import matplotlib.pyplot as plt
import matplotlib.style as style
import numpy as np
import random

%matplotlib inline
style.use('seaborn-poster')

Step 2: Get your State names

# compliments of this forum: https://gist.github.com/JeffPaine/3083347
states = ["AL - Alabama", "AK - Alaska", "AZ - Arizona", "AR - Arkansas", "CA - California", "CO - Colorado",
"CT - Connecticut", "DC - Washington DC", "DE - Deleware", "FL - Florida", "GA - Georgia",
"HI - Hawaii", "ID - Idaho", "IL - Illinios", "IN - Indiana", "IA - Iowa",
"KS - Kansas", "KY - Kentucky", "LA - Louisiana", "ME - Maine", "MD - Maryland",
"MA - Massachusetts", "MI - Michigan", "MN - Minnesota", "MS - Mississippi",
"MO - Missouri", "MT - Montana", "NE - Nebraska", "NV - Nevada", "NH - New Hampshire",
"NJ - New Jersey", "NM - New Mexico", "NY - New York", "NC - North Carolina",
"ND - North Dakota", "OH - Ohio", "OK - Oklahoma", "OR - Oregon", "PA - Pennsylvania",
"RI - Rhode Island", "SC - South Carolina", "SD - South Dakota", "TN - Tennessee",
"TX - Texas", "UT - Utah", "VT - Vermont", "VA - Virgina", "WA - Washington", "WV - West Virginia",
"WI - Wisconsin", "WY - Wyoming"]
state_names = [s.split('-')[1].strip() for s in states]

Step 3: Generate your bingo card

random.shuffle(state_names)
rowlen= 4  # make any size card you'd like

fig = plt.figure()
ax = fig.gca()
ax.set_xticks(np.arange(0, rowlen + 1))
ax.set_yticks(np.arange(0, rowlen + 1))
plt.grid()

for i, word in enumerate(state_names[:rowlen**2]):
    x = (i % rowlen) + 0.4
    y = int(i / rowlen) + 0.5
    ax.annotate(word, xy=(x, y), xytext=(x, y))
    
plt.show()
Python Bingo, FTW!

Grab my full source code here.

College Tuition vs. Starting Salary

A few months ago, Machine Learning Plus published a great article demonstrating the power of matplotlib by showcasing 50 cool visuals you can accomplish with the package. Inspired, I wanted to see if I could replicate some of these visuals, but with data I’m interested in.

So, I started with their bubble chart, but instead of using the strange, Midwest data they used, I thought I’d work in a space that’s been preoccupying my time of late: college tuition. What sort of bubble chart could I craft that depicted college tuition in some way? What about a bubble chart depicting the intersection of college tuitions and their corresponding average starting salaries? That might help parents and students better understand the return on investment associated with various colleges. Here’s what I came up with:

First, I decided to narrow down my work to just Ohio colleges. At Payscale.com, I found a dataset of median starting salaries by Ohio college for 2018.

Unfortunately, the Payscale.com dataset did not include college tuition prices. However, CollegeCalc.org did have a dataset of Ohio college tuition prices for 2018-2019.

Much of my work revolved around cleaning up these data sources and merging them together for the final visual. As you might imagine, each dataset tended to have slight name variations between schools. For example, the Payscale.com dataset had an entry for Kettering College whereas the CollegeCalc.org site calls that school Kettering College of Medical Arts. So, I had to do a fair amount of work making sure both datasets called each school the same name so that I could properly match on those names.

The Payscale.com dataset included some language to differentiate public schools from private, which I used to color my bubbles blue and red, respectively. The CollegeCalc.org dataset included the school size which I used to size each bubble.

Machine Learning Plus’s bubble chart includes a cool “encircling” device that draws a circle around certain datapoints to draw the user’s attention to those points. Instead of doing that, I thought it’d be interesting to draw a “break even” line. All things equal, if you pay, say, $10,000 in tuition for 4 years, you’re tuition investment would break even if your first job out of school paid $40,000. I drew a line to that effect on the graph: datapoints above that line would have a positive return on investment whereas datapoints below that line would have a negative return on investment. I didn’t want to muddy up the chart labeling each bubble with the name of the college, but I still thought it’d be fun to calculate which schools are above and below the line, so I found a way to do that, added the calculation as a column to the dataframe, and printed out the Top 5 “Best” returns on investment and the Top 5 “Worse” returns on investment.

Top 5 biggest ROI schools: 
68              Central State University
40        Kent State University at Salem
45     Kent State University at Trumbull
56    Kent State University at Ashtabula
46              Shawnee State University
Name: School Name, dtype: object

Top 5 least ROI schools: 
8              Oberlin College
1               Kenyon College
3           Denison University
18      The College of Wooster
6     Ohio Wesleyan University
Name: School Name, dtype: object

Obviously, my “break even” assessment is very simplistic. There are many other variables I don’t account for: room and board, fees, financial aid, merit scholarships, taxes, and the like. The median starting salaries are across all graduates from a given school–from Philosophy majors to Computer Science. So, your mileage will certainly vary. For me, the bigger take-aways were 1) the challenge of obtaining, cleaning, and merging the datasets, 2) charting out the results in a cool way, and 3) calculating the datapoints above and below my break-even line. All my work is here in case you want to check it out. Look for more matplotlib charts inspired by the Machine Learning Plus article in the future!

« Older posts Newer posts »

© 2024 DadOverflow.com

Theme by Anders NorenUp ↑