I just make a try to install openSUSE on my system, just to experience how it works and how it looks like but unfortunately I was unaware that i’m digging my own grave by doing this. Actually I have two OS on my system which are running under Legacy mode. While installing openSUSE I accidentally changed setting to UEFI mode and installed under that mode. Due to this grub crashed and both my pre-installed OS dead. After spending an hour or two somehow I changed their mode from UEFI to legacy both still facing some glitches in it. So I planned to re-install any one OS, by that way I’m able to secure my other OS too. I will take 30 minutes or less to get install and within few more minutes I recover my second OS too by installing grub. Now it’s time to install KDE and time to upgrade my OS which will take about 4-5 hours. So I set my OS for upgrade. Meanwhile I learned so many things like vim, tmux, mathematics on terminal, name-mangling etc. I use to work on sublime and vim but prefer sublime more. This time I planned to work on vim I never customize vim, so finally this time I did it. After customizing I can proudly say that “Nothing Like Vim”, “Vim Is Used Only By Real Developers”. How to work using tmux : tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal

$ sudo apt-get install tmux

It has it’s own bindings but I changed them according to my comfort level. For doing this goto your home directory and in .tmux.conf file ( if not present then create it ) add these few lines

# set prefix key to ctrl+a until I have time to adapt
unbind C-b
set -g prefix C-z

# send the prefix to client inside window (ala nested sessions)
bind-key z send-prefix

# toggle last window like screen
bind-key C-z last-window

# navigate through windows like screen
bind-key C-z-x next
bind-key C-z-c prev

# window splitting
unbind %
bind | split-window -h
unbind '"'
bind ? split-window -v

# Mouse mode
set mouse-utf8 off
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'

# Vim-style copy/paste
unbind [
bind y copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel

Run $ tmux on terminal and perform required action to perform particular action. Maths on terminal : We normally use calculator for doing addition, subtraction and other actions. Stop using them use terminal for doing this 😉

$ sudo apt-get install apcalc
For performing actions like addition and all do this

For addition 
$ calc <value1> + <value2> eg: calc 1+2+3+3
Similarly we can use for multiplication, subtraction and for division.

Factor of any number can be find by using factor command eg:

$ factor <value>

Name-Mangling :

The C++ provides a feature called function overloading. This enables
you to write many functions with same name, provided each function
takes parameters of different types. The lower level languages (C or
assembly) and tools (linker) do not have capability of understanding
function overloading. For these languages, each function name must be
unique so that functions can be differentiated from each other by its
name only.

C++ differentiates functions with name and parameter both. It
generates a new name for each function. The new name depends on the
original C++ function name and parameters. Given a function name of a
set of parameters, it will always generate a unique name. If
parameters (number of params, type of params or order of params)
change then it will generate another name even if the original C++
function name is same. This process of encoding the function name is
known as name mangling.
Name mangling in done is C++ compiler to support polymorphism.

Here are few examples of mangled name for g++ compiler:-
 Original name:   void myFun();      Mangled name:  _Z5myFunv
 Original name:  void myFun(int a, char c);      Mangled name:  _Z5myFunic
 
 For this:
 
 class MyClass {
    void MyFunction(int a) {}
 }
 
 mangled name of MyClass:MyFunction will become _ZN7MyClass10MyFunctionEi.
Advertisements