Thursday, May 5, 2011

How to move big buildings

As we all know, walking is wearing out your muscles, soles and motivation. Wouldn't it be much nicer if it would just take a moment's thought to move your target closer? Look at the mile long walk to the building in the background on the picture to the left. The silvery car in the front is just a couple of steps away, but then the strenuous part beckons.

The magic unveils itself when you hire someone with big tools that can move buildings in a heartbeat. Actually, it looks like he pushed all and everything behind the silver car closer up - nice!

Of course, that's cheating! In two respects, actually:

1. I had to walk quite a bit away from the scene to take the second picture.

2. The focal length of the lens went from wide (17mm = 27.2mm/35mm equivalent) to long (should call it "narrow", 200mm = 320mm/35mm equivalent).

So, combining a short walk with an increase in focal length had this "compression" effect. As opposed to some statements about this phenomenon, it's not the focal length that is responsible for it. The picture on the left was also shot with 17mm focal length, only from the same spot where the second picture was taken: Behold, the same "compression" effect!

The reason: it was cropped out of the one on the right (hence the little blurriness and the weird white balance).

So, what's responsible for the compression effect? Angle! Our friends W (the one with the wide-angle lens) and T (with the telephoto lens) are taking a picture of a tree so that it appears the same size in both sensors (layer A).

The house in the background (layer B) fills about a third of the frame for W but still almost the full frame for T. No wonder it looks closer. Since cropping has the same effect of reducing the angle, pictures 2 and 3 show the same compression effect.

I assume that the confusion about perspective compression stems from the fact that the idea of a wide-angle lens is to get close to the subject, so the wide angle effect hits. Per se, the focal length has nothing to do with it (at least ideally).

Wednesday, May 4, 2011

Memorizing Modes

Right! After months of lazying around without playing, grab the bass and go back to getting the modes back engraved in the brain.

Takes a couple of hours and then the fingers get them back in. Here's my way of memorizing them (as long as my fingers don't recall them automatically).

Generally they come in two "basic shapes" (here for the bottom three strings):

|---|-*-|-y-|-y-|-*-|---| Major
|---|-*-|-x-|-x-|-*-|---|
|---|---|-*-|---|-*-|---|

|---|---|-*-|---|-*-|---| Minor
|---|---|-*-|-y-|-y-|-*-|
|---|---|-*-|-x-|-x-|-*-|

For x and y we can have the lower position (1) or the higher position (2). So, for example,

Mode I (Ionian) is "Major 1,2" (or systematically 4, 7)

|---|-*-|---|-*-|-*-|---|
|---|-*-|-*-|---|-*-|---|
|---|---|-*-|---|-*-|---|

Mode ii (Dorian) is the only one that doesn't work that way (because it's the only minor scale with an undiminished 6th). We'll look at it in a moment.

Mode iii (Phrygian) is "Minor 1,2" (systematically b2, 5)

|---|---|-*-|---|-*-|---|
|---|---|-*-|---|-*-|-*-|
|---|---|-*-|-*-|---|-*-|

Mode IV (Lydian) is "Major 2,2" (systematically #4, 7)
Mode V (Mixolydian) is "Major 1,1" (systematically 4, b7)
Mode vi (Aeolian) is "Minor 2,2" (systematically 2, 5)
Mode vii (Locrian) is "Minor 1,1" (systematically b2, b5)

So, apart from Dorian it all works nicely (as long as you remember the Major/Minor alternations, but that's more or less trivial - I use uppercase roman for Major and lowercase roman for Minor. And, no!, that doesn't refer to CS majors or minors.)

1,2
??
1,2
2,2
1,1
2,2
1,1

Dorian is obviously Minor 2,2 but it has this pesky 6th that maybe Jaco Pastorius could have reached on the second string (well, at least starting at F#) - I can't. In any case, I memorize it as "Minor 2,2,+1" and use the third string for the 6th:

|---|-*-|-*-|---|-*-|---|
|---|---|-*-|---|-*-|---|
|---|---|-*-|---|-*-|-*-|

So it all comes out to
1,2
2,2,+1
1,2
2,2
1,1
2,2
1,1

The pattern is easy, except for Dorian, which I treat as a special case anyway. So, it boils down to 1,2 - 1,2 - 2,2 - 1,1 - 2,2 - 1,1. Not too difficult.

With some special training in pattern recognition, the inquisitive mind now immediately stumbles on the questions: What then is "Major 2,1" and "Minor 2,1"? Easy:

Major 2,1: 1 2 3 #4 5 6 b7 8
Minor 2,1: 1 2 b3 4 b5 b6 b7 8

Well, they're obviously not modes; Minor 2,1 to me is Locrian with an undiminished 2nd - scaled back to Ionian that's a #1 and that's an Avoid Note in my book. I'm not so sure about that with respect to Major 2,1. Without any experience, I guess the 2 could work as a Passing Note on V (Mixo) - I might have to try that...

Monday, May 2, 2011

Setting up Cassandra under Ubuntu and VMWare

Nope! Not the Greek mythical figure; Apache Cassandra, the "Distributed Database". Let's see how that works...

The issue is that I'm not sure if this beast runs together with OpenJDK, the web seems to be positive about the issue, but you never know (seems to become this year's catch phrase).

As fas as I know, two disks are better than one. So, create another virtual disk under VMWare for this VM and check if it works:

sudo fdisk -l
Yep! Shows up with "Disk /dev/sdb doesn't contain a valid partition table" - we should be able to change that...

sudo fdisk /dev/sdb - then "n" (new), "p" (primary), "1" and accept all settings, exit with "w"

Check back with "sudo fdisk -l" - it's dev/sdb1 now. All as planned!

Create an ext3 file system with "sudo mkfs.ext3 /dev/sdb1" (check!)

Give it a nice name: sudo e2label /dev/sdb1 hd2

Thank you... next!

Downloaded the latest version of Cassandra from the website - I think there's also a way to use apt for that, but I'd really like to make sure I got the latest version (0.7.5).

Unpack the archive into my home folder - I'm not in the mood to deal with permissions at this stage; it's going to be difficult enough. So, here's what we have:

/bin
/conf
/interface
/javadoc
/lib

and a couple of well-know readme, license etc. files.

Check the readme: Tells you how to unpack the file (little late for that, but thanks anyway) and how to set up the logs. Let's do that!

sudo mkdir -p /var/log/cassandra
sudo chown -R `whoami` /var/log/cassandra
sudo mkdir -p /var/lib/cassandra
sudo chown -R `whoami` /var/lib/cassandra

Next dreaded issue: ports. The Cassandra Wiki is clear about that:
By default, Cassandra uses 7000 for cluster communication, 9160 for clients (Thrift), and 8080 for JMX. These are all editable in the configuration file or bin/cassandra.in.sh (for JVM options). All ports are TCP.

8080, of course! As if there's no other choice of ports; everybody and his brother listens on 8080. Just joking - I know that makes sense!

Change that in conf/cassandra-env.sh under the Cassandra install directory:

JMX_PORT="8080" changed to JMX_PORT="10036"

Now - last for this session - check if it responds to the CLI:

~/apache-cassandra-0.7.5/bin/cassandra-cli

Yep! Something happens...

[default@unknown] connect localhost/9160;

Did I mention I very much dislike a prompt like "default@unknown"?

Connected to: "Test Cluster" on localhost/9160

Enough success for one night... More later!

Friday, April 29, 2011

Finally back

Semester's almost over - grading almost done. Now for some fun: brand new toys!

  • 24 inch monitor
  • Ubuntu Natty Narwhal (11.04) under VMWare Player
  • OpenJDK
  • Libre Office
  • NetBeans 7.0
  • GlassFish 3.1

Life can be good! Now: setting up NetBeans under Natty. First attempt to run it all under Open JDK - it should work; let's see.

  • Install Open JDK: sudo apt-get install open-jdk-6-jkd (check!)
  • Run NetBeans 7 installer: sh netbeans-7.0-ml-linux.sh (don't sudo! - check!)
  • Add Tomcat - you never know!
  • Make a note about the locations: all under mu home directory (you never know!)
  • Open NetBeans, program "Hello, world!" (check!)
  • Set up the GlassFish server: ~/glassfish-3.1 does it
  • Start it, start admin console - it's running on 4848 (check!)
  • Will do Tomcat later - enough to play with GlassFish for the moment.

Thursday, July 30, 2009

Tuesday, July 28, 2009

Running Perl on IIS 7 : Wade Hilmo : The Official Microsoft IIS Site

Running Perl on IIS 7 : Wade Hilmo : The Official Microsoft IIS Site

After hours getting ActivePerl to run on my 64-bit Vista IIS7, finally that's the thing that did it.

Important: download the 32 bit version!

Wednesday, July 15, 2009

100 in 100: The Rule of Thirds from Adorama Learning Center

100 in 100: The Rule of Thirds from Adorama Learning Center


Reminds me of something I learned some time ago - well, during an exhibition and some pro seminars, actually.

Sometimes the RoT really doesn't work too well, like in this image which used some Photoshop to create this slightly strange appearance of a street portrait. I somehow liked the proportions and the idea - the man with his back to the main scene showing a detached attitude, so that's all very much ok. Problem: No "power point" on any thirds!


What the speakers at the seminar did was obvious once someone tells you: You place the image into a mat via Photoshop (or Gimp, works just as well) in a way that now a power point of the whole print is on a third. Of course, that means the image is matted asymmetrically, but that gives it another unusual "twang".

Finally, here's the result without the aux lines - it's set for a 3x2 ratio, changing that would of course mean to reposition the main image, but that shouldn't be too difficult.