Just a note for encoding URL in NDEF message, the NDEF record should user TNF_WELL_KNOWN as its TNF. And NDEF record type should be RTD_URI. And the first byte could be encoded for different protocols (e.g. 0x01 = "http://www", 0x02 = "https://www", etc.
References:
Beginning NFC
Professional NFC Application Development for Android
Tuesday, January 8, 2019
Tuesday, December 18, 2018
Resources for jQuery i18n library
jQuery i18n is a handy library to provide multi-language for your web applications. Below are some useful references:
Inject git last commit id to SpringBoot project
1) Add git-commit-id-plugin in pom.xml
<build>
<plugins>
<plugin>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<includeOnlyProperties>
<includeOnlyProperty>git.commit.id.abbrev</includeOnlyProperty>
</includeOnlyProperties>
</configuration>
</plugin>
...
</plugins>
</build>
...
</plugins>
</build>
2) Get the value via Thymeleaf
<head th:with="abbrev=${@environment.getProperty('git.commit.id.abbrev')}">
<head th:with="abbrev=${@environment.getProperty('git.commit.id.abbrev')}">
Sunday, August 19, 2018
Strange blue border in MapView of ArcGIS JS 4
Starting from ArcGIS JS 4.x, under some special conditions, the MapView will have a blue border when the MapView is focus, who genius get this geneless idea?
To get rid of this stupid box, style the following:
.esri-view-surface--inset-outline::after {
outline: none !important;
padding: 0px !important;
}
So when this stupid design will come out? When ever your HTML got the following conditions, that stupid box will be shown when MapView is on focus:
body {
margin: 0;
}
#mapDiv {
width: 100%
}
... The most weird API ever encountered
To get rid of this stupid box, style the following:
.esri-view-surface--inset-outline::after {
outline: none !important;
padding: 0px !important;
}
So when this stupid design will come out? When ever your HTML got the following conditions, that stupid box will be shown when MapView is on focus:
body {
margin: 0;
}
#mapDiv {
width: 100%
}
... The most weird API ever encountered
Friday, July 20, 2018
Updating graphic in ArcGIS JS 4.x GraphicsLayer
Esri still don't have a clue on how to modify a graphic in GraphicsLayer directly at version 4.8.
You still need to clone the graphic, remove the existing one, and add the new one to realize the modification.
Ref:
https://developers.arcgis.com/javascript/latest/guide/functionality-matrix/index.html#graphicslayer
Stone age API.
Friday, April 27, 2018
Android: get resource ID from resource name
That's a nice resource:
https://stackoverflow.com/questions/3476430/how-to-get-a-resource-id-with-a-known-resource-name
Thursday, April 19, 2018
QEMU references
QEMU is a quick and clean solution for emulation. However, when compare to its alternatives like Virtualbox, it requires much more attention on its settings and tweak in order to get things work. The followings are some nice resources to make our life easier with that tool:
Wednesday, March 7, 2018
Map server URL with query parameters in ArcGIS JS 4.6
Starting from ArcGIS JS 4.6, the map server URL should not have any query parameters. Any query parameters exists in the map server URL will be removed.
To handle this issues, you can override the urlUtils.removeQueryParameters() as below
require(["esri/core/urlUtils"], function(urlUtils) {
urlUtils.removeQueryParameters = function(a){
return a;
};
});
But somehow that's a bad trick. A better way is to use the TileLayer._set() to get rid of the parameters stripping action when setting the URL. i.e.
TileLayer._set('url', 'map_server_url')
To handle this issues, you can override the urlUtils.removeQueryParameters() as below
require(["esri/core/urlUtils"], function(urlUtils) {
urlUtils.removeQueryParameters = function(a){
return a;
};
});
But somehow that's a bad trick. A better way is to use the TileLayer._set() to get rid of the parameters stripping action when setting the URL. i.e.
TileLayer._set('url', 'map_server_url')
Using Proxy with ArcGIS JS
For servers without CORS enabled. We can use proxy mechanism to access the services.
This is done by modifying the proxy.ashx.
You can also add any parameters before sending the request to the actual server.
More references could be found at:
https://developers.arcgis.com/javascript/latest/guide/proxies/index.html
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( ) ...