Tuesday, December 30, 2008

maven dependency for child projects

The dependencies that you want your child projects to inherit cannot be nested in the element. Dependencies in this element merely state the preference for a version and by itself does not affect a project's dependency graph.

To get child projects to inherit parent dependencies we need to add these dependencies in the element without an enclosing element.

Tuesday, December 16, 2008

Tuesday, December 9, 2008

Deleting all .svn folders

Here's something you can do in Ubuntu at the command line if you need to delete all those pesky .svn folders


find . -name .svn -type d -exec rm -rf {} \;


Here "." looks at the current directory. Change the directory to one of your choice.

Friday, December 5, 2008

Hangup with Netbeans 6.x on Ubuntu

1. It's slow
2. It looks ugly in Ubuntu. Drop down boxes end abruptly. Underscores are missing in dropdowns. Actually it's all Swing applications in Ubuntu if you have Compiz enabled.
3. It's slow.

Google in English, wherever you are

You know how frustrating it is to go to a foreign country and all google searches have foreign labels. China for one.

Well here's a real simple way that you can set English to appear all the time.

1. Go to www.google.com. You will automatically be routed to a local version of Google.
2. Click English at the bottom of the search text box (it's the right most one in case you can't tell)
3. Now all searches have English in them including the searches that you run from the Firefox search box.

Sunday, November 30, 2008

Flex Actionscript and MXML sleeping together

Loads of tutorials online provide means to control the look and feel of Flex GUI components. Majority of them use MXML to achieve this.

So what if you wanted to control the style in Action Script?

well call the "setStyle" method on the object.

Look at the API for a listing of MXML properties, e,g

mx:Label
Properties
condenseWhite="true|false"
data="null"
htmlText=""
listData="null"
selectable="true|false"
text=""
truncateToFit="true|false"

- example

then call {object}.setStyle("data","null")

Monday, November 24, 2008

2 letter country code select box

Ever had a need to get 2 letter country codes in a nice prepackaged select box?

Here's the link: SelectBox

However if you copy-paste it into a text editor, you get line numbers that appear on the left. Here's the workaround.

1. Open a Spreadsheet application (OpenOffice Calc e.g)
2. Copy-paste from the website into the spreadsheet.
3. Select the cells and then paste them into the text editor.

voila!

Tuesday, November 18, 2008

Netbeans Illogical hot keys

Why does Netbeans use crappy hot keys?

I'm using the UML editor and to switch to Pan navigation, I need to hit Ctrl+Shift+Alt+P.

That's 4 keys and the 'P' is way over the Atlantic end of the keyboard.

IMHO, any set of hot keys that involve more than 3 keys should be scrapped.

Monday, November 17, 2008

Mondrian Dimension with Table JOIN

If anyone out there ever has a need to join 2 tables in a single dimension, use this:

Table Join in dimension

Mondrian Schema Guide

If you ever need a Mondrian schema reference, here's where to point the browser

Mondrian Schema

Don't bother if you think I'm talking about art

Sunday, November 16, 2008

Apache secure MUST-DOs

1. Disable directory browsing
edit the virtual hosting file and add this

Options -Indexes

If you ever need to deny access from a country to your site

Why am I doing this? I have a website in PHP Nuke that I haven't patched (yet!). There are some Indonesian script kiddies that keep taking it out using SQL Injection.

Solution:
Block a country

Friday, November 14, 2008

Change font size on Netbeans

Netbeans on Ubuntu has fonts that is a size too larger IMHO.

Here's a link on how you can change the font size.

http://blog.igorminar.com/2006/10/changing-font-size-in-netbeans.html


from the link:

"
....
For now, I found out that you can control the font size with a command line parameter --fontsize . Or even better you can put this in the netbeans.conf file that can be found in /Applications/NetBeans.app/Contents/Resources/NetBeans/etc/ directory. I prefer to use font size 11 (the default is 13). To set this you need to append the setting to the net so the netbeans_default_options variable.
.."

MySQL recovery

If your MyISAM tables ever get screwed, use this procedure

1. stop mysql
2. go to mysql data folder (typically /var/lib/mysql)
3. run "myisamchk -r -f -s -u *.MYI"
4. restart mysql

Wednesday, November 12, 2008

Transferring Virtual Machine

If anyone out there ever intends to transfer VMWare VMs from Linux to Windows (for example), then you might have issues with how VMWare handles ext3 and ntfs filesystems.

Check the logs and you will probably see a line mentioning that VMWare is unable to create RAM.

Just add this line to your .vmx file (using a text editor)

mainmem.UseNamedFile="FALSE"


Use that line exactly as it looks.

I forgot where I got this information from. But thanks VMWare guy!