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.
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.
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!
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.
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.
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.
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.
Here are my goals for 2013. A lot of the same things as last year, but hopefully I’ll get further along with them.
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.
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.
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.
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:
Command – arrow keys = change to different terminal windows
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.
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.
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.
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.
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.
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.
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:
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.
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.
It’s been a while since I’ve posted work done at the house, but work has progressed quite a bit.
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.
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?