Tuesday, August 6, 2013

Removing DOS Carriage Return in Linux

This shows up as "^M" in some editors, and can cause some scripts to fail.

To fix it, install the package "dos2unix". Available in at the minimum RedHat and Ubuntu based distros.

Thursday, August 1, 2013

Android Private Libraries

In the Eclipse ADT, this is libraries that are placed in the "libs" folder, they are automatically placed on the classpath as "Android Private Libraries".

However, when removing it, the ADT removes the library but flags it as an error as it is missing. A restart needed to be performed before the project compiles properly.

Android Include Library in APK

In order for library JAR files to be included in the APK, it is necessary to go the "Build Path" and check "Android Private Libraries" in "Order and Export".

References:

Android Library References

To make one project depend on another, add into project.properties as follows:

android.library.reference.1=../LibraryOne
android.library.reference.2=../LibraryTwo

Friday, July 12, 2013

Tuesday, July 9, 2013

Android Themes Remove Action/Title Bar

Some people do this by using themes that don't have title or action bars, but this might be in conflict with existing theming requirements. This method is also difficult to apply to multiple SDK levels at the same time, due to inconsistent theme availability.

The best solution so far is to add customizations within each style as described in these answers:

Android Icon Sizes

Current recommended launcher icon sizes in Android:

  1. 48 x 48 (mdpi)
  2. 72 x 72 (hdpi)
  3. 96 x 96 (xhdpi)
  4. 144 x 144 (xxhdpi)
There is also 36 x 36 for ldpi but the OS is able to resize that nicely from the better quality ones.

Monday, June 10, 2013

Big Data is About Speed Instead of Just Size

Article: http://www.guardian.co.uk/news/datablog/2013/may/20/big-data-critics-overlooked-speed-not-size

The main point of the article provides an insightful reminder for us not to be fixation with just the volume aspect of big data. There are many cases characterized by a high-velocity stream of data that needs to be processed and acted on immediately.

Google Launches "Mobile Backend as a Service"

Google launches "Mobile Backend as a Service" starter kit. It's called "Mobile Backend Starter" and runs on top of Google App Engine.

It's mainly a client-to-client networking and communications stack. It supports storage of state data on the server side and also Google Authentication. However, no customized server logic or extensions are supported.

References:

Wednesday, May 29, 2013

Application Management for AWS

Currently, the following application management frameworks are available for AWS (excludes third party solutions):

  1. AWS Elastic Beanstalk
  2. AWS OpsWorks
  3. AWS CloudFormation

Something they didn't mention in the above web-page is that OpsWorks is a technology acquired in an acquisition, and does not integrate into all of AWS's services yet, the most important being ELB (OpsWorks uses HAProxy). Leaving CloudFormation as the framework of choice if this is an issue.

Forum post about this: https://forums.aws.amazon.com/message.jspa?messageID=426226

On the other hand, the downside of CloudFormation is the lack of automated failover.

Sunday, April 7, 2013

BASH IO Redirection

In bash, by default, only stdout gets redirected to a file when you use the ">" operator.

To redirect stderr to a file, use the "2>" operator.

To redirect both, use "&>"

Reference:http://www.cyberciti.biz/faq/redirecting-stderr-to-stdout/

Git Undo Staging a File for Commit

If a file has already been staged for commit i.e. via the "git add" command, use the following command to unstage the file:

git reset HEAD <filename>

Monday, April 1, 2013

The "spi" Package in Java Projects

It's quite common to find a package called "spi" in Java projects.

Here's an explanation of what it means and what it's for:

Monday, March 18, 2013

C# Start New Process

This is how it's done:http://stackoverflow.com/questions/258416/shellexecute-equivalent-in-net

If you need to start multiple processes asynchronously, you'd need to first start multiple threads and then within each thread, each process is started.

Reference for this: http://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C

How to add arguments: http://msdn.microsoft.com/en-sg/library/system.diagnostics.processstartinfo.arguments.aspx

Tuesday, March 12, 2013

C# Getting Time Since Epoch

Many things are simpler in C# than e.g. in Java, but getting the Epoch time is an exception, and this is how it's done.


TimeSpan timeSpan = DateTime.UtcNow - new DateTime(1970, 1, 1);
double currentTime = timeSpan.TotalSeconds;

Tuesday, February 5, 2013

Ubuntu: Configuring Tomcat

Instead of hacking the startup scripts, some of the common configuration variables can be set in Ubuntu in the file "/etc/default/tomcat7"

Git Log Show File List

To list the files that were involved in each commit:

git log --name-status

References: