Posts

Smallest font size in Chrome

Since Chrome has a smallest font size setting, you can't use CSS to set font size less than (12px, by default):    font-size: 6px !important; /* This has no effect ! Sigh .. */ Instead, you may consider to use transform instead:    transform: scale(0.833); /* 10/12 = 0.833 */ And you may also consider to shift the <div> container to fix the position changed by transform:    position: relative;    left: -15px;

Backup and Restore with PostgreSQL

Enter psql DOS> psql -U user database_name DOS> psql database_name (if no password defined) Drop DB DOS> dropdb database_name PSQL# drop database database_name Create DB DOS> createdb database_name PSQL# create database database_name Dump DB DOS> pg_dump database_name > file_name Restore from Dump DOS> psql -U user -d database_name -f file_name

Make web application start up faster

To make web application start up faster in Tomcat, you may consider the following tuning: Add metadata-complete="true"  as an attribute in <web-app> tag Add <absolute-ordering/> inside <web-app> </web-app>

Change font size by language using CSS

Quick useful when browser render text with different size in different languages: html : lang ( en ) h1 { font - size : 20px ; } html : lang ( ko ) h1 { font - size : 10px ; } Reference: http://stackoverflow.com/questions/15267355/change-font-size-based-on-language

Using @RunWith(SpringJUnit4ClassRunner.class)

Image
If you use @RunWith(SpringJUnit4ClassRunner.class) in a JUnit test class and it just cannot run, do double check your JUnit version. It requires JUnit 4.9 or above. 

Leaflet vs ArcGIS JS / FeatureLayer

I'd been deciding ESRI-Leaflet or ArcGIS JS for a small project. Some findings for our references: When using FeatureLayer for plenty amount of data (e.g. vast amount of points), ArcGIS JS performs better than Leaflet. So even the file size of Leaflet is far smaller than ArcGIS JS, I still have to choose the larger one. Hope Leaflet FeatureLayer performance can boost up in future.

True Parallel AsyncTask in Android

Multiple AsyncTask execute() actually execute the tasks sequentially. If the previous task takes a long time to run, the next task can only wait till the previous one finish. To have a true parallel run, use the following instead of AsyncTask.execute() :     AsyncTask.executeOnExecutor(Executor exec, Params... params)