Fruitbox

Aug 31, 2009

ClipSpeak 1.5 released!

I just finished uploading ClipSpeak 1.5 to various places. Check it out on CodePlex!
The new Save to MP3 dialog

Aug 30, 2009

The minimum number of keys

A few days back, this crossed my thought: We interact with our computers through a keyboard that has quite a number of keys. We can do the same things, albeit not as comfortably, on our mobile phones, which traditionally only has about 1/10th the number of keys as a full computer keyboard. If we take this to the extreme; How many keys are needed to control a computer, the way they work today?
This is a nice case to apply the principle of reduction and emulation to. If we have a device which can emulate a computer keyboard, it can control the computer, since the regular computer keyboard can.
Step 1: Consider a device with only arrow keys and an enter key. To control a computer with this device we would only need to have an on-screen keyboard program, where we navigate to the key we want to press and hit enter.
Step 2: Now we don’t really need that many arrow keys. One is really enough: the “forward” key. Think of a keyboard represented linearly, and when we move to the end we get back to the beginning. Although neither convenient nor practical, we can now control the computer with two keys.
Step 3: Why have two keys when we only need one? After all, two keys to remember is even TWICE as many as having only one key. Let the software program switch selected key every second, and you press the enter key when the key you want is highlighted. Or alternatively, make a double-click equivalent function, but then this could be treated as having two keys.
Conclusion: We only need one key, which I think should referred to as “the any key”.

Did you know: There is a well kept secret in the history of computing: The first keyboards only had one key (bet you didn’t know that, eh?) After all, keep it simple is nice, isn’t it? Why design a complicated piece of hardware when you can have a big, easy-to-hit, RSI monster like the one-key keyboard. If you wanted to, you could even make it really small. You didn’t even have to learn touch typing or anything like that! But no, it wasn’t until someone invented the cracks between keys that things got more complicated.
Remark: This blog post is copyright(c) 1956-2009, written on a one-key keyboard.

Jun 29, 2009

Playing my Keyboard from the Internet

Filed under: Technology, English

Yesterday I started a small project to create a C# application that would let me play my MIDI keyboard from another computer over the internet. This application now works, and I call it MIDINet.
MIDINet has a client-server-architecture. The server listens for incoming UDP-packets, parses those and translates them into MIDI messages, which are sent directly to my Roland E-86. The client is set up to send packets to my server when the user presses certain keys on the computer keyboard.
Usefulness: questionable. Funness-factor: High!

Jun 28, 2009

Quick App Tip: Paint.NET

Filed under: Technology, English

Are you using MS Paint? In that case you might want to have a look at Paint.NET, which is like the new paint. It is free, runs on the .NET Framework, and has a lot of features that MS Paint lacks: layers and effects for instance. A very good thing about Paint.NET is that it is very easy to extend its functionality by plug-ins that are very easy to install and use (just put a .dll-file in a folder and you’re done). There are a lot of great plut-ins out there: effects, language packs and what not.
Check it out at www.getpaint.net.

Jun 27, 2009

LHC: Countdown revisited

Filed under: Misc, English

The Large Hedron Collider, LHC, the giant particle accelerator in Switzerland, will apparently be operational some time in October this year. If I recall correctly we were waiting last year too, but the accelerator broke down, and the costs associated with bringing it up in the winter was decided to be too high.

Better luck this time!

Jun 24, 2009

ClipSpeak 1.5 coming soon!

ClipSpeak 1.5 will hopefully be out pretty soon. Some things to look forward to are:
* Save to MP3 — Put your texts on your MP3-player
* Lots of bug fixes — including a couple of bugs related to Adobe Reader and Firefox
* Change voice speed and volume — These settings can be changed in the voice selection dialog
* Toggle ClipSpeak on/off — via a keyboard command.

May 10, 2009

A FriendFeed!?

Filed under: Misc, English

As can be seen on my main homepage (a.k.a. my links page), at danielshome.webs.com, I have now set up a FriendFeed (here) aggregating my twitter, blogs and YouTube profile. Nice!

Starting article series on Swedish typography and LaTeX

As the title says, I am going to write about customising LaTeX to work with Swedish typographical rules and conventions. The articles will be in Swedish and will be on my Swedish blog, Fruitbox 2.

Apr 22, 2009

Bogosort

Today I am going to present one of the worst sorting algorithms, along with a C# implementation. The algorithm is called bogosort, also known by other names such as monkey sort, random sort or shotgun sort. This algorithm is very simple, and it works as follows:

1. Given a random array, check if it is sorted.
2. If it is not sorted, shuffle it randomly.

As you can imagine, this algorith is not very fast, but it CAN be very effective, and for an array just consisting of two elements, it is actually very nice. Despite this, don’t use it for practical purposes!
For a very detailed analysis of this algorithm, see the paper by H. Gruber, M. Holzer and O. Ruepp titled “Sorting the Slow Way: An Analysis of Perversely Awful Randomized Sorting Algorithms“.
Following is a C# implementation, which generates a random array, runs bogosort and then prints some nice statistics:

using System;
namespace Bogosort
{
class Program
{
private static System.Random rnd = new System.Random();
private static int compctr = 0;
static void Main(string[] args)
{
int[] array = GenRandomArray(6);
Console.WriteLine("Sorting a list of " + array.Length + " random numbers between 0 and " + 10 * array.Length + ".");
Console.Write("Original array: ");
PrintArray(array);
int i = 0;
System.DateTime startTime = System.DateTime.Now;
while (!Sorted(array))
{
array = Shuffle(array);
Console.Write("Shuffle " + i + ": ");
PrintArray(array);
i++;
}
System.DateTime stopTime = System.DateTime.Now;
Console.Write("The sorted array is: ");
PrintArray(array);
Console.WriteLine("This required " + i + " shufflings and took " + (stopTime-startTime).Milliseconds + " milliseconds.");
Console.WriteLine("The total number of comparisons made was " + compctr + ", which is " + (double)compctr / (double)i + " comparisons on average.");
Console.WriteLine("The total number of swaps made was " + array.Length * i + ".");
}
private static int Factorial(int x)
{
if (x < 2) return 1;
return x * Factorial(x - 1);
}
private static void PrintArray(int[] array)
{
string s = "";
for (int i =0; i {
s += array[i] + ", ";
}
Console.WriteLine(s + array[array.Length - 1]);
}
private static int[] GenRandomArray(int length)
{
int[] array = new int[length];
for (int i = 0; i < length; i++)
{
array[i] = rnd.Next(10*length);
}
return array;
}
private static bool Sorted(int[] array)
{
for (int i = 1; i < array.Length; i++)
{
compctr++;
if (array[i] < array[i - 1]) return false;
}
return true;
}
private static int[] Shuffle(int[] array)
{
for (int i = 0; i < array.Length; i++)
{
int pos = rnd.Next(array.Length);
int temp = array[pos];
array[pos] = array[i];
array[i] = temp;
}
return array;
}
}
}

For a far better reading experience see the Algorithm wiki page on bogosort.

Apr 17, 2009

The Pirate Bay Trial

Filed under: Misc, Technology, English

So the pirate bay trial, #spectrial, is now over. One year in prison and a fine of 30 million Swedish crowns, that’s the sentence. This outcome clearly shows the inadequacy of the justice system when laws are unable to keep pace with technological development. Sadly, I am not surprised. Now who will be the first to sue Google for aiding in copyright infringement?

Mar 28, 2009

Earth Hour 2009

Filed under: Misc, English

The Earth Hour 2009 event has just started here in Sweden. I am sitting here watching tweets go by in #earthhour and trying to keep track of the event.

Nov 12, 2008

A New Video

Filed under: Music, English

A Final Fantasy piano medley of about five minutes!

Oct 24, 2008

Planned: ClipSpeak 1.5

Filed under: Technology, English

The next version of ClipSpeak, namely ClipSpeak 1.5, will feature two quite important improvements. One of them is SAPI4 support, which will allow you to select the voices you might not be able to right now with 1.0. The other feature is the Save to MP3 function, which I think will be a very neat feature to have.
As usual, if you have suggestions, head over to the CodePlex page!

Aug 6, 2008

It is out: ClipSpeak 1.0

Filed under: Technology, English

It’s out, in a lot of places! Google it.
Voice selection is in, but ’save to mp3′ is still missing. Hopefully it’ll be there in the next release.

Jul 10, 2008

ClipSpeak 0.95 Released!

Filed under: Technology, English

It’s out! Where? Head over to CodePlex!
http://www.codeplex.com/clipspeak






















Fruitbox One Million Blogs . org Blog Directory & Search engine
Chat with me by Live Messenger:

Daniel Innala Ahlmark

Get free blog up and running in minutes with Blogsome
Theme designed by Riosoft