Linux command line Image Manipulation for Android Developers

Sometimes while developing Applications for Android one has to transform a lot of images at once. In those cases, it is easier to use the command line than standard programs such as gimp. Resize multiple Images via Command Line for i in *.png; do convert "$i" -resize 50% "${i%%.png*}.png"; done I use this a lot when developing for Android, as it is best to supply differently sized images for different devices to save memory.

Java – Image Manipulation

Handling Images in Java is fun. Here are some often used image manipulation methods. Negating colors of an image Change all pixels in BufferedImage to one color Changing opacity of image Adding two BufferedImages (with given opacity) Saving BufferedImage to a file Loading a BufferedImage from a file Most of these methods come from my java heatmap creating class so if you want to download them get them there.

Missing PHP String Functions: contains, equals, startsWith, endsWith

PHP is great because it is easy to deploy it on pretty much any webserver. But in my opinion the language itself is not very well designed. In this post I will take a look at the PHP string functions and offer implementations of those important string functions that PHP is missing (which are endsWith, startsWith, contains and equals). PHP and Java String functions compared: A Rant If you look at the Java String class it has all methods that one commonly needs for strings, and the method signatures are well designed.

Linux #4: Difference between find, locate and whereis

Difference between find, locate and whereis linux commands find: finds files by filename. see Linux: Search for a File by Filename for more details and example usages. locate: also finds files by filename but does not search the directory structure itself but only a database prepared by updatedb. Because of that locate is faster than find but less accurate. Examples: locate firefox # -> /etc/firefox # /etc/firefox-3.0 # /etc/firefox-3.5 # /etc/alternatives/firefox-homepage # /etc/alternatives/firefox-homepage-locales # [ .

Symfony2 Flash Message

Flash Messages make it possible to show a string on the next request, for example after a redirect. This is useful when you want to inform a user about the success or failure of form-requests. Symfony2 changed how flash messages work from version 2.0 to 2.1, so below you can read about how to use flash messages in both versions. Symfony2 flash message for Symfony 2.0 and below Setting the flash message To add a flash message – which lasts exactly one request – to a session use this code in the controller:

Domain Name Tools: Name suggestions, Price comparison and more

Here are a couple of tools that will help you choose and register a domain name: domain naming tipps: A list of things to consider when choosing a domain name. domain name suggestions generator: In case you need a good domain name idea this tool will generate a list of possible domain names on the basis of keywords provided by you and check if they are available. compare domain name prices: Compare the prices of the top domain name registrars and filter it by price, top level domain, available payment methods and by whether or not anonymous domain name registration is possible.

Linux #3: Search and Replace

Search and Replace text in one File To search a string in a file and replace all occurrences of it with a different string use sed: sed -i 's/string/replace/g' file With this command all occurrences of the text string in the file file will be replaced with replace. Search and Replace text in all Files in a directory To replace all occurrences of a string in all files in a directory recursively use sed in combination with find:

Low Adsense link unit coverage

My adsense link unit coverage is low. A lot lower than the coverage for the other adsense ad units so I tried to figure out what is going on. Google has this to say: For link units, coverage reflects the number of link units that showed ads after the user clicked on a term in the link unit. Coverage for pages displaying link units is typically much lower than for the other kinds of ad units, because it involves user clicking.

Netbeans: PHP autocomplete

In Netbeans PHP autocomplete does not always work because the type of a variable is not clear. Below you can read how to hint the type thus allowing for autocomplete to work in Netbeans with PHP as well as it does with Java.