Pages

Thursday, August 18, 2011

Mac -=- Removing dot underscore "._" files...

In some cases involving the Apple Double format, moving a file to a different file system will cause the prefix "._" to appear on a file name. The files "._" are invisible when you're trying to list the file even with "ls -al" but you can see them when you compress a file. 

To remove them, you can go on the root of the directory and type
find . -name '._*' -delete

In order to PERMANENTLY resolve this issue, you can however, add one of the following 2 lines of code to your .bash_profile file in your home directory:
# for Tiger OS 10.4 or earlier
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true

# for Leopard OS 10.5 and later
export COPYFILE_DISABLE=true

Tuesday, August 16, 2011

Linux -=- Find files and copy to a folder

Hi!

Here's how to copy the files found in the result of a search to a specified folder.

find /path/to -iname 'whatever' -exec cp '{}' /path/to/destination/ \;

Tuesday, August 9, 2011

Java -=- Regex find example

Here's a simple example that shows how to find the value of different groups in a string with a regular expression.

Pattern pattern = Pattern.compile("^([a-zA-Z0-9]*)_(\\d*)?_?(.*)-\\d*_.*$");
Matcher m = pattern.matcher(resourceFile.getName());

if (m.find()) {
    String destinationNickname = m.group(1);
    String jobnumber = m.group(2);
    String originalFileName = m.group(3);
} 

Test your regex with this site: http://www.regexplanet.com/simple/index.html

Thursday, July 21, 2011

The Best PHP Frameworks of 2011

I've found a good article concerning the best PHP frameworks of 2011. It worth the time of reading it!

http://davidjconnelly.wordpress.com/2011/07/03/the-best-php-framework-of-2011/

Yann

Wednesday, July 20, 2011

Mac -=- Recursively delete .DS_Store files

Hi!

Mac OS X writes .DS_Store in every folders. If you want to delete theses files, you could use this command:


rm -rf `find . -type f -name .DS_Store`

Tuesday, July 19, 2011

Friday, July 1, 2011

ExtJS -=- Error: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)

Hi!

If you are developing an application using the technologies mentioned in the title and have come across the operation aborted error in internet explorer (http://support.microsoft.com/default.aspx/kb/927917) then continue reading

Unlike Firefox and Safari - Internet explorer requires the DOM to be fully loaded before it can provide a peaceful execution of ExtJS code - you will face operation aborted errors otherwise.

Consider the following scenario

I declare a DIV container for an ExtJS based tab panel and immediately afterwards provide the required code.

..... ..... .....



Assuming more HTML markup follows after , this code will produce random operation aborted errors in internet explorer 6 and up. Sometimes it will load just fine while other times it will err out while you being able to see your page rendered - you will be unable to interact with the page and will be redirected to the default error page once you will click the ok button on the popup dialog box.

This error is not specific to ExtJS - this is a general bug with internet explorer and will occur whenever a DOM node is tried to be manipulated before the whole DOM structure has been read in by the browser. For example you will also face this issue with google-web-toolkit.

You can fix this issue by using the following approach

Leave all your containers where they are

Move all your javascript/ExtJs/GWT code just before then end of BODY tag.

Ideally you should consider moving all your code into JS files to speed up page loads due to caches.