Gtk+ Programming Series
Creator: [JaPh]
I'm currently making this series. Everything is simple and not so hard at all.
I will try to make it simple, however you need to know the basic of programming and Linux before starting to read this series.
Tutorial 1 - Hello World
Tutorial 2 - Gtk+ Package Dependencies
Tutorial 3 - Simple Gtk+ Window
Tutorial 4 - Preparation for Gtk+ Programming
Tutorial 5 - GtkWindow
Tutorial 6 - GtkLabel
Tutorial 7 - GtkButton
Tutorial 8 - GtkContainer
Tutorial 9 - GtkVBox
Tutorial 10 - GtkHBox & GtkVBox (Practice)
Tutorial 11 - GtkMessageDialog
Tutorial 12 - GtkTable
Tutorial 13 - GtkEntry
[ to be continued... ]
Have fun!@
First, make sure you installed libxml2.
Get it from here: LibXml2
Open Eclipse, New Project -> C Project.
On the menu Project, choose Properties, left pane: C/C++ Build - right pane: tab Tool Settings, choose GCC C Linker -> Libraries. On Libraries box, add "xml2". Then Apply -> OK
Left pane: C/C++ General -> Paths & Symbols, under tab Includes, under Languages list choose GNU C, click Add, type "/usr/include/libxml2". Then Apply -> OK.
Have fun!@
This is my little video guide through the wargame of SmashTheStack.Org
Wargame: SmashTheStack.Org | IO | Level 1
Creator: [JaPh]
Video: [ OGV | 24.1 MB | Super High Quality ]
Download: Rapidshare
Password: [japh]
Have fun!@
If u feel bored of your current username, why not change to new one?
$ usermod -l new_name old_name
Then you need to set a home folder for that username, since I have changed one of my own username, now I will need to rename my old home folder to new username home folder to reflect it
$ mv /home/old_name /home/new_name
$ usermod -d /home/new_name new_name
Note: make sure you don't login to this user, any process of old_user must not be running while the command is executed. Well, better to run it under your root account.
Have fun!@
There are various ways to print a perl array.
You can use a loop like this:
for( $i = 0; $i < @names; ++$i ) {
print $names[$i]." ";
}
Not a really good. How about using foreach loop?
foreach $i (@names) {
print $i." ";
}
Look better, right? But I've found a little interesting for.
for $i (@names) {
print $i." ";
}
It's still good!
How about some macro? Try this one
for (@names) {
print;
}
Uhm...but each element is not spaced out from each other..then, just make it space out
for (@names) {
print $_." ";
}
How about not using a loop? is there any way?
Oh, yeah...a great idea
print @names;
Oooops, elements are sticky together..space them out!
print "@names ";
It's better!
But I want to comma between each element, how?
In Perl, there is one special variable the set default output field seperator $,. Let's do this!
$, = ',';
print @names;
Wow! this is wonderful!
Is there any other option for printing an array?
You can join them before displaying.
print join( ',', @names);
This is a really nice trick!
Have fun!@
In order to get length of an array you can
+ either, use scalar() to force array length
+ or, take $#array_name + 1
my @letters = qw[ A B C D ];
print "Using Scalar: ".scalar( @letters )." elements.\n".
"Using Indice: ".( $#letters + 1 )." elements.\n";
Have fun!@
A little quick trick to empty an array in Perl is to set its length to a negative number.
Have fun!@
my @fruit = qw[ apple orange berry ];
print "Before: Fruit array has ".scalar( @fruit )." elements.\n";
$#fruit = -1;
print "After: Fruit array has ".scalar( @fruit )." elements.\n";