Jason’s Ranting & Raving

Those who don’t read have no advantage over those who can’t.

Archive for February, 2009

Free Speech censored by the United Nations?

Posted by jaystile on February 27, 2009

I was watching a news article on youtube by CNN. This (shallow) report is followed by the commentary of Lou Dobbs and Christopher Hitchens. They talk about the actions taken by the United Nations to move toward a binding resolution of member states to make it a crime for defamation of religion. As a side note, I dislike listening to Lou Dobbs and other talking heads on the news. Also, if you’re going to read a book on atheism, read ‘The God Delusion’ by Richard Dawkins which discusses why religion is unnecessary. Christopher Hitchens attacks religion in his book ‘god is not Great’ and is very hostile with his words.

People really do need to stand up for their rights and the rights of others. You scratch my back and I’ll scratch yours. I’ll protect your freedom to practice religion, if you protect my right to reject religion. I’ll protect your right to speak/write freely, if you protect my right to listen and read the media that I want to. I’ll protect your right to bear arms if you protect my rights against warrantless wiretapping.

The commentators do focus heavily on Islam since the resolution is promoted by Pakistan and backed by other Islamic nations. But ambiguous language leads to a litany of lawsuits. I’m sure every religion would be crawling out of the woodwork with claims of defamation of religion. My question is, when did it become a right not to get offended? I understand wanting rules regarding hate speech and race/religion based threats because that makes sense. You do NOT get to threaten people just because they are different than you. But a law regarding blasphemy? I believe that to be a terrible idea. I think it is appropriate to criticize bronze age ideologies that have long outlived their usefulness and do great amounts of harm in society.

The initial concept of the United Nations was great. Trying to stop the destruction of the world by another world war by using diplomacy and the aggregate power of the world against rogue nations is a noble prospect. But the U.N. is impotent because of special rules made just for the super powers like the United States and the former Soviet Union allowing one to undercut the other. And like all democracies, if the ‘crazies’ have the majority or people just stop caring the ruling body breaks down. (i.e., how the 43rd President of the United States got elected and the aftermath)

Posted in Civil Liberties, Outrage | Tagged: , , | Leave a Comment »

Perl: Converting Decimal to Degrees Minutes Seconds (and vice-versa)

Posted by jaystile on February 21, 2009

Here is some code I playing with trying to get conversion from one coordinate system to another. There is some percision loss due to the floating point math in the conversions. So expect to see a loss of a few seconds when converting from decimal.


1 #!/usr/bin/perl
2
3 use strict;
4 use POSIX qw(ceil floor);
5
6 # flush print to the output after every write.
7 $| = 1;
8
9 testConvertDegMinSecToDecimal();
10 testConvertDecimalToDegMinSec();
11
12 ##### TEST ROUTINES
13 sub testConvertDegMinSecToDecimal {
14 my $result = convertDegMinSecToDecimal(121, 8, 6);
15 print "RESULT: $result\n";
16
17 my $result = convertDegMinSecToDecimal(121, 59, 59);
18 print "RESULT: $result\n";
19 }
20
21 sub testConvertDecimalToDegMinSec {
22 my $deg; my $min; my $sec;
23 ($deg, $min, $sec) = convertDecimalToDegMinSec(121.135);
24 print "RESULT - DEG: $deg MIN: $min SEC: $sec\n";
25
26 ($deg, $min, $sec) = convertDecimalToDegMinSec(121.99317);
27 print "RESULT - DEG: $deg MIN: $min SEC: $sec\n";
28 }
29
30 ##### SUB ROUTINES
31 sub convertDegMinSecToDecimal {
32 my $deg = $_[0];
33 my $min = $_[1];
34 my $sec = $_[2];
35
36 my $result = $deg + ($min/60) + (($sec/60) *(1/60));
37 $result = sprintf("%.5f", $result);
38 }
39
40 sub convertDecimalToDegMinSec {
41 my $input = $_[0];
42 my $deg = floor($input);
43
44 $input = $input - $deg;
45 $input = $input * 60;
46
47 my $min = floor($input);
48
49 $input = $input - $min;
50 $input = $input * 60;
51
52 my $sec = floor($input);
53
54 return ($deg, $min, $sec);
55 }

If you’re playing with degrees minutes seconds & decimal degree conversions you’re probably interested in calculating distance on the Earth. There are two common algorithms for calculating distance that are available as CPAN modules:

Posted in Programming | Tagged: , , | Leave a Comment »

The Joy of Parenting: The Art of Manipulation

Posted by jaystile on February 19, 2009

I was working on my laptop and paying bills when my youngest daughter (2yrs) comes up to me and asks, “Can we play games?” I say, “No. Not right now.”

She asks me again, politely this time because that can change the outcome of a request, “Can we please, play games?” She likes to play the games on pbskids.org. She gets to play games with her mom while I and her older sister work on her reading lessons. (Look for an upcoming book review on ‘Teach Your Child to Read in 100 Easy Lessons’ on this blog). Again, dad answers, “No. Not right now, Dad is working.”

She says, “hmmph” and toddles off. My youngest comes back about 20 seconds later, “Would you please, give Sissy her reading lesson?”

“You want me to give your sister her reading lesson right now?”

“uh-huh, would you please?”

“No, I can’t I’m working right now.” It took me a bit to figure it out. She wanted me to give her sister a reading lesson so her and her mom could play games. What a little manipulator! She almost got me too. I was thinking, “Well, maybe I could get half the lesson done before dinner.”

Posted in Parenting | Tagged: , , , | Leave a Comment »

The Joy of Parenting: Meet Santa Claus

Posted by jaystile on February 17, 2009

The Denver Zoo presents Zoo Lights! This is when you go to the zoo at night in the middle of winter to look at Christmas lights. You proceed to freeze any under protected areas of your body while trying not to slip on the ice. The zoo provides a Santa Claus for the kids to talk to. After waiting in line for 30 agonizing minutes keeping our girls from rushing the bearded man dressed in red, my girls get into Santa’s sleigh. It should be noted that my children do not get to watch a whole lot of TV, so when you ask them what they want for Christmas, they really don’t have any ideas. Santa asked my oldest(4yrs), “What do you want for Christmas?” She responds, “A pinata of a white bear.” Santa was taken aback when trying to clarify her request. But then she realized she had forgotten an important item and yelled at him, “AND A BAT!” Because you’ve got to be able to get the candy out, right?

My youngest(2yrs) was very shy and would not look at Santa. But when he asked her what she wanted for Christmas she said, “candy”. F@#$ the pinata and bat. Just give me the candy.

Posted in Parenting | Tagged: , , | Leave a Comment »

The Joy of Parenting: Snowman

Posted by jaystile on February 16, 2009

My family made it to Keystone, CO for a company sponsored holiday party. Let me tell you, there are numerous benefits to be had working for a privately owned company. While up in the mountains we had about 6-8 inches of fresh snowfall. It was awesome! This was the best snowball, snowfort, and snowman making snow that I have ever seen. My daughters and I made a giant snowman. The base snowball was so large that I could not push it anymore. It took the effort of both me and my wife to lift the middle snowball onto it. Finally, we made the head. This was a great snowman. It just needed some finishing touches. We got some sticks for the arms. I announce that we need to find some rocks for the eyes. My eldest daughter (4) chimes in with “Dad, here are some rocks” and she hands them to me. They are pretty snow covered and I brush the snow off them, but it is really not coming off. I take my gloves off and try melting a little of the snow and that works and they look good. Then I started orienting them for the best possible alignment and I notice there is a little mud on them so I try and wipe it off…. but wait… the more I wipe the more mud there is. “OH, NO! IT’S NOT ROCKS!” It’s dog poop.

Disgruntled, I go back to the condo to wash my hands and pout while my wife and children laugh.

Posted in Parenting | Tagged: , , , | 1 Comment »

Ubuntu: Howto Setup a Local Subversion Repository

Posted by jaystile on February 13, 2009

This Howto is targeted for Ubuntu 8.04, Hardy Heron. Specifically, this will go through a quick start to get subversion running on the file system. Which, by the way, is NOT the recommended way of setting it up. But if you’re doing some local (1-person) development it is the quickest. The documentation for subversion can be found at svnbook.red-bean.com

Get Subversion!
I used the Synaptec Package Manager to download the ‘subversion’ package. You could probably done just as well using ‘apt-get’.

Create Repository!

svnadmin create /var/svnroot/

Import your code into the repository!
Where LocalDir is like /home/username/MyProject
and Where ProjectName is like MyProject

svn import LocalDir file:///var/svnroot/ProjectName

Check out your code from the repository!

svn checkout file:///var/svnroot/PorjectName

Your code is now under version control! (Don’t you feel all grown up now?)

Posted in Programming | Tagged: , | Leave a Comment »

Ubuntu: Howto Setup a Local PostgreSQL and pgAdmin

Posted by jaystile on February 13, 2009

I’m setting up a project for some prototyping web development I’ve been doing. I’m looking at configuring Ubuntu 8.04 Hardy Heron to use Postgresql 8.3. I’ve decided to document my steps (so I don’t forget them).

First off, I’m borrowing heavily from this site: www.ubuntugeek.com which configured Postgresql 8.2 for Ubuntu 7.10. Because I’ve found that Ubuntu, while very helpful in making installations easier, usually does not follow the default installation instructions. Of course you could always RTFM: PostgreSQL Documentation

Download the Postgres 8.3
I used Synaptec Package Manager tool to download the packages ‘postgresql’, ‘postresql-client’, and ‘pgadmin3’. I’m sure you could use the ‘apt-get’ instead.

Configure Postgres Login
Now we need to reset the password for the ‘postgres’ admin account for the server. If you’re going to expose this to the outside world replace ‘password’ with a strong password, like ‘I3!ABaie#9’.

sudo su postgres -c "psql template1"
template1=# ALTER USER postgres WITH PASSWORD ‘password’;
template1=# \q

For version 8.4 I had to use the following code to get pdAdminIII to work:

sudo -u postgres psql postgres
psql (8.4.4)
Type "help" for help.

postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q

That alters the password for within the database, now we need to do the same for the unix user ‘postgres’. Make sure you use the password you entered inside of psql.

sudo passwd -d postgres
sudo su postgres -c passwd

From here on in we can use both pgAdmin and command-line access (as the postgres user) to run the database server. Postgres 8.3 is configured to use local access only by default. If you want to open up PostgreSQL follow the link mentioned at the beginning of this article.

Restart the PostgreSQL server.

sudo /etc/init.d/postgresql-8.3 restart

Troubleshooting
I was having a hard time logging with pgadmin3. It turns out I was forgetting the ‘;’ semicolon in the ALTER USER statement.

Now What?
Now, that you have a database why don’t you do something with it? Like write a java application.

Posted in Programming | Tagged: | 2 Comments »

Life for Men.

Posted by jaystile on February 10, 2009

Ha Ha Ha! http://img242.imageshack.us/img242/6827/howtonotfailatlifepn3he9.png

Posted in Funny | Tagged: , , | Leave a Comment »

Cool Stuff: Green Techonology Ideas

Posted by jaystile on February 9, 2009

I think the human race has a destiny (that is if we can manage to not let crazy power hungry people stay in power worldwide). That is the merging of a high-technology and agrarian lifestyle. The more we can union technology and nature the better off we will be. Instead of the raw metal and asphalt we will have green growth.

While this ‘grown’ single family home concept is cool, I don’t really find it practical. Around major cities we have serious suburban sprawl. The American Dream, a white picket fence with a two car garage. A little place to call your own. This is becoming the American Nightmare with people having hour long commutes in gridlocked traffic. Not to mention the newer housing developments for the middle class have lot sizes so small you could hardly put a swing set on it. I think we might have to shift away from the concept of individual property. Instead we should be building upwards. I’m not talking about the small cramped apartment/condo style of housing. I’m referring to a 2500sq ft layout with parking. So instead of 8 houses jammed together you have one large multistory building with communal green space around it. This one building would share a lot space intensive purposes. Perhaps a communal workshop, a greenhouse, compost pile, play area, dog run, rooftop garden, bbq pit, etc. If enough of these buildings were planned you could construct the tram between them featured above to join other communities.

Notable problems with this approach would be that people don’t like to share with other people. We were raised that way and I don’t see that changing anytime soon. Second, once developers realize that people would be willing to live in a multi-family housing building if they had enough space, they would minimize the green space and we would lose the benefit of the multi-family dwelling. Third, are the sociopaths claiming all communal space as their own, blaring their music at all hours, leaving the communal areas a mess, and generally doing those things that would qualify them as a sociopath to begin with.

You might ask me, “Why don’t you just live on a commune?” I can answer that pretty easily. I don’t want to live with a bunch of dirty hippies. 😉

Rainforest City

Rainforest City

Posted in Cool Stuff | Tagged: , , , | Leave a Comment »