Skip to content

no-op Prop8 = start answering the right questions.

With the decision yesterday from California on the status of Prop8, and the media splashing it all over the place I feel the need to get my anger out on the issue.

First off, the court did the right thing, it did not get political and gave a very straight forward ruling on the issue:

  1. If you take an action that is legal at the time, but the law changes post that action, the action is still legal.
  2. Californians can change there constitution.

Nothing more, nothing less, and that’s what they are there for. The problem is that they were asked the wrong questions, thus there answers are not the ones that we want to hear. In short the question that they should have asked are:

  1. What is the state’s primary definition of marriage?
  2. Does the state have a responsibility to extend equal rights to a minority?

With the legal answers to these questions you can seal this debate completely:

First, as I see it there are three definitions of the word marriage:

inter-personal
“I love you enough that I want to tell you that I am commited to you and you alone.”
legal (aka: civil union)
“Hay everyone, if I get busted up and can’t speak for my self talk to this person.”
religious
(insert your own reason here)

As I see it the state is not involved in the interpersonal definition so it’s not available to the state as an option, leaving them the only choice to determine if they are a religious entity or not. Now lets bust out the punnet square and work this out:

In the eyes of the state: Civil Union = Marrage Religious = Marrage
Minority = Majority “gay marriage” = legal

  • If non-gay can marry, so can you.
  • The state only wants to know who to talk to if you can not.
“gay marriage” = legal

  • If non-gay can marry, so can you.
  • The state wishes to defer to religion to decide if this is correct or not.
Minority != Majority “gay marriage” = legal

  • You are diffrent there for you can be treated differently.
  • The state only wants to know who to talk to if you can not.
“gay marriage” != legal

  • You are diffrent there for you can be treated differently.
  • The state wishes to defer to religion to decide if this is correct or not.

So there we go, “gay marriage” is only illegal if the state does not feel that it is it’s responsibility to maintain equality and does not see it’s primary definition of the word marriage as mearly a formality to allow a citizen to defer there rights to another individual. The problem with the state standing up and saying this is that it starts to raise so many other questions:

  • If the state has a responsibility to treat minorities with equality, then why is the state putting child molesters on a public list?
  • If the state does not have a responsibility for equality then why are there no laws that state that all non-white males must make 50% less for the same work
  • If the state only cares about marriage as documentation, then why can I not marry multiple partners?
  • If the state wishes to defer to religion then you must publicly pick one religion to hold above all others as a clarification of the definition.

The bottom line is that the state is based on laws and all laws are mearly definitions, thus because there is confusion on the correct definition from the point of view of the citizens it is the states job to solidify these definitions.

Why I don’t understand the Obama at Notre Dame “fake” fiasco.

I’ve said it before and I’ll say it again, I’m pro-choice for one very simple reason:

I think that you are better suited to make your own decisions for yourself.

So with that in mind the only way that I can justify any one who is pro-life is that they feel that they know better about any of your decisions. That kinda makes sense when you think of the Catholic church as a group that dispenses lifestyle demands in a top down fashion. Though I think that there is a small, yet very vocal, minority that has completely lost sight of what is really going on.

If, for example, we decide that the Catholic church is in fact 100% completely correct and that we should structure everything to the exact letter of the doctrine, that this small minority desires, then I think that many who even consider them self Catholic would be adversely affected by this decision, let alone everyone else. Actually I would be very surprised if even members of this small minority could even work out what this universal doctrine should be as they have only rallied around one issue. So since that is not a good idea, what society does is to try and split the difference and make decisions that is best for everyone. Some times it does not quite work out so well, but we try.

Though to make this work, you have to be tolerant of those that do not think like you, do not do what you do, and those that do not believe what you do, I think that some guy named Jesus said something similar. In short we have to let people make decisions that work for them, and we need to accept that they might not make the same choice that we would. Only seems fitting, some one who considers them self so holy would only at least consider the words that happen to be in the book that they base their entire argument on, or am I expecting too much?

Morgage Calculator

It’s late and this is a hack but it ~seems~ to be in the ballpark of what the figures were getting back from our loan officer. It’s not factoring in all the other stuff like closing and other taxes, but for a quick ref on how much you’ll be paying or would like to pay on a place it’s decent enough.

Since it was hard enough to dig up the right formula and such I’ll share my bad hack here and if enough people poke me about it it might end up on CPAN.

In short it allows for the following things to happen:

  • If I know how much I want to spend, what is the max loan I can cap out at?
  • benh:bin>  mcal --payment 1400 --tax 2100
    TOTAL LOAN: $241767.420
    
  • If I know the loan amount how much will I spend a month
  • benh:bin>  mcal --loan 232000 --tax 2100
    MONTHLY PAYMENT: $1350.510
    
  • You can ask both questions at once, you get to parse out the results
  • benh:bin>  mcal --loan 239000 --payment 1200 --tax 2100
    TOTAL LOAN: $202295.188
    MONTHLY PAYMENT: $1385.978
    

… now on with the code …

#!/usr/bin/perl
use strict;
use warnings;

my $mor = My::Mortgage>new_with_options();
$mor->calc;

BEGIN{
package My::Mortgage;
use Moose;
with qw{MooseX::Getopt};
has [qw{loan payment tax}] => (
   is => 'rw',
   isa => 'Num',
   default => -1,
);

has rate => (qw{is rw isa Num default 4.5});
has years => (qw{is rw isa Int default 30});

has c => (
   is => 'rw',
   isa => 'Num',
   lazy => 1,
   default => sub{
      my $s = shift;
      my $c = $s->rate/100/12;
      my $n = $s->years*12;
      return ((1+$c)**$n * $c)/((1+$c)**$n -1);
   },
);

sub calc_payment {
   my $self = shift;
   return ($self->tax >= 0 )
        ? ($self->loan * $self->c) + ($self->tax / 12)
        : $self->loan * $self->c
        ;
}

sub calc_loan {
   my $self = shift;
   return ($self->tax >= 0)
        ? ($self->payment - ($self->tax / 12) )/$self->c
        : $self->payment/$self->c
        ;
}

sub calc {
   my $self = shift;
   die 'NOT ENOUGH INFO GIVEN'
      unless $self->payment >= 0 || $self->loan >= 0;
   printf qq{TOTAL LOAN: \$%0.03f\n}, $self->calc_loan
      if $self->payment >= 0 ;
   printf qq{MONTHLY PAYMENT: \$%0.03f\n}, $self->calc_payment
      if $self->loan >= 0 ;
}

1;
};#END BEGIN

Like everything else posted in the wild, take and play, have fun and break it, just don’t come crying to me if it eats your puppy.

Perl 5.10.0 on Dreamhost

Since the web moves forward, all past links and instructions are not always accruate any more, the Cwd.pm issues have been resolved and are on CPAN. Thus new instructions are needed, here’s what I’ve done:

  • mkdir ~/local
  • mkdir ~/src
  • cd ~/src
  • wget http://www.perl.com/CPAN/src/perl-5.10.0.tar.gz
  • tar zxvf ./perl-5.10.0.tar.gz
  • cd perl-5.10.0
  • mv ./lib/Cwd.pm ./lib/Cwd.pm.dist
  • wget http://cpansearch.perl.org/src/SMUELLER/PathTools-3.29/Cwd.pm -O ./lib/Cwd.pm
  • mv ./ext/Cwd/Cwd.xs ./ext/Cwd/Cwd.xs.dist
  • wget http://cpansearch.perl.org/src/SMUELLER/PathTools-3.29/Cwd.xs -O ./ext/Cwd/Cwd.xs
  • sh Configure -Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC /
    -Darchname=i386-linux -Dprefix=~/local/ -Dpager=/usr/bin/sensible-pager -Uafs /
    -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dvendorlib=/usr/share/perl5 /
    -Dvendorarch=/usr/lib/perl5 -Dvendorprefix=/usr -Uinstallusrbinperl -des
  • make
  • make test
  • Failed 2 tests out of 1433, 99.86% okay.
    ../ext/Cwd/t/cwd.t
    ../lib/perl5db.t

    I ignored these two.

  • make install
  • perl -v

    This is perl, v5.10.0 built for i386-linux-thread-multi

    Copyright 1987-2007, Larry Wall

    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using "man perl" or "perldoc perl". If you have access to the
    Internet, point your browser

UPDATE
You will also need to update Term::Readline::Gnu.

  • cd ~/src
  • wget ftp://ftp.cwru.edu/pub/bash/readline-6.0.tar.gz
  • tar zxvf readline-6.0.tar.gz
  • cd readline-6.0
  • ./configure –prefix=/home/$USER/local
  • make && make install
  • cd..
  • wget http://search.cpan.org/CPAN/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-1.19.tar.gz
  • tar zxvf Term-ReadLine-Gnu-1.19.tar.gz
  • cd Term-ReadLine-Gnu-1.19
  • perl ./Makefile.PL –prefix=~/local
  • make && make test && make install

RS, I hear you but I think that you’re missing the mark.

This is a rant-sponce to Richard Stalman’s (RS) Javascript Trap.

First, I really am glad that RS is vocal in the community. He’s done a lot of good and if there is no one to argue the point then we become complacent. That said, I am not always his biggest fan, and I often think that he takes things too far, looking at the world in only absolutes. I’m sure that it’s a great way to make the world easy to deal with and give you an ulser in the process.

The problem that I have in his bit about javascript is that he is proposing something that doesn’t even fix the problems that he outlines, and in the process creates a bunch of headaches.

[goal] allow the browser to shift to a ‘free’ version of any application that is ‘not-free’
[RS-solution] tag every thing with a licence and have the browser fail over.

While I can see his point, to make this work you would have to have some standard way to pack up a licence with the app,and for every transaction, async or not. With out this standard then you can not begin to teach the browser what is ‘free’ and is ‘not-free’. Thats a lot of redundant bandwith that is only going to be useful to a small slice of any given audiance, thus I don’t think that there will be much buy in.

Though, just for a bit lets pretend that there was a good standard way that you could tag all code that is sent to your browser with a some kind of ‘free or not’ bit. How would you address the proper fail over? The only way that I can even begin to think about this would be to have some global registrar that would map non-free apps to there free alternative. Because this is the web the interface for this would again have to be taged with the ‘free or not’ bit, so even to get to a point where you could even do this you would make a reqest to Google Docs (the example from RS’s article), your browser would see that your trying to use google docs, if it’s smart it would first look the the global registrar, look up Google Docs, see if there are any alternatives, then ask you if any of these you would like to use any alternatives. If you pick one then your browser would then make the request for data from Google analitics, and pass that data to the alternative and then show you the result of what ever the output of the alternative was.

Sure you could “streamline” a few of these steps by having the alternative be installed as some local plugin, it would speed things up a bit, but it’s still a real long way around the issue. In the end all you would end up with is seperate code bases that happen to manage the same data, you would have programers that are struggling to mantain API compatablity and comply with all the given featuresets of what ever it is that there cooking up.

This is the most backwards way to attempt to FOSS-a-fy web-apps. What this approach basicly does is to state that every ‘non-free’ app is perfect the way it is, so perfect that we need to duplicate the effort just to make a copy. FOSS was all about having open solutions that you could remix to save time. If you found something that did 90% of what you wanted you could just modify it enough to get what you wanted. If we follow RS then we need to give up the 100% of what has been done to completely recreate it with the right licence. Seems like a waste of time to me.

Talks I’m planning for OS Bridge.

So if you haven’t heard about OS Bridge, I’ll spare you and you can just go here: http://opensourcebridge.org, poke around and then come back here. Trust me, it’s worth your time.

Ok on to our next round of biz, “What is ben planning on yapping about at OS Bridge”? Well so far I’ve got two ideas cooked up, figured I would get them out of the head and on to some virtual paper and see how they look.

Critique, what do you really have to say?

Critique, feedback, peer review, they are all the same, but why are they so important? What should you look to get out of a critique? What should to look to put in to a critique? It all really boils down to trying really hard to think about what you need to say.

Living with a Moose, one year later

Picking up from last years talk on how Moose taught me OO (pdx.pm ) I’ll be talking about what a Moose can do for you. We’ll do a quick catch up for any one new to the land of the Moose. Then from there we will be talking about other pitfalls that I’ve run into and how to get your self out of them.

So there we go, I’ve got the excerpts done, not the details and then I can post ‘em up.

Another attempt to address an irrelevant argument.

This is mostly a responce to Jeff Atwood’s “A Scripter at Heart” post, and all the comments that followed. Rant tags engage.

The destinction between “scripting” and “programing” from the stand point of the person at the keyboard is irrelevant. Thus I think that this whole article and comment thread are, in effect, just as irrelevant. What is relevant is that we solve problems in a linerar stream and have a computer do the work. Where the compliation happens is only a step in your workflow, and has little bearing on the solution.

Why are we constantly trying to create distinctions where one is not nessassary. The only people that have any concept of interpreted vs compiled languages are the people at the keyboard. What Larry Wall’s “Programming is Hard, Let’s Go Scripting…” and Andy Lester’s counterpoint, “Stop Saying Script”, are in effect doing are trying to do is redefine the definition on the word ’script’. But who cares? If we look at definitions of the word script, the only one that does not imply a linear stream are the ones that refer to handwriting. Taking a look at program, we see that they all basicly boil down to ‘a plan or explination for future actions’.

Both are just as relevant and on point to “creating a linear stream of instructions to give to a computer to solve a problem”, so stop complaing and get to work.

Rant tags off.

[news flash] people have sex, and sometimes, they lie about it.

Ok, so any one who has not some how picked up on this completely over blown story about our fine mayor Sam Adams. I’ll catch you up, he had sex, and lied about it before an election. *gasp* I know it’s like thats never happened before. What is wrong with people, some how the act of voting for some one to do something for you some how seems to carry some extra burden of righteousness?

I’m going to share my email to Sam (login required).

Sam please DO NOT step down.

I know that it’s tough, I can only imagine how hard this has been for you. You can do so much for this city, sure it hurts that you lied to us, but that’s what people do. It happens, life goes on. Please, I did not vote for you to be a local saint, I voted for you because I felt that you can help make this city an even better place to live.


benh~

It’s all about perspective, ok so he lied about having sex. It’s not like he got us in to a war or something that some how effects my daily life. Sure lying is not the best thing for a politician to do in the first place, though really when was the last time that you found a politician fessing up and apologizing? Shouldn’t that say more about his character then anything?

I thought that he was the best guy for the job when I voted for him, I still think that he’s the best guy for the job. I want to see where he can take this place, Portland is great but theres always room for improvement. Just like Sam, great guy, room for improvement, apology accepted, lets get back to work.

wordpress: functions to do stuff there way, but what about my way?

So with all this recent playing with wordpress that I’ve been up to, the more and more that I find my self saying ‘This was not designed for me was it?’ Sadly the answer tends to be ‘nope’, but it’s all in PHP so I can monkey with what ever I want to.

GOAL:

  • respect the page order value
  • nested list of links to pages for a nav
  • system that allows me to define the HTML
  • filter list down to only show pages where a custom feild ‘display’ = ‘nav’ (allows me to allow the page to decide where it shows up)

HOMEWORK:

  • get page hierarchy() will not work, as it returns a flat list, thus looses context
  • wp list pages() will not work as it does not allow for custom HTML and does not respect the page order stuff as written in the docs (weird, I know!)
  • crap, I have to write my own

SOLUTION:


<?php
#should we be displaying things here?
function display_is ($p) {
    return ( get_post_meta($p->ID,'display',true) == 'nav' );
}
#does the parent id match? (there has to be a better way then writing to globals?)
function ppid_is ($p) {
    return ( $p->post_parent == $GLOBALS['DSP_current_post_parent'] );
}
#display the pages at this level (RECURSIVE)
function display_sub_pages ($pid, $class) {
    $GLOBALS['DSP_current_post_parent'] = $pid;
    $kids = get_posts( array(
                     'numberposts' => -1,
                     'post_parent' => $pid,
                     'post_type'   => 'page',
                     'orderby'     => 'menu_order',
                     'post_status' => 'publish',
    ) );
    $kids = array_filter ( $kids, 'display_is' );
    # this next one is retarded, but some how needed??? apparently get_posts(post_parent) doesn't work?
    $kids = array_filter ( $kids, 'ppid_is' );
    if (count($kids) > 0 ) {
       printf( "\n            <ul class=\'%s\'>\n", $class );
       foreach ($kids as $p) {
          printf("               <li class='%s' >\n", $p->post_title);
          printf("                  <a href='%s'>%s</a>\n", get_page_link($p->ID), $p->post_title );
          display_sub_pages($p->ID, "_$class" );
          print  "               </li>\n";
       }
       print     "            </ul>\n";
    }
    $GLOBALS['DSP_current_post_parent'] = '';
}

# kick start the process by starting at 0, then dig for sub-pages
display_sub_pages('0','nav');
?>

Now I can have my own HTML, I have a clean recursive call to build the entire tree (, the classes know how deep they are, in short it fits everything that I wished the default one had. It’s not the cleanest code I’ve done, my PHP-fu is rusty, sorry, apart from that, have at it kids. Swindle the code if you need something like this, comment if you found something broken.

Overall lessons learned:

  • PHP callback’s sucks
  • I always forget how stupid it is to just print HTML in your code untill I am forced to get back to it
  • I’m not Wordpress’s target demographic, I guess it’s a good thing for the masses, but it kinda gets to me that there are not hooks for things that I think are simple and obvious.

yes we can, yes we did

image by BohPhoto

So after a some what surprisingly short evening we have entered an era of what appears to be revived hope. It was very interesting to compare the two speeches between McCain and Obama. Both were sincere, honest, and to the point, qualities missing from the public face of both campaigns for a while. I was very pleased with both of the candidates though.

I really have to hand it to McCain, he seemed much more him self tonight, gave a good speech that I could connect with. The toughest thing I have to criticize about his speech was mostly the crowd, he riled up a hornets nest and now has to sit with it. But thats going to happen with any campaign.

John McCain’s Concession Speech in Phoenix

Though it was Obama’s speech that really floored me, it was like no other acceptance speech I can remember, the man has a way with words. He gracefully let some air out of the balloon saying that not everything is going to happen in the next 4 years. He brilliantly used a preachers technique of repetition to involve the crowd (”yes we can”). He used Regan’s ‘Beacon on the Hill’. He echoed Carters speeches telling the americans that we’re going to have to cut back, and it’s going to hurt. He spoke directly to those who were not in the crowd and did not vote for him, he has more of a mandate then Bush ever did (well one could argue post 9-11…) and yet reaches out to every one. He speaks of the worries of the nation, what’s on peoples minds. He’s a very tangible commodity, he’s striving to get us to a point where we can talk to the person across the street, no matter what campaign sign is planted in there yard.

Barack Obama’s presidential acceptance speech in Chicago’s Grant Park [MP3]

I see much of Carter in him, I just hope that it can last. Carter was a one term president because he tried to do too much too fast, was to arrogant too early, the job ended eating him alive. Carter’s legacy has been wonderful, he really found what he was good at, it just was not president. I hope that Obama is really the man for the job, if he can pull together a good team as well as he pulled this nation together then were good, I see a great future before us.

That said, for this to work, we need to all be on the same boat. You don’t have to like it, you can grump if you want, but you have to be paddling in the same direction. The thing that I worry most about with tonight swing, is that we’ve swung too far, that were going to push people away that we really need, there were going to throw the people that grump over board, instead of trying to hear them out. I don’t see this as a problem that Obama caused, but it’s one he will have to deal with, and deal with quickly, before it gets out of hand.

“Good night and good luck”