Live Chat!

compile D programming using gdc

          0 votos

January 27th, 2007 mysurface

How you heard about D programming? It is a new programming after c and c++. A stable version, 1.0, was released on January 2, 2007.
To compile D source code, you can uses GDC, it works just like gcc and g++.
gdc -o sample{,.d}
Check out the D programming homepage for more details.
Related Postscompile c and c++ [...]

Posted in Developer, gdc | Hits: 9701 | No Comments »

compile c and c++ source code

* * * *   1 votos

January 27th, 2007 mysurface

There are plenty of c and c++ compiler under unix based operating system, but the most famous one should be GNU gcc compiler. A well known open source kernel Linux is compiled by gcc as well. This post is to introduces you how you can use gcc to compile c and c++ source code, if [...]

Posted in Developer, g++, gcc | Hits: 26304 | 11 Comments »

peeking whats inside the binaries

* * * *   1 votos

January 22nd, 2007 mysurface

Curiosity kills the cat, we always wants to know more. I discover a command that can actually extract and prints out the readable string from the binaries. Okay lets see what is the interesting readable string in the /bin/cat
The simplest way is doing this:
strings /bin/cat
What I get ?

Richard M. Stallman
Torbjorn Granlund
5.96
GNU coreutils
benstuvAET
standard output

Haha, that is [...]

Posted in Developer, Misc, strings | Hits: 9821 | 1 Comment »

vim with ctags

* * * * ½ 3 votos

December 10th, 2006 mysurface

If you are c/c++ programmer and vim user, maybe know ctags. Most of the time, source code are distributed to many folders and each of them consist of numbers of .cc/.c and .h. Sometimes to search the definition of a function, class, enums etc by using “/” is inefficient. ctags allow fast jumping to function [...]

Posted in Developer, ctags, ln, vi, vim | Hits: 15434 | 4 Comments »

compare files and edit simultaneously with vimdiff

*         3 votos

November 24th, 2006 mysurface

Refers to How to create patch file using patch and diff, you can actually read the diff file to compare the difference between the files. But what if you wanna compare and edit simultaneously?
Given 2 different files at your hand, you can do that with vimdiff. Let say I wanna compare this two files Tb01/TbApi.cpp [...]

Posted in Developer, vi, vim, vimdiff | Hits: 13263 | 2 Comments »

How to create patch file using patch and diff

* * * * ½ 2 votos

November 23rd, 2006 mysurface

Okay, this is what I do. I only know the basic. But before doing this, please backup your source code, patch wrongly will screwup your source code.
First, how to create patch file?
Patch file is a readable file that created by diff with -c (context output format). It doesn’t matter and if you wanna know more, [...]

Posted in Developer, Misc, diff, patch | Hits: 20405 | 1 Comment »

Installing From Tarballs

* * * * * 1 votos

November 17th, 2006 mysurface

We usually download linux programs through package handling tools such as yum and apt-get. Download programs through package handling tools is easy, but not all programs is available in your Linux distribution repository. Sometimes, we need to download the source code, compile and install manually.
Usually, source code are compress in the archive format, its either [...]

Posted in Common, make, tar | Hits: 20818 | 3 Comments »

Some tips of GDB

          0 votos

November 10th, 2006 mysurface

Usually people uses gdb to debug when obtain core dump file. A very common error that trigger core dump is segmentation fault happen, check out this example to get more idea regarding core dump, and gdb. Additional link, here is a great tutorial shows you how to debug when occur segmentation fault.
This post is to [...]

Posted in Developer, gdb | Hits: 6143 | 2 Comments »

Generating Random numbers

* * * * * 1 votos

October 27th, 2006 mysurface

We can obtain pure random (NOT pseudo-random) bytes from /dev/random. Linux kernel harnesses a good source of randomness from you. The random bytes in /dev/random is measuring based on the time delay between your input actions.
so seems /dev/random provided random bytes, we need to turn the bytes into an integer so that we could read. [...]

Posted in Bash, Misc, echo, od, touch | Hits: 10176 | No Comments »

Substitute a Keyword In a File

* * * *   1 votos

October 9th, 2006 liewsheng

Sometime I need to replace a keyword with another, I can’t just open a file and substitute 1 by 1. It is faster to using a single command line. There have more than 2 ways to do it, but I prefer this 2 command: perl and sed.
To substitute a word ‘abc’ to ‘def’ in [...]

Posted in Text Manipulation, perl, sed | Hits: 6768 | 2 Comments »