gettin old

As I get older, I notice my motivation to write blogs/social media has decreased significantly. Perhaps this is why products like Snapchat and Tumblr have largely escaped my attention. Shoot, I still use IRC, the dinosaur of internet communication. As for what I’ve been doing recently, I’ve put some work into a django port for thehardwareproject.org, tried out some new programs to replace ones I’ve been using for years (Deluge replacing uTorrent, etc), and am actively looking at starting up some new dev projects for 2014/15. I’ll probably try and redo trekktalk.com into something useful, and maybe give Android Studio a shot when I attempt my next android project.

Rocksmith – The future of learning guitar?

rocksmith logo

So on the advice of my friend Luke, I bought Rocksmith a little while ago even though a new version is coming out in October (Rocksmith 2014). It’s actually a pretty good deal right now on Amazon (link) because for $25 you get the rocktone cable and the PC version of the game on DVD but comes with a steamplay code so you can install it via steam to have it on all your computers. I’m not exactly learning on Rocksmith since I’ve been playing off and on for around 17 years, but I’ve found it to be incredibly useful and pretty fun.

I think the best way to think of Rocksmith would be not as a video game, but as a practice or training aid. It’s not meant to be the teacher, god no. But it is a great supplemental tool for practicing and building up skills. Interestingly enough, your goal while playing is to keep doing each phrase perfectly so you can level up that phrase and get more notes (more points) until you reach the end game (master mode), which is no notes at all. This is an example of a song in normal Rocksmith mode. Excuse my crappy sounding D5.

YouTube Preview Image

I’m on twitch TV now and occasionally stream my Rocksmith sessions so if you want to check that out, click here. But yea, back to the main point. This is the future. I can totally see programs like this being used by music teachers to supplement home practicing. It’s not a bad idea since most music students would be younger and a video game might be better at holding their attention. Perhaps the days of dreading the practicing of instruments is over, but we’ll see.

Spam!

Spam

Spam, the food (not the email), has been a staple in my family’s pantry for as long as I can remember. When I was younger, I thought it was like that for everyone’s family. But as I started to find out as I got older, Americans generally disliked spam. From what I gather, it seems like most people associate spam with a lower class of eating; something along the lines of “I’d only eat that if I was poor.” I still meet people today that have never even tasted spam.

I’ve since read up on it and discovered that South Korea is the number three consumer of spam in the world, with Guam and Hawaii being the first two. In fact, most of the places where spam is popular coincide with locations of large US military installations. So basically, the army was providing spam to its soldiers and the natives would often get it through the black market or barter. If your country has a large US military presence necessitating large quantities of spam, food is probably a scarce resource so something like spam would be considered extremely valuable.

I still keep up the tradition of eating spam, usually just fried up and served with rice. Last time I went to the grocery store to get it, there were numerous varieties. They had pepper, jalapeno, bacon, and some others. I will always just get the original (and maybe the bacon on occasion) but I’m glad they’re trying to innovate in order to appeal to a newer generation of spam eaters. The legend of spam must live on!

A look at raw denim

Raw Denim

Lately I’ve been getting more and more interested in some non-tech topics such as photography and fashion. I’ll save photography for another blog post, so let’s talk a little about fashion today, specifically jeans. More specifically, raw denim.

I’d gone most of my life without really ever hearing the term “raw denim.” I think I’m not alone in this either. In our pre-fabricated consumer society, innovation (and laziness) has led us to an age where we really don’t have to maintain our possessions anymore. Cars have been reduced to just getting your oil changed every 3-5k miles. Pre-packaged/fast foods have made it so that you could probably go your entire life without having to know how a stove works. Clothing is now so cheap that it’s quite normal for people to go shopping every season for new clothes because their old clothes are already frayed or coming apart at the seams.

Up until a few months ago, I kept wondering why my jeans (which I wear every day) would end up becoming ultra soft only after a year. Looking into my closet now, I have about 5 pairs of banana republic relaxed fit jeans. Three of those are of the “ultra soft” texture I mentioned. Only the remaining two have any “crisp” left in them. Then I read up on jean maintenance and realized my aggressive cleanliness is what did them in. While reading up on the damage washing does to jeans, I found out about raw denim. So basically, towards the end of the jeans making process, the jeans have indigo applied to them, and are then washed, which removes a lot of the indigo and sets a very standard fade pattern. Raw denim just skips that wash step. The indigo is still mainly on the fabric while you wear them.

If you decide to wash them, the general rule is to wait about six months (to get a proper fade) and then it’s really just a matter of how far you’re willing to go. For normal people, you could probably just flip the jeans inside out, do a simple cold water wash with a tiny amount of detergent in the washer, and then hang dry them upside down. For the more hardcore people, you could fill up a bathtub with cold water, mix a little detergent in there, flip jeans inside out, put it in the tub weighing it down so that it’s totally submerged, leave it for around 45 min, rinse with cold water, and hang dry upside down.

There’s a process some manufacturers use known as sanforization that basically pre-shrinks the denim for you so it’s not so much of a shock when you first wash them. If you happen upon a pair of unsanforized raws, you are supposed to go through the ritual of pre-soaking them which entails you putting on your new pair of jeans and soaking yourself in a bathtub to pre-shrink them to your body. There is no end to the shenanigans people will go through in order to achieve the perfect fade. Some people have even given up on washing their jeans at all.

As for me, the reason I’m getting around to posting about this today is that my pair of Gustin #12 Charcoal, made out of sanforized raw selvage denim from Japan, was finally delivered. After wearing them for the past 3 hours, I love them. It’s a great fit and they just feel so crisp! I’ll take some pics and try to document the experiment of my first fade. Thankfully I don’t have to pre-soak because I really didn’t feel like sitting in a tub with my jeans on, haha.

The debacle that is SimCity 2013

First off, let me say it’s been a while since I’ve last blogged. Since November in fact. And the reason I’m writing here now is, yup you guessed it, I need to rant yet again. So here’s me getting my rant on…

SimCity 2k was the source of countless hours of fun for me back when I first started getting into PC gaming. I remember numerous nights of playing till 4 in the morning, trying to build the “perfect” city. Since then, I’ve played SimCity 3k and SimCity 4 and loved them all. There are plenty of facets to the SimCity games for there to be an appeal to most gamers who play sim or micro-management type games. Network management (traffic), city layout, finance management, and market manipulation are just a few I can think of off the top of my head. What I really loved about this game though, was that the sky was the limit. You were the mayor/God. You could transform the earth. You could rain down destruction/disaster if one of your sims even looked at you funny. You could demolish an entire row of high-rise condominiums without even evicting the tenants first, just to build a new shopping area with a nice medium-sized park so your sims could have their own Tysons Corner Galleria area. If you could imagine it, you could at least *try* to build it.

Fast forward to today. SimCity 2013 has been out for a bit now and the reviews that were originally positive have since turned negative. Maxis did some initial damage control going so far as to have a Q&A on Twitter with the head of the company, Lucy Bradshaw, back when the focus of the problems seemed to be on server issues and players couldn’t get online. Now that the initial launch week stress has cleared, players have come back with new grievances which the company might not be able to just throw more servers at, including pathfinding issues as well as an overly simplistic agent model which might end up causing more problems than it solved. Couple these problems with the anonymous simcity dev who earlier this week said in an interview that the company’s claims of the game depending on online connectivity are exaggerated (take with grain of salt), and you have a recipe for hell week in the PR department at EA/Maxis.

As for me, I’ve returned the game for a refund because it was just unplayable and I wanted to send a message with my wallet. Do I think they’ll listen? Probably not. Do I think the game was worth $60? Nope. I’ll most likely pick it up when it goes on sale for like $10 (which is probably going to be sooner rather than later I’m guessing given the current bad press around the game).

Taking the plunge: Windows 8

win8

I managed to get a copy of Windows 8 the other day for $15 so I decided to give it a shot even though I’d probably not have upgraded for a while (if at all) because of all the negative press. Well, it wasn’t solely the negative press. I’d read up a bit on the metro UI changes being introduced and was a bit hesitant on having to learn a new UI paradigm, but I’m glad to report my fears were overblown. After a few hours of casual usage, I’ve slowly come around to the new OS and have even come to appreciate some of the design decisions (while lamenting others).

I didn’t have too much on my laptop that I couldn’t get back with a cloud sync. I used the Windows 8 upgrade assistant program off the Microsoft website. It downloaded the Windows 8 image and then let me decide if I wanted to put it onto USB, or optical media, or just run right there. I put it onto USB in case I wanted to use it for the future and proceeded with the install. It went rather quickly on my Thinkpad T520 and was probably up and running in about 15-20 minutes. Then it finally booted up to the actual “Start” screen with the tiles.

desktop

I WER CONFUSED. Not gonna lie. This was a bit intimidating at first. I clicked on the IE tile and got a not found page because I hadn’t connected it to the wireless network yet. Around this time, I figured out that the windows key on the keyboard brought up the start screen. So I tried out the desktop tile and it brought me to something that resembled the Windows 7 desktop minus the start menu. I started getting to work doing all the post-installation work like setting up the wireless, installing Chrome (although IE 10 wasn’t bad from what I saw, but… IE… lulz), checking out the new changes to Windows Explorer, etc.

 

I’m still messing around with it and getting acclimated to the different application modes (metro vs desktop). Some of it feels awkward on the desktop and you can see where it wouldn’t be so bad on mobile (eg. the Games app tile). One quick observation is that file utilities such as copy/delete seem to work insanely faster. I’ll report back on what I find later.

Using javascript’s RegExp exec method

The exec method off the RegExp object in javascript can cause some confusion if you’re not used to it. Let’s say we had the following simple regex:

var regex = /the/i;

So we’re looking for the word “the” with the case-insensitive flag enabled so it will match “the”, “THE”, “The”, etc. Here’s some sample subject text:

var subject = 'The quick brown fox jumps over the lazy dog';

If we go with this “as is”, we’ll get something like the following:

 var match = regex.exec(subject);
 if (match) {
     alert(match[0]);
 }

This will alert “The”, but what about the other instance of “the” in the sentence? How come that wasn’t matched? Oh! We forgot to set the global flag on the regex object. Now it should look like this:

var regex = /the/ig;

And the matching code now looks like:

 var match = null;
 while ( (match = regex.exec(subject)) ) {
    alert(match[0]);
 }

Now we get both instances of “the” in the sentence. So what exactly is going on here? Let’s slightly change that last block of code to this:

 var match = null;
 while ( (match = regex.exec(subject)) ) {
    alert(match[0] + ' ' + regex.lastIndex);
 }

So here, we see the regex object has a property called lastIndex that is set after every iteration of “exec()”. If you run the code, you’ll get something like “The 3″ and “the 34″. Once “exec()” finds a match, it sets the lastIndex property of the regex to the character right after the matched text. The next time it runs through the loop, it checks this lastIndex position and starts from there.

I’ll end this with a couple of cautionary warnings:

  • Don’t set the regex inside the loop. This would cause the lastIndex property to always be initialized to zero, hence, infinite loop if it was run against text with a match.
  • Modifying the subject string during the exec loop is dangerous and can also lead to an infinite loop.

Hope this helps some people!

jQuery Expected

Long time no write. Work has been crazy busy and life is pretty good. Here’s a quick plugin I wrote to help defensive programming when using jquery selectors.

jQuery Expected is inspired by .NET’s Enumerable.Single. It takes in an expected value and returns the collection if the number of items in the selector array matches the expected value. When the expected value doesn’t match, an Error of type ExpectedValueError is thrown. ExpectedValueError is included in the global namespace.

example:

try {
    $('selector').expected(1).html('hello world');
} catch (ex) {
    if (ex instanceof ExpectedValueError) {
        alert('Selector did not have expected length of 1');
    } else {
        console.log(ex);
    }
}

check it out here at github.