Showing posts with label Notes. Show all posts
Showing posts with label Notes. Show all posts
Tuesday, January 2, 2018
Passport photo editing
----
au passport 3.75 x 4.75 cm 3.5-4.0 x 4.5 - 5.0cm
head 3.4 cm(3.2 - 3.6)
----
chinese passport
head 28-33mm length 21mm-24mm width
2x2 inches
----
original photo:
head 73.75cm
resolution: 28.346 pixels/cm
28.346*73.75/3.4 = 614.858 pixels/cm
head 69.74
resolution: 28.346 pixels/cm
28.346*69.74/3.4 = 581.426 pixesl/cm
----
New Element size:
614.858 pixels/cm 3.75 x 4.75 cm
New Element size:
581.426 pixels/cm 3.75 x 4.75 cm
----
AU Passport 6 elemetes size:
581.426 pixels/cm 4 x 6 inches
Thursday, October 29, 2015
Tuesday, October 27, 2015
C++ Notes
[1] http://www.cplusplus.com/reference/sstream/stringstream
[2] www.parashift.com/c++-faq/
CONCEPT
--------------
Pure Virtual Function
LIBRARY
------------
setw ( )
stringstream
iostream-vs-stdio
[2] www.parashift.com/c++-faq/
CONCEPT
--------------
Pure Virtual Function
When you have a pointer to an object, the object may actually be of a class that is derived from the class of the pointer (e.g., a Vehicle* that is actually pointing to a Car object; this is called “polymorphism”多态性). Dynamic binding is a result of virtual functions.
LIBRARY
------------
setw ( )
stringstream
iostream-vs-stdio
Monday, October 19, 2015
Git Notes -- Draft
[1] Webcast • The Basics of Git and GitHub • July 2013
[2] Getting-Started-First-Time-Git-Setup
[3] Getting-Started-Git-Basics
[4] Stackoverflow good reading to explain why-do-i-have-to-add-the-files-being-tracked-before-committing
#yum install git-core
Installation-of-git-to-get-lpc32xx.html
How to check is local repo up-to-date
[2] Getting-Started-First-Time-Git-Setup
[3] Getting-Started-Git-Basics
[4] Stackoverflow good reading to explain why-do-i-have-to-add-the-files-being-tracked-before-committing
#yum install git-core
Installation-of-git-to-get-lpc32xx.html
How to check is local repo up-to-date
fetch only synch repo info, but not doing real download
status will tell difference between local repo and remote repo after executing fetch
pull is doing real download
status will tell difference between local repo and remote repo after executing fetch
pull is doing real download
git fetch --dry-run
Friday, October 9, 2015
Tuesday, October 6, 2015
HTML Notes
[1] html_links from w3schools
[2] html tag (anchor point within a page) from w3schools
[3] Syntax Highlighter in Blog
[4] pre tag from w3schools
[4] div
[5] tt
[6] css_selectors via id(unique style), class(common style)
Ref [1] [3]
Ref [2]
Show text in box
[2] html tag (anchor point within a page) from w3schools
[3] Syntax Highlighter in Blog
[4] pre tag from w3schools
[4] div
[5] tt
[6] css_selectors via id(unique style), class(common style)
Ref [1] [3]
- Create anchor via 'id' attribute in html tag
- Add Link to anchor within web page '#tips'
- Add Link to anchor from other page externally 'xxxx.htm#tips'
Useful Tips Section
Visit the Useful Tips Section Visit the Useful Tips Section
Ref [2]
The tag defines a hyperlink, which is used to link from one page to another. In HTML 4.01, the tag could be either a hyperlink or an anchor. In HTML5, the tag is always a hyperlink, but if it has no href attribute, it is only a placeholder for a hyperlink. HTML5 has some new attributes, and some HTML 4.01 attributes are no longer supported.
Show text in box
#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey -cursor_name left_ptr autocutsel -fork lxsession -s Lubuntu -e LXDE
Monday, March 4, 2013
SVN Notes
[1] Thegeekstuff svn-command-examples
Ref
Removing files from SVN repo to synch with local folder
Ref
Removing files from SVN repo to synch with local folder
svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )Adding files from local folder into SVN repo for unversioned files
svn add --force * --auto-props --parents --depth infinity
$ svn checkout/co URL PATH
$ svn co https://www.thegeekstuff.com/project/branches/release/migration/data/cfg /home/sasikala/cfg/
A /home/sasikala/cfg/ftp_user.cfg
A /home/sasikala/cfg/inventory.cfg
A /home/sasikala/cfg/email_user.cfg
A /home/sasikala/cfg/svn-commands
Checked out revision 811.
$ ls /home/sasikala/cfg
. .. .svn email_user.cfg ftp_user.cfg inventory.cfg svn-commands
$ svn commit -m "log messages" $ cat /home/sasikala/cfg/svn-commands checkout commit add delete update status $ ls -l /home/sasikala/cfg/svn-commands -rw-r--r-- 1 root root 41 Apr 16 11:15 svn-commands $ svn commit -m "Making the file empty" svn-commands Sending svn-commands Transmitting file data . Committed revision 813. $ svn list --verbose https://www.thegeekstuff.com/project/branches/release/migration/data/bin 16 sasikala 28361 Apr 16 21:11 README.txt 21 sasikala 0 Apr 18 12:22 INSTALL 22 sasikala Apr 18 10:17 src/ $ svn add thegeekstuff A thegeekstuff $ svn commit -m "Adding a file thegeekstuff" thegeekstuff Adding thegeekstuff Transmitting file data . Committed revision 814. $ svn delete thegeekstuff D thegeekstuff $ svn commit -m "Removing thegeekstuff file" thegeekstuff Deleting thegeekstuff Committed revision 814. $ svn diff filename $ svn -r R1:R2 diff filename $ svn diff thegeekstuff Index: thegeekstuff =================================================================== --- thegeekstuff (revision 815) +++ thegeekstuff (working copy) @@ -1 +1 @@ -testing +tester $ svn status PATH $ svn status /home/sasikala/cfg M /home/sasikala/cfg/ftp_user.cfg M /home/sasikala/cfg/geekstuff $ svn log PATH $ svn log thegeekstuff ------------------------------------------------------------------------ r815 | sasikala | 2011-04-16 05:14:18 -0700 (Sat, 16 Apr 2011) | 1 line Adding a file thegeekstuff ------------------------------------------------------------------------ $ svn move src dest $ svn move thegeekstuff tgs A tgs D thegeekstuff $ ls .# .. .svn email_user.cfg ftp_user.cfg inventory.cfg tgs $ svn update PATH $ svn update A new/usercfg A new/webcfg Updated to revision 819.
Wednesday, September 15, 2010
Vi / Vim Notes
[1] vim.org tagbar plugin
[2] vimawesome.com vim plugin\
[3] linux.com vim-101-a-beginners-guide-to-vim
[4] derickbailey/2010/04/23/using-vim-as-your-c-code-editor-from-visual-studio/
[5] cscope.sourceforge.net/cscope_vim_tutorial.html
qyang@lubuntu-laptop:~$ tree ~/.vim
/home/qyang/.vim
├── autoload
│ ├── acp.vim
│ └── tagbar.vim
├── doc
│ ├── acp.jax
│ ├── acp.txt
│ ├── tagbar.txt
│ ├── tags
│ └── tags-ja
├── plugin
│ ├── cscope_maps.vim
│ └── tagbar.vim
├── plugins
│ ├── acp.vim
│ ├── cctree.vim
│ ├── ming.vim
│ └── qt.vim
├── README.md
└── syntax
├── python.vim
└── tagbar.vim
ming.vim
set showcmd
set ruler
set nocompatible
set ignorecase smartcase incsearch hlsearch
set nowrap
set smartindent
set backspace=indent,eol,start
function Setcohda(...)
set tabstop=2 shiftwidth=2
set expandtab
endfunction
function Setlinux(...)
set tabstop=8 shiftwidth=8
set noexpandtab
endfunction
command Cohda call Setcohda()
command Linux call Setlinux()
autocmd FileType cpp Cohda
autocmd FileType make set noexpandtab tabstop=8
autocmd FileType python set tabstop=4 shiftwidth=4 noexpandtab
noremap :!make
inoremap :!make
qt.vim
------------------------------------
Generate cscope.out on root directory of source code project, then start vim from that root directory. All symbols index in cscope.out can be used by vim now.
Try below to jump straight to the file including 'main' symbol
Insert following code into makefile to generate cscope.out via make.
DISPLAY TAB
---------------------
Not quite work correctly to show all tabs
:SeeTab vim.wikia.com
OPEN MULTIPLE FILES FROM CMD LINE
-------------------------
TURN ON LINE NUMBER
------------------------
:set number
REPLACE A STRING
-------------------
:1,$s/word1/word2/gc IN A WHOLE FILE
:n1,n2s/word1/word2/gc IN BETWEEN LINE 'n1' and 'n2', special character use '\' prefix. (e.g.,:1,$s/word\[/word1\[/gc, replace 'word[' with 'word1[' )
COMMAND MODE
---------------------
'g0' -- go zero, go to head of line;
'g$' -- go to end of line;
'G' -- go to end of this file;
'H' -- go to top of screen;
'M' -- go to middle of screen;
'L' -- go to bottom of screen;
'nG' -- go to line number 'n'
'/word' -- search a string 'word' forward;
'?word' -- search a string 'word' backward;
'nyy' -- yank/copy n lines after cursor;
'p' -- paste yanked contens one line below cursor;
'dd' -- delete current line;
'nd' -- delete n lines after cursor;
DELETE/COPY(YANK) A BLOCK OF TEXT
----------------------------
The ‘mark command can be very useful when deleting a long series of lines.To
delete a long series of lines, follow these steps:
1. Move the cursor to the beginning of the text you want to delete.
2. Mark it using the command ma. (This marks it with mark a.)
3. Go to the end of the text to be removed. Delete to mark a using the command
d’a.
Note:There is nothing special about using the a mark. Any mark from a to z
may be used.
BACK TO PREVIOUSLY VISITED LOCATION previous view
-----------------------------
Ctrl + O
Ctrl + I (tab)
Jumping_to_previously_visited_locations
JUMP TO SYMBOL DEFINITION when ctags/cscope enabled
------------------------------
Ctrl + ]
Ctrl + T
A 05 Vi Exercise
===============================
[1] http://stackoverflow.com/questions/1737163/traversing-text-in-insert-mode
Insert mode and navigation mode switch
----------------------------------------
ESC or Ctrl+[
Navigation Fast
--------------------
15 + h go backward 15 characters
5 + j go forward 5 lines
Ctrl+o + 2 + b navigate two words back without leaving insert mode
Ctrl+o will give you chance to run one vi command at navigation
mode, then return to insert mode automatically.
'+. back to previous editing place after navigation
Type 20 '-' delete backword 9 '-'
----------------------------------------
20 + i + - + ESC
9 + X
'20' set number of execute times
'i' into insert mode
'-' letter or words you want to repeat
'ESC' back to navigation mode will display all insert letters.
'9' set number of exectue times
'X' delete backward, 'x' delete forward
Paste from clip board
-----------------------------------
"+p
" use register
+ clipboard register index
p paste shortcut key
Corret Typo
----------------------
accifently
FfrdA will correct the word from accifently to accidently
'F' find backward 'f' find forward
'f' find letter 'f'
'r' replace current cursor
'd' type correct letter 'd'
'A' back to original edit place
Rewrite word
--------------------
you accidentlly typed
you intentially typed
you intertially typed
ESC + 2 + b + c + w intentially + ESC + A
Write words in multiple lines
--------------------
[2] http://vim.wikia.com/wiki/Inserting_text_in_multiple_lines
hello
hello
hello
hel:added:loappend
hel:added:loappend
hel:added:loappend
hllo hello append
hllo hello append
hllo hello append
Ctrl+v + navigate coursor to 'l' + j + j + j + I + :added: + ESC
Ctrl+v + navigate coursor to 'o' + l + A + Ctrl+R + "
Ctrl+v + select block you want to delete + d
'Ctrl+v' visual block mode.
'I' insert before current cursor in visual block mode.
'A' append after current cursor in visual block mode.
'Ctrl + R + "' past yank register in insert mode
'Ctrl + R + +' past clipboard insert mode.
[2] vimawesome.com vim plugin\
[3] linux.com vim-101-a-beginners-guide-to-vim
[4] derickbailey/2010/04/23/using-vim-as-your-c-code-editor-from-visual-studio/
[5] cscope.sourceforge.net/cscope_vim_tutorial.html
qyang@lubuntu-laptop:~$ tree ~/.vim
/home/qyang/.vim
├── autoload
│ ├── acp.vim
│ └── tagbar.vim
├── doc
│ ├── acp.jax
│ ├── acp.txt
│ ├── tagbar.txt
│ ├── tags
│ └── tags-ja
├── plugin
│ ├── cscope_maps.vim
│ └── tagbar.vim
├── plugins
│ ├── acp.vim
│ ├── cctree.vim
│ ├── ming.vim
│ └── qt.vim
├── README.md
└── syntax
├── python.vim
└── tagbar.vim
ming.vim
qt.vim
------------------------------------
: colorscheme morning : syntax on : autocmd FileType * set formatoptions=tcql nocindent comments& : autocmd InsertEnter * colorscheme blue : autocmd InsertLeave * colorscheme morning : set autowrite : ab #d #define : ab #i #include : ab #b /******************************************************** : ab #e ^H^H********************************************************/ : ab #l /*------------------------------------------------------*/ : set sw=4 : set notextmode : set notextauto : set hlsearch : set incsearch : set textwidth=150 : au BufWinEnter * let w:m1=matchadd('Search','\%<151v .="">77v', -1) : au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>150v.\+', -1) : autocmd FileType c,cpp set formatoptions=croql cindent comments=sr: /*,mb: *.ex: */,: // : set nowrap : match ErrorMsg '\%>80v.\+' : set expandtab : set shiftwidth=2 : set softtabstop=2 : map: s/^/\/\// 151v>: map : s/^\/\/// : set smartcase : set ic
: nmap :TagbarToggle func! DeleteTrailingWS() exe "normal mz" %s/\s\+$//ge exe "normal `z" endfunc autocmd BufWrite *.py : call DeleteTrailingWS()
Generate cscope.out on root directory of source code project, then start vim from that root directory. All symbols index in cscope.out can be used by vim now.
Try below to jump straight to the file including 'main' symbol
$vi -t main
Insert following code into makefile to generate cscope.out via make.
$make cscope -f MakefileName
# Make software # # Generate csope files cscope: cscope.out cscope.out: cscope.files @cscope -R -b -i $< cscope.files: @find am335x -name "*.[ch]" -not -path "*/bootloader/*" > $@ && \ find libs -name "*.[ch]" -not -path "*/kissfft/*" >> $@ && \ find am335x -name "*.cpp" -o -name "*.h" -not -path "*/bootloader/*" >> find rtos -name "*.c" -o -name "*.h" -o -name "*.cpp" >> $@ clean: @rm cscope.*
DISPLAY TAB
---------------------
Not quite work correctly to show all tabs
:SeeTab vim.wikia.com
OPEN MULTIPLE FILES FROM CMD LINE
-------------------------
qyang@lubuntu-laptop:~/Git_Local_Sandbox/PcapPlot$ vi -g -p *.sh *.py 12 files to edit
TURN ON LINE NUMBER
------------------------
:set number
REPLACE A STRING
-------------------
:1,$s/word1/word2/gc IN A WHOLE FILE
:n1,n2s/word1/word2/gc IN BETWEEN LINE 'n1' and 'n2', special character use '\' prefix. (e.g.,:1,$s/word\[/word1\[/gc, replace 'word[' with 'word1[' )
COMMAND MODE
---------------------
'g0' -- go zero, go to head of line;
'g$' -- go to end of line;
'G' -- go to end of this file;
'H' -- go to top of screen;
'M' -- go to middle of screen;
'L' -- go to bottom of screen;
'nG' -- go to line number 'n'
'/word' -- search a string 'word' forward;
'?word' -- search a string 'word' backward;
'nyy' -- yank/copy n lines after cursor;
'p' -- paste yanked contens one line below cursor;
'dd' -- delete current line;
'nd' -- delete n lines after cursor;
DELETE/COPY(YANK) A BLOCK OF TEXT
----------------------------
The ‘mark command can be very useful when deleting a long series of lines.To
delete a long series of lines, follow these steps:
1. Move the cursor to the beginning of the text you want to delete.
2. Mark it using the command ma. (This marks it with mark a.)
3. Go to the end of the text to be removed. Delete to mark a using the command
d’a.
Note:There is nothing special about using the a mark. Any mark from a to z
may be used.
BACK TO PREVIOUSLY VISITED LOCATION previous view
-----------------------------
Ctrl + O
Ctrl + I (tab)
Jumping_to_previously_visited_locations
JUMP TO SYMBOL DEFINITION when ctags/cscope enabled
------------------------------
Ctrl + ]
Ctrl + T
A 05 Vi Exercise
===============================
[1] http://stackoverflow.com/questions/1737163/traversing-text-in-insert-mode
Insert mode and navigation mode switch
----------------------------------------
ESC or Ctrl+[
Navigation Fast
--------------------
15 + h go backward 15 characters
5 + j go forward 5 lines
Ctrl+o + 2 + b navigate two words back without leaving insert mode
Ctrl+o will give you chance to run one vi command at navigation
mode, then return to insert mode automatically.
'+. back to previous editing place after navigation
Type 20 '-' delete backword 9 '-'
----------------------------------------
20 + i + - + ESC
9 + X
'20' set number of execute times
'i' into insert mode
'-' letter or words you want to repeat
'ESC' back to navigation mode will display all insert letters.
'9' set number of exectue times
'X' delete backward, 'x' delete forward
Paste from clip board
-----------------------------------
"+p
" use register
+ clipboard register index
p paste shortcut key
Corret Typo
----------------------
accifently
FfrdA will correct the word from accifently to accidently
'F' find backward 'f' find forward
'f' find letter 'f'
'r' replace current cursor
'd' type correct letter 'd'
'A' back to original edit place
Rewrite word
--------------------
you accidentlly typed
you intentially typed
you intertially typed
ESC + 2 + b + c + w intentially + ESC + A
Write words in multiple lines
--------------------
[2] http://vim.wikia.com/wiki/Inserting_text_in_multiple_lines
hello
hello
hello
hel:added:loappend
hel:added:loappend
hel:added:loappend
hllo hello append
hllo hello append
hllo hello append
Ctrl+v + navigate coursor to 'l' + j + j + j + I + :added: + ESC
Ctrl+v + navigate coursor to 'o' + l + A + Ctrl+R + "
Ctrl+v + select block you want to delete + d
'Ctrl+v' visual block mode.
'I' insert before current cursor in visual block mode.
'A' append after current cursor in visual block mode.
'Ctrl + R + "' past yank register in insert mode
'Ctrl + R + +' past clipboard insert mode.
Subscribe to:
Posts (Atom)