跳至主要内容

博文

using org2jekyll for blog publishing

switch to org2jekyll package from homegrown solution For some time, I was using the `autoinsert’ function to prepare Jekyll post. I have the following auto-insert define in my .emacs, so whenever I create a new markdown file in Jekyll ` post ` directory it prompts me for the Jekyll header. (define-auto-insert '("\\.markdown" . "Jekyll Markdown Post") '("TITLE: " "---\nlayout: post\ntitle: " str "\ndate: " (format-time-string "%Y-%m-%d %H:%m:%S %z") "\ncategories: " ("CATEGORY: " str " ") -1 "\n---\n" _ "\n") t) It turns out the procedure is too error prone. I got into various error (filename convention, markdown syntax, etc.) many times when trying to publish my post. Today I have the org2jekyll setted up, all steps need to publish a jekyll post is now simplified to: M-x org2jekyll-create-draft Anwser the questions as usual for Jekyl...

Enabling Native Acceleration for MLlib

The undefined symbol issue Got onto the ship of machine learning. And soon I hit the wall of `undefined symbol issue’ on lab cluster. Hi, it just the simple `MinMaxScaler’ example code published on spark MLlib(Machine Learning) guide!! Everything goes well until the last line `scaledData.show()`, boom. Spark-shell died with the following message on the console: /usr/java/jdk1.7.0_67-cloudera/bin/java: symbol lookup error: /tmp/jniloader82069440205403545netlib-native_system-linux-x86_64.so: undefined symbol: cblas_daxpy NO log. NO history server record. Nothing could be used for debug as first glance. Solution (Wrap up) My solution is based on CDH 5.11.0 (parcel) plus cloudera GPLExtra (parcel) plus Intel MKL library (parcel). The steps to enable MKL native acceleration for cloudera spark should be as simple as: Install `netlib-java` by integrate GPLExtra parcel as described in the Enable Native Accerleration For MLlib Install MKL library parcel by follow the Download Intel Ma...

Cross SDK is python26 incompatible

As Title While this is supposed to be true, at a glance of the error message. It is really difficult to find a community prof in mail/forum-loop. Note if I come back in the future. The error message [root@GitGSC chromiumos]$ cros_sdk Traceback (most recent call last): File "/opt/chrome/ChromiumOS/chromite/bin/cros_sdk", line 77, in <module> from chromite.lib import commandline File "/opt/chrome/ChromiumOS/chromite/lib/commandline.py", line 26, in <module> from chromite.lib import constants File "/opt/chrome/ChromiumOS/chromite/lib/constants.py", line 410 'ARM_USERDEBUG', ^ SyntaxError: invalid syntax The google group thread talking about python version things Bernhard, The “cros_sdk” script uses shebang “/usr/bin/python2” (see chromite/bin/cros_sdk). Perhaps that’s why /usr/bin/python is always invoked. You’re pretty much on your own out there, though. I do not think we want to go back t...

Ovftool is a must have for ESXi user

When download a sample VM image Today, to kick-start my cloudera learning journey, I finally downloaded a cloudera getting started image from cloudera official site. Well this image is not so huge, I still don’t have much space to store it on my local machine. As I have a ESX host siting several cubes away from my seat. I decide to upload the image to the host and run from there. Import a VM to ESX After play around the ESX client for some minutes, I find that I can only import an OVF or OVA image. Upload VM to ESX storage directly Alternatively, one have to upload the whole VM image by using the storage manager, then try to add the vmx file to inventory from there. As said, and sad, the image is a bit big, my VM image upload process end up successful, but the VM added from storage manager failed to start up. An error of “can not find vmdisk xxxx” with a mysterious vmdk filename showing up. Convert and then import, in one STEP The last solution for me to upload the image...

Generate markdown document from tableau project

Just survived from a multiple tableau integrated project, the project was not very well planned. So as a result, I have to provide some tableau project detail information document afterwards. Recorded every tableau projects’ data source connection, table relation and delivered location setting requires someone to open the project both on tableau desktop and tableau server. As tableau TDS file is actually just an XML file, to avoid the boring part, I came out following two simple XML style sheet for document generation. < xsl:stylesheet xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" version= "2.0" > < xsl:output method= "text" /> < xsl:strip-space elements= "*" /> < xsl:key name= "menu" match= "tableauwb" use= "@name" /> < xsl:template match= "/" > < xsl:text ># </ xsl:text > < xsl:value-of select= ...

Adobe Document Cloud not in Chinese UI

Recent days I’ve been reading Erlang related PDF, so I have a chance to write some private notes for later review. As it is a mobile century now, we never work on single device anymore. I would like to sync all my notes and my reading progress across different devices. With some time-consuming googling work finished, I find there’s two ready to be used solution that is able to fulfill my personal needs: Adobe Acrobat Reader DC + Acrobat Reader mobile + Document Cloud Foxit PDF reader + Foxit connected PDF service The result surprised me, because I’ve been using Acrobat Reader DC for about a year now, but never notice it is able to sync anything to Adobe managed cloud storage named Document Cloud. In fact, I’ve been wondering for years why Acrobat Reader renamed as Acrobat Reader DC in recent update and what does that ‘DC’ mean. Now comes to real life practice with the Document Cloud feature. It is wonderful, Acrobat Reader for android is able to manage PDF files in Docume...

Seven Languages in Seven Weeks

This morning, after 10 minutes struggle of do or do not follow the self study section. Just spend several hours of searching, coding and debugging, finally I got the following ruby script that is able to pass the self study excise. diff -r 9efeca9bd507 learning/ruby/acts_as_csv_module.rb --- a/learning/ruby/acts_as_csv_module.rb Tue Feb 07 15:13:11 2017 +0800 +++ b/learning/ruby/acts_as_csv_module.rb Tue Feb 07 15:13:49 2017 +0800 @@ -1,32 +1,90 @@ module ActsAsCsv + def self.included(base) base.extend ClassMethods end + module ClassMethods + def acts_as_csv include InstanceMethods end + + def acts_as_enumerable + include Enumerable + end end + module InstanceMethods + def read @csv_contents = [] filename = self.class.to_s.downcase + '.txt' file = File.new(filename) - @headers = file.gets.chomp.split(', ' ) + CsvRow.headers = file.gets.chomp.spl...