Monday, July 6, 2015

Sublime package control for Windows

Sublime is a popular editor. As many people already noticed that the following link provides a good introduction and tutorial for the power of Sublime. Because the instructor is using Sublime in MacOSX, therefore the video screen casting is more MacOSX user intuitive. Especially for package control for Windows users, which is the fundamental part for episodes after 2.9.

As we noticed the most popular package control for Sublime is: wbond (https://packagecontrol.io/installation), with the instruction for manual installation as below:

  1. Click the Preferences > Browse Packages… menu
  2. Browse up a folder and then into the Installed Packages/ folder
  3. Download Package Control.sublime-package and copy it into the Installed Packages/ directory
  4. Restart Sublime Text

But I found the step 2 and step 3 is actually not accurate for Windows.

  • For step 2 we could just ignore, in Windows, the folder you opened from step 1 is where you would like to put your package control in.
  • For step 3, after we download, you would like to release the zip file into a folder called "Package control" and copy that folder into step 1 opened location

Tuesday, May 20, 2014

Come back note and How to set GIT url password with special character

Haven't written a blog for a long time since I joined Microsoft. But I still believe, blog is a good place to share my learning and do potential benefits to other people. Let more people to have shorter learning curve as what I did. : ) 

Since I moved to Seattle, a lot has been changed in my life, therefore, this blog will not only about techniques, but also some home owner saving and maintenance tips as well. 

Hope everyone could enjoy. 

As a small benefits, sharing a a small hint, if you don’t know that already. :) 

Every time we push or pull in Git Command Line, we need to type in our username and password, this would be less desirable for us. Especially in windows, there is no out-of-box supporting for SSH for GIT. Therefore, using HTTPS could be a good alternative. 

For example in OpenCV, type in the following command line in Git we could set up the automation.  

git remote set-url origin https://username:password@github.com/username/opencv.git

But our issue is that some password may have special characters, such as #, $, @, this will break the url flow. The solution is just replace these special characters with url  encoding, (http://www.w3schools.com/tags/ref_urlencode.asp)

As an example, username: blastevil and password: blastevil@2014, the Git command line should be:  (@ in url encoding is %40)


git remote set-url origin https://blastevil:blastevil%402014@github.com/blastevil/opencv.git

Friday, January 10, 2014

How to find your Outlook 365 SMTP, POP and IMAP settings

Recently, I was attempting to send automatic emails through Python smtplib. It requires your email account's SMTP Server:

For google, it is: smtp.google.com:587

For you outlook office 365 account, you could find them through the following steps:

outlook.office365.com, log into your account.
On the right upper corner select Option,
On your account page you would see the link of " Setting for POP and IMAP"
There, you could see all your SMTP, POP and IMAP settings

Thursday, September 12, 2013

How to redefine / re-map keyboard in Windows

  In real life you may have some very inconvenient keyboard, or some applications may prefer
very frequently used keys for a very weak finger (such as Cntl in Emacs v.s Cntl is usually assign to you little finger).

  In Mac OSX you could easily reassign the keys in system administrator. But for Windows the original system does not provide such interface. There were some tool on the website you could easily find and use to modify the mapping. But if you want to map whatever you want and control everything by yourself. You may want to have a look at this blog.

  The following two links has provide useful introduction on how to modify the mapping through  Windows register. But they may not be very fully correctly. That's why I post this blog.
 
  Links:
  1. Download scan code reference from:
     http://msdn.microsoft.com/en-us/library/windows/hardware/gg463372.aspx
  2. Follow the instruction to change the register keys:
     http://www.howtogeek.com/howto/windows-vista/disable-caps-lock-key-in-windows-vista/

  Detailed Process:
 
  1. Find the related scan code file from the previous link 1 around page 33
     For example:
     Right Alt(scan 1 make) => E0 38
     Left Cntl(scan 1 make) => 1D    
  2. According to the instruction on previous link 2:
     Make from Right Alt => left Cntl should be (Scancode Map):
    
     0000 0000 0000 0000 0200 0000 1D00 38E0
     0000 0000
    
     There are two points need to notice:
     1. E0 38 should be reverse order as: 38 E0
     2. 1D    is actually short for 00 1D. Then revert the order in 8bit into 1D 00

  3. Generalizations
     The following three mappings:
     1. Right Alt => Left Cntl
     2. Right Win => Left Cntl
     3. Insert    => Nothing (0000)
    
     0000 0000 0000 0000 0400 0000 1D00 38E0
     1D00 5CE0 0000 52E0 0000 0000

Thursday, May 9, 2013

Progress bar for Console program

During processing a bunk of computation, people always eager to know how far from finish. The progress bar is exactly design for it.

Console program does not support those fancy GUI, therefore something like below might be preferred.

[======>                    ] 37%

The following code should be able to help you accomplish it.
Generally speaking, you could call this function as below:
PS:
You could also get access to this code at: https://gist.github.com/lbl1985/5552400
It is also part of my toolbox_c at: https://github.com/lbl1985/toolbox_c

Wednesday, May 8, 2013

Could not open Video in Windows with OpenCV precompiled dlls

Issue as described in the title. 
The reason is simple, the system need opencv_ffmpeg2**.dll to read video. Just add the bin folder into system path, or directly copy this .dll file into the folder where the executable file generated.

Thursday, April 18, 2013

armadillo to other data format conversion

Armadillo is a C++ linear algebra library, especially for computer vision application.

Armadillo is more similar to MATLAB with decent performance. (check http://nghiaho.com/?p=1726 for comparison).

We may want to cooperate Armadillo with OpenCV, STL or FFTW. In this blog the conversion between STL and OpenCV will be described.

1. armadillo to STL vector
2. Armadillo to OpenCV, Since OpenCV data is saved in row-wised, and armadillo data is saved in column-wised, therefore, when we convert the data, we may need to do transformation at first. The following is the sample code.
3. OpenCV to Armadillo

4. STL 2D vector (vector<vector<T> >) to Opencv cv::Mat 2D matrix
Hope these could be helpful for some one is seeking the answer~~



prettify