Saturday, January 30, 2010

GNU Plot and Octave

Octave is a MatLab-compatible interpreter, which uses Gnuplot to display graphics. I'll now show you how to capture the commands sent from Octave to Gnuplot. This is useful for learning how to drive Gnuplot, among other uses.

First, launch Octave, and then enter the following command:

octave> plot(sin(0:0.1:30),'LineWidth',3)

You can now regenerate this plot, but direct the plotting commands to a file:

octave> drawnow("svg", "drawing.svg", false, "drawing.gp")

In this case, we've chosen the SVG "terminal", so that a scalable-vector-graphics image is created in the current directory. The Gnuplot commands used to create this image can be found in the drawing.gp file.

Here's the drawing.svg image:

(blogger.com wouldn't actually let me upload an .svg, so I had to render it to a .png first, but you get the idea)

In another terminal window, you can feed the Gnuplot commands to Gnuplot, to recreate this image:

> gnuplot drawing.gp

If you don't want to create an image file, but instead want to view the image in a window, do this instead:

octave> drawnow("x11", "/dev/null", false, "drawing.gp")

Then launch Gnuplot, and enter this command:

gnuplot> load 'drawing.gp'

Whala!

Sunday, December 20, 2009

Ubuntu - "Open With"

Ever wonder how to easily specify which program ought to (by default) open a given file type? Wonder no more: Right click on a file of the type in question, then click "Properties" and select the "Open With" tab. There you will be able to either select a program by clicking on its check-box, or add a new program.

Happy Ubuntuing!

Thursday, December 10, 2009

Ubuntu Templates

Ever wonder why, when you right click on your desktop or in a folder, and select "Create Document", it tells you there are "No templates installed"?


Ubuntu expects you to have a ~/Templates folder (which should have been created when you installed Ubuntu). You may have deleted this at some point, and even if you hadn't, it probably didn't have anything in it. If you'd like to have some handy file templates, just create a ~/Templates folder. Then put some files in it. Whala! They should be available next time you use this right-click menu.

If you try it, and they don't show up, you'll need to edit this file:

~/.config/user-dirs.dirs

And make sure the following line exists:

XDG_TEMPLATES_DIR="$HOME/Templates"

It turns out that Ubuntu is smart enough to automatically edit this file for you, should you move (and maybe even rename) this folder. However, if you delete it, Ubuntu will set this line to use your home folder as the default location.

While you are editing this file, you might want to take a look at some of the other lines; you may find them useful.

Happy Ubuntuing!

Sunday, June 21, 2009

Google Earth 5.0 in Ubuntu 9.04 64-bit

There's a bit of a gochya when installing Google Earth in Ubuntu 9.04, 64-bit. If you read my previous blog post on this topic, that'll get you part way to installing it. However, it won't run properly, and will give you the following error message:

"google earth detected an error while trying to authenticate"

There is a missing dependancy, so all you have to do to get it to run is to do this:

> sudo apt-get install lib32nss-mdns

Happy Google Earth Surfing.

Saturday, June 6, 2009

Denver People's Fair - Land of Woo

The "woo" was out in force at the 2009 Denver (Capitol Hill) People's Fair this year.

COCORE - Colorado Coalition of Reason.
The only "anti-woo" we found at the fair.

Acupuncture. Its old, and the Chinese have used it. Therefore, its legit. QED

Allergies cured by "laser technology". I wonder if they remove them from the heads of the ill-tempered sea bass prior to use.

What ever it is, it cures everything.

Tarot. At least they make it clear its "magical thinking".

Tarot, and palm reading.

Oh good, finally, The Truth.

I'm glad there wasn't a monopoly on advanced palm-reading technology. Its good that consumers have a choice in how to get scammed.

Apparently, the chiropractors have been doing it wrong.

Chi-Chi Rodriguez would be proud.... or would file a law suit for patent infringement on his novel "magic bracelet" err "magnetic bracelet" technology.
(kind of hard to see)

Advanced Photoshop lessons.

Your spine is bent.

Magic cream cures all pain.

They'll read your brain, and your palm, at the same time. Its like a lube-job and a tire rotation, at the same garage. How convenient!

Got Energy?

Your spine is crooked.

Oh good, no one has a monopoly on magnetic technology, either.
God is now here. Uhuh. Be careful. These guys want you to think they are atheists. This seems like a clever trick, at first, until you talk to them, and realize they're idiots.

Looks like woo.

Smells like woo.

Must be woo. But its only $1, what's the harm?

Yay, Scientologists! In Denver! We're so honored!

Nope. And we're looking so hard.

Wait, these guys say they have the truth, but the other booth said they have the truth. Which truth is The Truth?

Saturday, April 25, 2009

Seed Starting

Its that time of year! Check out my simple, cheap and convenient method of seed starting:



And the final product:

Sunday, April 19, 2009

Horn Loaded Cellphone Speaker

Here are a couple of templates you can use to create you very own horn-loaded cellphone, handy for when you want to listen to MP3s over your speakerphone (not sure why you'd want to do that, but just in case):

Template 1

Template 2

They are in svg format, and I recommend viewing/printing them from within Inkscape. Firefox doesn't render the second one correctly.