Sunday, June 7, 2015

BB Flashback setting for Youtube Video

Click on Tools>Options in Tools Options

Display (One Time Setting)
Checked the following options:
"Switched off windows graphics effects"
"Disable the "show window contents while dragging option"
"Change resolution when recording" (1280x720)

Use the following options when Exporting Video:
1. Choose AVI
2. Under XviD MPEG-4 Codec, Choose COnfigure [Can download it here:https://www.xvid.com/download/]
3. Click on "Target quantizer"
4. Type 1500 as bit rate (original is 700)
This is one time setting, after setting, if you choose export, just export it without extra changes.

Saturday, April 25, 2015

How to vectorize your signature with Inkscape

It’s often useful to add your signature to a Word document instead of manually signing the actual paper with one of those pen thingies. Of course, the easiest method is to just sign a piece of paper, scan it, and insert it as an image. It’s simple to do, but because the scanned image is a bitmap it often looks rubbishy and pixellated when you print it or save it as a PDF.
The solution is to create a vector signature that is guaranteed to look fantastic at every scale. There are lots of methods out there. Here’s mine – it uses free software and is quick to do.
1. Sign a piece of white unlined paper. Choose your best, most representative signature, and scan it (400 dpi or so is usually good enough). Here I’m using the signature of a famous personage that I found online, rather than my own embarrassing scrawl.
2. Change the image to grayscale, and adjust the levels – Auto Levels usually does the trick. You can use Photoshop if you have it, but I use GIMP (GNU Image Manipulation Program), which is free and awesome. Get it from www.gimp.org/downloads. Save the signature as a JPG at high quality (95 or so). It should now look more like this:

3.  Open in the file Inkscape (the open source SVG graphics editor). You can download it from inkscape.org/download – it’s also free and awesome.


4. Resize the page to fit your signature (File menu -> Document Properties -> Fit page to selection):




5. Create a vector version of the signature by using the Trace Bitmap function from the Path menu. You can play around with the settings to fine-tune things, but I find I get good results using a single scan, the brightness cutoff method, thresholds at 0.880 and 0.970, and a 2 colour output. Press OK.


6. Your vector image is now sitting on top of your bitmap image, which you no longer need. Delete it by selecting it, moving it to the side, and pressing the delete key.



7. Resize the page to fit your new vector signature (File menu -> Document Properties -> Fit page to selection).


8. Now save it! From the File menu, choose -> Save As -> Enhanced Metafile (.emf).  There are lots of different vector filetypes you can use (.svg for example), but .emf is a good format for inserting into Word.
Then just insert your signature into Word as a picture, making sure the scale is appropriate (this might involve printing it out a few times to check). Make the image sit “in front of text” if you want to allow it to slightly overlie the typed text.
So that’s it! The result looks very professional, prints really well (it looks jet black on a laser printer!), and withstands infinite zooming when it’s in a PDF:





Wednesday, March 4, 2015

Writing Clean Code

I accumulated some reference

1. Put good comments on SVN, like what you want to test.  Retain those code that might be used again in the svn, and delete it from your code to keep it clean.
2. When you want to try a new function, a good way is to create a new class. Not create a new function in the class, that will make the class looks too bloat.
3. When the function is working, congrats keep it for the paper. If not, just delete it (note that the version still contain in SVN).
4. People says read code vs write code, times is 10 vs 1. Can't agree on that more. When you create a new class, try a new algorithm, try to record your idea somewhere (written in comment, if too complex a video). so that you can recall it. When you define a function, comments on its purpose and so on.
5. When trying a parameter, define it at a centre place. Cleaning the parameters once in a while.
6. Should have a rule on variable naming. And be consistent on it.
7. Test-driven development will save you lots of time finding bugs, and recreate the same test case. Write unit-test forefront.
8. Define some common libraries when you are coding, and find yourself code the same thing over and over again. Replace all codes with the libraries code for easiness of maintainence.


Wednesday, February 25, 2015

Ubuntu Packages - How to install gmpy on python

Know about Ubuntu Nickname
It depends on your Version on your Ubuntu, here some version of Ubuntu with their Nickname
Ubuntu 14.10 (Utopic)
Ubuntu 14.04.2 LTS (Trusty)
Ubuntu 12.04.5 LTS (Precise)
Ubuntu 10.04.4 LTS (Lucid)
You can find a more complete reference here
http://releases.ubuntu.com/

Check Ubuntu Version
To check your Ubuntu version
 lsb_release -a

Download your installer according to your Version
I am using precise, so I install it from here
http://packages.ubuntu.com/precise/math/python-gmpy

Search your package here [There is a search engine down the page]:
http://packages.ubuntu.com/

Install the installer
To install a deb package
sudo dpkg -i DEB_PACKAGE
http://askubuntu.com/questions/40779/how-do-i-install-a-deb-file-via-the-command-line

Wednesday, February 11, 2015

Getting Access Denied when accessing application data folder in Windows 7

Problem:
C:\Users\<ME AS ADMINSTRATOR>\AppData\Local\Application Data is not accessible

Those are junction points : hidden, protected operating system files that are not meant to be accessed by users.
Each one points to a user-accessible folder:

Real path is as follows:

Application Data - C:\Users\{user name}\AppData\Roaming
Cookies - C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\Cookies
History - C:\Users\{user name}\AppData\Local\Microsoft\Windows\History
Local Settings - C:\Users\{user name}\AppData\Local
My Documents - C:\Users\{user name}\Documents
NetHood - C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\Network Shortcuts
PrintHood - C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Recent - C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\Recent
SendTo - C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\SendTo
Start Menu - C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\Start Menu
Templates - C:\Users\{user name}\AppData\Roaming
Temporary Internet Files - C:\Users\{user name}\AppData\Local\Microsoft\Windows\Temporary Internet Files

Laptop wake up from sleep after closing the lip

I am using Toshiba Laptop with Windows 7.

Use tips from
http://www.howtogeek.com/122954/how-to-prevent-your-computer-from-waking-up-accidentally/

I turn off
Network adapters/Intel(R) Ethernet Connection I218-LM
Mice and other pointing devices/HID-compliant Mouse

[You could test whether you computer will be turned on with those devices after that]

Saturday, January 10, 2015

How Rainbow Table Works





Objective: 
Given a hash, get back the hash key.
Naive Way: 
1. Too much space - Have all mappings between plaintext and hash key (almost impossible - too large space)
2. Too much time - Trying one by one plaintext and try mapping
Rainbow Table:
Compromise between Space and Time


1.       Find the correct chain – Using the last column
2.       Getting the plain text – Using the first column
3.       1 failed or 2 failed, try again
What if we use R rather than R1,R2,R3?