Posted by: yuvan004 | November 9, 2012

Qgis installation for Ubuntu 12.04


UBUNTU is now updated to 12.04. Ubuntu software center does not have qgis. therefore, qgis need to be installed indirectly.

Install QGIS 1.6.0 (Quantum Geographic Information System) in Ubuntu from PPA
Quantum GIS (QGIS) is a cross-platform Geographic Information System and it supports numerous vector, raster, and database formats and functionalities. QGIS lets you browse and create map data on your computer. It supports many common spatial data formats (e.g. ESRI ShapeFile, geotiff). The current version QGIS 1.6.0 releases with many bug fixes, features and enhancements. QGIS 1.6.0 available on Windows, MacOS X and Linux.

To install: open terminal and enter the following scripts.

sudo apt-get install add-apt-repository
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install qgis

loading may take sometimes, be patient and wait till it ends; After installation it upgrades automatically to 1.7.4

check http://www.webcoz.com/install-qgis-1-6-0-quantum-geographic-information-system-in-ubuntu-from-ppa/ for further reference.

Posted by: yuvan004 | August 5, 2012

Vi and Vim


Vi and Vim

Vim is an advanced text editor that provides the power of the de-facto Unix editor ‘Vi’ with a more complete feature set. Vim is often called a “programmer’s editor,” and is so useful for programming that many consider it an entire IDE. It’s not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

This article aims to get help you install vim, and give you a basic introduction to vim.

Installation of Vim and Vi

Red Hat / CentOS / Fedora:

rpm -ivh vim-common-…rpm vim-minimal-…rpm vim-enhanced-…rpm vim-X11-…rpm
yum install vim-common vim-minimal vim-enhanced vim-X11

Debian:

apt-get install vim vim-common vim-gnome vim-gui-common vim-runtime

Ubuntu

sudo apt-get install vim-gnome

NOTE: As of Ubuntu 6.10 (Edgy Eft), the default Vim install is a cut-down version called “vim-tiny”. In order to get the full version complete with the online help documentation, and many of the advanced functions such as code folding; you will need to install “vim”:

sudo apt-get install vim

Compiling Vim from source:

Download vim source from http://vim.org
tar xzf vim-7.0.tar.gz
cd vim70
./configure –prefix=/opt –enable-cscope
make
make install

Building Vim

If you want the very latest version of Vim, you can build it yourself. Tony Mechelynck maintains a page on building Vim under Linux. The Vim packages page lists the packages you will need to install on Ubuntu.

A Quick Introduction

vim has a formidable learning curve, but by getting comfortable with vim and its great features, you will became very efficient at manipulating text. A pre-condition to that, is the programmer (novice) should learn Touch Typing to experience the power.

You can start vim in console mode by typing vi or vim at the terminal or vim in graphical mode by typing gvim. Doing so should bring up a blank screen, with details about vim. However, any attempts to type text will fail! Which brings us to the most confusing feature for beginners – modes.

Modes

One of the most confusing things about vim is that it has four modes.

  • Insert: To type text
  • Command: To issue commands. Also called as Normal mode.
  • Ex: To issue colon commands
  • Visual To select text visually

The Insert mode is not default, you must press i to move into insert mode. Type some text in the screen. Press the <Esc> button to get out of insert mode into Command mode. The command mode is used to move about, and to manipulate text, sometimes in interesting ways. The Visual mode is used to select text, press v to enter it and select some text, then you can issue commands that will apply only to the selected area, type <Esc> again to return to Command mode. The Ex mode is used to issue colon commands, which is used for operations like saving, search & replace and configuring vim. Save the text you just typed in by going to the Ex mode by pressing : from the normal mode and typing :w filename<Enter>. Quit vim by executing the colon command :q. To summarize,

vim (to start vim)
i (to insert text)

 (to come to command mode)
v (to select some text)
 (back to command mode)
:w filename (to save the text to the file 'filename')
:q (to quit the file)
:q! (to quit without saving)
vim filename (to open the file you just saved directly in vim)

However, it is best to learn vim by using it. You can quickly learn the basics of vim by using the inbuilt vim tutorial, by typing vim-tutor (vimtutor on dapper) in the terminal. Using the Ex: command :help from inside Vim is often very usefull.

Configuration

vim is a highly configurable editor, and it is best to configure vim to your liking as vim by default has all the nice features turned off. A list of files and their locations are given below.

  • ~/.vimrc is the vim configuration file which vim reads on startup
  • ~/.gvimrc is the gvim configuration file which gvim reads on startup. It’s best to keep only gui specific settings here, as it will take preference over the settings in your .vimrc file.
  • ~/.vim/ is the directory in which the user can add utility plugins, syntax highlighting plugins, and indent plugins.

Enable Syntax Highlighting

Turning syntax highlighting on is quite simple.

If you want to just enable syntax highlighting for a session, you can simply issue a colon command

:syn on

Syntax highlighting can be turned off by issuing another ‘colon’ command

:syn off

To make this permanent everytime you open a file, just add the following line to your vimrc.

syntax on

Enable Autoindenting

To enable Auto-Indenting of code, just type the following colon command.

:set ai

The code you type will indent automatically. If it does not indent correctly, you might need to obtain a indenting plugin for the language you are writing in from vim site.

TO make this permanent, add the following lines to your vimrc.

filetype indent on
set autoindent

Sample .vimrc file

Below is a basic .vimrc file with basic configuration. Please note that lines beginning with the character are comments.

" Turn on line numbering. Turn it off with "set nonu" 
set nu 

" Set syntax on
syntax on

" Indent automatically depending on filetype
filetype indent on
set autoindent

" Case insensitive search
set ic

" Higlhight search
set hls

" Wrap text instead of being on one line
set lbr

" Change colorscheme from default to delek
colorscheme delek

You can also learn more by looking at a more elaborate vimrc file at /usr/share/vim/vim70/vimrc_example.vim. You can find this example explained in detail at the Vim documentation.

You can also find several .vimrc files online on the dotfiles website.

Editing docbook documents with vim

To contribute to the Ubuntu Documentation, you will need to use the docbook format. If so, you might be interested in the VIM filetype plugin xmledit.

Add the following to your ~/.vimrc

map! ,e <emphasis>
map! ,p <para>
map <F3> v/>^Mx

If you are at the beginning of an opening XML tag you can just press F3 and the tag gets cut to the buffer. Go the end of the section and press ‘p’ (=paste) and it will be appended after the current char.

This is useful to add tags after the text is already written. A typical usecase is when it is necessary to add formatting to current documents which have been copy/pasted from a web site.

Online Sources

You can find valuable information about vim at the following pages

Posted by: yuvan004 | June 9, 2012

Running Eagle CAD 6.2 on Ubuntu 12.04


EAGLE (Easily Applicable Graphical Layout Editor) by Cadsoft is a flexible and expandable EDA schematic capture, PCB layout, autorouter and CAM program widely used since 1988. EAGLE is popular among hobbyists because of its freeware license and rich availability of component libraries on the web.

300px-Eagle_Schematic_Editor

Schematic capture

EAGLE contains a schematic editor, for designing circuit diagrams. Parts can be placed on many sheets and connected together through ports.

PCB layout

The PCB layout editor allows back annotation to the schematic and auto-routing to automatically connect traces based on the connections defined in the schematic.

EAGLE saves Gerber and PostScript layout files and Excellon and Sieb & Meyer drill files. These standard files are accepted by many PCB fabrication companies.

INSTALLATION IN UBUNTU 12.04

Ubuntu 12.04 only provides an older version of Eagle CAD, version 5.12.0 to be exact. A newer version 6.2 (32 bit) is available for download, but the installation fails due to the lack of a 32 bit libpng-1.4 library

error while loading shared libraries: libpng14.so.14: 
cannot open shared object file: No such file or directory.

First of all you need to install some packages to build the missing png library. Open a terminal window and enter on a 32 bit Ubuntu 12.04:

sudo apt-get install build-essential perl 
sudo apt-get install zlib1g zlib1g-dev

On a 64 bit Ubuntu 12.04:
sudo apt-get install build-essential perl gcc-multilib 
sudo apt-get install ia32-libs lib32z1 lib32z1-dev

Then you need to fetch the libpng source code and the Eagle CAD 6.2 installer, either 
with “wget” (as I have done it) or directly from the respective webpages. 
A current version of Eagle CAD is available for 
download here: http://www.cadsoftusa.com/download-eagle/
 libpng 1.4 can be found on this page: http://www.libpng.org/pub/png/libpng.html
 I will use the “/tmp/libpng-eagle” directory for building the library:

mkdir /tmp/libpng-eagle
cd /tmp/libpng-eagle
wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.11.tar.gz
tar xvfz libpng-1.4.11.tar.gz
cd libpng-1.4.11/
./configure --prefix=/tmp/libpng-eagle/install CFLAGS=-m32
make check
make install

At this point I assume that your Eagle CAD installation will be located at “/home/$USER/eagle-6.2.0“.

If not, simply adjust the location in the text below:

cd /tmp/libpng-eagle/install/lib/ 
mkdir -p /home/$USER/eagle-6.2.0/lib 
cp -a libpng14.so* /home/$USER/eagle-6.2.0/lib/

Now the installer should run…


export LD_LIBRARY_PATH=/home/$USER/eagle-6.2.0/lib/
cd /tmp/libpng-eagle/
wget ftp://ftp.cadsoft.de/eagle/program/6.2/eagle-lin-6.2.0.run
chmod 755 eagle-lin-6.2.0.run
./eagle-lin-6.2.0.run
After the installation finishes, Eagle CAD will still not run unless you tell it where 
to find the png library we have just created. The easiest way to do this is by creating 
an executable start-up shell script (e.g. /home/$USER/eagle-6.2.0/eagle.sh) 
which contains the following commands:
#!/bin/sh 
export LD_LIBRARY_PATH=/home/$USER/eagle-6.2.0/lib 
/home/$USER/eagle-6.2.0/bin/eagle

Additionally, you could create a Unity/Gnome menu entry, for example 
“/home/$USER/.local/share/applications/eagle.desktop”
 (do not forget to adapt the $USER):

#!/usr/bin/env xdg-open [Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=/home/$USER/eagle-6.2.0/bin/eagleicon50.png
Name=Eagle
Exec=/home/$USER/eagle-6.2.0/eagle.sh
Comment=Eagle CAD







Posted by: yuvan004 | May 2, 2012

How to Plan MAIO and HSN


Frequency Hopping e MA List

To understand how HSN and MAIO are used in planning, we first need to know some brief concepts.

  • Frequency Hopping – or FH: one of the great advantages of the GSM system, in the constant search to reduce interference. More on the FH due to a new tutorial.

 

  • MA List: set of frequencies (channels) assigned to a particular sector, ie are those channels that can be used to attend calls from users.

To illustrate, let’s consider a sector with 4 TRX, where the first TRX is used for BCCH and the others are TCH TRX.

The MA List with the channels of traffic then would be:

HSN e MAIO

Sure, with the example in mind, let us return to our parameters.

First, the definition of HSN: Hopping Sequence Number. It is a number that defines the frequency hopping algorithm, and can vary from 0 to 63, ie there are 64 hopping algorithms to be used in GSM.

 

If HSN is zero, the frequency hopping sequence is cyclic, ie without changes.

If HSN is greater than zero, then frequencies vary pseudo-randomly.

When we enabled the Hopping – our case – all TRX in the SAME SECTOR has the SAME HSN. And if the we have 1×1 SFH it is recommended to have the SAME HSN for ALL SECTORS of the BTS.

 

In our example, the MA List is small – just three frequencies. The size of the MA List should be taken into account in the planning of HSN: HSN should be the designated so as to minimize the average probability of collision, according to the designated MAIOs.

And how MAIO’s are designed?

Well, first defining MAIO: Mobile Allocation Index Offset. It’s MAIO that designate the initial position of frequency – among the frequencies available in MA List, that list with the frequency hopping. It is the frequency that TRX uses so get hopping.

MAIO planning is straightforward if the number of TRX is small compared to the length of the sequence of hopping.

For example, MAY 0 means that the TRX should use the first frequency, or f1.

 

GSM Automatic Frequency Planning Tools

The concept of HSN and MAIO is important, and when the number of TRX and frequencies is small, we can even do planning ‘byt hand’.

However, the best way – and always recommended – is to use network planning tools suitable for this purpose, as the AFP, from Optimi, or Ultima Forte, from Scheme.

These tools can be configured with measurements collected from the network (via BSS and / or Drive Test ), and with predictions (calculations) built in that allow the creation of a Interference Matrix. Based on this matrix, along with other algorithms, it allow a better design of parameters based on such critical conditions in traffic load and access. According to characteristics of each sector, they then provide the final planning, including the possibility of simulations.

MALIST contained frequencies [A,B,C,D,E,F,G,H,I,J,K,L]

for first TRx for traffic, the MAIO is 0. means that hopping sequence starts from first frequency in the MALIST, that is frequency A. and for MAIO 2 it starts from frequency C and for MAIO 4 it starts from frequency E.

For MAIO 0 and HSN 4
A,F,K,D,I,B,G,L,E,J,C,H,A,F

For MAIO 2 and HSN 4
C,H,A,F,K,D,I,B,G,L,E,J,C,H

For MAIO 4 and HSN 4
E,J,C,H,A,F,K,D,I,B,G,L,E,J

 

 

Posted by: yuvan004 | March 3, 2012

How to install and use the plugins in QGIS


Note: If you are using an older version of QGIS and you haven’t yet used the ‘Plugin Installer’, then you’ll probably want to enable it by going to ‘Plugins’ > ‘Plugin Manager’ and enabling ‘Plugin Installer’. At this point, it’s a good idea to update to the latest version of the installer by goin to ‘Plugins’ > ‘Plugin Installer’ and reinstalling it.

  1. In QGIS, go to ‘Plugins’ > ‘Plugin Installer’ > ‘Fetch Python Plugins’, and click on the ‘Repositories’ tab.
  2. Click on ‘Add 3rd Party Repopsitories, then when the warning pops up, click ‘OK’.
  3. This should load the new repositories, and you should now see a list of plugins on the ‘Plugins’ lab.
  4. Find the plugin that you are looking for (fTools, manageR, voronoi polygons), and click ‘Install/upgrade plugin’.
  5. You’re done! Now simply follow the instructions to activate the plugin.

If the above steps don’t work for you.

  1. Download the plugin you’re interested in using.
  2. Unzip the plugin zip file to the plugin dir of your QGIS install (the files should automatically extract to a single folder).

Windows: extract to ‘C:\Documents and Settings\_user_name_\.qgis\python\plugins’
Linux: extract to ‘/home/_user_name_/.qgis/python/plugins’
Mac: extract to ‘/Users/_user_name_/.qgis/python/plugins’
where _user_name_ is YOUR user name.

  1. Fire up QGIS and select the ‘Plugins’ menu and click on ‘Manage Plugins…’
  2. Select the desired plugin from the list and click ‘OK’.
  3. You’re done! You can now start using the plugin.

Older Posts »

Categories