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

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)


Wednesday, October 30, 2013

Sunday, September 8, 2013

Cases for Eclipse not started correctly

  1. !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

    Solution: Try to remove the file "workspace\.metadata\.plugins\org.eclipse.core.resources\.snap"
  2. Sometimes the eclipse hangs in the splash screen.

    Solution: Try to remove the file "workspace\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi"

Wednesday, May 22, 2013

Executing PowerShell script

  1. Check your execution policy:
    PS> Get-ExecutionPolicy
  2. The execution policy is "Restricted" by default
  3. Change it to "Unrestricted"
    PS> Set-ExecutionPolicy Unrestricted
  4. Then you can run your script
    e.g. PS> .\scriptfile.ps1
Ref: http://ithelp.ithome.com.tw/question/10028377

Thursday, May 2, 2013

ESRI ArcGIS JS API version 3.4 hiding the Dojo Dnd style "dojoDndAvatar"

For ArcGIS JS API v3.4, if you include "esri.css" in your project, then your Dojo Dnd Avatar (the floating hints while you're doing drag and drop) will be disappeared.

Why? Because in "esri.css", esri.css got the following style:

     .dojoDndAvatar {display: none;}

God... What the hell ESRI guys are doing ?!

Friday, April 19, 2013

Avoid Android drawable resource to be scaled automatically

You know, you can have drawable images in Android (e.g. /res/drawable), you normally have it rescaled automatically according to your device dpi (e.g. ldpi, mdpi, hdpi, etc).

If you just don't want Android to scale it for, put your graphic files in /res/drawable-nodpi.

Reference: http://blog.pseudoblue.com/2010/11/15/disable-pre-scaling-of-android-image-resources/

CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...