calculate with spotlight

If you’re using a mac and os x you’ll probaly love spotlight search (use cmd+space to bring it on).
What you maybe did not recocognized is the fact spotlight can even calculate für you. A few examples:

calculate with spotlight 1

calculate with spotlight 1

Simply use the well known operators + (plus), (minus), * (multiplication) and / (division)

calculate with spotlight 2

calculate with spotlight 2

Furthermore you can calculate radicals by typing sqrt()

calculate with spotlight 3

calculate with spotlight 3

Your mac even knows pi.

cfc calling in browsers

If you ever asked yourself how to take a quick look inside a coldfusion cfc directly in a browser, check this out. If your cfc is in the webroot you can call it of course in a browser as usual:

http://www.domain.com/path/example.cfc

If you call a cfc this way the „cfc explorer“ appeares on stage and shows you auto-generated documentation of the cfc.
Additonally you can invoke a function directly in a browser:

http://www.domain.com/example.cfc?method=examplefunction

A request like this will actually invoke the method specified as url-parameter „method“.
Take care: the cffunction access-attribute must be specified as remote.

using exiftool for manipulating image-, audio- and video-file metadata (ubuntu)

What’s this post about?
exiftool is a perl module with additional commandline support for reading, writing, editing oder removing meta-informations in images, audio- or video-files.

Installation
you need the package „libimage-exiftool-perl“, easy to install using apt-get

[sourcecode language=“bash“]
sudo apt-get install libimage-exiftool-perl
[/sourcecode]

General Syntax
you can use exiftool with the following syntax:

[sourcecode language=“bash“]
exiftool [options] filename.ext
[/sourcecode]

print width and height
with the following command you can see the dimensions for all jpg-images in a directory

[sourcecode language=“bash“]
exiftool -p ‚$Filename $ImageSize‘ *.jpg
[/sourcecode]

deleting metainformations
with the following command you can remove metadata from every jpg-file in a directory. exiftool will make backup-files for you (filename.jpg_original) automatically.

[sourcecode language=“bash“]
exiftool -all= *.jpg
[/sourcecode]

extracting a thumbnail from the image
with the following command you can extract a thumbnail from a jpg-file:

[sourcecode language=“bash“]
exiftool -b -ThumbnailImage filename.ext > thumbnailname.jpg
[/sourcecode]

extracting a preview-image from the image
with the following command you can extract a preview-image from a jpg-file:

[sourcecode language=“bash“]
exiftool -b -PreviewImage filename.ext > thumbnailname.jpg
[/sourcecode]

changing the dpi-resolution
with the following command you can change the dpi-resolution jpg-files in a directory (lossless change):

[sourcecode language=“bash“]
exiftool -Xresolution=150 -Yresolution=150 -ResolutionUnit=inches *.jpg
[/sourcecode]

seo: domain redirecting with htaccess and apache mod_rewrite (domain with or without www)

Because of SEO regarding the duplicate content problem one of the basic rules is „don’t offer your same content on different urls“. Because of that reason it’s generally recommendable to use permantent redirects from http://example.com(/xyz…) to http://www.example.com(/xyz…)
This task is easy to implement, for example you could use a rewrite rule in your htaccess-file. Here’s an example:

[sourcecode language=“bash“]
RewriteEngine on
#Rewrite Rule something -> www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
[/sourcecode]

Using this rule every single url from your domain requested without www. will be redirected to the same url with www.

Google Chrome extension „note anywhere“

Chrome extensions you shouldn’t miss, today: NOTE ANYWHERE
With the very helpful chrome extension „Note Anywhere“ you can add notes to any web page. It’s simple and basic, but it changed my way to work: i use this extension to leave my comments or to-do’s for me in a note on the fly on a certain web-page.  A note can be dragged everywhere on the screen.

Notes

Notes Anywhere in action

appcelerator titanium developer android sdk problem

If you’d set up the titanium developer IDE on your computer you have to specify the iOS and android SDK location in the profile perspective. Probably you’ve taken a quick look on the developer docs you find here: http://developer.appcelerator.com/

If you can’t launch a project in android simulator you’ve probably forgotten to update your downloaded android SDK. Please follow these steps (example OS X):

1. go to your android sdk folder
2. change  to the tools directory (e.g. /Users/homer/Library/android-sdk-mac_x86/tools)
3. execute the file named „android“ (or run it on shell, for more information see the SDK_Readme.txt in your android sdk folder)
4. Now you should see the Android SDk and AVD Manager. Update your installation by changing to „Available Packages“. After the whole process and a titanium restart the fancy android emulator should be coming up after launching your project.

Android Emulator

Android Emulator

subclipse plugin problem with java HL library

Under certain circumstances (no java hl lib available) you’ll have problems running the subclipse plugin within your eclipse IDE. In that case probably your error message is something similar to this:

Java HL Lib Error

Java HL Lib Error

There’s a simple solution, you could use the pure java SVNKit instead. Go to your team-settings and change the lib in the SVN interface dropdown as shown below:

SVN interface settings subclipse plugin

SVN interface settings subclipse plugin

Java HL is the default setting – after changing settings your subclipse should be working properly again. Of course, the other way is to install the java HL libs, you can do this with apt-get if you’re under ubuntu:

[sourcecode language=“css“]
sudo apt-get install libsvn-java
[/sourcecode]