[Software] Pencil Project

Web developers can try the Pencil Project. It offers not only a GUI to design the webpages, but also exports all of the webpages to a single web page. These features help you a lot to present your designed pages for customers.
Official Site: http://pencil.evolus.vn/

Posted in Software, Web Design | 870 Comments

[eID] The short survey of electronic ID cards.

[Chinese]
根據新版台灣國民身分證的新聞報導[1],大部分人會擔心這類措施的相關問題。像是:

  1. 為什麼我們政府要遵循國際民航組織ICAO(International Civil Aviation Organization)的標準呢?
  2. 為什麼機讀碼這麼像中國政府的台胞證形式呢?

我在此做了一些關於電子身分證(electronic ID, eID)的研究:

ICAO的策略目標強烈地與United Nations Sustainable Development Goals (SDGs)做連結,滿足17項中的13項。包含了確保健康的生命、達到性別平等、建立彈性的基礎設施、確保可承受的消耗與產製樣式、降低國與國之間的不平等性等等。[2]
為了達到這些目標,其中的一個解決方案是推動可機讀旅行文件,稱為ICAO Doc 9303.[3]

為什麼ICAO Doc 9303這麼重要?因為它可讓機器容易讀取你的個人資訊,包含姓名、出生日期、出生地與其他欄位。為了保護這些隱私資料,一系列的安全措施也被採用 (請見[3] 的Part 11與Part 12)。

為了建立eID,德國的新版身分證也採用ICAO Doc 9303 [4]。(事實上,它採用其他方案 ISO/IEC standard 14443 [5],但也使用ICAO Doc 9303的部分標準[6])

這就是為何我們政府聲稱eID遵循ICAO的國際規範。

另一個問題:「為什麼機讀碼這麼像中國政府的台胞證形式呢?」
可機讀護照(Machine Readable Passport, MRP)採用可機讀區域(Machine Readable Zone)來讓機器輕易讀取[7][8],這樣的措施也被德國、義大利等國的身分證採用,新式身分證也採用類似的編碼方式。這就是為何新版台胞證有類似的機讀碼。

更多的eID趨勢,可以參見科技新報的報導[9]。

[English]
According to the news of electronic ID card for Taiwanese [1], most of people wonder the problems of this measure. Some problems arises:

  • Why does our government follow the standard of ICAO(International Civil Aviation Organization)?
  • Why is the machine readable code very similar to that of Taiwanese citizen card which China provided?

I make a short survey on the specification of electronic ID card (abbreviate eID).

ICAO’s strategic objective strongly linked to 13 of the 17 United Nations Sustainable Development Goals (SDGs) proposed. Those include ensuring healthy lives, achieving gender equality, building resilient infrastructure, ensuring sustainable consumption and production patterns, reducing inequality among countries and so on.[2]
For achieving these goals, one of the solution is to promote Machine Readable Travel Documents, called ICAO Doc 9303.[3]

Why is the ICAO Doc 9303 important? Because it can let machines easily read your personal information including name, birthday, born town and other fields. For protecting the private data, a series of security measures are adopted. (See Parts 11 and 12 in [3].)

For creating eID cards, ICAO Doc 9303 is one of the solution for German new ID card [4]. (Actually, it adopts another solution called ISO/IEC standard 14443 [5] but also uses part of the specification of ICAO Doc 9303 [6]).

That’s why our government say that the new ID card can be compatible with international specification – ICAO.

The other question: “Why is the machine readable code very similar to Taiwanese citizen card which China provided?”

The machine readable passport (MRP) should use a machine readable zone (MRZ) to let machine easily read the information [7][8] which is also adopted by multiple eID cards like German, Italian and so on. The Taiwanese citizen card provided by China use the similar encoding method. That’s why the new Taiwanese use the MRZ for machines.
As aforementioned, the security is also ensured.
For further trend of eID, please refer to the post of TechNews.[9]

References

  1. 仝澤蓉, “新版身分證樣式曝光 將採中英對照,”  聯合財經網 [Online]. Available:  http://goo.gl/HHKvWx
  2. ICAO, “ICAO and the United Nations Sustainable Development Goals,” ICAO [Online]. Available:http://www.icao.int/about-icao/aviation-development/Pages/SDG.aspx
  3. ICAO, “Machine Readable Travel Documents,” ICAO [Online] Available: http://www.icao.int/publications/pages/publication.aspx?docnum=9303
  4. Moritz Horsch, Johannes Braun and Alex Wiesmaier, “Mobile eID application for the German identity card,” Technische Universität Darmstadt, Technical Report [Online]. Available: https://www.cdc.informatik.tu-darmstadt.de/reports/TR/Mobile_eID_app_for_the_German_ID_card.pdf 
  5. “ISO/IEC 14443,” Wikipedia [Online]. Available: https://en.wikipedia.org/wiki/ISO/IEC_14443
  6. “National identity cards in the European Economic Area,” Wikipedia [Online]. Available: https://en.wikipedia.org/wiki/National_identity_cards_in_the_European_Economic_Area
  7. “Machine-readable passport,” Wikipedia [Online] Available: https://en.wikipedia.org/wiki/Machine-readable_passport#Official_travel_documents 
  8. “可機讀護照,” Wikiwand [Online] Available:http://goo.gl/iG87tf
  9. Sanada Yukimura, “台灣新版晶片身分證 2017 年上路? 看全球 eID 趨勢,” 科技新報 [Online] Available: http://technews.tw/2015/05/11/taiwan-eid-2007/ 
Posted in eID, ICAO, Security, 科技, 軟體(Software) | 3 Comments

[Docear4Word] The beta version for fixing bugs on displaying reference list.

Today, I downloaded the source code of Docear4Word with version 1.23 in order to fix the bug I reported in my previous post.
After struggling a while, the improvement is done.
Please visit my created repository here. (URL: https://github.com/allen501pc/Docear4Word )

Posted in Docear, Docear4Word | 6 Comments

[Docear4Word] Fix the bug from Docear4Word that doesn’t display URL in IEEE-with-URL style.

Docear is the one of academic literature suites I love. It provides  not only a comprehensive mind map tool but also a reference management tool inherited by JabRef. By using the JabRef’s managed reference results, the extension, Docear4Word , can help us easily add citations and display them with many styles. However, the provided IEEE-with-URL style has a bug on displaying URL.
No matter how URLs  you add, the generated reference list never shows URLs.
That’s because the included ieee-w-url.csl doesn’t add the macro for generating URLs when you use the entry types except webpage. The webpage entry type is not set as default entry types in Docear. That’s why you add any entry types that Docear provided, then the URLs are never displayed!
One  solution is to replace the old ieee-w-url.csl with newer one.
According to Prof. Dr. Artur Lugmayr’s post [1], we just follow these steps:

  1. Open the directory named “C:ProgramDataDocear4WordStyles
  2. Getting the administrator permission, open the file called “ieee-w-url.csl” in the directory.
  3. Replace the whole content with the newer one I put in Github. (mirrored from the git [2] of citation-style-languages) The newer content of this csl is on https://github.com/allen501pc/styles/blob/master/ieee-with-url.csl. Then save it!

Docear是我喜愛的學術文獻整理套件之一。它提供了全面性的心智圖以及基於JabRef的參考文獻整理工具。其外掛 Docear4Word 藉著使用JabRef的整理文獻結果,幫助我們輕易地加入文獻參考與展現不同風格的參考文獻。然而,提供的IEEE-with-URL風格在輸出URL時,存在著一個臭蟲。
無論您如何加入URL,產生的文獻列表卻從不顯示這些URL。這是因為內建的ieee-w-url.csl 除了webpage這個entry type以外,並無產生URL的巨集。而webpage這個entry type卻沒有成為Docear的內建entry type。這就是無論你怎麼在Docear提供的entry type加入URL,這些URL卻從未顯示。
解決之道是替換掉舊的ieee-w-url.csl。根據Prof. Dr. Artur Lugmayr的貼文[1],我們只要遵循以下步驟即可:

  1. 開啟 C:ProgramDataDocear4WordStyles 目錄。
  2. 在此目錄中,以管理者權限開啟ieee-w-url.csl檔案。
  3. 到本人提供的Gibhubhttps://github.com/allen501pc/styles/blob/master/ieee-with-url.csl 取得該新版的內容格式,替換掉舊的(該內容格式是由Citation-Style-Languages的Github [2]鏡射而來。)

    References
    [1] Prof. Dr. Artur Lugmayr, “Professional and free referencing software,” [Online] Available: http://artur-lugmayr.blogspot.tw/2013/09/professional-free-referencing-software.html
    [2] CitationStyles.org, “Official repository for Citation Style Language (CSL) citation styles,” [Online] Available: https://github.com/citation-style-language/styles

    Posted in Docear, 學術研究 | Leave a comment

    Solve the problem of Causing IIS Express Slow Down

    [Chinese/中文]
    最近我的Visual Studio 2013內建的IIS Express 實在跑太慢了,而且常常回報無服務回應的錯誤。根據此條目,看起來像是logger元件出問題。
    為了解決此一問題,我們可以嘗試以下步驟:
    1. 用系統管理員權限開啟命令提示字元視窗 (cmd console)
    2. 輸入以下指令
      (1) cd  %systemroot%system32inetsrv
      (2) appcmd set config /section:urlCompression /doStaticCompression:True
      (3) appcmd set config /section:urlCompression /doDynamicCompression:False
      (4) appcmd set config /section:httpLogging /dontLog:True

    [English]
    Recently, my Visual Studio 2013’s built-in IIS Express runs too slower and it often reports errors about no service response.
    According to the thread, it seems logger component of IISExpress broken.
    To fix the problem, we can try the following steps:
    1. Open a cmd console with Administrator permission.
    2. Type the subsequent commands:
      (1) cd  %systemroot%system32inetsrv
      (2) appcmd set config /section:urlCompression /doStaticCompression:True
      (3) appcmd set config /section:urlCompression /doDynamicCompression:False
      (4) appcmd set config /section:httpLogging /dontLog:True

    Reference

    1. Mike Volodarsky, “Getting Start with Appcmd.exe”, Microsoft Developer Network. URL: http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe
    2. “VS 2013 Professional – Web Dev Server (IIS Express) is very slow”, Microsoft Developer Network. URL: https://social.msdn.microsoft.com/Forums/en-US/8e42baa5-38c7-4fef-b120-b0dd22ba8228/vs-2013-professional-web-dev-server-iis-express-is-very-slow?forum=visualstudiogeneral
    Posted in visual studio, Windows, 程式設計, 網路, 軟體(Software) | Leave a comment

    Resource Scheduler , Calculator, Short-Circuit in Hadoop YARN and HDFS

    In order to execute the next-year plan, I search the research topics and technologies in Hadoop YARN and HDFS, then make a note as follows:

    Since Hadoop YARN was proposed, the new generation technology are continusly discussed. For knowing the work of YARN, please refer to the post [1].
    The capacity scheduler of YARN[2][3] provides a default capacity scheduler, org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler [4], to let hadoop eco-system manipulates its’ resources. It also provides resource calculator, org.apache.hadoop.yarn.util.resource.DefaultResourseCalculator [5], to calculate the memory usage, the disk usage and the cpu usage of each compute node.
    For those system administrators and developers who are curious about the operations of resource allocation and the scheduler, please see the reports [6], [7] and [8].
    In scientific area, Project HaSTE [9] proposed a new Hadoop YARN scheduling algorithm, which aims at efficiently utilizing the resources for scheduling map/reduce tasks in Hadoop YARN and improving the makespan of MapReduce jobs.

    On the other hand, HDFS [10] is a usually used file system in Hadoop. However, it needs TCP socket connection to read/write data. Due to this reason, the IO performance will be lower than directly reading from local disk without network connection. Therefore, HDFS provides a function called HDFS Short-Circuit Local Reads [11] and also provides a native libaray to directly access the HDFS file system. According to the report [12], the I/O performance of using Short-Circuit is better than TCP.
    ps. The other tricky technology to improve the I/O performance of HDFS is to use CombineFileInputFormat [13][14]. But I don’t think this method is better than using Short-Circuit.

    Reference

    1. Karthik Kambatla, Wing Yew Poon, and Vikram Srivastava, “How Apache Hadoop YARN HA Works,” Cludera. Available: [Online] http://blog.cloudera.com/blog/2014/05/how-apache-hadoop-yarn-ha-works/
    2. Hadoop, “Haddop MapReduce Next Generation – Capacity Scheduler”, Apache Hadoop. Available: [Online] http://hadoop.apache.org/docs/r2.5.2/hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html#Configuration
    3. skyWalker_ONLY, “Hadoop-2.4.1学习之容量调度器”. Available: [Online] http://blog.csdn.net/skywalker_only/article/details/41351147
    4. GrepCode, “CapacityScheduler”, GrepCode.com. Available: [Online] http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hadoop/hadoop-yarn-server-resourcemanager/2.6.0/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java/
    5. GrepCode, “ResourceCalculator”, GrepCode.com. Available: [Online] http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hadoop/hadoop-yarn-common/2.6.0/org/apache/hadoop/yarn/util/resource/DefaultResourceCalculator.java/
    6. Vinod Kumar Vavilapalli, “Resource Location in YARN: Deep Dive,” Hortonworks. Available: [Online] http://hortonworks.com/blog/resource-localization-in-yarn-deep-dive/
    7. SEQUENCEIQ, “YARN Schedulers demystified – Part 1: Capacity.” Available: [Online] http://blog.sequenceiq.com/blog/2014/07/22/schedulers-part-1/
    8. SEQUENCEIQ, “YARN Schedulers demystified – Part 2: Fair.” Available: [Online] http://blog.sequenceiq.com/blog/2014/09/09/yarn-schedulers-demystified-part-2-fair/
    9. Bo Sheng, “Project HaSTE: Hadoop YARN Scheduling Based on Task-Dependency and Resource-Demand,” The 7th IEEE International Conference on Cloud Computing, Anchorage, AK, June 2014.  Available: [Online] http://www.cs.umb.edu/~shengbo/research/haste.html
    10. Hadoop, “HDFS User Guide,” Apache Hadoop. Available: [Online] http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html#Related_Documentation
    11. Hadoop, “HDFS Short-Circuit Local Reads,” Apache Hadoop. Available: [Online] https://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html
    12. Colin McCabe, “How Improved Short-Circuit Local Reads Bring Better Performance and Security to Hadoop,” Cloudera. Available: [Online] http://blog.cloudera.com/blog/2013/08/how-improved-short-circuit-local-reads-bring-better-performance-and-security-to-hadoop/
    13. Dhruba Borthakur, “HDFS block replica placement in your hands now!” Available: [Online] http://hadoopblog.blogspot.de/2009/09/hdfs-block-replica-placement-in-your.html
    14. Hadoop, “Class CombineFileInputFormat<K,V>”. Available: [Online] http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapred/lib/CombineFileInputFormat.html
    Posted in hadoop, Java, Programming, 學術研究, 程式設計 | Leave a comment

    艾倫查字典已經更新

    Dear all,

    I’ve updated this plugin called “艾倫查字典”. Please download or update it from here.
    I also published the source code on Github, developers who are interested in can fork or download its’ source code from https://github.com/allen501pc/AllenDictionary

    Best regards,

    Posted in 未分類 | 1 Comment

    Process SequenceFile without Enabling Hadoop Platform

    Recently I got a requirement for reading Hadoop’s SequenceFile without enabling Hadoop Platform. However, most examples introduce the read/write SequenceFile with Hadoop Platform. How do I read such files without hadoop?
    There’s a tricky solution in this case.
    1. Download Hadoop binary file from hadoop site. For Linux/Unix please directly download it; for Windows, there’s pre-built archive file – hadoop-common-2.2.0-bin (source code is here) , created by Abhijit Ghosh.
    2. Set environment variable HADOOP_HOME by the directory path (suppose the directory is /usr/local/hadoop in Unix ; or C:/hadoop-common-2.2.0-bin in Windows)
    3. Append $HADOOP_HOME/bin to the end of environment variable PATH. ( i.e. /usr/local/hadoop/bin in Unix ; or C:/hadoop-common-2.2.0-bin/bin in Windows
    4. Write your program like this (Notice that you have to download hadoop-common-2.2+):

    import java.io.IOException;
    import java.net.URI;
    import java.net.URISyntaxException;
    import java.net.URLEncoder;

    import org.apache.hadoop.conf.Configuration;
    import org.apache.hadoop.fs.FileSystem;
    import org.apache.hadoop.fs.Path;
    import org.apache.hadoop.io.SequenceFile;
    import org.apache.hadoop.io.Text;
    import org.apache.hadoop.util.ReflectionUtils;

    public class ProcessSequenceFile {

    public static void readSequenceFile(String sequenceFileName) throws IOException, URISyntaxException {
    Configuration conf = new Configuration();
    String directoryPath = "file:///";
    directoryPath = URLEncoder.encode(directoryPath, "UTF-8");
    FileSystem fs = FileSystem.get(new URI(directoryPath),conf);
    Path file = new Path(fs.getUri().toString() + sequenceFileName);
    @SuppressWarnings("deprecation")
    SequenceFile.Reader reader = new SequenceFile.Reader(fs, file, conf);
    Text key = (Text) ReflectionUtils.newInstance(reader.getKeyClass(), conf);
    Text value = (Text) ReflectionUtils.newInstance(reader.getValueClass(), conf);
    while(reader.next(key,value)) {
    System.out.println("Key:" + key);
    System.out.println("=================");
    System.out.println(value);

    }

    }

    public static void main(String[] args) {
    try {
    // If args[0] is the SequenceFile we need to read.
    readSequenceFile(args[0]);
    } catch (IOException | URISyntaxException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }
    }

    Enjoy it!

    Reference:
    1. Gnosis Runmination, “WIN7下运行hadoop程序报:Failed to locate the winutils binary in the hadoop binary path.” Available: [Online] http://www.cnblogs.com/zq-inlook/p/4386216.html
    2. StackOverFlow, “Running Apache Hadoop 2.1.0 on Windows”. Available: [Online] http://stackoverflow.com/questions/18630019/running-apache-hadoop-2-1-0-on-windows
    3.  Abhijit Ghosh, “ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path,” SrcCodes.com. Available: [Online] http://www.srccodes.com/p/article/39/error-util-shell-failed-locate-winutils-binary-hadoop-binary-path
    4. Hadoop, “Native Libraries Guide.” Available: [Online] https://hadoop.apache.org/docs/r2.6.0/hadoop-project-dist/hadoop-common/NativeLibraries.html#Native_Hadoop_Library

    Posted in hadoop, Java, Programming, 程式設計 | Leave a comment

    Allen查字典故障一事

    各位使用者好。上架許久的Allen查字典外掛,最近好像故障了。我目前著手修正中,看能不能趕在周六以前修正完畢,請耐心等候。謝謝!

    Posted in browser, chrome, Programming, 程式設計 | 2 Comments

    Explore Your Passwords Stored in Chrome Browser

    • Google Chrome provided a service which stored people’s accounts and passwords. In past versions of Chrome, it put these private information at the file with path  C:Users<User>AppDataLocalGoogleChromeUser DataDefaultWeb Data on Windows platform. Currently it changed this file path to C:Users<User>AppDataLocalGoogleChromeUser DataDefaultLogin Data. [1] Both these files are stored in SQL Lite format [2].
      This file stores users’ private information including the following fields [1]:
    • Origin_URL : Base URL of website.
    • Action_URL: Login endpoint of the website.
    • Username_element: name of user name field from the website.
    • Username_value: Actual username.
    • Password_element: Name of the password field in the website.
    • Password_value: Actual password value. (encrypted.)
    • Date_created: Time of this password be stored.
    • Blacklisted_by_user: 1 or 0 for representing this website in blacklist or not.

    All fields except Password_value are stored by plain text. On Windows platform, it uses DPAPI [3][4] to encrypt/decrypt Password_value. DPAPI gets keys from users’ logon password or a specified key based on Windows user’ profile. That means, crackers cannot easily crack your stored password on their own platform while they remotely got your Login Data. On Windows 7, DPAPI provided AES256 as an encryption algorithm and SHA512 as a hash algorithm to protect your secrect.

    After knowing the protection strategy in Chrome, it’s very easy to retrieve user passwords. To my best knowledge, these two projects can retrieve user passwords stored by Chrome.
    1. Chrome Password Dump.
    2. Chrome-passwords. (Open Source)

    Additionally, the security of this proection for Chrome’s autofill function is very weak. Please see the following video and you will find the reason.

    Reference
    [1] Security, “Exposing the Password Secrets of Google Chrome.” Available:[Online] http://securityxploded.com/googlechromesecrets.php
    [2] SQLite, “SQLite.” Available:[Online] https://www.sqlite.org/
    [3] Passcape Software, “DPAPI Secrets. Security analysis and data recovery in DPAPI.” Available: [Online] http://www.passcape.com/index.php?section=docsys&cmd=details&id=28
    [4] OBVIEX, “How to encrypt and decrypt data using DPAPI in C# or VB.NET.” Available:[Online] http://www.obviex.com/samples/dpapi.aspx

    Posted in 未分類 | 1 Comment