Archive

Archive for September, 2009

Grooveshark: Easy, legal music sharing

September 30th, 2009 1 comment

I’ve become a big fan of Grooveshark for discovering new music. It is a great way to legally find and share music. Interestingly, you can upload your own files into Grooveshark to make them available to everyone, and a portion of the revenues go back to the artist in royalties — however that works.

Each file, or playlist you create can be converted into an embeddable widget for your blog. For example, give the Glitch Mob a listen. :


Categories: Music, Uncategorized Tags:

Zoomify: Upload and View Huge Images in Wordpress.

September 25th, 2009 3 comments

The first idea that came to mind for Zoomify was encouraging Real Estate agents to use Zoomify in creating Virtual tours of thier properties for sale. If you have great images of a property with lots of detail, use Zoomify to really draw your visitors into the property.


Navigate through this image just like you would a Google Map

Using Zoomify, you can upload and view extra large images, and see all the detail using a Google Maps-like pan and zoom navigation.

So, how does this work? It’s pretty easy, once you get past the initial configuration….Steps 1,2,3 below only have to be done the first time, of course.

  1. Go and download Zoomify Express, a small client you download that will chop up your image into something that is pan-and-zoom able. This gets installed (unzipped actually) on your PC.
  2. Zoomify your image by dragging it onto the Zoomify Converter.exe You can get detailed directions on the Zoomify site.
  3. Install the YD-Zoomify plugin by Yann Dubois. If you don’t know how to install plugins on Wordpress, read Installing plugins on the Wordpress site. (if you install from the Wordpress auto-installer, you’ll want to replace the zoomifyViewer.swf file that comes with that version to the new version that came with your zoomify software install. FTP is your friend here. )
  4. Upload your Zoomified image folder to Wordpress. Zoomify creates a folder named the same as your image, which contains an xml file, and one or more subfolders with a ton of images. I used FTP to upload these files to [wordpressInstallDirectory]/wp-content/uploads/[imagefoldername] — substitute the items in brackets with values from your own system.
  5. Place the Zoomify command in your post. You’ll need to enter a code into your post where you want the Zoomified image to appear. You do this as follows:
    • Enter <!-- YDZOOM( 'fullURLToTheUploadedFolderOfImages', widthInPixels, heightInPixels, 'uniqeNameForThisZoomify') --> where:
    • fullURLToTheUploadedFolderOfImages, which goes in single quotes, is the full URL, including http:// to the location of this folder. something line ‘http://www.example.com/wp-content/uploads/myiamge’
    • widthInPixels, not in quotes, is the width of the area where you want to place the Zoomified image.
    • heightInPixels, not in quotes, same as width, only height.
    • uniqueNameForThisZoomify, in quotes, is and arbitrary name for this Zoomified image, make sure it starts with a letter. Each Zoomify instance you add to your post needs its own name.

A word of caution because it bit me…. The domain name you use for referencing the folder must match exactly the domain in your browser (for example http://example.com) otherwise you’ll get an “error loading” message. So if your browser says “http://example.com” but your fullURL entry above says “http://www.example.com” you’ll get an error because they don’t match. Make them match, or go learn about crossdomain.xml files and Flash.

Good Luck Zoomifying your images.

Categories: Photo Sharing, Quick Tips, wordpress Tags:

Linux Noob: An introduction to shell scripting

September 25th, 2009 No comments

Using the command line in Linux can be one of the most daunting tasks to a regular Windows User. The Linux command line, or “Shell” is vastly more powerful that the command line you might be used to in windows. On Linux, you can create shell scripts (like a Windows Batch file, but on fists full of steroids).

If you want to learn more about
An Introduction to Shell Scripting

It’s a work in progress, but has a lot of great information for someone getting started.

Categories: linux, noob Tags:

Use Cygwin to count the lines in a text file on Windows.

September 24th, 2009 No comments

You can quickly count the lines in text file on a Linux (or other *nix based system) with this command

wc -l < filename

(Of course, you need to substitute the filename with your filename.

Need to do this on a WIndows system? Download cygwin and you can issue the same command from the cygwin command line.  The only trick to cygwin is to remember that your root directory (C:\ on most Windows systems) is /cygdrive/c. Then the directory structure is the same from there.

Categories: linux Tags: , ,

Vista: Editing your hosts file.

September 21st, 2009 No comments

Vista has odd permissions when editing files, especially if the file is in a location that Windows thinks is sensititve.

If you try to modify your hosts file in Vista, it will not let you save it. It tells you that you don’t have permission, probably telling you the file is read only, even if the read-only bit is not set. To successfully modify the hosts file, run notepad.exe as an administrator and open the file.

  • Browse to Start -> All Programs -> Accessories
  • Right click “Notepad” and select “Run as administrator”
  • Click “Continue” on the UAC prompt
  • Click File -> Open
  • Browse to “C:\Windows\System32\Drivers\etc”
  • Change the file filter drop down box from “Text Documents (*.txt)” to “All Files (*.*)” Select “hosts” and click “Open”
  • Make the needed changes and close Notepad. Save when prompted.

(Via)

Categories: Uncategorized Tags:

Create Histogram data in mySQL

September 15th, 2009 No comments

Here is the easiest way I know to create the data for a histogram chart.

Consider the following query.
"select count(price - (price mod 10)) as freq, price - (price mod 10) as label
from sales
where 1
group by price - (price mod 10)
order byprice - (price mod 10) ASC")

In this query, we are creating a histogram of items according to their list price. We will be able to see the distribution of products , in this case, in strata of 10. In this case the price of products would be distributed over prices between, say 0 and 2 or 3 hundred. You can set a MOD value that would create strata in reasonable segments for your data.

What we are doing here, is using the MOD function to round down the individual sales to increments set by the MOD value. MOD is a type of division that only returns the remainder.

For example if you have sales of
10
11
23
24
45
56

MOD 10 of each of those values would return:

0
1
3
4
5
6

We then subtract the remainder from the price, resulting in

10
10
20
20
40
50

Rather than just outputting that list, we count each of those values to get a distribution:


+---------------+
| freq | label |
+---------------+
| 2 | 10 |
| 2 | 20 |
| 1 | 40 |
| 1 | 50 |
+---------------+

Finally, since we use the COUNT() function, we need to group, and we put them in order by the label so that the segments are in order.

You can then feed those values to your favorite graphing engine, to make handsome charts of your resulting data.

Categories: charts and graphs, mysql Tags:

What was that command again? Linux History

September 14th, 2009 No comments

Here is a total noob hint.

You can see the last 500 or so commands you have entered in the command line on a Linux system with the following command:
history

Now, if you want to filter that list you can use grep. For example, if you want to see the files you have edited, you could:
history | grep nano
Assuming of course, that you use nano as your text editor.

Categories: linux, noob Tags:

The worlds shortest guide to cron

September 14th, 2009 No comments

You can see a guide to complete a cron entry here. It always seems a lot harder to find how to actually see and edit the schedule.

To see what you have in your cron schedule
crontab -l

To edit your cron schedule
crontab -e

Categories: linux Tags: