Friday, July 19, 2019

Conflict between pandas 0.25.0 and pandas-datareader 0.7.0

For Python users, there is a conflict between "pandas 0.25.0" and "pandas-datareader 0.7.0".

If you do an "from pandas_datareader import data", you will got a conflict:

    "ImportError: cannot import name StringIO from pandas.compat"

To get rid of this issue, use "pandas 0.24.2" + "pandas-datareader 0.7.0" instead.

Wednesday, May 8, 2019

Linux mounted NTFS partition as read-only suddenly

Sometimes in dual boot system (Windows / Linux), the NTFS partitions might have some problem causing the Linux mounted the NTFS partitions as read-only. To solve this problem, one might try following to see if it works:


Step 1: Unmount the partition first

This can be done via Disks application OR command line:
  • e.g. umount -v /dev/sda1

Step 2: Run ntfsfix on the target partition
  • e.g. sudo ntfsfix /dev/sda1


If the command is successful, the following output should be shown:
  Mounting volume... The disk contains an unclean file system (0, 0).
  Metadata kept in Windows cache, refused to mount.
  FAILED
  Attempting to correct errors... 
  Processing $MFT and $MFTMirr...
  Reading $MFT... OK
  Reading $MFTMirr... OK
  Comparing $MFTMirr to $MFT... OK
  Processing of $MFT and $MFTMirr completed successfully.
  Setting required flags on partition... OK
  Going to empty the journal ($LogFile)... OK
  Checking the alternate boot sector... OK
  NTFS volume version is 3.1.
  NTFS partition /dev/sda1 was processed successfully.

Step 3: Remount the partition

    The partition should be read-write enabled






Tuesday, January 8, 2019

NFC notes on NDEF message for URL

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, December 18, 2018

Spring Boot Application Properties List

The list of Spring Boot Application Common Properties:

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>
      <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>


2) Get the value via Thymeleaf

   <head th:with="abbrev=${@environment.getProperty('git.commit.id.abbrev')}">

Monday, August 20, 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




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:

Upgrade nodejs in conda (from v18 to v26)

If your conda env is nodejs v18, doing a conda install nodejs=26 is likely to create a lot of conflict. Consider remove those conflicting p...