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.
Tuesday, January 5, 2016
Thursday, November 12, 2015
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.
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.
Tuesday, June 23, 2015
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)
To have a true parallel run, use the following instead of AsyncTask.execute():
AsyncTask.executeOnExecutor(Executor exec, Params... params)
Friday, May 29, 2015
3D translate an element in HTML
To translate the element, you need:
<div style="perspective:500px; margin-left:100px;">
<div style="transform: rotateX(40deg)">
<table border=1>
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
...
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
</table>
</div>
</div>
- A container having CSS style "perspective: ___px"
- The actual element having CSS style "transform: rotateX(___deg)"
<div style="perspective:500px; margin-left:100px;">
<div style="transform: rotateX(40deg)">
<table border=1>
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
...
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
<tr><td>testing</td><td>testing</td><td>testing</td></tr>
</table>
</div>
</div>
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
| testing | testing | testing | testing | testing |
Monday, April 20, 2015
Speed Up the Eclipse IDE
Nice tutorials and references for people who find their Eclipse is kinda slow:
- http://www.nicolasbize.com/blog/7-tips-to-speed-up-eclipse/
Tuesday, April 7, 2015
Install Teclast X80H (FB6M) as Android USB in Windows
Teclast X80H (FB6M) is a dual OS (Windows 8.1 + Android 4.4.4) tablet, to install
- Install the Samsung USB driver
- Restart the computer
- Select Device Manager > The X80H device > Update Driver Software.
- Select Browse my computer for driver software
- Select Let me pick from a list of device drivers on my computer
- Select ADB Interface / Android USB Devices from the list
- Select SAMSUNG Android ADB Interface
http://forum.xda-developers.com/windows-8-rt/general/teclast-x80h-8-dual-os-chinese-tablet-t2996314/post59151938#post59151938
Can Teclast simply provide an adb driver link for customer download easily? ... sigh
Wednesday, April 1, 2015
JavaScript frameworks that we should get touch with
More and more JavaScript framework to work with:
- React.js
- Ember.js
- Knockout.js
- Backbone.js
- Meteor
- Mithril
- Ember
- Vue.js
- Breeze.js
- Ractive
Reference: http://www.breck-mckye.com/blog/2014/12/the-state-of-javascript-in-2015/
Wednesday, December 10, 2014
Enable logcat in RedMi / HongMi AOSP 4.2.2
For some reason the logcat in AOSP 4.2.2 maybe disabled by default. To re-enable it, follow the steps below:
- Extract the file in /system/etc/init.d/03MTKTweakElse
- Comment out the line "rm /dev/log/main", this statement will disable the logcat to function
- Push back the file to the device
C:\> adb push 03MTKTweakElse /system/etc/init.d/03MTKTweakElse
You may not have the privilege to write on the directory /system, to handle this, remount the /system partition using:
- Enter the shell
adb shell - Change to root
su - Remount the /system as Read-Write
mount -o remount rw /system
Monday, November 10, 2014
Show multiple lines of title in Android ActionBar
To show multiple lines of title in Android ActionBar, one of the most common solution is to assign some of the text in SubTitle. Here we have another approach:
Basically we get the TextView object of the title in ActionBar, set it's max lines attribute to 2:
int titleId = Resources.getSystem().getIdentifier("action_bar_title","id","android");
TextView title = (TextView) findViewById(titleId);
title.setSingleLine(false);
title.setMaxLines(2);
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
Then we can set a long title to the ActionBar where the text will be displayed as two lines:
getActionBar().setTitle("... your long title here ...");
Basically we get the TextView object of the title in ActionBar, set it's max lines attribute to 2:
int titleId = Resources.getSystem().getIdentifier("action_bar_title","id","android");
TextView title = (TextView) findViewById(titleId);
title.setSingleLine(false);
title.setMaxLines(2);
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
Then we can set a long title to the ActionBar where the text will be displayed as two lines:
getActionBar().setTitle("... your long title here ...");
Tuesday, November 4, 2014
ArcGIS: Query for a simplified feature set
To query a simplified feature set using QueryTask, you can set the "MaxAllowableOffset" property through
com.esri.core.tasks.ags.query.Query.setMaxAllowableOffset( )
or if you're using ArcGIS Android SDK version 10.2.4 already, then it should be:
com.esri.core.tasks.ags.query.QueryParameters.setMaxAllowableOffset( )
com.esri.core.tasks.ags.query.Query.setMaxAllowableOffset( )
or if you're using ArcGIS Android SDK version 10.2.4 already, then it should be:
com.esri.core.tasks.ags.query.QueryParameters.setMaxAllowableOffset( )
Subscribe to:
Posts (Atom)
CSP on Apache
To add CSP to root if sort of funny. The following will NOT work for most cases !! <LocationMatch "^/$"> Header s...
-
When Office2003 couldn't find file SKU011.CAB: regedit -> [HKEY_LOCAL_MACHINE] -> [SOFTWARE] -> [Microsoft] -> [Office] -...
-
The resolution can be changed by editing the BlueStack's registry: HKLM\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Height and ...
-
Suppose you got a file in Big5 containing some HKSCS characters (e.g. 深水埗, 赤鱲角, etc). When your environment (Ref: Charset.defaultCharset( ) ...