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:

javascript
var regex = /the/ig;

And the matching code now looks like:

javascript
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:

javascript
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.

jQuery Listerine Plugin

I’ve been helping a friend with his site, www.thehardwareproject.org, for the past couple of months. It was a good chance to rework a lot of my php CMS and one thing I noticed was that there were a lot of pages where all I was doing was displaying information via a list of divs. Different pages might have the lists formatted differently, but rather than write page-specific backend code to format the lists, why not output all lists uniformly to the page and then have client-side code manage the display?

Listerine has 2 modes. One is “columns” which basically creates a user-set number of columns on the page and then evenly distributes the list items between columns. The other mode is “grid” which is more of a tile-like display.

simple columns example:

$('.manufacturer_list_container').listerine({
    cols: 3,
    transform: 'columns'
});

Download the code here.

making bossam (bo ssam)

This weekend, I finally got around to making bossam (bo ssam), the Korean version of boiled pork and cabbage, at home. Using the instructions I found on this great korean food blog, it didn’t come out half bad. Some adjustments I made to the recipe are not using an onion, using a Korean red pepper instead of a Serrano pepper, not using a vegetable boil bag, and using 2.5 lbs of skin-on pork belly (which caused me to have way too many leftovers). Here are some pics of the process.

cleaning the pork

giving the lettuce a salt bath

dwenjang paste and coffee grounds in a pot.

boiling pork with coffee grounds.

everything in pot with new water.

boiling napa cabbage

time to enjoy the fruits of our labor!

Disable Script Debugging in Visual Web Developer 2010 Express

This little registry hack will disable javascript debugging in Visual Web Developer 2010 Express. You should really be using something like Chrome Dev Tools or Firebug when debugging javascript anyways.

reg add HKLM\SOFTWARE\Microsoft\VWDExpress\10.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f

happy new years 2012

Happy new years! For this first post of the new year, I thought I’d take a look at last year’s resolutions and see how I fared.

  • Play MORE video games.  Try and beat them too since I have a nasty habit of just dropping them midway through.
  • Learn Python and Java.
  • Try and complete more of my programming side projects instead of leaving them half-done (this seems to be a recurring theme in my life).
  • Learn to drive stick.
  • Try and do some more grad school classes.  I had put them off to pay off some debt first, but I should really try and get this done.
  • Pay off debt.
  • Read more books.
  • Be less political.

I have managed to actually beat more of the video games I started playing this year rather than leaving them unfinished. Some exceptions include Castlevania and Oblivion. Now that SWTOR has come out, I’ll probably leave those unfinished for a while though. I’ve managed to learn a bit of python, as well as learned to use git to publish some of the stuff I’ve learned to the web. I didn’t get around to learning stick or take more grad school classes. Due to unforeseen circumstances, I wasn’t able to save up as much money as I would have liked this past year to pay off debt. I did manage to read a lot more books though and I think I’ve become a bit less political. All in all, not a bad run of resolutions.

For this next year, I’ll keep the resolutions simple.

  • Start working out more and possibly start a martial arts class.
  • Pay off debt.
  • Start working on a video game project.
  • Learn, learn, learn. Always try to continue the learning process.

jquery-querystring

Just published a plugin that extends jquery to give access to querystring params easily. For the longest time, I was just copy/pasting one function into all my projects to do this, but finally decided to make it a jquery plugin for future use. Here’s how to use it:

$.querystring(param_name_here);

example:

var q = $.querystring('q');

Ezmode. get the code here: https://github.com/gehsekky/jquery-querystring