It’s been a while, so I thought I’d start off slow with a little tidbit I busted out today.

Here’s the problem:

Say I have

def foo(b, c):
    ...

and

def bar(a, b, c, *args, **kwargs):
    ...

and

def baz(*args, **kwargs):
    ...

And I want to write a decorator or something that intercepts the variable b before it hits the function.

How am I supposed to know which one is b when it’s different positions in each function, or could even be a kwarg?

I have my decorator right here:

from decorator import decorator
@decorator
def lol_dec(fn, *args, **kwargs):
    ...

I figured the best solution would be moving the args that could be named intoto the kwargs. It took me a bit of digging until I came across the inspect module, but it worked, and can work for you.

from inspect import getargspec
def fudge_args(fn, args, kwargs):
    #TODO once we all use 2.6 change it to following
    #fn_args = getargspec(fn).args
    fn_args = getargspec(fn)[0]

    new_kwargs = dict(zip(fn_args, args))
    new_kwargs.update(kwargs)

    return args[len(fn_args):], new_kwargs

It’s as easy as that. We just take the list of args from the ArgSpec, zip it up with the list of ordered arguments (args). Add them to a copy of kwargs. Note, we’re only returning args that were left over after the zip.

It’s used like so:

@decorator
def lol_dec(fn, *args, **kwargs):
    args, kwargs = fudge_args(fn, args, kwargs)
    kwargs['b'] = kwargs['b'] * 3
    return fn(*args, **kwargs)

New Venture - Muffin Castle

December 18th, 2008

I’m a software engineer as you may or may not know.  Sometimes, though, I feel a bit unfulfilled after work because I don’t make anything.  You can’t see what I do, you can’t touch what I do at work.  It’s database software.  People think it’s boring.

Anyways, I think I’ve figured out how to fill the void.

I’m starting a clothing brand or site or whatever you want to call it called Muffin Castle with my girlfriend, Marisa.  She does the art, and I do pretty much everything else.  It’s more or less an excuse for me to play with ecommerce, screen printing, trying a turn at marketing something, and maybe get a few shirts out of it.  I’m hoping more to just get this hobby to pay for itself versus making money (although making a few bucks for my hard work wouldn’t hurt).

I also get the chance to use drupal, which is in PHP and I frown upon PHP.  It does have a lot of momentum and seems fairly easy to hack.  Eventually I’d like to roll a site with Pylons, but that’s going to be a later date when I get a lot of free time on my hands.

I’d like you all to check out muffincastle.com in the coming month or so because we’ll be going live January 1st.

You can follow muffincastle on twitter to see what we’re up to.  We should have our first round of production shirts done this weekend so stay tuned for photos.  You can find some of our “beta” work and prototypes here (our real shirts will look a lot more finished :))

Just a quick update.  The new fancy wire I ordered came and I made a new cable.  Check it.

 

grado-cable-1

Perhaps I’ll be wrong, but I don’t think Apple will ever include blu-ray support on any of their products, with the small exclusion of MAYBE the Mac Pro.

Why?  It’s simple.  Apple wants to drive sales of their iTunes store, especially the HD movies.  Analysts that say it’s because it’s “about the price,” are either uninformed or in bed with Apple.  If there wasn’t a video iTunes store, Apple would love having Blu-Ray as an option for a premium.  Hell, until a year or so ago, you had to pay extra to have a DVD burner (the super drive as they call it) on the lower end MacBooks and iMacs.

Quote from forbes:

Another surprise, however, was that Apple’s new machines don’t incorporate support for Blu-ray. When asked about the move, Jobs simply called the optical disc technology a “bag of hurt.”

Analysts agreed. For now, excluding Blu-ray is all about the price.

Right, right, all about the price.  Price of what?  Price of Apple allowing a bit of competition to their HD offerings?

Modding the Grado SR80s

October 12th, 2008

I’ve had my Grado SR80s for about a year and a half now, and they have been no less than awesome since I got them.  Unfortunately, the tip of the 3.5mm TRS plug broke off when I tried bending it back into place.  This was a good excuse for an overhaul on the headphones because I have had a lot of modding ideas brewing for a while, especially after I saw this article about adding 2.5mm sub-mini jacks to the earcups.  I also just recently got the sen 414 earpads and did the reverse quarter mod… which added a bit of color, so I figured, why not more?

So let’s get started.  All these pictures were taken post-mortem unfortunately, but I will try to explain the process.

First, we start after removing the earcups from the headband, and removing the earpads.  We have to open up the earcup which isn’t that easy.  Some things I read suggested submerging in hot water, or using a blow dryer or just simple prying it apart.  None of them worked so well, so I figured out a better way to do it.  It requires two larger flat-head screwdrivers (the lower one seen in the picture could probably be substituted for a butter knife)

grados-4

What I’m doing in the above picture is using the larger driver as a base and rotating the smaller one clockwise which creates sufficient force to separate it.  The lower screwdriver allows the upper one to rotate without scraping the plastic.  Once I figured this out it took no more than 30 seconds per earcup to separate.

Now is a good time to paint or mod the outer enclose if you desire.

After opening I clipped the the cable about 7mm after the zip tie and then stripped the outer insulation.  Then I soldered the inner wires to the 2.5mm jack.  I had to make the jack fit in the earcup, so I hadto file the slot down vertically so the jack’s enclose wasn’t higher than the plastic for the earcup.  I then screwed it into place with the set screw (I didn’t even need to hot glue it, but it most likely is dependent upon the jack.

After that, I added the 2.5mm sub-mini plug to the other end of the cable that I snipped.  Blue is ground FYI.

grados-3

Repeat for the other earcup.

The outer enclosure will require some modification to make the 2.5mm plug connect flush to the jack, as well as it fit over the set screw for the jack.  I recommend using a file and exacto knive.  My worksmanship isn’t top notch, but I will probably give it another coat of paint eventually.

After that, you can put the cover back on.  It might look something like this.

grados-2

Since my original problem was the plug, I also put a new plug on the end.  I filed it down to be able to fit into my iPhone.  It’s a little ugly, but it gets the job done and I hate those iPhone adaptors.

 

grados-6 grados-5

 

Here are some more photos of the finished product.

grados-1

grados-7

I plan on making a new cable or two for them once this fancy stuff I got from eBay arrive.  I’ll update the post once it comes.  I ordered most of the parts from mcm electronics.  They seemed to have the best catalog and selection of 2.5mm plugs/jacks.

BarCampBay: November 8th & 9th

August 22nd, 2008

Just a quick update. We decided on the date. BarCampBay will be held the weekend of November 8th & 9th.

Also, I created the logo last night. Here it is:
Big Logo

Yeah, yeah, the GG bridge is a bit cliche, but I think it looks a kinda snappy.

Anyways, the BarCampBay wiki page can be found here: http://barcamp.org/BarCampBay

We’re still in need of sponsors, a venue, volunteers, and maybe an organizer or two, so if you can help, send an email to barcampbay@gmail.com

Google Checkout and Buy.com

August 19th, 2008

I’m not one to rave about retailers or services, but I feel like doing so because of the contempt  I’ve been accumulating for Amazon, eBay, and PayPal.

First, let’s talk about Google Checkout…  It’s fast as hell, saves my preferences, and whatnot.  Since it saves my addresses, I don’t need to individually register for each reseller.  It’s also a common interface for each reseller as well, so I know where to click and stuff.  I loathe using PayPal.  It’s slow as a sloth.  Just logging in takes forever.  Also, I don’t like transferring from my bank account with PayPal, and it won’t let you set a credit card to default.  I know it’s in their best interest, but not in mine or a general consumer.  If you’ve ever had to dispute with a seller, it’s a whole lot easier going through the credit card company than PayPal.  Also, checking out takes several clicks, and it’s not a very intuitive interface.  There’s times where I thought I was finished paying for something, but I didn’t click the one last confirm button.

Let’s move on to Buy.com.  Sure, it’s nothing special, but they do use google checkout and have some pretty good deals.  Also, they don’t mess around with shipping like Amazon does.  Sure, amazon has free super saver shipping, but what good is that if they hold your package for 5 days until they ship it.  They’re certainly not doing it because it would cost them more to ship it in the next day or two.  With Buy.com they ship it fast, and have fair or free shipping prices.  I ordered a package yesterday and got it today.  Also, there’s no misleading crap to trick me into purchasing Amazon Prime-like service with one click.  I know it’s gotten a lot of flack on resellerraitings.com, but the 3 or 4 purchases I’ve made from them had been quick and easy.

BarCampBay

August 19th, 2008

I’ve been thinking for a while about planning a general BarCamp for the bay.  I finally got around to contacting some people and it seems like there would be sufficient interest.

The date we have chosen is the last weekend in October.  We don’t have anything more than that, so I’ll update the blog/wiki/stuff when more stuff is decided.

For now if you want, follow BarCampBay on twitter.  Also, we’re still need in volunteers, so if you’re interested, drop me an email at mikelikespie [ at ] gmail.

Dear Apple,

You first thought you were tricky when you forced QuickTime down our throats, and screwed with firefox and made it nearly impossible to remove the plugin.  Also, no option to not allow the removal of QuickTime software.  Guess what?  Apple software isn’t the best.  ESPECIALLY for windows.  A computer with the exact same runs iTunes about 10 times slower (when doing  scrolling) in windows than in OS X.  It’s probably something very trivial or them optimizing a bitblt wrong.

Anyways, back to the point of this post… This is the default when Software Updater comes up.

Well, I added the wtf.  Safari is checked by default. Also, I don’t believe it’s faster than FF3 anymore.  I’m almost tempted to see if it made it the default browser. It probably does. Stop being shitty Apple. You’re just as bad as adware.  If you didn’t have your own browser, you’d probably pushing a firefox toolbar on us.

If I wasn’t tied to iTunes for the iPhone, I’d most definitely be using Windows Media Player when in Windows and have any Apple software on my Windows box.

When buying an Apple product, everybody knows there’s a “style tax” that you’re paying for the logo, and the operating system.

But how much is style worth to you?

I’ll start off with what I’m not going to compare, because it’s hard to do an apples to apples comparison (no pun intended).

  • Mac Pros - They’re quite good. They’re well made, have great, enterprise quality hardware, and compared to Dell or HP workstations, they’re really not that pricey. Try seeing what the CPUs cost on newegg. That being said, the upgrades are overprices for them, and buying more drives or RAM aftermarket makes a lot of sense.
  • iMacs - Ok, I think they’re a bit overpriced, but I can’t really do a fair comparison because it’s hard to put a pricetag on the convenience they offer, and they’re pretty slick.
  • iP.*s - There isn’t better out there because I think other manufactuers have realized they can’t really compete (possibly excluding iPhones).
  • Mac Mini - Yes, they’re overpriced, but the same as the iMacs, there isn’t a fair comparison.

This brings me to the notebooks…. Let’s start with the 15″ MacBook Pro (MBP).

I used a first generation MBP at a previous job for about 6 months. Overall, I really enjoyed it, aside from it getting a bit toasty (which Apple/Intel fixed with the C2D), and the MagSafe almost starting on fire (which Apple replaced even though it was out of warranty). I find Leopard to pretty great operating system, and most of the software I use either has an OS X version or equivalent. MacPorts is a lifesaver as well.

The system I will compare the MBP to is the 14.1″ AND 15.4″ Lenovo T61. I’m also quite familiar with these systems because I use a T61 every day. Let’s assume I configure the 14.1″ with Windows Vista, and the 15.4″ with SUSE Linux (Lenovo pre-installs it).

Let’s get the subjective comparison out of the way:

  • Build Quality - Honestly, I think this one is a tie. Sure, ThinkPads aren’t the same as they used to be (when IBM made them), but they’re still built like tanks. MBPs are pretty good too.
  • Screen Hinges - This is a strong win for the ThinkPad. If I lift my T61 up by the top of the screen, it actually stays at a 90 degree angle with the base. The hinges are really tight and have no wobble at all even on airplanes and the CalTrain. Even my 3 year old T43’s hinge is still tight. MBP’s hinges aren’t awful but they’re still a bit wobbly. Flying isn’t the best thing.
  • Options - I’m not going to compare this feature by feature, but I’d have to say MBP wins as far as bells and whistles go. The useless Thinklight doesn’t even come close to the lit keyboard, and the automatic screen dimming is pretty nice. I do like how you can get a battery to put in your optical drive bay for the thinkpads though.
  • Docking Station - Obviously, the ThinkPad wins. There isn’t one for the MBPs. I feel if one is often on the go, but works in the office too and doesn’t have a desktop, docking stations are a must. I know I don’t want to plug in ethernet, vga, 3 USB devices, headphones, power, etc. every time I sit down at the office.
  • Software - This is a tie to me. I’d say windows would win, but I don’t want to start an argument and this is way too subjective for me.
  • Size Feel - By this, I mean: How cumbersome does the notebook feel? Loser #1: 15.4″ ThinkPad. It’s a beast. It’s thick and heavy. Loser #2: MBP. It’s not as bad as the big ThinkPad, but it feels heavy and it’s not as portable as I prefer. Winner: 14.1″ ThinkPad. Even though it might weigh a bit more (I need to check) than the MBP, it feels significantly smaller, and this makes it a bit more portable.
  • Resolution - I like high resolutions. I’m not old yet. The MBP doesn’t suffer from a low res. The 15.4″ T61p I use might actually be too high of a resolution (until software figures out how to deal with scaling their fonts and images properly). It’s resolution is 1920×1200. It is more pixels than a 1080p hdtv! 1440×900 on the 14.1″ is a pretty good pixel density for me. It’s the same resolution as the MBP, but on a smaller screen. I’d say the winner of this one is personal preference.
  • Input Devices - There’s a lot of haters on the TrackPoint (you know, the little red nipple pointing device on ThinkPads), but it’s pretty good once you get used to it. Also, it has a middle button. For me, ThinkPad is the winner. I suppose if you wouldn’t use it anyway, the ThinkPad has two mouse buttons, so that’s easier than the two finger tap with the MacBook Pro touchpad. Touchpads cramp my hands. I will admit I did like the two finger drag scroll for the MBP.
  • Style - MBP of course.  It’s Apple.  People will think you have lots of money and listen to good music.  I’m still waiting for the matte black to be retro.

Let’s get down to the objective matters. Specs and costs. First comparison will be the $1999 MBP against the thinkpads with equivalent or better specs (to make it fair).

One caveat is that the ThinkPads video cards are less powerful than the MBPs (and not configurable). The 15.4″ with Linux has integrated graphics and the 14.1″ has a NVS 140 128mb.

MBP 14.1″ T61 15.4″ T61 (W/ Linux)
CPU 2.4GHz Intel Core 2 Duo Intel® Core™ 2 Duo processor T8300 (2.4GHz 800MHz 3MBL2) Intel® Core™ 2 Duo processor T8300 (2.4GHz 800MHz 3MBL2)
Disk Capacity 200gb 250gb 250gb
Disk Speed 5400rpm 5400rpm 5400rpm
Memory 2gb 2gb 2gb
Video Card nVIDIA GeForce 8600GT 256mb nVIDIA Quadro NVS 140M 128mb Intel GMA X3100 GM965
Cost $1999.00 $1,177.60 $1,068.40

There you have it.  Of course, not everybody pays retail for the MacBook pro.  The best way to get one is if you’re a student.  Either a) you can get a student ADC account for $100 which gives you one 20% discount on any piece of apple hardware which would bring the price to $1700ish,  b) be a student, get a MBP for your 10% discount, and sell the free iPod Touch on eBay if they’re doing a promotion at the time, or c) Know somebody who works at apple and use their 15% friends and family discount.  That being said, it’s not difficult to find better promotions on ThinkPads or knowing somebody to get one of their EPP discounts.

If I were purchasing a new notebook for myself on my current salary it’s a no-brainer to get a ThinkPad.  If I had a choice on which one I’d get for free or from work, then the decision would be tougher because it’s not directly out of pocket.  I’d get an X300 probably, but I’ll save my rants about the MacBook Air for another time.

For part 2 (if I ever get around to it), I will compare specs at the same prices… How good of a ThinkPad that can be had for $1999.