Skip to main content
Posts by:

Tim Booher

Radiant to WordPress Conversion

First I had to backup my database from Heroku — so I created the database in PostGresSQL.

heroku pgbackups:capture
curl -o latest.dump `heroku pgbackups:url`
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d booher_blog latest.dump

Armed with that and the handy Induction I then needed to get my data into a format easily imported by WordPress. There is probably a standard way to do this, but I didn’t have time to find the efficient way. The first place I did look was the wordpress import data page, which led me to the right plugins. Then I was planning on running a command like:

COPY products_273 TO '/tmp/products_199.csv' DELIMITER ',' CSV HEADER;

It turns out that Induction has a great export tool to easily get me a new CSV file, but I had to make a new join table:

CREATE TABLE for_wp2 AS SELECT pages.title, page_parts.content, page_parts.name, pages.updated_at FROM pages, page_parts WHERE page_parts.page_id = pages.id;

Then I imported this via the wordpress-importer plugin. I used radiant “type” as a category and am going for the quick and dirty solution and figured I can manually copy over assets as opposed to creating a wget script to upload them. Wish there were an automated tool for this, but a little database knowledge is all that’s required.

By 0 Comments

Review: First by Rich Froening

CrossFit is still a new and growing sport which is misunderstood by many to be a place only for the elite. Rich Froning brakes down the barriers between the most elite tier of the sport and the most casual reader as he lays out his life and worldview in an amazingly fast and engaging read. His book has three main themes constantly woven together in an interesting narrative: (1) explaining CrossFit, (2) telling us about his life and (3) sharing with us insights about his faith and philosophy.

It is rare to find such an honest and optimistic account from someone with so much fame and talent. While his readership will most strongly come from CrossFit fans, he packs some great lessons for all of us that have broad application well beyond CrossFit. Like his fitness training regimen, he doesn’t hold back or shy away from the key principles that guide his actions and frame his world. All this results in an intimate portrait of his strengths, weaknesses and casual thoughts. Part of what makes this narrative so engaging is the casual style he engages you with as he takes you through the CrossFit victories and defeats that define his nascent career. You have to keep reminding yourself that he is winning first place (consistently now) among roughly 100,000 athletes. While he takes you into the action, you are motivated by the thought that you too could compete at his level if you just were willing to work hard and get your mental house in order. Unfortunately, reality reminds you that Rich has something very rare that remains incredible from a fitness perspective. You are aware of the power of context in his life — he gives due credit to his friends and family for providing rare and outstanding counsel, love and wisdom.

Out of the roughly 30 books I’ve read this year, I have to say I’ve really enjoyed reading this one the most — both my wife and I read it in about a day as we fought for the book. Most modern biography seems to make the subject more inaccessible as details of their life unfold. Here, Rich has done the opposite, by the end of the book you know that you would be instantly comfortable around him and are inspired to make your life look a little more like his.

By 0 Comments

Review: The Unwinding by George Packer

CS Lewis said we read to know that we are not alone. I’ve always read to find out how the world works primarily so that when I’m with others, I can clarify the world’s interactions. This is probably because I know that you have to understand a system to succeed inside and, as a parent of four children, I’m also committed to making the future as good as possible for them, in addition to loving my Creator and wanting to impact and preserve the world for Him. In short, I’m more motivated than lonely, though I am a little of both at different times. Whatever the reason, I’ve got a deep fascination with finding out how the world works and building an accurate philosophy of history. This book seemed to fit that bill and it does deliver the author’s opinion, cynical and misguided as it may be.

Clearly, George Packer is a well established member of the anti-establishment and that view determines the polarization of his pen as he sketches a series of lives and their experiences with what he terms the unwinding. He defines the unwinding as the change in American society present in the last 40 years as we have transitioned from a manufacturing-based and more localized economy to our present state. The author describes this world for us as a place where the institutions of government have failed us because they have been taken over by special interests and the only guardians of hope are the iconoclast organizers, journalists and activists determined to fight the system. However, any time these activists get to work, they better not get big because they risk becoming part of the establishment, which creates a strange tension for me: while you can’t trust any private institution to act responsibly, he seems to have a blind trust in the government to regulate and level the playing field. Through a set of engaging and short biographical vignettes, he builds the case for increased regulation to protect the public from our failed institutions. He puts a name and a history on what otherwise might be another name who loses their home. He portrays hapless families used by the big banks to take away their home, and to be content there, but to take away their dignity, their health and even their sanity in an insatiable act of greed. His message is clear — a disease has taken over our country and it is in general the establishment and in particular republican party (wholly owned by big business) and the democrats of the permanent political class. But isn’t he missing something here? Aren’t we all culpable when it comes to greed? I know it is obvious, but I can’t escape the fact that no one was forced to sign any of the mortgage papers that provided the legal justification to reclaim their homes after they repeatedly failed to make payments.

While he exalts the value of the individual against the institution, even his heroes come off a bit weak. Dean Price, Tammy and Peter Theil all get their platform while some are put before us for outright scorn or tabloid entertainment: Breitbart, Gingrich, and Oprah. Yes, all the biographies are interesting, but besides their entertainment value many failed to fall into the larger narrative in any meaningful way.

Despite my overall disagreement with his diagnosis, I greatly enjoyed this read and recommend it to my friends. He also exposes you to inside the system and does give some very interesting perspectives. The way he tells it in biographical sketches made the book very compelling and did teach me a lot about the world and the way he set up his framework forced me to ask some very interesting questions related to how I think the world fits together.

In the end, was left motivated by the book to do something. Not just motivated to be part of the solution, but I was committed to not be at the mercy of legal and banking systems. Most of all I want to be full in my humanity. I want to be an individual empowered by the ability to have freedom of action and freedom to be and I want to be part of the world that empowers individuals to do the same.

By 0 Comments

Build 3d Model of Yard

I have always believed in compensating for my lack of experience through leveraging my modeling background. With the right tools, I can hone my intuition and help my lack of experience through careful planning. I also need tools to communicate to my family, friends and any contractors my exact plans. In the past I had built small 3d sections of my yard through setting up a laser level on a high point and breaking my yard into a grid and carefully measuring with a level. The results were a 3d point cloud that I wrangled into (formerly) Google SketchUp.

My latest plans call for a shed and potentially a kitchen and house expansion. This requires a full 3d model of my entire yard and I don’t have anything close to the time required to build separate grids and compile them into a patchwork. Additionally, a key principle of mine is to match the fidelity required and all I needed was a rough sandbox for my yard — for the purposes of design only. This means I could be up to 5-10 off in elevation and still get what I want.

Two years ago, I purchased the GIS data for Alexandria, and through Matlab mapping toolbox I was able to pull up the following contours of my yard.

Image

I couldn’t think of any immediate way to get these lines into dxf or some vector format readable by SketchUp, but I was able to retrace the lines easily enough (2 hours of work, but I wanted clean splines anyway) when I combined the 2′ contour data with the following survey of my house.

Image

The problem was that it produced a terrible approximation that didn’t look like my yard. I ended up trying to approximate the yard through some basic shapes, but I ended up with this mess.

first try of 3d yard

The next try was an attempt to get the fidelity right and rely on intuition. I took a hose out and tried to keep it flat. I learned that the city plot was a lot more accurate than I originally thought. Oh well, but now I had a better model to work with. I used Autodesk Sketch on the ipad and made up the contours with my finger. Than I scanned them into visio to get some good splines.

Here is the result:

contours

landscape_update_1

With some rough pulling, I have something much closer to what I’m expecting:

landscape_update_3

 

All together this gave me exactly what I wanted, a solid 3d model that enabled me to play with my yard and start planning my shed.

3d view

3d view 2

 

By 0 Comments

Defense Acquisition Certification

Here is a post that I hope is helpful to others out there who can be paralyzed from taking action to getting professional acquisition certifications. What is the official name and background of this program? The official name is the Acquisition Professional Development Program. The Acquisition Professional Development Program (APDP) promotes the development and sustainment of a professional acquisition workforce in the Air Force. It is DoD wide. You need it because certain jobs will require you to have it. Good acquisition organizations take this seriously, because it is an easy way to weed folks out from future jobs.

Where are the best places for information? Here are the links I found useful:

  • AF acquisition careers You can find an overview of the program and the useful sites here.
  • What are the requirements for each level?Follow the guidelines for your discipline here: dap.dau.mil.
  • How do I know what level I am? Go to Acquisition Career Management System but you might need to go to (afpc secure ) first. The purpose is to go to My Civilian APDP Record and
  • Where do I sign up for courses?here
  • What is the continuous learning requirement? 80 points over two years.

What is the road ahead for me? I have a level 3 certification due date of 2014-06-03. My acquistion position is “ACQUISITION POSITION NOTCRITICAL OR DEVELOPMENTAL” and my position title is that I am a “GENERAL ENGINEER”.

What classes have I completed? 2013-11-05 SYS 101 GRADUATED 2012-08-24 CON 115 GRADUATED 2012-07-25 PMT 251 GRADUATED 2012-06-28 SAM 101 GRADUATED 2003-08-01 TST 101 GRADUATED 2003-04-18 ACQ 201B GRADUATED 2003-02-21 ACQ 201A GRADUATED 2001-12-28 ACQ 101 GRADUATED Latest continuous learning points are from: 2012-08-24 34.0 CON 115. How can I get more continous learning points? (It looks like there is a whole web site on this. I’m going to focus on getting the courses done for L2 SPRDE-SYSTEMS ENGINEER, and hope that gets me more than enough CL points.)

Continuous Learning Status My status is “CURRENT”. My last suspense was 2012-07-25 (for what?) POINTS TO DATE: 34 (what does this mean?) SUSPENSE: 2014-07-25 (this requires attention — what does that mean)

Current plan? I need to take the following: * Log 103 * Sys 101 (just as a pre-req) * Sys 202 * Sys 203 * CLE 003

Welcome TIMOTHY - here is a summary of your progress toward earning 80 Continuous Learning points (CLPs) every 24 months:

The Personnel System shows that you are in an Acquisition Coded position, and you are required to earn 80 CL points within 24 months.

 Currently, your CL suspense date is:     7/25/2014
ACQNow CL points earned this period:     34
Points needed:                                    46

 If you do not have any upcoming CL events scheduled, you might consider the following methods of earning points to help you meet the goal:
- a DAU Web based course (click here)
- a DAU Continuous Learning Module (click here)
- an AFIT Module (click here)

What/where is a list of different types of certification levels you can get?

  • Contracting
  • Systems Engineering
  • Financial Management
  • Program Management
  • Information Technology
  • Logistics
  • Scientific Research and Development
  • Test and Evaluation
  • Production, Manufacturing & Quality Assurance

So I need to get certified in Systems Engineering

Level 1 (Done)

  • Acq 101 (done)
  • Sys 101 (done)
  • CLE 001
  • CLM 017

Level 2

  • ACQ 201 A/B (done)
  • LOG 103 (20 CLP) (working now)
  • SYS 202 (9 CLP) (done)
  • SYS 203 (36 CLP)
  • CLE 003

  • 2 Year Experience, BS

Level 3

  • SYS 302
  • CLE 012
  • CLE 068
  • CLL 008

  • 4 year experience

By 0 Comments

Find corrupted images

So I deleted all my pictures, and I restored them which resulted in a bunch of corrupted images; thousands of corrupted images. To fix this, I wrote the following script in MATLAB using the image processing toolbox:

// insert blog here

Using matlab I tried to determine what a corrupted image is. First when using the image processing toolbox to open an image, I noticed:

g = imread(s);
Warning: JPEG library error (8 bit), "Corrupt JPEG data: premature end of data segment"."
Warning: JPEG library error (8 bit), "Invalid JPEG file structure: two SOI markers"."

Also, a histogram of such a file looked liked this:

histogram

So, the only challenge is to find the spike, or simply a crazy high percent of 128, the mean value. Simple enough.

cd('/media/95543211-fd8f-4fc9-9b24-3a787113e4c2/+JPEG');
jpegs = dir('.');

num_files = 100;

file_count = length(jpegs);

G = zeros(1,num_files-2);

for i = 3:(num_files+2)
    name = jpegs(i).name;
    disp(['working: ' name]);
    if true
        try
         I = rgb2gray(imread(name));
         [w, l] = size(I);
         gray_percent = sum(sum(I==128))/(w*l);
         G(i-2) = gray_percent;
         if gray_percent > 0.07
           disp(['moving . . . ' name]);
           movefile(name, ['too_much_gray/' name]);
         else
           disp(['good: ' name]);
           movefile(name, ['noerr/' name]);
         end
        catch
         disp(['bad: ' name]);
        end

    end
end

Then a script to see which images might be corrupt:

And a ruby script to move the results (yeah — really inefficient, I know).

So files that might crash matlab are at least removed.

#!/bin/bash

for f in *
do
  # echo "Processing $f file..."
  # take action on each file. $f store current file name
  if ! identify "$f" &> /dev/null; then
     echo "$f"
  fi
done

and (yes, this is silly)

#!/home/bonhoeffer/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
filez = <<EOF
__003999
__026328
__029322
__032335
__035823
__035842
__036090
__038688
__039670
__048554
__048561
__048634
19991215_22_43_43_033877
19991215_22_43_43_034820
19991215_22_43_43_049844
19991215_22_43_56_038011
19991215_22_44_16_010202
20070729_14_42_57_048540
EOF

puts filez.split(' ').size

filez.split(' ').each do |f|
	puts "mv #{f} matlab_bad/#{f}"
	`mv #{f} matlab_bad/#{f}`
end

By 0 Comments

IMA equations

Here are some of the questions I had when starting as an IMA.

How do you schedule IDTs?

You have to be on a .mil domain or else you need to use arrows-r.

utaps

Who pays?

IDTs and the 2-week annual tour are centrally funded.

What are my work requirements?

I am cat A with 48 paid IDTs and 2 week tour is required and my R/R Date is Aug-4.

This is a nice briefing AFD-120503-056.pdf.

What is the R/R date?

12 consecutive months in which an active Guard or Reserve member is required to earn a minimum of 50 points (including membership) for a satisfactory year of federal service.

This defines a “good year”.

key reference: http://www.e-publishing.af.mil/shared/media/epubs/AFI{aaa01f1184b23bc5204459599a780c2efd1a71f819cd2b338cab4b7a2f8e97d4}2036-2254V1.pdf

What is form 40A?

How do OPRs work? Where do you find them?

In work.

-At the end of each training day, write bullet statements on the back of your orders or 40A describing your accomplishments. Provide your supervisor with a copy for your record. This will become input for the OPR/EPR.

-Accomplishments in your civilian profession may be used for an OPR, IF they are pertinent to military skills and leadership

Who do you ask for help and what will you get from them?

Ask the BIMMA or the senior reservist

How much civilian leave do you get?

15 days

By 0 Comments

Congressional Districts in Full JSON Format

The challenge is how to get ERSI shapefiles into a full json format.

I had MATLAB fired up and was going to generate this originally. It turns out a lot of the data are already there. Experience matters *a lot*. It took me two weeks to do this before. This time it took about 5 hours.

I still have all the MATLAB code, along with my custom gis calculations, but this puts everything into the database and is much cleaner.

By 0 Comments

Removing Images of a certain size

I had a bunch of bogus images in my directory and I was going through and manually deleting them. I wised up a little bit and thought I would write a quick script. While it ran, I thought I would share with you.

I had: 25760 images and probably about 15,000 of them were bunk. I could use identify from ImageMagik to get the data which contained the width and height of the image. All the bogus images were a specific height. By writing a script I was able to put them all into a directory, which I could then review for deletion.

Enjoy

By 0 Comments

Road Trip to Camp of the Woods

Yes, pretty much a full day driving, but a great chance to catch up and enjoy each other as a family.

By 0 Comments