Archive for the “Programmer’s Talk” Category

Getting Started with GTK and GLade for GUI programming

Considering you have read the previous article on GUI programming, this article will give an insight about GTK.

When starting learning Glade, it is essential to learn the basic concepts of GTK+. Unfortunately there is a misconception that it’s enough to learn Glade for learning GUI designing rather than learning GTK+. Glade is definitely an easier way to implement GTK but it is impossible to create interface for your application with only Glade knowledge.

Official GTK+ tutorial is the best place to learn the Basic things about GTK+. Though reading the entire documentation may seem to be a herculean task, it would good to cover important topics like packing of widgets. After having a basic knowledge about GTK+, next step is having a look at the official Glade3 manual. Version that is supplied with Glade3 is outdated,you can find a simpler and more updated one here.

Now if you think, you are well and comfortable with GTK+ Basics, you will definitely want to try a real world example. Many authors provide tutorials with real world examples. I managed to find out two such, one by Micah carrick and other by Tadej Borovšak. It would be better to follow Tadej’s Tutorial as the former one does not use Glade3-3.6.7 which is latest version. Anyway you can also give a look at the tutorial by Micah. Now when you start seriously with GTK programming, never forget to visit GTK Forum for getting your doubts cleared.

Now if you are ready to spend a few bucks try to get a copy of  Foundations Of GTK development.

Here are a few other resources which would with worth giving a look though I haven’t tried them personally.

Tutorial for How to set the colour of a widget in GTK+
Tutorial

Gtk+ 2.0 Tree View tutorial
Tutorial Pdf

Gtk+ 2.0 Text View tutorial
Tutorial Pdf

Gtk+ 2.0 GtkComboBox Widget Tutorial
Part1
Part 2
Part 3

GtkDialog tutorial
Part 1
Part 2

Wrapping and resizing GtkLabel dynamically
Tutorial

Using pop-up windows
Tutorial

Gtk memory management in a nutshell
Tutorial
Gtk Menu Tutorial
Tutorial

Popularity: 72% [?]

Arch Linux, First step in creating your own OS

It’s a dream of every noob that even before coding the first “Hello World” program, student want to know how to code an OS. Dreams are good but this is harder than one can image. If you are so strong with your dream, rather than thinking of coding your OS from scratch better you try building your own Arch. Arch Linux is a fully customizable, light weight operating system. The CD image can be downloaded. But this is actually a very slim installation and it’s not at all usable. You will have to install the window manager, desktop environment and everything else you see on a full fledged operating system.

One of the main disadvantage of Arch Linux is it’s cryptic text based installer. So better you watch some video and get familiarised with the instalation procedure.

Here are a few video tutorials for the installation and customization of Arch Linux.


Popularity: 17% [?]

Thursday, March 18, 2010 Categorized under: Programmer's Talk, Tech Buzz
Author: ajithpaul ajithpaul ajithpaul

View hidden passwords in a webpage using simple javascript code

Here you have a very simple javascript code that enables you to reveal typed-in or saved passwords in a webpage that are hidden under asterix.

This a cool code which unlike other password revealing softwares require no installation and can be typed in directly into the address bar of your web browser.

Copy the entire code as it is

javascript:(
function()
{
var F,f,i;
F = document.forms;
f = F[0];
for (i=0; i<f.length; ++i)
{
if (f[i].type.toLowerCase() == "password")
alert(f[i].value);
}
}
)
();


Checkout the following Screenshot


PS :

1.In line 7, it is F[0] (zero)

2.This will only work if you have not disabled javascript in your browser.

Popularity: 9% [?]

Search man pages in linux for a particular word / command

Wikipedia defines man pages as “extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems”. Just as the definition goes sometimes the documentation is so extensive that you are unable to find the data you need.

Actually it’s not a big deal to find a particular word. You would have noticed that the usual Ctrl+F won’t work here.

For finding a particular word just access the man pages by man command.

Then for finding a particular ‘word’ type /word followed by Enter.

Now the first word will be highlighted. For the finding the instances of that word in next pages of the man page press Space and the ‘word’ in the next page will be highlighted. That’s it.

This same method also  can also  be used in vi for searching words.

Here is an example.

Popularity: 29% [?]

Install Softwares in Ubuntu 9.10 without internet connection

Weeks ago when I was trying to setup Ubuntu in my pc for the first time, installing new software you need in your new pc would be a impossible process without internet or any Repository DVDs. I managed to get a few resources from net and here I will explain it as a step by step procedure. First you should have another computer which is well connected to the internet or you should have an APTonCD created by someone. Once you install the required softwares with the help of internet connected PC, you could backup all the packages into a CD for using next time.

  • Generating List of required files to be downloaded.

After you have installed Ubuntu in your system, you will definetely need files to keep it updated. First of all you have to generate the list of files to be downloaded. You use the following command for generating the required files list.

sudo apt-get update -qq –print-uris |cut -d\’ -f 2 > filelist.txt

This will generate a text file filelist.txt with all the essential update files to be downloaded.

Now if you want any specific softwares to installed like APTonCD you would need more files to be downloaded. To get the additional files to be downloaded use the following command

apt-get -qq –print-uris install ***packagename*** | cut -d\’ -f2 >filelist2.txt

Move both filelist.txt and filelist2.txt into a removable media like pen drive.

  • Downloading the required files to be downloaded.

In the computer with internet connection create a folder called files in the desktop.
Copy the two text files into that folder.
Move to the folder with the following command in terminal

cd Desktop/files
wget -i filelist.txt -x
wget -i filelist2.txt -x

Now you will have all your required files downloaded to the new folder in separate directories. Also keep the two text files inside the pen drive itself.

  • Final installation process

Now move the files to the computer in which the new software are to be installed. Now you will have to open the file manager with root privileges to copy files into the root directory.

Press Alt+F2

In the popup window type

gksudo nautilus

Copy the folder into the root directory. You can move into the root directory by clicking the tab with the symbol of a harddisk in the upper part.

Now using the same file manager window move to ‘etc’ folder in root directory.
Now locate the sources.list found in ‘apt’ directory in ‘etc’./etc/apt/sources.list

Make a duplicate copy of that file and name it “sources.list.cpy” (right-click on the file, copy, and then paste). This is just a safety precaution in-case something goes wrong.

Now right-click the file sources.list and select “Open gedit” or any other text editor

Now add all the contents of filelist2.txt at the end of sources.list
Now using the Replace option under the Search menu in gedit replace all http:/ on that file with file:/files

Ubuntu

Next everything will be over with

sudo apt-get update

Popularity: 66% [?]

Page 1 of 212