Archive of posts from 2012

2012 in Review

Being the last day of 2012, I thought I’d take a minute and check out how I did with the goals I set for last year.

Kindle/iPad/ebook Reader Issue

I just purchased a book on Amazon to read on my ipad. Unfortunately, I have a number of different email addresses and I ended up using an email address that was different than the one I used to set up the Amazon app on my ipad. So the only way that I can read the book I just bought is to deregister the app with the old email, which will delete all the books that I currently have and then reregister with the new email address that I used. I did that and now have a single book in my ipad app, which is the one I just bought. If I want to get back the others, I have to repeat the process and go back to my old email address.

Ruby and Ldap

I’ve been rewriting a script I use that lets people update their linux and samba user passwords at the same time. Our server uses samba and openldap to behave as a primary domain controller for our windows computers and a single sign-on for a few other services. It’s been working great for years and way back when we started using this, I wrote a perl script to take care of keeping the two passwords in sync. The original problem was that if you use the regular linux passwd command, the linux password will change, but the samba one will not. The samba password uses an nthash. In a given user’s ldap account, there is the userPassword field which holds the linux password and the sambaNTPassword field which holds the samba password. For a user to be able to use any of the web services we run on the server and login to any of our windows computers with the same password, these two fields need to contain the same password.

Hidden ~/Library Directory

Mac OS X 10.8 (I think 10.7 too) hides the user’s Library directory by default. This is annoying. To automatically make in show in Finder, run this:

Mac Keyboard Shortcuts

Command – arrow keys = change to different terminal windows

Site Update

I had a little time yesterday so I updated the user interface for the colandheartless site. It didn’t take too long and I’m very happy with how it turned out. The site is basically just serving up static webpages, so it’s just some basic css/html. I did make all the pages php, but that’s just so that I could put a function at the top of the page to display the header and navigation bar. It’s really the only php that I know, but it’s so handy that I use it all the time. Anyway, I wanted to update things so that I have slightly better organization for when I add new stuff. Specifically, I’d like to continually make pages that document the process of making the map game I’ve been thinking about and all the stuff that I’ve had to learn to be able to make the game. I could do this in the blog, but I’d also like to have a freer format for things than the blog provides. With the new site, I can pretty much do whatever I want.

It Takes Time

I have, for the past few days, been immersing myself in adding parts to my arduino to extend functionality. There’s a game involving a map that has been floating around in my head for a very long time. It’s finally time for me to do something about it, so I’m starting to learn the things necessary to make it happen. I successfully hooked up a shift register to add a lot more leds, which will be necessary and now am hooking up a different type of shift register to add more buttons. This has proved a bit more difficult, but now, in my advanced age, I know that it takes time for things to sink in. Today was one of those great days where after struggling for a while, the light bulb went off over my head and I think I understand how things work.

Regex in Ruby

This is something simple that I should know off the top of my head, but seemed to have forgotten today. So I’m writing it here, to hopefully, help me to remember.

On one of the webapps I’ve written, someone signed up but had an apostrophe in their name. I had already accounted for spaces in names, but not apostrophes. So, I decided that I should fix things for any non-word character.

The method that cleans up the name is this:

def fullname_no_spaces
  [firstname.gsub(" ","_"), lastname.gsub(" ","_")].join("_")
end

This just substitutes any spaces it finds with an underscore. To have it replace any non-word character with an underscore, I just changed it to this:

def fullname_no_spaces
  [firstname.gsub(/\W/,"_"), lastname.gsub(/\W/,"_")].join("_")
end

That fixed my problems. For further reference, here are the regex values I could use:

^  beginning of a line or string 
$  end of a line or string 
.  any character except newline 
\w  word character[0-9A-Za-z_] 
\W  non-word character 
\s  whitespace character[ \t\n\r\f] 
\S  non-whitespace character 
\d  digit, same as[0-9] 
\D  non-digit 
\A  beginning of a string 
\Z  end of a string, or before newline at the end 
\z  end of a string 
\b  word boundary(outside[]only) 
\B  non-word boundary 
\b  backspace(0x08)(inside[]only) 
[ ] any single character of set 
*   0 or more previous regular expression 
*?  0 or more previous regular expression(non greedy) 
+  1 or more previous regular expression 
+?  1 or more previous regular expression(non greedy) 
{m,n}   at least m but most n previous regular expression 
{m,n}?  at least m but most n previous regular expression(non greedy) 
?  0 or 1 previous regular expression 
|  alternation 
( )  grouping regular expressions 
(?# )  comment 
(?: )  grouping without backreferences 
(?= )  zero-width positive look-ahead assertion 
(?! )  zero-width negative look-ahead assertion 
(?ix-ix)  turns on (or off) `i' and `x' options within regular expression.

I use a few of these a lot, but I need to remember all of them because they’re really handy. Perhaps, I’ll make a printout and hang it in my office.

Fun

I can’t believe that my nieces and nephews don’t like coming to my house because I have no games. I let them play with real tools like drills, hammers, saws, etc. That’s way more fun. Here’s Abby using a drill.

Windows 8

I had read a bunch of bad things about Windows 8, so I thought I’d use my Technet subscription to install it and see for myself. When it first starts, it does truly suck. I don’t know what that first window that comes up is, but it looks ridiculous on a laptop. However, my clicking on my account name, I got to the familiar desktop. I’ll have to see if there’s a way to just make that be the default. The next weird thing was the lack of a start button. This meant that I couldn’t figure out how to get to the Control Panel. So I ended up installing a free program called Classic Shell. This gave me the start button and let me get to the Control Panel, which looks remarkably like Windows 7. That’s good. Anyway, I created a link on my desktop to Control Panel. I tried duplicating this link to see if I could have created it without installing Classic Shell, but that didn’t work.

Cloudflare

I just put coldandheartless.com on Cloudflare. It sounds like something that would be really helpful and I figured I’d give the free version a try before I move another domain to the paid version. It was incredibly easy to set up, which was great. Took basically a single click in my Badger account to enable Cloudflare and then put in the new dns values. I’ll admit that I don’t exactly know how it all works, but so far it seems pretty cool. I did see that there’s a wordpress plugin for Cloudflare and I’ll probably install that next.

Floor Pictures

I’m basically done with the floor, but forgot to post the pictures I took of the process. So, for future reference, here they are:

Blinds!

The floor is basically done. I just put some brown paper on it for protection as I washed all the walls and repainted in a few areas. I also put up blinds! They look great and work wonderfully as well. To help me with the blinds, I brought down my table and put that in the dining room so I could work easily.

Days Off

I took the rest of this week off. Today, I decided to drive to Glacial Park Nature Preserve in Ringwood IL, which took me about two hours to get to. I read they had a nice hiking trail and while I hadn’t ever hiked before, I thought it was something that I might enjoy. My goal on the hike was to take one picture that I could print out and hang on the wall of my newly finished house. All of my pictures are here. Most aren’t very good, but there are two that I think I’d be happy with on my wall. So, when I move back home, one of the first things I’m going to do is have a print made of one or two of them.

Updates

It’s been a while since I’ve posted work done at the house, but work has progressed quite a bit.

How I Spent My Labor Day Weekend

Aside from the time I spent working on my laptop, I did get quite a bit done at the house. I was going to do the final sanding of the wood floor, but then decided that doing the tiling would probably scuff it up a lot. So, instead I decided to start working on the area around the stairs, which will be tiled.

Switching to Mac OS X 10.8

Today, I downloaded and installed Mac OS X 10.8. I won’t call it an upgrade because it’s not. About two hours ago, I attempted to install 10.6 on my one-month-old laptop. Sadly, it did not work. Every time I tried to boot to the old OS, the system crashed. So, I’m stuck with this piece of shit operating system. Here’s the thing. I thought 10.7 was pretty bad. It made no real changes, except things that appeared to be eye-candy, and which, for me, made the product worse. So, what do I hate about 10.8?

Test Pattern with Processing

We have a couple of students who needed a test pattern printed out. The pattern was basically a circle cut into a given number of pieces of pie. They initially requested 100 “pieces”, but weren’t exactly sure if that was going to be what they wanted. There was no chance I’d be able to draw this by hand, so I wanted to write something that would generate the pattern and be easy to edit so they could generate patterns with a different number of pieces. I thought that Processing would be a good way to do this and it turned out to be very easy, once I remembered two things. One, all angles in Processing should be in radians, so 360 degrees is 2 * PI radians. And two, that [0,0] is the upper left corner of the drawing. Once I had those settled, I wrote the following:

Last Patch

There was a small area between the dining room and the bedroom that had some weird wood in the floor. I found out why when I removed it and tried to piece in some pieces I had pulled up elsewhere. The opening was a little bit bigger than the thickness of two pieces. So, I decided to fill it using the maple floor that I had left. Here’s how it looked when I was about halfway through. I think it looks pretty good.

Ready for Sanding

I think I’ve now finished all the repairs on the floor. The wooden floor is now ready for more sanding before finishing. I even broke out the good camera to take some pictures. Here’s how things look, including some of the mistakes that I made.

Finished Something

It took a while, but I finally finished the big flooring replacement at my house. Putting the very last piece in took a bit of work and it’s by no means perfect, but I’m happy with it. Hopefully, I didn’t make any big mistakes that will cause the floor to buckle in winter. I still have two smaller places to patch, but I’m happy with the bit I finished today.

New Laptop

My new MacBook Pro (WITHOUT retina display) came yesterday. It’s SO nice having a matte screen again. I cannot say how much I hate seeing reflections of lights or myself in my screen. So this has been great. I still have my old laptop and I have a time machine backup for it. However, I decided not to use time machine to restore the computer. One, because there’s tons of stuff installed that I don’t really want any more. So, this will force me to clean up. Two, I did restore with time machine a while back, when the hard drive failed. It didn’t work perfectly. And I had to reinstall some software packages and clean up other stuff anyway. So, I decided to just avoid it altogether. This also got me to look at some programs that I was using to see that they won’t run under 10.7. The program I use to encrypt stuff is one such program, so I need to find an alternative for that. There were a couple others, but I think it’s good to set things up again. It helps me to remember why I did it.

Change in Long Listings

I was just doing some work on one of the computers that I’ve installed RHEL6 on and noticed something weird. Here is a listing on an RHEL5 node:

Little Bit at a Time

I’ve tried to stop by my house every day after work this week and just install one row of flooring. (It’s been in the 90s, so I really can’t work that long anyway.) I figure I’ll slowly make progress this week. Here’s how things are looking after today.

I Am So Tired

I worked a lot on the house today. Put in a pretty full day. First up was repairing the bad subfloor, which wasn’t bad at all.

Working with rvm
ok:~ maryh$ rvm update
ok:~ maryh$ rvm reload
RVM reloaded!
ok:~ maryh$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p358]
[ruby-]1.8.7-head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2-p180
[ruby-]1.9.2-p290
[ruby-]1.9.2-p318
[ruby-]1.9.2[-p320]
[ruby-]1.9.2-head
[ruby-]1.9.3-preview1
[ruby-]1.9.3-rc1
[ruby-]1.9.3-p0
[ruby-]1.9.3-p125
[ruby-]1.9.3[-p194]
[ruby-]1.9.3-head
ruby-head
New Laptop Coming

I ordered a new MacBook Pro today. I specifically, did not order the one with the retina display. On those, you cannot fix anything. The ram is soldered to the board, the storage is some special thing and the battery cannot be replaced. Additionally, it no longer has an on-board ethernet port. You have to get a dongle to convert a thunderbolt port for that. I’d also have to get another dongle to hook up my external monitor. Lastly, somewhere I read that the fancy retina display still shows reflections. The blog post I read about it, said something to the effect of, still make sure you turn that overhead light behind you off. Since that’s the kind of thing that drives me nuts, I was pretty sure that no matter how nice it looked, it probably wasn’t for me. I had intended to go to and Apple Store and see it for myself, but after looking at all the other drawbacks listed above, I just decided I didn’t care. I’ve had this current MacBook Pro for 5 1/2 years. In that time, through AppleCare, I’ve had the logic board replaced and the dvd replaced. Once AppleCare expired, I’ve replaced the hard drive a few times, the lcd screen after I cracked it, the battery about 3 or 4 times, the power supply twice and the dvd is broken again, but I don’t care. I just don’t like that I’m not able to repair something that I supposedly own. And carrying a bunch of dongles also doesn’t appeal to me. I will have to get one for the monitor (my current one was the last to actually have a dvi connector on it, which was great), but I guess I’ll live with that.

Start of New Flooring Installation

Today, I started putting down the maple flooring that I bought to fix the bad areas. Here’s my first row.

I Love Fixing Things

My van wouldn’t start the other day. I had recently had some hose in the steering system replaced because it had holes and since then, the car was really hard to start. I don’t think these things were related. I think it had something to do with the fact that since I have Julie’s car, I’m not driving the van very much. It can sit in my garage for weeks at a time. So, when I did go to drive it, mainly just to make sure it was still working, I found that it would not start. I turned the key and it just made some clicking noises. I’m no mechanic, but I thought that this was a battery issue, even though the radio and lights were still working. A quick check on Google confirmed this.

Getting There

I spent a very short time working on the house this weekend, due to a graduation party and very hot weather. But I did manage to take out all the wood that I’m going to replace with the new maple flooring. Here’s how it looks.

Transit of Venus

We had perfect weather to see the transit of Venus today. I took my telescope and solar filter down to Mark’s house and had some fun with Jack and Abby. They both have now seen the transit and know that they won’t see it again, unless they live to 117 and 113 respectively.

Congrats!

Congratulations to Emily and Tori on their graduation!

On the Downward Slope

I was feeling pretty good going into the 5K this morning, but thanks to the turkey below, I have now found myself on the downward slope of life.

Fun Weekend

This Memorial Day weekend was quite a good one. I got the holes in my floor all patched. Now I just have to work on the section that I’m replacing with new wood. We had beautiful weather for Bike the Drive on Sunday. And today, we had a nice barbeque and birthday celebration for my Mom. Included were my brother John bringing his new motorcycle around and giving rides to all the kids and my Mom.

Living Room Patched

I finished patching the holes in the living room. I’m no expert at working with wood floors, but I think I did an ok job. At least, I’m not too embarrassed to say that I did the floor. Now, I have two small areas to do in the dining room, a small area in the bedroom and then the big patch of maple. I’m getting excited because I can definitely see the progress and the end seems near.

Patching Continues

I biked out to a lumber liquidators store on Friday and ordered ~80 square feet of maple flooring. I’m going to cut out the big section between the dining and living rooms and put maple in there. It will look very different, but I’m ok with that. I had wanted to use a bunch of different kinds of wood, but since you have to buy 20 square feet at a time, I would have had to buy a lot. So I decided to just go with maple.

Patching Begins

Over the weekend, I finished the basic sanding (yay!) and started patching. I think it’s going to turn out ok. Here’s how it looks now.

Don’t Know Why This Didn’t Work Yesterday
[~]# gem install rails -v "3.1.3"
Another Day…

I’m getting close to finishing the first sanding layer. Here’s all I have left to do in the living room. After this, I should be able to start patching holes.

Chugging Along

No work last weekend, since I was suffering with back issues. Today, I went for a run and then back to the house to work on the floor. The dining room is basically done, at least with paint/finish removal. Now I’m working on the living room. Here’s how it looked about halfway through.

Ransack with Nested Attributes

In my app, I track plates which have a number of properties. They also have a location because I need to track where each plate has been. However, for the most part, what I really care about is where the plate is now, its current location. When I do my ransack search on the plates, I want to be able to have some check boxes with the possible locations. So, for example, people could search for all the plates that were annealed at a certain temperature and are located at Chicago. This means I have to search the locations for a given plate, but only for the latest location. I tried a number of different ways to do this in ransack and didn’t have much luck. I got it working how I wanted, but I’m fairly certain that this isn’t the best way to do it.

Ruby Enumerators

I have a rails app that handles a lot of information about a set of experimental plates. Along with holding information about each plate, I have another table locations, that’s nested with the plates, as in plates has_many locations and locations belongs_to plates. The locations is a separate table because these plates can get shipped to different locations a lot. This is a way for us to track where all the plates are. Most importantly, we want to know which location for a give plate has the latest date, because this will tell us where the plate currently is.

Ransack Update

I have an earlier post describing the way I set up a ransack search that sets up check boxes for possible search values in a given field. This was my first time using ransack and to say I had no idea what I was doing was not too far off. I’ve recently had to use it for another app and took some time looking into it again. And I think I’ve found the correct way to do a search like this.

More Floor Work

Pulled a muscle in my back yesterday, so today was spent lying around making sure I didn’t make it worse. I bought the movie “The Visitor” and watched in a large number of times. Julie always says that I like sad movies and I guess she’s right. I do love that one.

Floor Status

Work on sanding the floor has begun. It’s painful to my knees and back and very slow. On day 1, I rented a floor sander for a few hours to do the bulk of the work. Now, I’m trying to clean things up with my little belt sander. We’ll see how long it lasts before I burn out the motor.

Rails Forms with Check Boxes

In my latest rails app, I want to compare a number of objects. My first solution was to create a new search page with a form on it.

Ransack Integration Test

In my efforts to test the right stuff, I wanted to test that my basic search was working properly. I have a collection of plates that we’re storing a bunch of information on. Each plate has a unique serial number. We also have a unique id for each plate, but for our users, the serial number is what they’ll use to identify it. So I wanted to make a form that would let people search for a particular plate based on the serial number. And since this search form will be on my home controller and not the plate controller, I need to use an integration test to do this.

Interesting Evening

I spent the evening poking around The National Archives. I found some neat images that I downloaded. I did a search for Theodore Roosevelt, because I’m currently reading a biography of him and I’ve been fascinated with him since I visited his birthplace a few years ago. And I searched for Thomas Edison because he’s always been one of my favorite people.

Dropdown Lists

In the event that I want to make a simple dropdown list in a form in rails, I can use this:

IPhone Saga Continues

I was feeling pretty full of myself after replacing the screen on my iphone. Alas, I now have new troubles. It seems that my iphone thinks that headphones are plugged in all the time. This means that I cannot take calls, listen or speak on my phone without putting it on speaker. I thought that this was related to my changing the screen, but I don’t think it is. First of all, I didn’t have this problem after I replaced the screen. It appeared about a week later. Secondly, I searched this issue online and found that lots of people have it. Just another great apple product.

Typical Weekend

As I spend most weekends, I was working at my house today. I met my contractor in the morning to discuss putting in the back door. He’d rather just come back one more time to finish everything, so I have to buy my lights and then give him a call. So, I may be able to get all that done in a few weeks. Good thing I did my taxes, so I’ll have a little money to buy the lights.

A Full Day

Earlier this week, I had a bad day. I had two cars that I couldn’t drive, my bike had a flat, my iphone was in pieces, the power supply for my laptop was working sporadically (ended up buying a new one) and I was dreading doing my taxes. Today is much, much better.

Ransack Gem

Recently, I started using the ransack gem (https://github.com/ernie/ransack) for searching in one of my apps. I’m putting this here as an example, in case I ever need to make any more changes. The basics of ransack are pretty easy to do and work decently well. First step, add a search method to your controller. It should look something like this:

Ready for Grout

I didn’t feel like posting yet another pictures of the floor in my kitchen. However, it is now done, up to the back door. The next step is grouting. I’m debating whether I should grout or wait until I finish the whole thing before grouting. Either way, the tiles are all in. Took a while, but I think it looks pretty good.

Just Get Started

I could be messing around with arranging tiles on the kitchen floor for years. I finally decided that I just need to set the tile and see how it turns out. If I make a mistake, so be it. I’ll figure out a way to fix it. So I spent today setting tile. I have about half of the area done that I want to do. I could have probably done the entire kitchen, but realized that this would block access to my bathroom. This meant that I couldn’t get to either bathroom in the house. The upstairs one is blocked because I started sanding the stairs. Blocking the downstairs one just seemed like a stupid idea. So I did half the area, to leave a path. I’ll do the other half after I can walk on the tile I just installed. So, here’s how things look so far.

Floor Progress

Here’s where I am on the floor.

Routes

I’m working on a new app for work. Basically, it’s just another app that lets people put up some info and an image to go with it. The difference to this one is that I’m storing information on glass plates, which each have a unique identifier that’s not an integer. I didn’t want to mess around with changing the primary key from id to something else, because later I’m going to be using it with some other tables. Instead, what I’d like to do is be able to show the image associated with the plate at a url that uses the unique identifier. So, instead of something like plates/12, I could download the info at sample/538-12122. Here’s what I did.

Little Work Over Weekend

I fixed most of the bad boards in the subfloor of the kitchen. And cut out some cement board to use as a sublayer. Here is how the house is looking.

Subfloor Preparation

Even though the floor has a definite slope, I figured I had to replace some bad boards in the subfloor. Here are the boards I’ve replaced so far. I probably need to do one more, but I think I’ll use a 1″x8″ instead of a 1″x6″, since there’s a bigger hole to fill.

The Work is Slow

I spent the days working on the house. Made a big mistake, but learned a valuable lesson.

Happy Birthday Aunt Lu!

My Aunt Lucille celebrated her 81st birthday just before the new year. Happy birthday to her!

The Idiot Returns

While staying at my sister’s condo, I thought that her furnace seemed rather loud. In fact, it’s loud enough that it has woken me up a few times. I was thinking that maybe it was getting louder because the furnace filter needed to be changed. So, when it woke me up at 5am this morning, I decided to find out what size the filter was so I could buy a new one after work. Since it’s above the ceiling in the bathroom, I needed a ladder to reach it easily. There’s only a step stool here, so I was stretching quite a bit to try to get to it. I quickly saw that this was a size filter that I had never seen before. I figured it was roughly 12″x36″. I went to Home Depot after work, thinking there wouldn’t be many filters in that size and I’d notice it right away. Well, there were no filters in that size. Nothing remotely close. So, I got a tape measure and actually measured the filter when I got home. The size, 9 7/8″ x 39 3/4″. Basically, 10″x39″. Looked online and didn’t find anything remotely around that size. It looks like this was going to have to be custom made.

State of the Floor

The floor is probably not going to be beautiful, but I think it’ll look ok. And I love the fact that I’m using the same wood that was in the floor. Stuff that had square nails in it when I pulled it out.

One Coat of Stain

I finally decided that I was never going to get the floor perfect with sanding and that it was finally good enough. So today, I bought a can of stain and decided to just put it on to see what happens. I was going to just stain the one side of the floor that looked lighter, but then decided to do the whole thing. I didn’t really wipe any off on the lighter side of the floor, but did wipe off right away on the darker side. When I go back tomorrow, I’ll see how it turned out. If it’s ok, then I’ll put on the finish coat. If it’s not ok, I’ll probably also put on the finish coat because I have no idea how to fix this.

2012 (and beyond) Goals

Happy New Year!