Archive of posts from 2013

Getting Ready for the Wrap Up

For the past couple of years, I’ve done a sort of year-in-review post with my thoughts about what went well over the past year and what I’d like to do in the upcoming year. I don’t really refer back to this list at any point during the year, but perhaps I should. In general, I like to see things that I think would be helpful/fun to know/learn/do in the coming year. And if I see things that I’ve had on my list for more than one year, I’d like to think that I make a bit more of an effort to do them. Anyway, as the end of the year is coming up and this is how I sort of like to spend my January 1st, I’ve been starting to think about the year in general. By and large, I’m pretty happy and think I had a pretty good year. I may have gotten a bit lazy toward the end, but overall, I’m not complaining. I’ll go into more details next week.

Conduit!

This weekend was the time to put in conduit for all my outlets. And that’s what I did. I’ve put in a lot of outlets and think that I have set everything up quite nicely. I’m really happy that my conduit bending skills have improved quite a lot. Here are some pictures:

Froze My Butt Off

Julie and I did the Santa Hustle this morning. It was under 20 degrees and freakin’ freezing. Here’s a few pictures I took when I could get my fingers out of my gloves.

I Earned a Cookie

I had a pretty good Thanksgiving weekend. Got the wall done, so I feel I’ve earned a cookie.

Getting There!

My favorite holiday weekend is going on. I had planned on renting a truck and fighting the crowds at Home Depot to get the rest of the insulation that I needed. Alas, the truck I usually get was rented for the day. So I had to change my plan. Instead I finished hooking up my drain vent. Hopefully it’s ok. It goes up somewhere upstairs. I’ll have to find it when I get to work on the upstairs.

Back in the Swing of Things

My two weeks of jury duty threw me off my game a bit, but I got back to working on the house again. This weekend I built the half wall, though I left it tall because I’m not sure how high it should be. I also finally rented a truck and bought some insulation. I started attaching it to the wall as well. Here are some pictures I took this weekend.

Good Weekend

I got a lot done this weekend. Today, I finished up by cutting and laying out all the pipe for the new kitchen drain and stack. I haven’t glued it all together because I want Mickey to come and double-check it, but I think it’s going to work.

Idiot

Take a look at the new water lines in the kitchen. Notice anything odd about them?

Good Morning So Far

I installed my new water lines this morning. Yay! But I have a leak. Boo! I’ll have to fix that later. It’s supposed to rain this afternoon, so I wanted to get the outside of the window I installed finished. I took some aluminum to work to bend on our brake there. Unfortunately, it’s only 2′ wide, so I had to use two pieces to fit my window. But I got it in. I’m sure a real window-installer would have made it look nicer, but I think it’s waterproof, which is my only concern.

Robot in Action

I finally built my robot. I had taken pictures of the process, but never got around to posting them. Instead, here’s the first video I made.

Drunken Jogging

I started using the RunKeeper app to track my jogs, as my sister uses it and likes it a lot. It is also able to track bike rides, which I also do. So this seemed like a great solution. And to top it off, on my first run, it said my pace was a bit faster than I thought I was doing, so I was pretty happy.

My Robot

My niece and nephew were both talking about building a robot and it made me realize that I wanted to build a robot as well. After looking around, I had intended to buy the new Arduino robot, but it wasn’t in stock. Instead I found a hexapod robot called Hexy, which looked even more fun. So I ordered it and it arrived today.

The Challenge

Paul proposed that I host Thanksgiving again. Will I be able to do it at my house? This is going to require a kitchen. Here’s what mine looks like now.

Front Stairs

While waiting for the new window to arrive, I decided to tackle some other tasks that I’ve been ignoring. First up, my horribly dangerous front stairs. Since I’m getting a roommate soon, who will unquestionably complain about them, I decided I should do something. None of the contractors I contacted over the summer got back to me, so it’s looking like the stairs won’t get rebuilt this year. I had mixed a little mortar the other week to fix the gaps around my window and it was pretty easy to work with. So I thought, why not give it a try?

Mass Mailing in Rails

I have a need to send out a bunch of individual emails from the same email address. I thought it would be good practice for me to see if I could do this as part of a rails app. The interesting thing is that I don’t want to save anything to a model. I just want to be able to upload a csv file, get all the names and email addresses out and send the same email with attachment to all of them. Here’s how I did it.

Depressing

Sometimes you don’t want to know the state of your house and other times you can’t help but notice. I really, really need to have my house tuckpointed. This is a shot of the inside of the old hood vent. Yes, that is water pouring down.

Handy Trick

If you have some sample code in a ruby file that you want to run ONLY when that file is called directly, enclose it in the following if statement.

End of Summer

Here are what was left of the roses on my rosebush before I started hacking it down. It is so nice out, just under 70 degrees, which is perfect to me. I cut my grass and even trimmed the tree in front of my house, in anticipation of my new roommate. Just trying to eliminate some of the things he’ll complain about.

It Works!

Yes, the new car is small, but I can still move stuff. It just takes me a few more trips than usual. To get 18 2″x4″x10′, took me three trips to Home Depot. But it’s a beautiful day, so I’m ok with that.

Status Report

I’m a little stuck. Here’s how things look now.

Labor Day

I decided to not work on Labor Day, thus turning it into No-Labor Day and to go for a long bike ride instead. I have just finished my 57-mile ride and am probably not going to move for the rest of the evening. Here is the info from my route.

Cold-Air Return Moved

I can cross number 2 from the last post off. I moved the cold-air return much lower to the floor and cut the wall to about half size. I just cut the wall shorter, but didn’t measure anything because I’m not sure how high, exactly, it should be. I’ll have to cut them down again later when I know how high the countertop will be.

More Demolition

Today I decided to take down the wall between the kitchen and dining room. Well, not take the whole wall down, but just take off all the drywall so I could see what was there. I’m going to have to cut this wall down to match the height of the kitchen cabinets. But since this wall is at the end of the slope in the floor, I’m not exactly sure where to cut it yet. That will come later. I also finished pulling all the furring strips that were close to the ceiling down, so the brick walls are bare, except for the outlets on them. I would have taken them off too, but that requires me to cut the power to the room, which means the lights won’t work. And today it has been storming quite a bit, so there isn’t much natural light to work with. I’ll see if tomorrow is better for that.

Rails4 and Assets

I spent a ridiculous amount of time trying to get a background image to show on a production server running a new rails4 app. Everything looked fine on my laptop, but once I deployed to the server, the image wouldn’t show. I only had one image on the site, but I’m pretty sure that if I had more, none of them would have showed.

Really Done Now

It took a little over an hour, but I got the floor grouted. I will have to inspect it more closely in the morning when the light is better, but I think it looks pretty good.

Know What’s Better Than Perfect? Done!

I am really tired, but the tile is all in. Sometime this week, I’ll grout and it’ll be completely done, but that’s pretty easy. The difficult stuff was this weekend and I got it done. It’s no where near perfect. In fact, I ended up needing one more red tile. But since it was going in a place that will be under cabinets, I just stuck two smaller pieces together. And if you look closely, you’ll see a number of other mistakes, but I’m going to try to not look closely and just be happy with it.

So Close

My intention today was to finish putting down the tile in my kitchen. I got really close, but then ran out of thinset again. So I need to go to Home Depot for more and then I can finish it tomorrow. Yay!

Smarter Than I Look

I’m getting to the point in my kitchen where I’m rebuilding walls. Unfortunately, my memory of how the contractor did the rest of the house is fuzzy. So I searched through iPhoto on my laptop to see if I could find any pictures of how the walls went up. And I found a movie I made where I walked through the house to look at the electrical connections and could see how the walls were built. And even better, I said what this piece of electrical conduit that’s currently sticking in my kitchen is for. That was great because I was leaning toward cutting it out since I didn’t know why it was there. Yay me! So this morning I’m going to make another movie for myself just for future reference.

Ruby Methods

I’m still learning where methods go when writing ruby on rails applications. I read something earlier today (and had read it before) that you need to think “tell, don’t ask” when it comes to methods. So basically when working with an object, if you want it to do something, you tell it to do that. This method will then go into the model and get called with @object.method. So, in my application, after an applicant is saved. I want to send a message to the object to send email to that applicant. I had this in the controller, but now I’m pretty sure that this belongs in the model. It ends up looking like this:

Pittsburgh Trip

I just got back from a long weekend spent in Pittsburgh. I went there to attend Steel City Ruby Conf, which was pretty good. The first day had a lot of self-described “touchy-feely” talks, which I wasn’t crazy about, but understood why they were being given. Though Julie Pagano’s talk on Front-End Development was pretty good and Jim Weinrich’s “Friendly Flying Robots” was a lot of fun. The talks on Day 2 were much more what I was looking forward to. The talk on git by the Steven Ball was really informative and I’m hoping I can start using some of his tips right away. Avdi Grimm’s talk on Pair Programming has pretty much convinced me that I should give it a try as soon as I get some time. And Leon Gersing’s inspiring talk was the perfect finish. So, based on the strength of those talks, I feel it was a pretty good conference.

Kitchen Tile

I took a few days this week and got to work on the tile floor in the kitchen. I had hoped to get more of it finished, but ran out of thin set mortar and energy. Thankfully, Julie came over to visit and Paul brought us both lunch, so I had a lovely lunch with them. Not sure if I’ll be able to finish it tomorrow, so I this may be on hold for a week or so. Going to try to just be satisfied with what I got done today.

Family Trip to Michigan

Finally got around to posting all the pictures I took on our trip to Michigan. They’re here.

Fixing Inflections for Acronyms

In my app, there are a list of files that people need to upload. I had set things up so that they could pick the type of file from a dropdown list. The list of files are:

First Cabinet

It probably says something about me (that I wouldn’t like) that a thoroughly enjoyable evening to me is to have a baseball game on while assembling a cabinet in my pajamas. I bought two cabinets yesterday and put together my first one today.

Rebuilding Begins!

I made my first repairs today.

Rails Basics

These are just some notes on doing everything in rails by hand.

Rails Controllers

I’m starting a new rails app, using Rails4, and am trying to do more things by hand instead of depending on generators. I actually think generators are great, but I want to better understand how all the parts fit together. So I want to know how to do things by hand, instead of depending on the generators.

Gutted!

That’s basically it for gutting the kitchen.

Me and Mari

photo

Partial Success

I got a lot done today. But pulling up floor boards is hard on my back. And by around lunchtime, I knew I was done for the day. I got most of the room done and generated a large amount of garbage, which is basically how I measure how much I worked.

Looking on the Bright Side

My sister has returned to town, so I had to return her car, making me carless for the time-being. I have finally decided on a car and was supposed to go and pick it up today. But, because I’m a moron, I forgot to call my insurance company to pay for insurance on my brand-new car. So, I decided to postpone picking up the car until Monday.

Lots to Do

Since I was feeling depressed after realizing how much there still is to do on the kitchen, I thought I should take a minute to see how far I’ve come. Below are some pictures I took on the final walkthru of the house when I bought it in 2005 and how it looks now. Eight years of my life. Not sure it was worth it.

Walls Down

I finally finished taking down the walls in the kitchen, though I think I still have to pull off those furring strips. However, I have generated a ton of garbage, so I’ll hold off on that for now. I also have to make the wall between the kitchen and dining room into a half wall, but that can come later. I think the next step will be to rip out the floor down to the subfloor. After that, I’m not sure. I may have to consult with Mick.

Crazy

Mickey the Great came over today and we moved the gas line in my kitchen. As an added bonus, we put in some shutoff valves which I was missing. And lastly, we fully disconnected the dishwasher. We also hauled it out to the alley and two hours later, it’s already gone. Now I’ll be able to put out my beautiful old stove (that has a hole in the side) as well.

It’s Over

There will be no more cooking or cleaning at my house for the foreseeable future. I just finished removing the sink. It’s somewhat depressing thinking about how much more work I have to do.

Pathetic

Yesterday was the annual Run for Hope that I’ve been doing the past few years. This year, as usual, I was racing my now 13-year old nephew Jack. He beat me last year by seven minutes and my goal was to get that down to five this year.

My Saturday

I offered to drive my Mom and my aunt anywhere they wanted. They chose to go to Bohemia National Cemetery. It didn’t take too long and we found what we were looking for.

An Accident

I have had two snakes (that I’ve seen) in my backyard for as long as I’ve owned my house. For the most part, they can do whatever they want back there and I don’t care. I usually only see them when I’m cutting the grass and they quickly slide away. Today, the grass was a little taller and I didn’t see one of them and I think I killed him. I feel pretty bad about this.

Ruby Dates

In one of my apps, the price of registration for an event goes up after a particular date. So I have to check if today’s date is after the given date. Here’s how I’ll do this:

A Little Bit More

Had to fill my garbage cans again, so I took out a cabinet. Now I need to put a valve on my gas line, so I can disconnect the stove. And then it will be time to get rid of the sink. At that point, I’ll be sad because washing dishes will be a pain. (I’m thinking I’ll just go and buy paper plates and cups.)

A Fun Vacation

I signed up to the Five Boro Bike Tour in NYC over last weekend. I took my folding bike on Amtrak and it was a pretty good trip. It would have been great, but Amtrak is definitely not the way to travel. (Next time I want to go somewhere on a train, I first need to go to Europe.) As this was my first vacation in a while, I was very much looking forward to it.

Little vim tricks

Our datalogger saves files in a windows format, which means when I open it in a unix program, I don’t see any line feeds. The quick solution to this is to open the file in vim and run:

Little More Work

I took the morning and tried to take down a bit more of the wall in the kitchen. It was nice being able to stand on the counter to reach the high parts. Here’s how things look now.

Libv8 Gem Problems

I had some problems installing the libv8 gem after installing ruby 2.0. The solution was to use yum to install the python26 packages and then make a link from them to /usr/local/bin/python. After that the gem install libv8 command worked.

Requiring https

My apps tend to just be electronic sign-up sheets for various events. There’s no way we’re going to pay for an SSL certificate for a site that will probably be up for a month or two, at most. However, we do require people administering the page to login, which means passwords which need to be encrypted. That’s really all I care about encrypting, not the entire site. So, my somewhat simple solution is:

More Capistrano

Capistrano used to have a pair of tasks called deploy:web:disable and deploy:web:enable that I really liked. All they basically did was to upload a file to the webserver that would be displayed while a new version was deploying. I thought this was really helpful because if anyone visited the site during the deployment, they’d see the message that the site was under maintenance. Without this file, visitors to the site would see a cryptic rails rack error that made no sense. Sometime last year, after a capistrano update, I realized that these tasks were no longer there. By that time, I had understood that it was just uploading a file, so I could duplicate the tasks manually by editing a file to add the current time and then uploading it to the webserver. (In either case, I had to modify my httpd.conf file to reflect the location of the file.) Then, after the update, I’d remove the file. This wasn’t difficult, but it was WAY easier to do this:

Spoke Too Soon

When I came home from work, I was feeling a little full of myself and then I wrote my previous blog post. I spent the past couple of hours watching some Railscasts that were really informative, on using capistrano to do all sorts of things. So I changed my capistrano file quite a bit and do feel that I understand it a bit more.

Advancing

Today, I started a new ruby on rails website for a workshop. It’s a very basic site that just handles registrations and redirects people to the credit card processor that we use. This is the main type of website that I write in rails and it’s probably my tenth site that I’ve written for this purpose. Previously, I had always used scaffolding in rails and then deleted the stuff that I didn’t need. This time, I made a conscious choice to not use any scaffolding and instead generate my own controllers and models. I’m happy to say that I didn’t have any real problems. So I’m thinking that I’m no longer a complete beginner with rails. I might even go so far as to say I’m an intermediate rails programmer. Which means it’s time for me to start advancing some more. I found this website http://learn.thoughtbot.com and was thinking of signing up for the prime program. The intermediate ruby on rails workshop looks pretty interesting. Though, after reading the syllabus, I’m thinking that perhaps I was at intermediate level a while ago. In the listing of things that they plan to cover, I already know a few:

Little Work

My organizing kick really tired me out. I slept for a very long time and didn’t feel like doing anything today. But I felt I should do something today, so I decided to just finish taking the drywall off the back of the kitchen. It didn’t take long, but since I was already tired, it pretty much finished me for the day.

Organizing Kick

Since I was doing a bit of organizing at work this week, it has carried over to my house. This is not a mood I’m usually in, so I decided to take advantage of it and do a little work on my basement. My basement needs a lot of work, so this put a very small dent into it. I’d say I cleaned up about a quarter of the basement. And I’m pretty happy with that.

A Few Good Hours

I woke up and decided I better get started. So, down came the upper cabinets, except for the one with the vent going outside. I’ll do that later.

It Begins Again

It’s March and I’ve finally saved up enough (I hope), so I started work on my kitchen. Here’s a shot of the first two cabinets I took down.

RHEL6 No graphics, error: could not open default font ‘fixed’–SOLVED

After some updates from RHEL6, some users were having problems with X not starting. Looking at the log file, I saw this error:

Ruby 2.0 with Other Versions

Ruby 2.0.0 came out today and I thought I’d install it. I had been using rvm to handle my multiple versions of ruby, but when I tried to do a rvm install 2.0.0, I got a bunch of errors about homebrew. It seems as though homebrew is now required. This is a problem for me because I’ve been using MacPorts for years and I just don’t feel like switching right now. So, I figured that I’d just see if I could compile it myself by hand and come up with a way to have multiple versions of ruby. The thing is, I really don’t switch between versions all that much. I will now, as I slowly convert all the sites I have to 2.0. So I’ll need to go back and forth a little. But once it’s done, I probably won’t switch for a long time. I’ve been on 1.9.3 for a very long time and it worked fine. Anyway, I’m not exactly sure how I’ll do this, but I’m going to give it a try.

More Ruby Notes

I just found out that these two ruby commands do the same thing.

Rails3 form_for vs form_tag

I’ve been advancing a little in my rails work, to the point where I’m making more elaborate forms. So I’ve had to switch to using form_tag instead of the form_for that’s the default when you use scaffolding. I have a pretty good understanding of the differences now, so I’m documenting it here.

Sendmail on Mac OS X 10.8

I wanted to use sendmail to test the sending of some messages in one of my apps. The command I wanted to run was:

Ruby File Open Options

I spent a little time looking for this info, so I thought I’d post it here. Use it like this:

Drop a Column in MySQL Table

For some reason, my migration file wouldn’t drop a column when I tried to go back to an earlier version. I fixed this by just going into mysql and dropping the table manually.

Simple Dropdown Menu of Numbers

Every so often I need to make a simple dropdown menu of numbers in my app. And for some strange reason, I always seem to forget how to do this. So here are some examples for myself to use when I forget the next time.

Update Multiple Boolean Attributes in Rails3

We are hosting an event where students need to submit two pieces of paper and pay to attend. The model I’ve created has three boolean values for these three items: safety_waiver, image_waiver and paid. As the forms and payments come in, I could manually edit each entry and check off who has paid or not. But, since I’ve done a few of these events in the past, I know it would be easier if I could just see a list of everyone who hasn’t paid or turned in their waivers and check a bunch at once. I tried following Railscast #52, which was great and almost got me there, but didn’t work for me in the end. So here’s what I did.

A Bad Habit

Until yesterday, I had been carless for the past few weeks. Even though it was ridiculously cold, if I wanted to get to work, I’d do my bus-el-bus trip to get there and then reverse it to get home. In all honesty, this wasn’t that difficult, though it was rather cold this week. One of the things that I had thought about, when I bought my house, was that I didn’t want to be dependent on a car. So, I can take public transit to work, I can walk to a grocery store or other stores that I might need. Now though, that I have my car back, I was just thinking that I’ll drive over to Target this morning to pick up some stuff. This is ridiculous. Last week, I would have (and did) just walk there. There was a talk in the evening the other day downtown that I wanted to hear. So, even after I took public transit home, ate dinner and was a bit tired, I bundled up again and walked to a different el stop to take the train to go to the meeting. Now, I’m being a total weenie and want to drive to a store that’s maybe a mile away, but probably less to buy some things that aren’t even heavy. I am completely ashamed of myself. This is a habit that I need to break and I’m not sure how I’ll do it. But, I’m going to try and be more aware of when I instinctively think to just get in my car and drive. More immediately, I’m going to put on my boots and coat and walk over to the store. Self, quit being such a wuss!

FUN!

My brother convinced me to buy a mountain bike on Friday and we went up to Kettle Moraine on Saturday for a ride. I was a bit nervous, hoping that I wouldn’t hurt myself, since I’d never done anything like this. I love riding my bike, but I usually stay on pavement, which makes the riding pretty easy, even in traffic. Since there were a few of us who had never done it before, we went on an intermediate trail of about 4 miles. It was about 41 degrees, which wasn’t bad, but it was totally muddy. And I have to be honest, I haven’t gotten that filthy in a long time and it was fun. Since it was so muddy and a bit chilly, I couldn’t take too many pictures because it was a pain to take off my gloves and get the camera out. But here are a few shots from the day.

Rails and Autocomplete

I recently wrote a simple rails app to let people record measurements (current and voltage) on for a given plate. Each plate can have many measurements and each measurement belongs to only one plate. I wanted to make it easy for people to enter the data and there might be a fair number of plates, so I didn’t want people to have to scroll down a long drop down menu to pick a plate. This seemed like an ideal situation to use autocomplete on. Basically, the home screen is just the new measurements path. So, putting in the measurements will be easy. I then wanted to have a text field for the plate name that has autocomplete enabled. As the user enters in information for each plate, a little drop down list will popup that users can use to pick the correct plate. And if it’s a new plate, it will automatically add it to the database.

Coffeescript is Whitespace Sensitive

I’m attempting to get autocomplete working on a rails app. I’m basically following the instructions in Railscast #102 (revised). It wasn’t working because I didn’t realize that coffeescript was whitespace sensitive. Once I realized that, I thought I was set, but I wasn’t. I like having my tabs be two spaces, but coffeescript wants four space tabs. So after I doubled all of my tabs, things started working.

Context

There are a number of blogs that I read, almost daily. I know a lot of people do this and many do it by subscribing to the RSS feed of a given blog. I am not one of those people. Why? I like to see the information in its original context. RSS readers strip everything off the webpage except the text of the post. So just by glance, I can’t tell which website the post came from. I don’t like this at all. I prefer to read the text on the original site that the author created. Why? It helps me to remember where I read the information. A typical example, just the other day, I was thinking that there was a book I was interested in reading because I had read about it on some website. It was a somewhat technical book, so it could have been reviewed on any number of sites that I visit. However, I couldn’t remember the title and I didn’t think it was an actual review of the book. I was something written by the person who wrote the book. I remembered liking the post, but all I could remember was that I had read about it in December and it was to be published in January. Now that it was January, I wanted to remember it to see if I wanted to buy it. After picturing the article, I remembered that it was on the NY Times website. I like that my brain still had the connection of where I read the article. I supposed if I read it in an RSS feed (which I don’t even know if the NY Times provides), I could have looked there somehow. But I think it’s good for my brain to still be making connections like this. It’s probably more inefficient to read blogs this way, but it’s my preferred way. And I’m also not a fan of making everything more efficient. Inefficiency is good. But that’s a post for another day.

To 2013

Here are my goals for 2013. A lot of the same things as last year, but hopefully I’ll get further along with them.