Jul 022011

Went to a fun home game with a buddy and they played a couple interesting games I hadn’t heard of before. At least one of them is their own invention but I figured it’d be worth it to write down some thoughts on the rules and general play to aid my memory.

Pucker

Dealer antes (common practice in this group) and each player gets 2 cards. Player to the left of the dealer can choose to contend for a low by sliding their cards to the middle. If no one challenges the player gets a leg. If one (or more) challenge then the players exchange hand (hidden from others) and pay off the size of the pot to whoever they’re wrong. So for example:

Pot of $5

  • I’m first and slide in 73 for the low
  • Next player slides in cards as does one other
  • We rotate the other hands and peak at them and I see that there’s a 53 and a 32
  • I pay both the 32 and the 53 $5 – the size of the pot
  • The 53 pays $5 to the 32 – since I just paid him $5 it costs him nothing

After that round each player gets a 3rd card and you content for the high hand as above. Then a 4th is played low and a 5th high. On all the low hands there’s an additional ante from all the players so the pot continues to build. We played a max $30 cap on what you would have to pay another when contending for a leg but the pot in the middle continues to build. First player to 3 legs wins the pot. If no player has 3 legs after 5 cards are dealt the pot remains, the deal rotates and another round commences from the beginning.

A couple interesting variations we came up with:

  • play 3rd street like a 3 card poker hand so straights and flushes count and hand ranking becomes: straight flush, 3 of a kind, straight, flush, pair, high card.
  • play 5th with a “pussy rule” where if everyone declines to contend for the high, everyone has to flip their hand and the actual high pays a penalty – discourages nitty play and leads to more trash talking which is key

It’s kinds of a complicated game to explain but fun and quite an action game. Because you can get paid while contending for a leg you can win money even if you don’t take down the ultimate pot in the middle. It’s pretty easy to take a big swing and win or lose twice the cap while contending for a leg.

Strategy wise it’s a game where position is a massive advantage and bluffing is huge. Because the pot in the middle can grow large and the pot can’t be won if you’re challenged you’ll see people challenging a guy with 2 legs even with little chance of being correct. I can see a potential situation where players would essentially refuse to let the game end because the pot was so large and the max penalty for losing a challenge is capped but this didn’t arise in practice. It’s probably important to play this game in a “friendly” environment.

I’m not sure if this game goes by any other names but I couldn’t find anything out there on this game so it could be a local invention.

One of the things that always bothered me about Ruby on Rails apps in general and RESTful routing in general is how quickly it breaks down in the real world. You know the world with clients and designers. It’s all fine and well, your “blogs” page lists all the blogs and “blog/1″ shows the first blog entry and everything is all nice and neat and then someone insists that you have to have a tag cloud on all the pages and maybe a list of most recent comments or a blog roll. The pure and simple joy of the blogs routes loads the blogs model and displays in the blogs views all goes to hell.

Up to now I’ve had two techniques to deal with this and both of them frankly suck.

1) Have the controller load all the models that the view needs. This just reeks. The index action in the blog controller can logically load the blogs but why should it have to know that the designer put a blog roll on that page and it also needs to load those urls along with topics for a tag cloud or comments. I really hate the idea of my controller having to know about design elements when it should be controlling: namely deal with the inputs and data logically associated with that particular resource.

2) Dump all that crap into your application_controller in some filter that get run all the time. At least this is DRY but I really hate the idea of hiding this stuff away where you don’t expect it and can’t find it. When there’s something wrong and you need to address something on the blogs index page you’re naturally going to go to the blogs views/controller/model. Having some truly common stuff in your application controller (current_user) is okay but I’ve too often seen this loading of miscellaneous junk bloat the application_controller beyond reason.

Enter cells. Call em components, or widgets or blocks they’re what pretty much every real world rails app needs. Encapsulate that common element on the side into it’s own bit and then include it like a partial. But like a smart partial that loads the data it needs by itself. It take a partial from a strictly display oriented view thing and adds a lightweight controller to do the controller like stuff we need.

I’d come across cells a while ago and never used them but had a few spare minutes and decided to give it a try and that’s about all it takes. I have a feeling I’ll be using them in just about every project from now on.

If you’re like me and installed Fedora in a VirtualBox by just clicking through defaults you’ll find that when you try to do anything you’ve setup a box with very little disk space. At least in my case I ended up with a virtual hard drive with 8G max and a root partition with 5.5G allocated. It’s okay though because by blindly clicking through defaults I ended up using LVM2 for that root partition.

So since I have LVM in place I can simply add another disk and extend the logical volume/partition onto it. Easy as cake as they say.

1) Add a disk – this is VirtualBox so shut down the the box and then from settings, storage add another device. I went with 50G this time. Really – you bought developers PCs with only 138G drives in them? Oh well, it’ll expand to use what I need up to that 50G limit.

2) Add an LVM physical volume – startup that machine and then use “fdisk /dev/sdb” to create a partition on the new drive and then “pvcreate /dev/sdb1″

3) Add that physical volume to my volume group. I didn’t know the name of that volume group so “vgs” showed me that it is vg_machinename and then “vgextend vg_machinename /dev/sdb1″

4) Extend the logical volume to increase take advantage of some of that newly available space. I wasn’t sure of the logical volume name so “df” showed me that it is /dev/mapper/vg_machinename-lv_root and so “lvextend -L50G /dev/mapper/vg_machinename-lv_root” and I’m good right? Well sort of. The logical volume is bigger but the filesystem is still the same size.

5) Extend the file system over that new larger logical volume. Since it’s mounted on / I can’t unmount so shutdown and boot off of the live CD image I used to install. Then “e2fsck -f /dev/mapper/vg_machinename-lv_root” followed by “resize2fs /dev/mapper/vg_machinename-lv_root”.

6) Unmount the CD image, reboot and voila – lots more elbow room.

Not exactly an end user kind of operation but not a horrible ordeal either and all without losing the stuff I had on there already. The same basic process should work for other distributions as long as you’re using LVM2 and ext4 as the filesystem though the naming will likely be somewhat different.

Apr 022011

Dear HBO,

I subscribe to your service. While I enjoy the show Boardwalk Empire, I didn’t see all of the episodes during their first run. You’ve graciously put some of the episodes on demand. But not all of them. I’d prefer to watch them on demand but if I can’t I’ll go on the internet and download the episodes. If I’m going on the internet to download the episodes I won’t have any need to subscribe to your service.

Restricting the episodes available on demand is not protecting your DVD sales. There’s no circumstance under which I, as an HBO subscriber, will purchase the show on DVD. Restricting the episodes available on demand is jeopardizing your subscription business because the on demand feature is a major factor in my being a subscriber.

Dear Movie Exec,

Please see above except substitute Netflix for on demand. There is no circumstance under which I will buy your movies on DVD. I don’t care to own your movie, I just want to watch it once. I’m willing to wait 6 months or whatever to watch it on Netflix which is by far the most convenient way for me to watch a movie. Restricting movies available on Netflix is not protecting your DVD sales it’s jeopardizing whatever revenue you get from Netflix.

Dear Showtime,

For some reason my FIOS DVR didn’t record the season of Californication like I asked it to. Luckily you have the entire season available on demand.

Thank you.

I’d ask you to get FIOS to fix their DVR but some things are too much to ask.

Mar 132011

I seem to always run into problems when attempting to update my iPhone software through iTunes. I’d get through downloading the file and then when iTunes starts to process the download it would give an error about network connection timed out. It’s kind of a curious error because as far as I could tell it had already download the update. I had a hunch that what iTunes is doing at that point is making another network query to validate the install and that connection was for some reason being blocked by my firewall which is Kaspersky. So I proceeded to shutdown everything but iTunes and went into Kaspersky to pause my protection and voila – the update downloads and proceeds just fine. Once it got to the point where it was actually updating the software on the iPhone I re-enabled Kaspersky and the update went through without a hitch.

I actually seem to remember having this same exact problem on the prior iOS update and not that I think about it, it seems that I had to disable the firewall to get that one through as well.

In general I’m pretty happy with Kaspersky but like just about all Windows anti-virus/firewall software I’ve tried the false negatives are a bit annoying. And I really wish it would offer more insight into exactly what it was doing.

Dec 162010

So I have a model that uses an integer to track it’s state which can be one of several predetermined states – proposed, accepted, rejected – which I’ve mapped to an integer. I’ve used ruby magic to make lots of syntactically pretty methods so that I can do things like @proposal.accepted? and can transition it like @proposal.rejected!. It’s all data driven so that I can add new states easily. Off the top of my head:

@@states = {1 => 'Proposed', 2 => 'Accepted', 3 => 'Rejected'}
 
@@states.each_pair do |k,v|
  define_method "#{v.downcase}?" { self.state_id == k }
  define_method "#{v.downcase}!" { self.state_id = k }
end

That’s all great but in a related table I find the need to select only related objects of a certain state. What I initially got is something like this:

has_many accepted_proposals  ... conditions => 'proposals.state_id = 2'

Now if there’s one thing I’ve learned to hate it’s magic numbers sprinkled around the code. What I want is to write something like:

has_many accepted_proposals ... conditions => ['proposals.state_id = ?', Proposal.accepted_state_id]

And so I tried to define it like my other useful utility methods except … you can’t use define_method to make a class method, only an instance method. I didn’t like this but then while discussing it with a colleague I had the thought – method_missing! I’ve never had cause to use to use it before but the idea is pretty simple. Insert your own code that can pattern match against a method name that isn’t previously defined and do something useful. And what you end up with is something like this:

@@state_ids = Hash.new
@@states.each_pair do |k,v|
  @@state_id[v.downcase] = k
end
 
def self.method_missing(method_sym, *arguments, &block)
  if method_sym.to_s =~ /^(.*)_state_id$/
    @@state_ids[$1]
  else
    super
  end
end

So adding a new state to the class variable effectively gives me 3 automagically generated methods, @proposal.state?, @proposal.state! and Proposal.state_state_id. Very sweet.

Now of course I can do this in a more traditional way with a class method that would look something like Proposal.state_id(‘accepted) but that seems vaguely unsatisfying while the method_missing approach just reeks of awesome.

Feb 012009

So somehow I ended up with a second dog. Well maybe 1.5 dogs since Mocha doesn’t quite qualify.

Cathy had been wanting a “real dog” that will play with the kids and be less of a cat than Mocha and so we visited PetSmart in Reston where the Lost Dog Rescue was having an adoption event. We saw a dog walking around who was calm, very tolerant of the kids and generally seemed like a good fit. And of course we went home with Sunny.

We thought Sunny was a mix. Turns out he’s very likely a pure breed Catahoula. He was supposed to be deaf but he’s certainly not completely deaf though we’re not entirely sure how well he hears. He was supposed to be calm. Turns out he’s got kennel cough and will very likely perk up a lot when that’s cured. Despite what Drew though he didn’t actually catch kennel cough from Sunny. Though Sunny does have giardia which is a fun little parasite that humans can catch. Oh and Sunny is not allowed on the furniture but you can see how well that’s going.

So far though Sunny seems to be adapting well. Mocha doesn’t quite love him but is quickly working toward tolerance.

As for the title? Right after we took Sunny home we had a nasty series of snow and freezing rain. Emma went out to walk the dog with mom and fell and scraped her knee. She was bleeding (and crying) and I offered to have Sunny lick her wounds. Emma declined because “If he licks it he’ll turn into a vampire dog”. Quite logical really and so Sunny’s help wasn’t needed.

Oct 272008

I don’t have a cool Iphone or equivalent (yet) but I just recently learned about some cool stuff you can do with a regular old cell phone. Send a text to 466453 (”google”) with a simple query and you get back an answer. I’m not sure all of what you can ask but the real trick is that you don’t need to know all sort of special formats or anything. Send “penn state score” and in seconds you get the latest score of the game in progress. When you’re team is in contention for a national championship and you’re forced to be out on a Saturday this is golden.

Sep 262008

So Nickelodeon has this kids vote for the president thing they do where kids get to vote online for who they think will be president. I was watching the end of a show with Drew when the commercial for the kids vote thing popped up and Drew announced: “I want to vote for Rocco”.

Dad: Who?

Drew: Rocco. I want to vote for Rocco.

Dad: You mean Barack Obama?

Drew: Yeah. Muh Rocco Bama.

Dad: Why do you want to vote for him?

Drew: Because he has a cool name.

So there you have it. All those who were afraid that Barack Obama would be a tough name for Americans to swallow just need to poll the under 7 set.

Feb 172008
Jumper

Jumper is a sci-fi movie about a geeky outcast guy who suddenly discovers he has the ability to “teleport” to different places. He runs away from home, leaving behind a dad “who wasn’t much of one” and his high school crush. We catch up with him later as he’s living the good life of a wold hopping bank robber, when he’s attacked by someone who knows what he can do and seeks to kill him because of it. Obviously now that he’s in danger it would be a good time to visit the old high school crush and put her in danger too.

Jumper is a fairly interesting concept. The ability to jump is never given a scientific basis – people just seem to be born with it – and the people who hunt jumpers are never given much of a rationale beyond – “You’re an abomination. Only God should have the ability to be all places.” Beyond that the the characters are largely undeveloped and the movie is lacking a certain something I like to call a plot.

At the end of the movie my feeling was that the movie was pretty pointless. There’s no central theme or overall story arc. The story just seems to happen to the character. Oddly enough there’s a pretty prominent actor (Diane Lane) who plays a very minor (in terms of screen time) role. Either a lot of her performance was left on the cutting room floor or she was there for some other reason. That other reason would be sequels. The movie feels almost like a pilot for a TV show and the concept would seem to be good one for a TV show or perhaps a series of movies. Diane Lane’s character delivers one of those obvious “we’ll be making a sequel” lines near the end of the movie and I wouldn’t be surprised if the intention is to bring her back in a bigger role in a future version.

  • Effects – pretty good – the locations of course are spectacular
  • Action – decent enough
  • Plot – virtually non-existant
  • Performances – Sam L. Jackson oddly disappoints for some reason. Rachel Bilson is cute which seems to be her character’s main quality, Hayden Christensen does ok in the lead
  • Overall: probably a 2 of 5 – worth watching when it hits TNT and you have nothing better to do

My rating: 2.0 stars
**

Happy Birthday to Mii

Wii Comments Off
Feb 122008

Got an early Valentines/Birthday/Anniversary gift.

And yes, your arm does get sore from playing Wii tennis. Unfortunately I don’t think it counts as a workout.

Of course that puts these on the wishlist:

Rayman's Raving Rabbids 2Tiger Woods 08Super Mario Galaxy

The new Mario Kart for Wii isn’t out yet. :)

Feb 062008

Emma just informed us that “I didn’t want to get my hair wet when I got appetized.”

I suppose we’d all be upset if we were going to be served up before an entrée and had to get our hair wet in the process.

Winning is sweet

General Comments Off
Feb 062008

Winning against a team that everyone hates is even sweeter.

Parenting is all about hoping for the future “I can’t wait until my kids are able to do …” and glorifying the past “It was so great when my kids …”

During football season (Yay Giants!) I’d glorify the past. Particularly the days when Emma was just a few months old and she and Drew were both napping in the afternoon. Mom and Drew would go upstairs to nap, Emma would fall asleep on my chest and I got to watch the game. Nowadays I very rarely get to watch a show I want to see while the kids are awake (though I think Drew is starting to like Mythbusters).

Of course this is a case of “the good old days” since the reason that Mom was napping along with the kids is that Emma was still getting up in the middle of the night.

For a long time I longed for the days when the kids would be out of diapers. Not that changing them was so horrid but because it was a general hassle. Now I just long for the day when Emma can go to the bathroom without assistance from dear old dad.

Boo at the Zoo

Kids Comments Off
Oct 312005

This was our second year at Boo at the Zoo – the National Zoo’s Halloween event. For Emma it was essentially her first time trick-or-treating. Last year she was too little to get even the slightest idea what was going on. She continued that at first – reluctant to put on her costume, a bit put off by the decorations and crowds, etc. Then people started dropping candy (and other treats) into her bag. The wide eyed amazement was fun to watch. By the end of the day it was “Treat?”. She couldn’t quite get out the whole “Trick or Treat” so she decided to focus on the important part.

Day and Knight

Kids Comments Off
Sep 132005

Straight from the “things kids say files” …

Drew and Katie are playing at the playground slide thing ..
(Did you ever notice that there’s no such thing as the plain old fashioned slide anymore – you know the kind that’s just a set of steps that ends in a slide? All the “slides” now are fort like things with multiple stairs and slides and fireman polls, etc. “They didn’t have that when I was a kid.”)

Katie is at the top of the “fort”.
Katie: Oh, no. A dragon is coming. I need someone strong and brave to rescue me.
(I believe she refered to Drew as a prince).
Drew: No, no. Dragons are for Knights!
Katie: Oh, not during the bright daytime?

Sep 082005

I missed the first proposal – by his friend Amelia – but was on the court to witness Andrew’s second marriage proposal. Drew, Philip and Katie – all living on the court and all within about 6 months of each other age wise – are developing into quite the torrid little love triangle. Well as torrid as 3 year olds can get. It’s As the World Turns on China Rose Court.

This particular marriage proposal was quite amusing as it went something like this.
Philip (to Katie): You’re marrying me.
Katie: No! I’m marrying Andrew.
Andrew: No.

I’m not sure whether to be afraid that Drew’s a commitment-phobe or to be proud that he doesn’t want to be tied down just yet. He’s quite the stud.

Drew’s First Show

Kids Comments Off
May 222005

We took Drew (and Emma) to see Dora’s Pirate Adventure – the live musical – at the Warner Theater. Andrew, who had just woken from a nap in the car, was pretty much stunned the entire time. He did seem to enjoy the show, though he spent the entire time on either Mom or Dad’s lap. And of course it got the ringing endorsement from the TiVo raised child, “I want to watch it again”.

Emma, true to her nature, danced away for the first half and then spent Act 2 climbing the stairs in the theater and running the halls.

What amazed me most however was my willingness to spend $12 on a Dora flashlight thing. It’s one of those things that I’d ordinarily balk at – having been taught that lesson by my own dad – but something about the circumstances made it seem like a worthwhile expense for a memorable occassion. Drew of course loved it for about 3 1/2 minutes.

© 2011 nestoriak.com Suffusion theme by Sayontan Sinha