Everyone who ever decides to ever start a blog has likely run in to that span of time where you just can’t convince your self to post anything. Some times its a day, some times its a week, then for others (like me) its months at a time. So again I’m going to try and break that cycle and just start pushing ideas and rants here.
Lets see how this one goes.
Tuesday, January 19, 2010
Next step, lets see how long the chin fluff stays?
–
benh~
I have a problem with todo lists, I have the attention span of a turnip thus there a blessing and a curse, as I get excited and put a bunch of stuff on said list then promptly forget that there was a list at all. So I’m going to start making sunday the ‘clean up your todo list’ day. The hope is that come monday I’ll have a list that more accurately describes what really should be done for the week, hope being the operative word. So here goes:
The first ‘left-over task that I’m going to tackle today is to talk about my little side project, euler_bench, a little attempt at the little benchmarker that could. The initial goal was to build up something that would show how much progress the Rakudo project has made. Because it was easy we started off by using the Project Euler problem set. Because of this the current code is completely tied to the way that we started to organize around the euler problems.
This is not the worst thing in the world but since then it’s ballooned a bit in scope and now I would like to really re-do most of the back-end stuff to be portable, thus allowing the ability to compare anything to anything else. You know, the same problem that any quick prototype has, it works really well for one thing, but speed was traded for flexability, now its time to really build the project. All good lessons learned, and here’s where you come in.
Because the project is now at a point where planning is involved, if you have feature requests jump in. If you have any desire to play along feel free to grab a fork (its on github for just this reason). This has been the project that I’ve been working on at the weekly PDX Thursday Hackathon, so you can join in there too if you so desire.
So its not the best post, but it’s good enough to check the box in hiveminder. Off to check something else off too.
–
benh~
I am testing crowdscience so you might be asked to fill out a survey. Don’t know how this is all going to work, so if you feel like it go forth and click away, if not sorry in advance.
Moose gives you the tools to code in a very very clean and standard manner. It does not inhibit you from being dumb, but it makes being smart very easy. Let me give you an example.
For work we have a Type for our product id’s, it is just a few lines of code but in allows us to have all our objects know before they do anything that they have a valid id. Well a co-worker noticed this morning that the validation was overly strict, we would (correctly) fail if the id included leading or trailing white space.
Not a huge problem to solve, but why have every object do it’s own cleaning? Sure you could have a central place for the code, but what I really want is to never have to worry about this at all, and we already have a central choke point. So lets head back to that type that is already being cohersed… so why not do the change there, wait there is no reason not to.
5 minutes later we’re back up and running, no muss, no fuss. Moose, a good toolkit is makes doing the right thing easy, and you end up with an OO system for free =).
Thanks again team #moose.
I’ll admit this right up front, I could completely be missing the whole point of ChromeOS. I’m not in communication with any one over at the googleplex, I don’t know any dev’s that are spec-ing this out, so it’s quite likely that I’m completely wrong.
That said, the way that I read everything coming directly from google is that you get enough underlying linux to enable the hardware, run a local webserver and a browser, thats it. Chrome (the browser) becomes the only UI layer, just like Gnome or KDE, and because it is a browser it can talk to the local server and the outside world. Every user application then is nothing more then a call to the local webserver in another ‘tab’ of the browser. This allows you to leverage HTML5 and CSS for display, JS for logic, and add in a little sugar to give you access to a SQLite DB and file system, *tada* a toolbox to solve just about any standard desktop app. Also because it’s a browser theres no reason that remote calls to existing services like gMail are built in. Thinking of things like this allow you to see how they can say things like every app will be crossplatform compatable because all you need to do is host your app on another server and *wamo* it works on any copy of firefox because it’s just HTML5 and JS with access to some data store.
So that’s how I see things, but it seems like everyone else has missed the boat. It seems that there are two camps of confusion.
- ChromeOS = Cloud + thin client
- If this is indeed what google has up it’s sleve, it doesn’t seem like a very good move. There are so many privacy concerns that come up when any one thinks of the cloud, and thats not going to go away by the time that this gets released. Even worse though is that this line of thinking implies that the device will be useless with out a connection to the cloud. What use will any device be if it pushes everything out to the cloud with out any local storage and then that line is cut? Even a simple cellphone is useful enough these days to play games and check a calendar when there is no cell service.
- ChromeOS = Desktop
- If you have to ask if your browser is going to get his with a virus then you’ve been stuck in the windows mind set for too long. Will there be code exploit holes, sure, but there no diffrent then any other browser issue. We run our browsers now, and no one seems to care so how will this been any diffrent.
So I’ll say it again, I could be wrong, Google could be investing alot of time and money in to building up something to compete with X and any other UI layer on linux, or they could just run there browser and be done with it.
So theres some buzz around todays announcement of Google’s ChromeOS, but heres the thing, it’s nothing new. -GASP-, I know. So lets take a quick overview of of this ‘re-think what operating systems should be’, actually is.
At it’s core, is the linux kernel, thus allowing you to run on both ARM and x86, though nothing new. Next up the stack is the posiblity of a new network stack, though I doubt that it’ll be from scratch. Then for the UI layer, there going to use Chrome, there browser, still not a new idea.
Now I have no doubt that Google will do some amazing work, there going to include some interesting features, but hoestly lets call a spade a spade. This proposal has no conceptual diffrence then the instance of Palm’s WebOS that I have running in my pocket right now. The only functonal diffrence is that Palm went with WebKit and Google’s going with Chrome.
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:
- If you take an action that is legal at the time, but the law changes post that action, the action is still legal.
- 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:
- What is the state’s primary definition of marriage?
- 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.
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?
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.