2009-03-31

Comux 001110

Yes, i took the plunge and now i am a really proud owner of the T-Mobile G1. And all i can say is i'm not sure how the hardware survives oozing that much awesomeness!

Slashdot Slashdot It!

2009-03-24

Comux 001101

This isn't really a joke.

Slashdot Slashdot It!

2009-03-17

2009-03-10

Comux 001011

2009-03-08

Abstruse Goose and Prime Riddles

So i'm a real maths geek. And seeing the latest Abstruse Goose comic on Saturday morning lead me to solving a math problem with code. By the time i got to the last piece of the riddle ( it's a 3 parter ), i decided that looking and guessing would take too long, so i figured that it was an easy enough problem to solve in code. Less than an hour later, i had a quick C# program that solved the problem. It took considerably longer than it would for me in C++, mainly because there were many things i needed to look up. So here it is:

using System;

public class MainClass

{

 public static void Main (string[] args)

{

 if( args.Length != 2 )

 {

  Console.WriteLine("Usage: PrimeFinder <n> <digits>");

  Console.WriteLine("where n is the length of the prime you are looking for and digits is the search space" );

  return;

 }

 

 int count = Convert.ToInt32( args[0] );

 

 if( count > args[1].Length )

 {

  Console.WriteLine("Number of digits was longer then the search space");

  return;

 }

 

 

 for( int i =0; i<=args[1].Length-count; i++ )

 {

  string current = args[1].Substring( i, count );

  Int64 toCheck = Convert.ToInt64( current );

  if( isPrime( toCheck ) )

  {

   Console.Write("Found Prime: ");

   Console.WriteLine( toCheck );

   return;

  }

 }

 

 Console.WriteLine("No primes found");

}

 

 public static bool isPrime( Int64 numberToCheck )

{

 Int64 limit = (Int64)Math.Ceiling( Math.Sqrt( numberToCheck ) );

 

 

 for( Int64 i = 2; i <= limit; i++ )

 {

  Int64 rem;

  Math.DivRem( numberToCheck, i, out rem );

  

  if( rem == 0 )

  {

   return false;

  }

 }

 return true;

}

}

Basically, you specify a search space of numbers and the length of the prime you are looking for and it will return the first prime of that size in the search space.

Now that was fun! Furthermore, i did a quick port of that code to Android with a simple ui. In the end, i have to say that MonoDevelop was far nicer to work with than Eclipse has ever been, and i don't feel like my pc is struggling to allocate free memory for the IDE.

As for the Android app, it will eventually make its way to the Android market as soon as i get around to paying the $25 ( Maybe when the HTC magic arrives here in the Netherlands? ).

2009-03-03

Comux 001010

Slashdot Slashdot It!

2009-03-02

Music Tax and the Plight of Freedom

Recently there has been much talk about a proposed music tax. Seems that a certain organisation wants to implement a mandatory download taxation on internet bills, allowing for unlimited music downloads. While some people may welcome this, justifying it with their greed for music downloads, a question of freedom arises. Discussing it recently with my wife got her somewhat angry, and she wrote this story, which i feel raises many valid points about the concept of any entertainment tax. So here goes:

I was talking about the new, up-and-coming, hyped about tax thingy with my better half the other night. I'm pretty much against this Golden Lifeline idea and I thought of this nice analogy for the tax.

Let's say there is an imaginary store called RuzgIxtA. And they sell lots and lots of types of chocolate. And almost everyone loves these chocolates. These people love it, they must have it, everyone has heard of it in all corners of the world. Obviously they have not tried or bought each and every type of RuzgIxtA chocolate but what can you say, some chocolates are really in demand.

Now let's say that I am a fan of some chocolate varieties of this brand name. I don't buy that much and not a huge load in a short period of time. After all, I do like other chocolate makers' brands. And I've been a tad too busy to go chocolate browsing of late. But I agree, they are nice and buying one once in a while is a delight.

Ok, but the good folk at RuzgIxtA have been plagued with problems. See, some dodgy nasty shoplifters have been stealing their chocolates. It didn't matter that the company hired new security or new CCTV. Things just got nicked. As the measures got tougher, these thieves got more creative. Sometimes they wold target the chocolate transfer routes. Sometimes they got a friend of a friend who bought a chocolate to actually make the chocolate from scratch and gave it away for free.

Ahh the employees and workers were hard hit. The Christmas trees looked a bit more measly at the end of the year; they had to introduce low quality milk for some chocolates; the wrapping looked a bit tackier. It took money to make these chocolates and stealing created huge losses.

I suppose there was a number of things they could have done. They could have dealt with it in a number of ways. But let's say, in the face of overwhelming theft, RuzgIxtA came up with the idea of a tax. Somewhere, somehow someone came up with this idea of charging a tax. See, their argument seemed to be "The RuzgIxtA chocolates are so so popular that someone somewhere is almost always buying a RuzgIxtA chocolate. Someone at regular intervals in his/her life will buy a RuzgIxtA chocolate. So why don't we simply implement a tax? Everyone will pay this tax. We get our money's worth and all taxpayers can come in and take all the chocolate they want from our stores. After all, you paid for it now."

Must have sounded nice to a lot of people. Unlimited RuzgIxtA chocolate for a minimal amount? It's a dream come true. Think about it, this is the best way to deal with theft, they said eagerly whilst gripping the latest RuzgIxtA chocolate in their hands.

Meanwhile I was reading this lastest development (in this imaginary scenario) and thinking "Oi, hold on!". What if I only buy RuzgIxtA chocolate every other month? Or on a special occasion? I don't wanna pay continuously for something I may or may not use that month. That's why I didn't opt for the super-duper delux cable option, for meatball's sake.

Plus, as a a fan of other chocolate brands I was a bit miffed. It's a tad arrogant to think everyone must be using this brand. Somewhere sometime in their lives. Is there abolutely no way someone might not ever eat their brand? Quite presumptuous isn't it? Meanwhile, other companies in the chocolate making industry are thinking "Why can't our business get a 'secure for life' card?" That's not my worry. I wonder if any business is entitled to a 'Make money no matter what we do' option.

As it is I was against a few varieties of RuzgIxtA chocolate. Some people liked it, it was a free country so I was not going to say don't make that brand. It was just something I did not like. Ugh as means of an example, I thought about RuzgIxtA, the 90s remix. It was a mixture of nuts and raisins made to imitate RuzgIxtA the early 60s Slicky chocolate ... without the tasty flavor or psychedelic cover art. It had liquorice and anchovies as was the taste of the younger crowd. Not to mention the artwork of the woman in a suggestive pose. I liked the 60s Slicky and was quite upset with these recent changes. But I figured, hey if I don't like it, I don't have to buy it. Others who like it can enjoy it. That's where you get to live and let live, right?

And another thing. The celestial uber 20s RuzgIxtA chocolate was a bit of a dodgy one. At least in my opinion. The recipe maker for that one had said a few things in news recently that offended my personal beliefs. About zappers and fish tentacle omens and what not. I didn't agree with that. And I didn't like the fact that he wanted to ban the use of non-stick pans from cooking classes. Just use the lifter as the fish-deity intended, he said on telly. And kid should learn early on, why lifters + tons of butter is so much better than a lifter, was what he said. Bollocks! And did you know, the brand of chocolate he made for RuzgIxtA also had these annoying sayings about lifter uses and belief in fish-deities on the wrapper. I was not going to buy that! Heck, I was not going to buy that for younger folk in family. No way I was gonna give money to something that went against my beliefs. As it is, this fella was known to contribute tons of money he made to the Annual Lifter Champion Races.

By the bye, lately RuzgIxtA chocolate makers have been in the news for the wrong reasons. In one or two cases they have stuck their tongue out at customers, showed them the finger or just told them to bugger off. This was all at big public events. It was quite upsetting. Things settled down a bit when the little old ladies and their etiquette society staged a protest outside the shop threatening a boycott. The nasty lads were told off after which they announced a public apology and took a number of pictures whilst shaking the hands of the previously affronted customers. Admittedly, one of the reasons the chocolate makers were so dreadfully sorry was the threat to boycott their goodies.

So, if I was paying this stupid tax my money was going to a) fund more tardy remakes of the RuzgIxtA classic chocolates,  and b) also double as annoying lifter man's salary and leisure activities? And let's not forget, no matter how these chocolate makers acted or how atrocious their products became,  they could kiss bye-bye to customer care and satisfaction since they get this nice little tax income from each and every fan and non-fan.

And where did that leave my freedom to choose? Can I just promise to never buy RuzgIxtA chocolate and be exempt from the tax? So that I can opt to buy other chocolates based on how well I like them?

Hey if I pay a tax, I should have a say in what kind of chocolates can or cannot be made. Surely? You know what they say ... no taxation without representation, or something to that effect.