Wow, looks like Apple has finally beat out Microsoft:
http://money.cnn.com/2010/05/26/technology/apple_microsoft/
This ad parody really sums it all up. It was Microsoft's vision of the future several years ago, with an updated voice-over.
:)
Wednesday, May 26, 2010
Sunday, May 23, 2010
Free Screenplay / Media Production software
I ran across a free software package for writing screen plays called Celtx.
Website: http://www.celtx.com/
It's got a surprising number of features and works under Windows/Mac/Linux. It includes support for a variety of projects: Film, Audio-Visual, Theatre, Audio Play, Storyboard, Comic Book.
Here's the screenplay editor. Scripts can be published in a number of formats:

Story board editor:

For scheduling shoots for each scene:
Saturday, May 15, 2010
Ubuntu 10.04 released!
I just upgraded to the new version. As with the last release, the operating system is integrated with the net, with a repository of 30,000 free software packages (one click install), and 2GB of free cloud storage.

Also, I like the integrated music store in the RhythmBox media player, where people can either purchase music, or artists can submit music. There's two music hosting services for artists: Jamendo (where music is essentially submitted as free/public domain), and Magnatune (with traditional music rights going to the artist).

Also, I'm happy with WINE (windows emulator) where I can run my older Windows applications, like Macromedia Flash 5. It's still a little hit-and-miss on the most recent Windows applications (where the emulator hasn't caught up) but I've found it runs older Windows programs better than Windows. I popped in an old Windows 95 game the other day, and it ran flawlessly.
Sunday, March 21, 2010
Curvilinear Perspective
A while back I noticed a problem with linear perspective. In linear perspective, a road vanishes to a single point on the horizon:
However, this would be the case in both directions the person is looking. That would mean that if a person looked straight down, and linear perspective really described how objects appear to shrink, the observer ought to see something like this:
However, of course, what the observer sees are two parallel lines:
This means the that the lines are actually curved, since they join at both ends. But what is this curve?
First we must consider why would an object look smaller when it's further away? The apparent size is determined by the angle that's subtended with the eyes. Moving a object further away creates a smaller apparent angle.
Applying a little basic trigonometry, the tangent of the apparent angle formed between the road and eye would be:
tan(size/2) = width / (distance * sec (a)) = cos(a) * width / distance
So:
size = 2 * arctan[ cos(a) * width / distance ]
Where "a" is the viewing angle, and "size" is the size it appears to be. This means the curve of the road might look something like:

Which explains why linear perspective is a great approximation for perspective, even though it isn't always usable. About 1/3 on each end is approximately a straight line, and the middle 1/3 is curved slightly.
However, this would be the case in both directions the person is looking. That would mean that if a person looked straight down, and linear perspective really described how objects appear to shrink, the observer ought to see something like this:
However, of course, what the observer sees are two parallel lines:
This means the that the lines are actually curved, since they join at both ends. But what is this curve?First we must consider why would an object look smaller when it's further away? The apparent size is determined by the angle that's subtended with the eyes. Moving a object further away creates a smaller apparent angle.
Applying a little basic trigonometry, the tangent of the apparent angle formed between the road and eye would be:tan(size/2) = width / (distance * sec (a)) = cos(a) * width / distance
So:
size = 2 * arctan[ cos(a) * width / distance ]
Where "a" is the viewing angle, and "size" is the size it appears to be. This means the curve of the road might look something like:

Which explains why linear perspective is a great approximation for perspective, even though it isn't always usable. About 1/3 on each end is approximately a straight line, and the middle 1/3 is curved slightly.
Saturday, January 2, 2010
A great website
I mistyped hulu.com the other day (as huku.com) and ended up here:
http://zombo.com/
I noticed there's a subdomain at http://anything.zombo.com, where I noticed this comment:
http://obmoz.com/
http://zombo.com/
I noticed there's a subdomain at http://anything.zombo.com, where I noticed this comment:
Obmozcom is much better than zombocomSure enough ..
Obmozcom has 40% more flashing dots than zombocom
you can actually SEE the colours at Obmozcom
Obmozcom welcomes you with all its heart and soul and open arms. you wont find a welcome like THAT at zombocom!
http://obmoz.com/
Wednesday, December 30, 2009
Creating udev rules on Linux
I spent some time figuring out how to customize behaviour when hot pluging devices on linux, so I might as well post my notes in case I forget. :)
You can use udev to trigger events, to write custom linux scripts for hot plugged device.
Here's one of the more clever ideas with custom hotplug scripts using a standard usb stick as a key to unlock the computer. This will secure a workstation to only the person with the key:
http://raftaman.net/?p=300
Here's a simple example of writing a custom image processor for a camera (most cameras are already supported, but this is an example from the ground up).
Basically what is needed is:
a. figuring out the name of the device on the system
b. figuring out the full signature of the device
c. writing a rule to match the signature
d. writing a program that will be triggered
First you have to figure out the name of the device on the system. When the device is unplugged, take a snapshot of all the device on the system. IMO an easy way is to look at the /sys/ directory. It will contain nodes for all hotplugged devices. First take a snapshot when the device is unplugged.
find /sys > /tmp/dev_out.txt
Then plug in the device, and take another snapshot:
find /sys > /tmp/dev_in.txt
Now you can compare the differences in the two snapshots. Note that one physical device can actually be several devices (for example if it has multiple partitions). You will want a short name.
diff /tmp/dev_out.txt /tmp/dev_in.txt
An alternate way to find the name of device nodes, run this, and plug in device.
udevadm monitor
The name might look like /sys/path/to/device. Then get complete signature of the device:
udevadm info -a -p /sys/path/to/device
Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices... The complete signature of the device looks like a bunch of gibberish, but it's just key/value pairs:
looking at device '/devices/pci0000:00/0000:00:1f.4/usb2/2-2/2-2:1.0/host13/target13:0:0/13:0:0:0/block/sdc':
KERNEL=="sdc"
SUBSYSTEM=="block"
DRIVER==""
ATTR{range}=="16"
ATTR{ext_range}=="256"
ATTR{removable}=="1"
ATTR{ro}=="0"
ATTR{size}=="429569"
ATTR{capability}=="53"
ATTR{stat}==" 87 996 1083 1820 0 0 0 0 0 1016 1820"
looking at parent device '/devices/pci0000:00/0000:00:1f.4/usb2/2-2/2-2:1.0/host13/target13:0:0/13:0:0:0':
KERNELS=="13:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{device_blocked}=="0"
ATTRS{type}=="0"
ATTRS{scsi_level}=="0"
ATTRS{vendor}=="VTech "
ATTRS{model}=="Kidizoom "
ATTRS{rev}=="1.21"
ATTRS{state}=="running"
ATTRS{timeout}=="30"
ATTRS{iocounterbits}=="32"
ATTRS{iorequest_cnt}=="0x28a"
ATTRS{iodone_cnt}=="0x28a"
ATTRS{ioerr_cnt}=="0x8"
ATTRS{modalias}=="scsi:t-0x00"
ATTRS{evt_media_change}=="0"
ATTRS{queue_depth}=="1"
ATTRS{queue_type}=="none"
ATTRS{max_sectors}=="240"
looking at parent device '/devices/pci0000:00/0000:00:1f.4/usb2/2-2/2-2:1.0/host13/target13:0:0':
KERNELS=="target13:0:0"
SUBSYSTEMS=="scsi"
DRIVERS==""
...
These two lines should basically describe the device:
ATTRS{vendor}=="VTech "
ATTRS{model}=="Kidizoom "
Forming a rule is basically a matter of picking out a few lines from the complete signature and putting them all on one line seperated with commas. Files go under
/etc/udev/rules.d/
The name of the rule starts with a number (order executed) and ends with .rules
There can only be at most one parent in matching rules.
RUN will trigger a program to execute after device is mounted
ACTION can be "add" or "remove"
# EXAMPLE:
# FILE /etc/udev/rules.d/99-camera-copy.rules
# This will trigger /path/to/your/program
# when the device is plugged in
ACTION=="add", SUBSYSTEM=="block", ATTRS{vendor}=="VTech ", ATTRS{model}=="Kidizoom ", ATTRS{rev}=="1.21", RUN+="/path/to/your/program"
Also, udev will pause until the program called is finished. You can also run the program in the background to return immediately (recommended for longer processes). To detach bash script, enclose it in braces and end with &:
#!/bin/bash
{
echo "hello there" >> /tmp/udev_test.log
} &
All programs will be run as root user (full permissions). To lauch graphical programs as a regular user:
#!/bin/bash
{
# what program to run?
run=picasa
user=`who grep :0\) cut -f 1 -d ' '`
export DISPLAY=:0.0
su $user -c "xhost local:$user; $run"
} &
For more information, here's an older writeup (the tool "udevinfo" has changed to "udevadm info")
http://www.reactivated.net/writing_udev_rules.html
You can use udev to trigger events, to write custom linux scripts for hot plugged device.
Here's one of the more clever ideas with custom hotplug scripts using a standard usb stick as a key to unlock the computer. This will secure a workstation to only the person with the key:
http://raftaman.net/?p=300
Here's a simple example of writing a custom image processor for a camera (most cameras are already supported, but this is an example from the ground up).
Basically what is needed is:
a. figuring out the name of the device on the system
b. figuring out the full signature of the device
c. writing a rule to match the signature
d. writing a program that will be triggered
First you have to figure out the name of the device on the system. When the device is unplugged, take a snapshot of all the device on the system. IMO an easy way is to look at the /sys/ directory. It will contain nodes for all hotplugged devices. First take a snapshot when the device is unplugged.
find /sys > /tmp/dev_out.txt
Then plug in the device, and take another snapshot:
find /sys > /tmp/dev_in.txt
Now you can compare the differences in the two snapshots. Note that one physical device can actually be several devices (for example if it has multiple partitions). You will want a short name.
diff /tmp/dev_out.txt /tmp/dev_in.txt
An alternate way to find the name of device nodes, run this, and plug in device.
udevadm monitor
The name might look like /sys/path/to/device. Then get complete signature of the device:
udevadm info -a -p /sys/path/to/device
Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices... The complete signature of the device looks like a bunch of gibberish, but it's just key/value pairs:
looking at device '/devices/pci0000:00/0000:00:1f.4/usb2/2-2/2-2:1.0/host13/target13:0:0/13:0:0:0/block/sdc':
KERNEL=="sdc"
SUBSYSTEM=="block"
DRIVER==""
ATTR{range}=="16"
ATTR{ext_range}=="256"
ATTR{removable}=="1"
ATTR{ro}=="0"
ATTR{size}=="429569"
ATTR{capability}=="53"
ATTR{stat}==" 87 996 1083 1820 0 0 0 0 0 1016 1820"
looking at parent device '/devices/pci0000:00/0000:00:1f.4/usb2/2-2/2-2:1.0/host13/target13:0:0/13:0:0:0':
KERNELS=="13:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{device_blocked}=="0"
ATTRS{type}=="0"
ATTRS{scsi_level}=="0"
ATTRS{vendor}=="VTech "
ATTRS{model}=="Kidizoom "
ATTRS{rev}=="1.21"
ATTRS{state}=="running"
ATTRS{timeout}=="30"
ATTRS{iocounterbits}=="32"
ATTRS{iorequest_cnt}=="0x28a"
ATTRS{iodone_cnt}=="0x28a"
ATTRS{ioerr_cnt}=="0x8"
ATTRS{modalias}=="scsi:t-0x00"
ATTRS{evt_media_change}=="0"
ATTRS{queue_depth}=="1"
ATTRS{queue_type}=="none"
ATTRS{max_sectors}=="240"
looking at parent device '/devices/pci0000:00/0000:00:1f.4/usb2/2-2/2-2:1.0/host13/target13:0:0':
KERNELS=="target13:0:0"
SUBSYSTEMS=="scsi"
DRIVERS==""
...
These two lines should basically describe the device:
ATTRS{vendor}=="VTech "
ATTRS{model}=="Kidizoom "
Forming a rule is basically a matter of picking out a few lines from the complete signature and putting them all on one line seperated with commas. Files go under
/etc/udev/rules.d/
The name of the rule starts with a number (order executed) and ends with .rules
There can only be at most one parent in matching rules.
RUN will trigger a program to execute after device is mounted
ACTION can be "add" or "remove"
# EXAMPLE:
# FILE /etc/udev/rules.d/99-camera-copy.rules
# This will trigger /path/to/your/program
# when the device is plugged in
ACTION=="add", SUBSYSTEM=="block", ATTRS{vendor}=="VTech ", ATTRS{model}=="Kidizoom ", ATTRS{rev}=="1.21", RUN+="/path/to/your/program"
Also, udev will pause until the program called is finished. You can also run the program in the background to return immediately (recommended for longer processes). To detach bash script, enclose it in braces and end with &:
#!/bin/bash
{
echo "hello there" >> /tmp/udev_test.log
} &
All programs will be run as root user (full permissions). To lauch graphical programs as a regular user:
#!/bin/bash
{
# what program to run?
run=picasa
user=`who grep :0\) cut -f 1 -d ' '`
export DISPLAY=:0.0
su $user -c "xhost local:$user; $run"
} &
For more information, here's an older writeup (the tool "udevinfo" has changed to "udevadm info")
http://www.reactivated.net/writing_udev_rules.html
Also, thank you Rcspam for an example of using the kidizoom on Ubuntu 10.04+:
http://rcspamsblogen.blogspot.com/2011/01/kidizoom-and-ubuntu-maverick.html
http://rcspamsblogen.blogspot.com/2011/01/kidizoom-and-ubuntu-maverick.html
(English)
Wednesday, December 16, 2009
Understanding "Imaginary" Numbers
In grade school, when I learned about negative numbers, I thought they made a lot of sense. Until I learned that multiplying two negatives make a positive number:
-1 * -1 = 1
I recall this seemed completely backwards, intuitively. And most the class agreed. But the teacher explained to everyone that they were wrong. However, the beauty of math is that it really is just a set of rules, and the rules can be anything as long as they are consistent.
This is just one definition of multiplication. We can imagine a different system of numbers, with a different system of multiplication rules. And as long as we can make the rules consistent, each system of numbers is just as valid.
One way to think about this is, we can think of two different concepts of "negative" numbers: "fully negative" numbers, and "partially negative" numbers. Multiplying two "partially negative" numbers will produce a "fully negative" number.
-1 * -1 = 1
I recall this seemed completely backwards, intuitively. And most the class agreed. But the teacher explained to everyone that they were wrong. However, the beauty of math is that it really is just a set of rules, and the rules can be anything as long as they are consistent.
This is just one definition of multiplication. We can imagine a different system of numbers, with a different system of multiplication rules. And as long as we can make the rules consistent, each system of numbers is just as valid.
One way to think about this is, we can think of two different concepts of "negative" numbers: "fully negative" numbers, and "partially negative" numbers. Multiplying two "partially negative" numbers will produce a "fully negative" number.
For example, somewhat like defining short '-' and long '--' negative symbols:
-1 * -1 = --1
IOW, multiplying two "partially negative" 1's will produce a "fully negative 1."
However, if we have two number systems, we of course can't have the same symbol mean two different things or it's hard to read. So we can define the more intuitive '-1' with a special symbol like 'i' (perhaps to stand for something like "intuitive -1").
Then we can connect the two number systems together like:
i * i = -1
Then we can treat 'i' like any other unit of measure. As in: 1i, 2i, 3i, ...
A 'complex number' makes use of both number systems, and can be visualized the same way as two-dimensional XY coordinate system. The difference is that each axis has a different number system attached to it. These can written as a sum:
x = a + bi
The term 'imaginary' is a horribly confusing term though, since these numbers are no more or less imaginary than ordinary negative numbers. If anything, they are based in more intuitive rules about negative numbers.
If anything, you can just think of i as "a more intuitive -1" which follows an alternative multiplication rule: two "intuitive" negative numbers multiplied together equal a "regular" negative number. This is entirely consistent with the standard rule: two "regular" negatives multiplied together equal a "regular" positive number.
-1 * -1 = --1
IOW, multiplying two "partially negative" 1's will produce a "fully negative 1."
However, if we have two number systems, we of course can't have the same symbol mean two different things or it's hard to read. So we can define the more intuitive '-1' with a special symbol like 'i' (perhaps to stand for something like "intuitive -1").
Then we can connect the two number systems together like:
i * i = -1
Then we can treat 'i' like any other unit of measure. As in: 1i, 2i, 3i, ...
A 'complex number' makes use of both number systems, and can be visualized the same way as two-dimensional XY coordinate system. The difference is that each axis has a different number system attached to it. These can written as a sum:
x = a + bi
The term 'imaginary' is a horribly confusing term though, since these numbers are no more or less imaginary than ordinary negative numbers. If anything, they are based in more intuitive rules about negative numbers.
If anything, you can just think of i as "a more intuitive -1" which follows an alternative multiplication rule: two "intuitive" negative numbers multiplied together equal a "regular" negative number. This is entirely consistent with the standard rule: two "regular" negatives multiplied together equal a "regular" positive number.
Subscribe to:
Comments (Atom)