Selenium automates browsers. Control the browser through Java code:
http://docs.seleniumhq.org/
Thursday, July 17, 2014
Tuesday, July 15, 2014
Setting Tomcat JVM in service mode
Running Tomcat (Service mode) with default Java Virtual Machine (JVM) could cause some strange problem sometimes. It's because your own development may depends on a particular VM (e.g. the HotSpot VM). In this case, you will need to specify the JVM instead of using the default one.
To do this, run the tomcat7w.exe in TOMCAT_HOME\bin\, and select the the Java tab. You will find the Java Virtual Machine option as shown below:
Wednesday, June 4, 2014
Using slapadd in OpenLDAP
A correct way to use slapadd:
/sbin> slapadd -f d:\OpenLDAP\etc\openldap\slapd.conf -l d:\data\root-unit.ldif
Note that -F d:\OpenLDAP\etc\openldap won't work, you must use the -f parameter.
/sbin> slapadd -f d:\OpenLDAP\etc\openldap\slapd.conf -l d:\data\root-unit.ldif
Note that -F d:\OpenLDAP\etc\openldap won't work, you must use the -f parameter.
Thursday, May 29, 2014
Dojo: Problem of having TabContainer inside ContentPane in IE8
In Dojo, the popular JavaScript library, we have ContentPane which allows us to put different widget into it, such as TabContainer, DataGrid, etc. They works fine in most browsers, but in IE 8, that could be a bit tricky.
Suppose we have the following code fragment:
<div id="testContentPane"
data-dojo-type="dijit/layout/ContentPane""
style="height: 200px; overflow: auto; border: 5px blue solid;">
testing 1 <br> testing 2 <br> testing 3 <br>
testing 4 <br> testing 5 <br> testing 6 <br><br>
<div id="testTabContainer"
data-dojo-type="dijit/layout/TabContainer"
style="width:80%; height:200px;"
disabled='disabled'>
<div id="tabControl"
data-dojo-type="dijit/layout/ContentPane"
title="Tab" closable="false">
Testing tab
</div>
</div>
</div>
The above code fragment is suppose to create a ContentPane and put a TabContainer into it:
Suppose we have the following code fragment:
<div id="testContentPane"
data-dojo-type="dijit/layout/ContentPane""
style="height: 200px; overflow: auto; border: 5px blue solid;">
testing 1 <br> testing 2 <br> testing 3 <br>
testing 4 <br> testing 5 <br> testing 6 <br><br>
<div id="testTabContainer"
data-dojo-type="dijit/layout/TabContainer"
style="width:80%; height:200px;"
disabled='disabled'>
<div id="tabControl"
data-dojo-type="dijit/layout/ContentPane"
title="Tab" closable="false">
Testing tab
</div>
</div>
</div>
Everything goes fine with IE 10, IE 9, Chrome, Firefox, but in IE 8, we have:
Look! The TabContainer just floating on top of the ContentPane. How to solve this issue?
Put CSS position: relative in the ContentPane and the issue will be fixed.
Why? Because in IE 8, the TabContainer is position:absolute. If ContentPane position CSS is not assigned, the TabContainer will leave out of it. By assigning position:relative to ContentPane, the position of TabContainer will be limited inside the ContentPane. Like this:
Thursday, March 20, 2014
Android ListView Animations
Just found a library ListViewAnimations which delivers nice animations for list items in Android.
To start an animation programatically, we may consider something like:
To start an animation programatically, we may consider something like:
v.clearAnimation();
Animation animation = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_top_to_bottom);
v.startAnimation(animation);
Monday, March 17, 2014
Using Google Map API to access Google Earth Enterprise
Nice references for showing Google Earth Enterprise maps using the Map API:
The major thing is that we will use GFusionMap object instead of google.maps.Map object in the JavasScript. So that we can specify the GEE server definitions when we create the map object.
Sunday, March 2, 2014
ArcGIS Server Cached Map Expiry Time
The tiled cached map expire time can be controlled by a variable "cacheControlMaxAge" in ArcGIS Server Administrator Directory, available starting at ArcGIS for Server (Window) 10.2.
Ref: http://resources.arcgis.com/en/help/main/10.2/index.html#//015400000577000000
The default HTTP header "max-age" is 86400 (i.e. 24 hours), which seems cannot be changed in ArcGIS Server 10.0.
For Android SDK 10.2, the map caching activities only works on the particular session. That means when the user quit the app and start it again. The previous cache will not be used.
Ref: http://resources.arcgis.com/en/help/main/10.2/index.html#//015400000577000000
The default HTTP header "max-age" is 86400 (i.e. 24 hours), which seems cannot be changed in ArcGIS Server 10.0.
For Android SDK 10.2, the map caching activities only works on the particular session. That means when the user quit the app and start it again. The previous cache will not be used.
Friday, February 21, 2014
OpenOffice keeps showing the restoring window in OSX
If your OpenOffice just keeps showing the restoring window / reopen document window in OSX:
Simply remove all the contents in the following directory:
/Users/<user name>/Library/Saved Application State/org.openoffice.script.savedState
Horrible implementation...
Tuesday, February 18, 2014
Check httpd.conf syntax
Simply run the following command:
httpd -t
It will shows "Syntax OK" if your httpd.conf works.
Monday, November 4, 2013
Customize the 404 page for ArcGIS Server Map Services
ArcGIS Server 10 internal Tomcat web root:
\ArcGIS\Server10.0\java\manager\web_output
ArcGIS Server 10 internal Tomcat conf:
\ArcGIS\Server10.0\java\manager\service\managerappserver\conf
\ArcGIS\Server10.0\java\manager\web_output
ArcGIS Server 10 internal Tomcat conf:
\ArcGIS\Server10.0\java\manager\service\managerappserver\conf
You may modify the web.xml by adding the error page definition:
...
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/404.htm</location>
</error-page>
</web-app>
And the 404 error file can put in the root (/web_output)
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( ) ...




