20 February 2011

WP localization string

<?php _e('Some string', 'theme_textdomain'); ?>

i.e.


<?php _e('Some string', 'is_IS'); ?>

13 December 2010

AgileIS 2009

01 November 2010

Find text in files through the Terminal

grep -li 'TEXT TO FIND IN FILES' **/*.doc
will find the 'TEXT TO FIND IN FILES' in all .doc files.

18 October 2009

Gmail killer feature

I like my gmail and the new Google Docs preview feature is just wonderful for someone like me how keeps most everything at Google Docs.

11 August 2009

21 April 2009

MacBook Pro scrolling/zooming flickers

Got a new 2.66GHz MacBook Pro a few days ago and yesterday the scrolling/zooming flickers kicked in. I found this discussion but no help there yet.

Looks like a chip bug with the NVIDIA graphics card. Good thing there are two of them in the machine...best would have been if one was from another manufacturer ;)

I really had enough when trying to zoom with the trackpad in iPhoto so I decided to try to switch to the other graphics display card. That was simple. Seems to work, at least for now, but the issue seems to build up over time.

I'll add comments here to follow this through.

26 March 2009

WebObjects application launching as MainBundle.woa

For some unknown reason a couple of WebObjects applications were not not launching as the APPLICATION_NAME.woa but as MainBundle.woa and totally unusable as such.

When launching from Eclipse I got an error on locating Info.plist in JavaDTWGeneration.framework, JavaEOGeneration.framework and JavaEOProject.framework that was causing the problem.

Reinstalled Webobjects 5.4.3 and everything when back to normal.

22 January 2009

Using JVC GZ-HD7 Everio with MAC OS X

Converting TOD FHD files from JVC Everio on Mac OS X
If you wan't to edit you Full HD videos from your Everio in iMovie you'll have to convert the videos to work on the mac.

You'll need to download and install ffmpegx and connect your JCV Everio via USB and locate the TOD file(s).


  1. In ffmpegx click Open and choose the TOD file

  2. Set the destination file in the Save As

  3. Under Target format select MOV

  4. Under Video set the bitrate to 28000

  5. Under Audio it might be a good idea to match the bitrate too

  6. Click Encode and just wait =)


Evario manual
The manual for the Everio can be found, as most manuals, at retrevo.com, but you have to sign up. For those how don't wan't to use this great service the manuals can be accessed on this folder at box.net.

Importing straigt into iMovie
You can set the record quality down to 1440( down from 1920 ) and then you can read straight from the Everio into iMovie via FireWire cable.
When you need to import into iMovie just follow the instructions in this video:

15 August 2008

Qualifing an array

EOQualifier.filteredArrayWithQualifier( ARRAY, QUALIFIER );

12 August 2008

Reverting back to an older version of Eclipse/WOLips

When all hell breaks loose when upgrading Eclipse/WOLips:
1. Go to Help - Software updates - Manage Configuration
2. Select what you want to replace and click "Replace with Another Version" and select the desired version.

JAVA_HOME on mac

export JAVA_HOME=/Library/Java/Home

01 July 2008

NSArray sorting

Don't forget the little magic in

EOSortOrdering.sortedArrayUsingKeyOrderArray( form.elements(), new NSArray( ERXS.asc( Element.ORDER_KEY ) ) );

Unlimited email address with your Gmail

You can send yourself emails with the plus sign(+) after your gmail address and then any text you want after the plus sign and it will show up in your inbox. Ex. if your gmail address is rass@gmail.com you can send yourself and email to rass+gat@gmail.com.

This can be quite handy when giving your email to "unknown" websites and also with filters you can organize your email pretty neatly.

Note that not all website forms allow you enter the + sign, in those cases you can also replace gmail.com googlemail.com, e.x. rass@googlemail.com is delivered to rass@gmail.com ;)

More on this at digitalalchemy.tv

07 May 2008

CallableStatement date&time parameter

After spending an enormous amount of time trying to include the time with a java.sql.Date call to a Stored Procedure through CallableStamtent I found out that CS also accepts Timestamp...that really made my day =)

27 March 2008

The caret synbol( ^ ) in bindings

The caret symbol( ^ ) indicates that the value should be taken from the parent component.

11 March 2008

Getting resources from Unit Tests

Since Unit Tests are run from the command line( or Ant ) access to Resources of a WebObjects project are no good with ResourceManager. Simple functions to get resources based on the filesystem:


/**
* Returns a path to a resource filename in a folder(s) under the root folder
* */
private String resourceLocationString( String filename, String folder ) {
String urlToFile = getClass().getResource( "/" ).toString();
urlToFile = urlToFile.replace( "bin/", "" );
urlToFile = urlToFile.replace( "file:", "" ); // now we should be at the projects root directory
urlToFile = urlToFile.concat( folder + "/" + filename );
return urlToFile;
}

/**
* Returns data for pdf file
* */
private byte[] bytesForPDFResource( String urlToFile ) throws FileNotFoundException, IOException {
FileInputStream in = new FileInputStream( urlToFile );
byte[] data = new byte[in.available()];
in.read(data);
return data;
}

Write data to a file in the filesystem


FileOutputStream fs = new FileOutputStream( ABSOLUTE_PATH_TO_FILE );
fs.write( SOME_DATA );
fs.close();

18 January 2008

Executing SQL

Need to call simple SQL commands, like getting the next primary key by calling a sequence:


NSArray rawRows = EOUtilities.rawRowsForSQL( EDITING_CONTEXT, MODEL_NAME, SQL_STRING, NSArray.EmptyArray );
NSDictionary rowWithPK = (NSDictionary)rawRows.objectAtIndex( 0);
Object maxPK = rowWithPK.objectForKey( "NR" );