Tuesday, December 10, 2013
Wednesday, November 27, 2013
Android: Stop or quit the search UI
To quit the search UI in android:
((SearchManager)this.getSystemService(Context.SEARCH_SERVICE)).stopSearch();
((SearchManager)this.getSystemService(Context.SEARCH_SERVICE)).stopSearch();
Saturday, November 9, 2013
Android app: Find your phone via SMS
Beep My Phone is a useful Android app where you can send a SMS message to your phone, and the phone will play the notification sound no matter you had muted your phone or not.
Check it out via:
https://play.google.com/store/apps/details?id=com.mk2.beepmyphone
Check it out via:
https://play.google.com/store/apps/details?id=com.mk2.beepmyphone
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)
Friday, November 1, 2013
References for setting up app routing in IIS 7
Application Request Routing in IIS
- http://learn.iis.net/page.aspx/482/install-application-request-routing/
- http://blogs.iis.net/wonyoo/archive/2011/04/20/how-to-install-application-request-routing-arr-2-5-without-web-platform-installer-webpi.aspx
- http://blogs.iis.net/wonyoo/archive/2011/03/29/why-is-application-request-routing-version-2-5-available-only-via-web-platform-installer.aspx
Thursday, October 31, 2013
Wednesday, October 30, 2013
Remove the "Zoom to" link in Callout of ArcGIS Javascript API
We can add the following style to hide the "Zoom to" link:
.action.zoomTo {
display: none;
}
Ref:
http://forums.arcgis.com/threads/89318-Remove-quot-Zoom-to-quot-link
.action.zoomTo {
display: none;
}
Ref:
http://forums.arcgis.com/threads/89318-Remove-quot-Zoom-to-quot-link
Sunday, September 8, 2013
Cases for Eclipse not started correctly
- !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" - Sometimes the eclipse hangs in the splash screen.
Solution: Try to remove the file "workspace\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi"
Monday, June 3, 2013
Android App: Brightness Shortcut
A useful app for android user to switch their screen brightness through shortcuts.
Click here to visit the app page in Google Play!
Free version also available!
The most cool thing is that you can have shortcuts "Previous Brightness" and "Next Brightness", which allows you to switch the brightness with gestures (linked to shortcuts) in launchers.
Click here to visit the app page in Google Play!
Free version also available!
Wednesday, May 22, 2013
Executing PowerShell script
- Check your execution policy:
PS> Get-ExecutionPolicy - The execution policy is "Restricted" by default
- Change it to "Unrestricted"
PS> Set-ExecutionPolicy Unrestricted - Then you can run your script
e.g. PS> .\scriptfile.ps1
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 ?!
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/
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/
Thursday, February 28, 2013
Customize your ACTION_CHOOSER Intent
For an Android Intent chooser, it is possible to either remove an Intent or add an custom Intent, this is how we do it:
List<Intent> targetedShareIntents = new ArrayList<Intent>();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "http://www.blogspot.com");
List<ResolveInfo> resInfo = this.getPackageManager().queryIntentActivities(intent, 0);
for (ResolveInfo resolveInfo : resInfo) {
String packageName = resolveInfo.activityInfo.packageName;
Intent targetedShareIntent = new Intent(android.content.Intent.ACTION_SEND);
targetedShareIntent.setType("text/plain");
targetedShareIntent.putExtra(Intent.EXTRA_TEXT, "http://www.blogspot.com");
targetedShareIntent.setPackage(packageName);
if (!packageName.equals("com.facebook.katana")) { // Remove Facebook Intent share
targetedShareIntents.add(targetedShareIntent);
}
}
// Add my own activity in the share Intent chooser
Intent i = new Intent(this, NextActivity.class);
targetedShareIntents.add(i);
Intent chooserIntent = Intent.createChooser(
targetedShareIntents.remove(0), "Select app to share");
chooserIntent.putExtra(
Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents.toArray(new Parcelable[]{}));
startActivity(chooserIntent);
Very nice reference from the following posts:
List<Intent> targetedShareIntents = new ArrayList<Intent>();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "http://www.blogspot.com");
List<ResolveInfo> resInfo = this.getPackageManager().queryIntentActivities(intent, 0);
for (ResolveInfo resolveInfo : resInfo) {
String packageName = resolveInfo.activityInfo.packageName;
Intent targetedShareIntent = new Intent(android.content.Intent.ACTION_SEND);
targetedShareIntent.setType("text/plain");
targetedShareIntent.putExtra(Intent.EXTRA_TEXT, "http://www.blogspot.com");
targetedShareIntent.setPackage(packageName);
if (!packageName.equals("com.facebook.katana")) { // Remove Facebook Intent share
targetedShareIntents.add(targetedShareIntent);
}
}
// Add my own activity in the share Intent chooser
Intent i = new Intent(this, NextActivity.class);
targetedShareIntents.add(i);
Intent chooserIntent = Intent.createChooser(
targetedShareIntents.remove(0), "Select app to share");
chooserIntent.putExtra(
Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents.toArray(new Parcelable[]{}));
startActivity(chooserIntent);
Very nice reference from the following posts:
Sunday, January 13, 2013
[Windows] System Update Readiness Tool
To avoid Windows crash during system update, consider using the System Update Readiness Tool before doing the actual update, more information at:
http://windows.microsoft.com/en-US/windows7/What-is-the-System-Update-Readiness-Tool
http://windows.microsoft.com/en-US/windows7/What-is-the-System-Update-Readiness-Tool
Thursday, January 3, 2013
Adjusting the screen resolution of BlueStack
The resolution can be changed by editing the BlueStack's registry:
HKLM\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Height
and
HKLM\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Width
HKLM\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Height
and
HKLM\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Width
Subscribe to:
Posts (Atom)
Sync multiple git repo at once
Use the following command in Linux will do the job: ls -d RepoNames* | xargs -I{} git -C {} pull
-
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 ...
-
To count the number lines of files / stdout in Linux, we uses "wc -l" to achieve. In Windows, we use the following instead: find...