Ben Lobaugh Online

/(bb|[^b]{2})/

colorful_sunset

Colorful sunset

database

MySQL: Count number of tables in database

If you need to count the number of tables that exist in a MySQL database you can do so with the following query. Just remember to swap out the database name!

SELECT count(*) 
FROM information_schema.tables 
WHERE table_schema = 'YOUR_DB_NAME'
files

Bash script to automatically convert git submodules to regular files

Git submodules drive me batty! They are a great idea in theory however in practical application they are a pain in the butt to work with.

I have a project that has accumulated over a dozen submodules over the past couple years. Switching branches and merging anything has become excruciating. This morning was the last straw. I WANT THEM GONE! Removing dozens of submodules by hand is time consuming so I tossed together this quick Bash script. I hope it is helpful to anyone else out there struggling with git submodules.

#!/bin/bash

# Get a list of all the submodules
submodules=($(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'))

# Loop over submodules and convert to regular files
for submodule in "${submodules[@]}"
do  
   echo "Removing $submodule"
   git rm --cached $submodule # Delete references to submodule HEAD
   rm -rf $submodule/.git* # Remove submodule .git references to prevent confusion from main repo
   git add $submodule # Add the left over files from the submodule to the main repo
   git commit -m "Converting submodule $submodule to regular files" # Commit the new regular files!
done

# Finally remove the submodule mapping
git rm .gitmodules
IMG_0521

July 28, 2016 Race Results for the Downtown Sailing Series

Tonight’s race was much better than last week! We started well and almost ended well. I am getting to know the course better. Shane and I tweaked and dialed Zippey’s settings, and added some new things.

We wound up in 45th place out of 49 boats. Not as good as last week, however we were able to sail the entire time this race!

I have crewed on race boats for two seasons and being in the skipper seat on your own boat is significantly different. I have to give a big props and thanks to Joe Bozick for his great teaching and deep technical understanding of all things sailing. He has made me a much more competent sailor and race winner hopeful!

Quick Notes

What we did well

  • Paid attention to the wind shadows of other boats. As one of the smallest boats out there everyone steals your wind!
  • Wind was puffy. We played into it as well as we could given Zippey’s current sail inventory.
  • We set up iRegatta to track our speed. That helped us as we tinkered with Zippey’s settings to find the fastest.
  • Shane put a cunningham on the main. That gave the main a significantly better shape, and it was easier to read the main.
  • Shane had some extra tale tales that he stuck on the headsail.

What we could have done better

  • I misjudged our speed to the start and we were a couple minutes late over the line. We should stay closer next time.
  • Getting away from the breakwater as early as possible would be a fantastic idea.
  • We stayed in close to shore on the second leg. The wind seems better further out. Next time we tack over after rounding the first mark.
  • Replace the broken slugs on the head of the mainsail.
  • Put the slug on the back foot of the mainsail into the end of the boom.
  • Have more lines available of varying lengths to rig up impromptu things.
  • Had a traveler system set up.

Race Overview

The start is along the Elliot Bay Marina breakwater and for a small boat like mine the start is tough. The start is downwind and the breakwater blocks a lot of wind from my tiny sails. This gives the larger boats a significant advantage.

As soon as Zippey pulled away from the breakwater she hit a channel between the marina and the cruise ship dock. That area seems to always have a good strong breeze coming down it. Zippey loves riding that. The wind shadow fills in a bit going towards the first mark. On the way to the mark Zippey did magnificent. Only one boat passed us. We caught a couple, including an older Pearson race boat, Dynamite. Zippey made a good consistent 4.4 knots to the mark on a broad reach.

After rounding the first mark is was a downwind slog. Zippey tooled along at about 3.9 knots. Last week winds were really light and the boats that tacked out made it to the second mark quickly. Tonight with the stronger breeze we thought we would make it fine, however as the shore approached the wind strength retreated. Shane was running the headsail and we popped onto wing-on-wing (manually, no whisker pole) and slowly scooted away from the other boats near us. We watched boats start to park in front of us and tried to skirt around them but got becalmed briefly also. Our momentum was able to carry us to the mark, which Zippey proudly rounded in front of a C&C 29. The C&C 29 has a PHRF of around 171 whereas Zippey is a North American Spirit 23 with a rating around 240 (Yet to be officially rated). That means the C&C 29 should have charged ahead of us by 69 seconds per mile! Overall she should have beat us by around 550 seconds. She did take off after rounding the mark and smoked us to the finish. Skipper made a tactical error early on that allowed us to pass.

The drive back to the finish is loooooong. Wind strength further away from the shore was better but still oscillated. Zippey’s centerboard is stuck up in the keel which prevented us from being able to point high. Tacks were huge degrees! We managed to keep Zippey in the 4 knot range most of the time. Shane rigged up a cunningham to pull down the front of the main and we experimented with the vang tension. All the little tweaks helped both Zippey’s speed and pointing ability.

We sailed well right up to the finish. When we were about 150 feet off the finish the wind died on our side. We watched at least 20 boats correct for the wind and sail right passed us. Bummer.

Overall great race! We learned a ton about Zippey and how to make her go faster. With some more tweaks I think she will have great potential with her current sail inventory.

Photos

IMG_0228

This awesome tshirt was designed and modeled by Robert Dall

Canadian Bus tshirt!

Page 1 of 134

Powered by WordPress & Drip City Coffee