Thursday, August 13, 2009

diffdir

One thing Solaris does nicely is let you find the differences between directories and show 'em side by side so you can figure out what files are where.

I'm using Ubuntu (and Bash, like normal) and need to find a dir diff showing files in one dir and not in another, etc .

this is simply the command diff -q -r dir1 dir2.

However, I'm using source controlled directories, so this shows up with a whole mess of gall-durn .svn directories, etc. So I need to filter this out and an alias won't work.

Here's the code for my dirdiff or diffdir bash script:


#!/bin/bash
#--verbose
if (!(test -d $1))
then
echo "bad dir 1";
exit;
fi
if (!(test -d $2))
then
echo "bad dir 2";
exit;
fi
out=`diff -q -r $1 $2 | egrep -v svn `;
# echo "Result of diff: $out";
if [ -z "$out" ]
then
echo "Same";
else
echo "Difference between $1 and $2: "
echo "$out"
fi
# echo "Done";


Tuesday, August 11, 2009

Submission to FCC Re: Broadband

Who I Am / Use Cases:

1. I am a computer professional and use a large amount of bandwidth connecting with my workplace's VPN.

2. Further, I regularly download and upload large amounts of source code as part of my work on Linux and open-source related projects.

3. Futher, I have a great interest in downloading movies via Hulu.com, NetFlix.com, etc.

My requests / Interests:

1. My cable TV provider (Comcast, Inc.) provides my internet connection. They currently have a cap on usage of about 250 GB per month, but no way for me as a user to track my usage level. They also have a penalty for overuse of 'banishment' which would leave me with far fewer options for broadband.

Proposal: Require all providers that provide ISP services that have a cap on overall bandwidth usage to provide a free, auditable, accessible via automated tool (website, etc., vs. calling in by phone), means of finding out our usage.

Proposal: Require any cap on bandwidth to have reasonable overage charges in line with actual usage. That is, if there is an overage, an email would notify me, and my account would be charged a fee at the same rate or less than the original usage. This prevents them from setting a $10,000 fine on a small overage. If my monthly bill is $50, then doubling the bandwidth usage would ONLY double my bill, or less.

3. Describe in law that any collusion between ISPs (comcast, AT&T and/or other DSL providers, etc.) in setting prices, contract terms, or making available services or not, would be punishable under anti-trust statutes.

4. PROHIBIT MANDATORY COLLECTIVE BARGAINING in ISP broadband contracts. These massively favor the corporate interests and are well-known to almost never result in outcomes favorable to the 'little guy'.

5. Alternatively, require publication of all collective bargaining cases in the form of submission to a public civil federal court to establish if the cases are being resolved / adjudicated fairly. No outside judicial review of these cases ever occurs and this practice is organized fraud under the guise of allegedly fair practices in a gamed system.

6. I agree that all federally funded road and bridge projects require installation of large scale conduit in public rights of way affording access to the installation of dark or used fiber optic or other communication cables. Such space to be leased in a manner to prevent monopolizing of said conduit capacity by any one provider.

Your Confirmation Number is: '2009811037388 '
Date Received: Aug 11 2009
Docket: 09-51
Number of Files Transmitted: 1

Wednesday, June 10, 2009

Summer Reading Ideas

I recently wrote this as recommendations for good books for a trip:

Reading is all about what's right FOR a person. Not knowing you well, difficult to say.

However, one of the best science fiction books I've read in years is "Old Man's War" by John Scalzi (sp?). If you liked Heinlein (best: 'To Sail Beyond the Sunset", "Stranger in a Strange Land", or "Have Spacesuit Will Travel"... Or perhaps "Starship Troopers" which was 100x better than the movie), or Asimov (best: "Caves of Steel"), you'll like Old Man's War.

If you're more into NonFiction, "The World Is Flat" is good despite being several years old. "Eat the Rich" is very funny and an excellent economics bit told with lots of jokes and irreverent humor.

"Hitchhiker's Guide to the Galaxy" is fantastically funny science fiction, again 100x better than the movie.

I recently read a thing called The J Curve which has completely changed my understanding of international politics, talking about how countries behave in general terms, and evolve from autocracies to pluralistic democracies, or NOT, as the case may be. Feel free to skim, this has great parts and boring bits, but it's worth skimming to get there.

I was traveling in Europe many years ago and found a copy of Rob Roy, which was great reading on the trains. Long, yet very engaging.

Anything by Mark Twain makes great reading for travel - easy to put down and pick up again.

All in all, your best bet is a librarian, someone older who's been there a while. Tell them what you've read and liked, and be honest. My mother in law is a librarian, and she is one of the least judgemental people I know. She's found me great books, because she knows my taste and can match books to it.

Monday, June 01, 2009

On the Idea of Being Awesome

AWESOME nature entwines within its nonchalant grasp that mote of me.

Casually searching for meaning, loving and being loved, I hope for a difference-making life to emerge from this, my formless day-breaking average-ness, my oft-times mundane but happily or at least consolingly unique existence, my castle of experiences.

Such castles I have witnessed and joined in assembling, my own and my cared-for compatriots. These being assembled, we build them from our faults and costs and joys and glees.

Such are the AWESOME projects I set my shoulder upon. Such projects are unleashed by ashes and sawdust, by baby's cry and dinner's on and cleaning messes made by my not-swift-enough fingers or too-swift tongue.

I find my sadness and happiness and all betwixt that remains of a day, Awesome.

Wierd Phone dialing rules

Ok, so it occurred to me today again how silly and wrong the numbering scheme for phone numbers is.

It's especially confusing when you're abroad. Country codes are not all the same number of digits, like area codes. Very Silly way to run a numbering scheme.

My opinion: Country codes should all be the same length, say 3 digits. There's only 211 countries, that should be enough. From anywhere then, dial 999, then the country code, etc. Everyone knows the same rules, everywhere it's the same idea. If you don't dial 999 first, you're dialing inside your country. Every country has a different number of digits in their numbering scheme, too! It's confusing and yucky!

So how hard would it be to have a 10 digit number (area + 7) for every person in every country? that's enough, isn't it?

(123) 456-7890 = 1,234,567,890 == 1.2 billion phone numbers per country. Ug. Doesn't work for China or India if everyone has a phone number there.

Ok, so we decide on an 11 digit number (4 digit area code) and we get 12 billion numbers per country. That's enough.

Better yet, your phone number could be yours for life, and you could register it with a phone handset or location, like we do with cell phones.

I guess the only change here would be adding a digit to the area codes. But, the international dialing scheme would change so no matter where you went, you'd easily understand how to dial in that country, and between countries.

This is sounding a lot like the domain name scheme for the internet. I know, too idealistic to work. Maybe in 100 years when we need the flexibility. Or, it's utterly silly because in 100 years, there won't be phone numbers, there'll be phone 'codes' like domain names you register, and it will stick with you for as long as you want, and any computer/phone (like there's a difference) can find you.

Rant mode off...

Tuesday, April 28, 2009

Just had a big problem with my at-work PC. I upgraded from Intrepid to Jaunty, and X stopped working. Not just a little - hard lock on start. UG! Tried previous kernels, no go, same symptom, so not that.

Tried recovery mode netroot, root with networking. didn't know my graphics card. Looked at xorg.conf for complexities. But, xorg.conf yielded NOTHING, it was very generic, it can't be failing. Running lspci shows I'm running ATI RV515 GL (that's a FireGL V3350 card). Jaunty upgrade failed with this card.

Link Here to read great explanation of fixing it

Summary of commands from this other page:
$ sudo apt-get remove –purge xorg-driver-fglrx xserver-xorg-video-ati xserver-xorg-video-radeon
$ sudo apt-get install xserver-xorg-video-ati
$ sudo apt-get install –reinstall libgl1-mesa-glx libgl1-mesa-dri
$ dpkg-reconfigure -phigh xserver-xorg
Presto, reboot and glorious!

Sunday, March 22, 2009

How We Got Our Cats

We had a great method for getting our cats. We lost our one cat to old age about 2 years ago. So, off to Orphans of the Storm (lincolnshire, methinks). Into a room with 300 cats we 5 marched: Beck and I, and the 3 kids who were having a very very bad day. That is, they were squirelly, loud, obnoxious, moving too fast, chasing, screaming, etc.

We had 7 or 8 cats approach us. One, with us now and named Sirius Black because he's SERIOUSLY black, is a hunk of old bunker-buster weight-lifting hunka-hunka-burning-cat. That day, he crawled into Beck's lap and started purring despite the fact that 2 other cats were ON TOP of him, fighting. This is the mark of a winner cat.

Second was Luna Lovegood, who played with the kids despite them being less than polite, but was very lithe and coped well with the situation. We have since learned she's a theoretical physicist of a cat (I would say 'rocket scientist' but that's not as much of an achievement anymore). We have a YouTube video of her opening a door.

We have doors that have a thumb-push-down latch in our older home, and one closed to keep the upstairs separate. This was great. I'm mildly allergic, so can't sleep with cats, but I can stand it as long as I don't pet them and rub my eyes or breathe in their fur. So, life is good with a dividing line, the door. But, Luna started appearing upstairs on our bed in the middle of the night, and I was sure I closed the door at night.

She learned to stand on the stove, balance on one foot, tap the latch and pull at the same time to open the door. Here is the YouTube link.

We went out that weekend and bought a new door and mounted it in a different doorway, having to change the hinge locations and do lots of carpentry. I got to have some fun streching my skillset.

RECOMMENDED: Use Tung Oil. We did the rather bland looking pine door in about 10 coats of Tung oil with a light sanding using extra fine steel wool between. Now it looks Fantastic, like we paid tons for this expensive solid wood door with a fancy finish. True, the tung oil cost more than the door, but it was worth it.

So, to sum up, don't get your cats with kids on a good day. Get them on a bad day, and the ones that self-select to approach you are the keepers.

Wednesday, March 11, 2009

Working with JQuery Tablesorter Parser Input Fields

I've recently had to deal with JQuery's tablesorter. the trouble was, it had a problem sorting form input fields in columns. The columns sorted fine when they were static text, but when each column was a form entry field of <input type="text" ...> it wouldn't sort. this is because it was trying to sort the HTML of "<input ..." instead of the field value.

The solution to this took a little googleing and a bit of creative coding. My first solution was to use a regex to recognize the value="aaaa" and replace it to have the parser work on that text. The yucky factor was big.

Instead, I found the concept of using a val function on the text. This ended up being two parsers, because one of my input fields was a numeric value.

Here's the text:

$.tablesorter.addParser({
id: "textbox_text",
is: function(s) {
return false;
},
format: function(s) {
return $($.trim(s)).val().toLowerCase();
},
type: "text"
});

$.tablesorter.addParser({
id: "textbox_numeric",
is: function(s) {
return false;
},
format: function(s) {
return $($.trim(s)).val().toLowerCase();
},
type: "numeric"
});

$.tablesorter.addParser({
id: "checkbox_parser",
is: function(s) {
return false;
},
format: function(s) {
ret = $($.trim(s)).attr('checked');
return ret
},
type: "numeric"
});

$(document).ready(function()
{
$("#docReqTable").tablesorter(
{ widgets: ['zebra'],
sortColumn: 1,
sortClassAsc: 'headerSortUp', // class name for ascending sorting action to header
sortClassDesc: 'headerSortDown', // class name for descending sorting action to header
headerClass: 'header', // class name for headers (th's)
stripingRowClass: ['even','odd'], // class names for striping supplyed as a array.
stripRowsOnStartUp: true,
sortList: [[1, 0]],
headers: {
0 : { sorter : 'checkbox_parser' },
1 : { sorter : 'textbox_text' },
3 : { sorter : 'checkbox_parser' },
4 : { sorter : 'textbox_numeric' },
5 : { sorter : 'textbox_numeric' },
},
debug: true,
});
});


I'm having trouble now because I type in the input fields, and then click on a header to re-sort the data, and it doesn't sort to the top. That is, dynamically updating the values in the table doesn't allow a sorton operation in JQuery tablesorter to recognize the new values.

We already had a method to change the mouse pointer to a 'hand' when it mouseover'd the table header, so it looked like a clickable link there (a good visual clue to the user that the table really is sortable).

So, I tried adding a couple of methods I found online to the mouseover code to see if they would update the cache and allow resort based on the dynamically changed values inside the textbox. I even put some code in the tablesorter.js file for reSort_A and reSort_B that tried some things, to no avail.

The code for that is:

...
th onMouseOver="setPointerHand(this);" onMouseOut="setPointerDefault(this);" class="{sorter: 'text'}"
...
function setPointerHand(method)
{
document.body.style.cursor = 'hand';
$(docReqTable).trigger("appendCache");
$(docReqTable).trigger("update");
$(docReqTable).trigger('reSort_B');
$(docReqTable).trigger('applyWidgets');
return false;
}

function setPointerDefault(method)
{
document.body.style.cursor = 'default';
$(docReqTable).trigger("appendCache");
$(docReqTable).trigger("update");
//$(docReqTable).trigger("log", "doing stuff");
$(docReqTable).trigger('reSort_B');
$(docReqTable).trigger('applyWidgets');
return false;
}



That's as far as I've gotten. If anyone has clues for how to make the update / re-sort work well, please reply on this blog or otherwise post it!

Friday, January 02, 2009

Christmas Letter from the Kevin J. Rice

Update from the Holidays and the Rice Household:

The summer this year was taken up by working on a wrap-around brick patio for our house, so when we get out of the van it's onto a brick walkway instead of mud. This hopefully contributes to the cleanliness of our entrance hall. We (mostly me) broke out the concrete walk with a jackhammer (me! Fun!), and dug down 14 to 18 inches to put in a drain tile system. This turned out to be about 20 yards of dirt and gravel moving.

I put on some muscle during this. Unfortunately, it's still not finished. The hole has about 6 inches of lift left before we can put the bricks in. I would have finished with another weekend, but something interfered with this plan: a broken jaw.

On October 27th, I was working at clearing and burning some brush (buckthorn trees/bushes) at my church. While moving some large branches in the fire, I bent one back and then had it fly up and hit me in the face. It broke my jaw in 2 places (chin and near my ear). I've had my jaw wired shut for about 7 weeks and it the last two have had it opened but not unwired. There's still with the 'dental arch' in place sticking the insides of my cheeks with sharp wires, but hopefully this will come off in the next week or so.

So, drinking through a straw has meant losing 20 pounds, which makes me look nicer and I could certainly have used it, but I don't recommend it as a weight loss method.

Other news of the family:

Beck is working on her writing, and enjoying that. She's not enjoying arthritis in her foot and hip, and some plantar fasciitis to go with it.

Atticus is in kindergarden. He just turned 6, and there was much celebrating. He will (of course) be bummed out for the rest of his life having a birthday so close to Christmas, but we did what we could to make it properly a birthday just for him, with cake and a party and such things.

Xander is 7 and in first grade, doing very well. He's reading to himself some, and we've all been gathering at night (all the kids and mama at least) on the master bedroom bed, while Beck reads from the Harry Potter series. This is going over VERY well, even with some of the scary parts. We're in book 4 now and much of the kids' free-play has Harry Potter motifs.

Carter is 4 and frequently tries to get her way by screaming loudly. This hurts my ears horribly, and I've found my stress level increases directly with the noise level. With stress, I get a little angry, so I've taken to wearing earplugs during times of likely noisy events, which give me much more patience and thus ability to parent well.

Of course, the whole house has quieted down significantly since Christmas, when the boys got Nintendo DS's and Carter got a Leapster. Lego StarWars is a favorite, followed by Mario. We had a relaxing drive of over an hour when they had something to do besides pester the driver.

Speaking of driving, I saw good friends at New Years' eve and day. Kevin Gordon (who lives about 1.5 hours away) and his family, and Steve Brodson (who is minutes away from us) and his family, then the Brodsons' again for football on new years' day. Not that I'm THAT into football, but I like watching it occasionally and it's always fun to hang out and be social, especially since the kids have made such events less frequent.

The party at Kevin's on the eve was very interesting conversationally. One guest was a neighbor who does electrical contracting for a railroad nearby. He told some stories about putting up a whip antenna near high tension wires and having the induced voltage from the lines of several hundred volts on this relatively short antenna. Apparently everything has to be VERY well grounded around railroads due to lightning strikes, etc., too.

My work at Textura is taking up a lot more time recently, due to our serving the construction industry, which (as everyone knows) is being hit hard by the recession. We're working on putting out a new feature that solves a larger business problem and are hoping that it will generate some more business / revenue because people will find it more useful. So, lots of extra hours for me, but it's fun work since I can readily see the benefit to our users and hope our business outlook grows with the additional users and usage that this feature will bring.

Today we got a new kitten/cat, which had been at my mother in law's house, but she's not home enough for it so we took it. This brings our total back to 3; we had 3 but one had to go away because of a behavior problem and it's good to have a group again. They play together very interestingly (cat politics) and it's fun to watch and warm to be sat upon whilst watching TV, reading, etc.

Fitnesse ArrayFixture: my simple example

Recently I've been fighting with Fitnesse, specifically a pyFit server, trying to get an ArrayFixture to run properly. The only example of ArrayFixture I could find was the generic one. Here is a better example of ArrayFixture.

I'm calling this from within a DoFixture, mind you, so sorry if there's that added complication, but you should be able to figure out what's happening based on this.


class LwRow(object):

_typeDict = {}

def __init__(self):
self.rowNumber = None ; self._typeDict['rowNumber' ] = "Int"
self.indent = None ; self._typeDict['indent' ] = "Int"
self.refobjType = None ; self._typeDict['refobjType'] = "String"
self.refobjId = None ; self._typeDict['refobjId' ] = "Int"
self.sNumber = None ; self._typeDict['sNumber' ] = "String"
# ... blah more here...

def name(self):
self._typeDict['name'] = "String"
return self.linkOrgEditContractorText or ''

def getSetOfRowObjects(self):
rows = []
obj = LwRow()
obj.rowNumber = 1
obj.indent = 3
# ... more setting here...
rows.append(obj)
# blah, repeat, appending more rows...
return rows

class ReviewLwsArrayFixture(ArrayFixture):

def __init__(self, p, c, dr, user, trans=None):
ArrayFixture.__init__(self)
rows = []
#... do stuff here to retrieve data...
retData = getSetOfRowObjects()
print "Have retData=%s" % (pformat(retData))

# THESE ARE PRO-FORMA, MUST BE HERE:
self.paramCollection = retData
self.setActualCollection()

def getTargetClass(self):
return LwRow

def reviewLwsArrayAsUserPpCcDrUser(self, p, c, dr, user, trans):
return self.ReviewLwsArrayFixture(p=p, c=c, dr=dr, user=user, trans=trans)


# then you can write your UAT / Fitnesse code as follows.
# Note that I can use ANY attribute of the lwRow object without declaring it
# in my arrayfixture code (I have LwRow declared in a non-fixture related module)

|review lws array as user | gcUser| pp | p1 | cc | c1 | dr| Dr1 |
|rowNumber|name|indent|refobj type|
|1|manual name one|Manual|False|
|2|subMc1|LW Sub|True|
|3|subMc2|LW Sub|True|
|4|subMc3|LW Sub|True|


and / or:

|review lws array as user | gcUser| pp | p1 | cc | c1 | dr| Dr1 |
|rowNumber|name|sNumber|
|1|x|62|
|2|y|63|
|3|z|64|
|4|z|46|
|5|z|55|
|6|z|63|
|7|q|64|

That's it!