.comment-link {margin-left:.6em;}

sticky scratch

Sunday, October 31, 2004

Quote of the day

Então já usas o emacs?
Não pah, uso o webmail e tá andar...
(...)
Ah é aquela coisa tipo notepad!

-- Dioguinho

Saturday, October 30, 2004

Best movies ever

- Snatch
- Matrix series
- 6th Sense
- The Village
- The Good, the bad and the ugly
- Mad Max series
- Star wars series
- The Terminator I & II
- Lord of the Rings series
- Indiana Jones Series
- Batman Series
- Alien series
- Predator series
- Seven
- The Ring
- Resident Evil
- Pulp Fiction
- Trainspotting
- Untouchables
- 51th State
- Brave heart
- Nightmare before Christmas
- American Pie series
- Dumb and Dumber
- Aceventura Series
- Vita è Bella
- John Carpenter's Vampires
- The Godfather series
- Apocalypse Now
- Cidade de Deus
- Finding Nemo
- The Hunt for the Red October
- Shrek series
- Kill Bill series
- E.T.
- Enemy at the gates
- Fight Club
- James Bond Series
- Hannibal, the Cannibal
- Jurassic Park I,II
- K-9
- The crow
- The Shark
- The Last Samurai
- The Score
- Meet the Parents

(updated regularly)

Thursday, October 28, 2004

C programming language bookmarks

My C References on Internet:

Programming in C, UNIX System Calls and Subroutines using C:
http://www.cs.cf.ac.uk/Dave/C/CE.html

Eddie's Basic Guide to C Programming:
http://www.iota-six.co.uk/c/a1_c_programming_intro.asp

comp.lang.c Frequently Asked Questions:
http://www.eskimo.com/~scs/C-faq/top.html

Unix Programming Frequently Asked Questions:
http://www.erlenstar.demon.co.uk/unix/faq_toc.html

Network Programming under Unix Systems:
http://users.actcom.co.il/~choo/lupg/tutorials/internetworking/internet-theory.html

Beej's Guide to Network Programming:
http://www.ecst.csuchico.edu/~beej/guide/net/

Beej's Guide to Unix Interprocess Communication:

Introduction to GDB (Gnu Debugger):
http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html

GDB (Gnu Debugger):
http://shekel.jct.ac.il/cc-res/online-doc/gdb/gdb_toc.html

Tutorials (GCC, GDB, threads, ...):
http://users.actcom.co.il/~choo/lupg/tutorials/index.html


Last update: 01:12 - 12.11.04

Wednesday, October 27, 2004

emacs guide

Emacs tips (using keyboard)
======================

BEFORE USE:
This tips are labeled based on the most known conventions which doesn't mean they are the chosen ones by emacs developers.
It's important to know that this are just some of the default most useful bindings for me. Emacs is much more than that.

NOTATION (taken from 2.3.1 Command Keys (Meta, Esc, Control, and Alt) in http://rootprompt.org/article.php3?article=359):
As you'll soon learn, Emacs makes heavy use of multi-key combinations. Because it is not a modal editor like vi, you don't have to think about being in ``command mode'' or ``editing mode'' before you can try to move the cursor or execute a command. Instead, you just press the right combination of keys and Emacs does as told (usually).

The keys that Emacs makes the most use of are usually abbreviated in the documentation as C (for Control or Ctrl) and M for (Meta). While most modern PC keyboards have one or more keys labeled Ctrl few have one labeled Meta. You'll want to mentally substitute either Esc or Alt for the Meta key. In most standard configurations, both Esc and Alt do essentially the same thing. So when you see a reference in any Emacs related documentation to C-x f it means ``press control-x and then f.'' And if you see a reference to something like M-x shell is means ``press alt-x and type the word shell''.


Running emacs:
bash $ emacs

Running emacs with opened file:
bash $ emacs filename

Inside emacs....
Opening file (aka Find File):
C-x-f

Saving buffer (file):
C-x-s

Saving buffer as (file as):
C-x-w

List buffers:
C-x-b

Switch buffer:
C-x b

Quit buffer:
C-x-k

Quit emacs:
C-x-c

Show menu:
F10

Execute Emacs function (explicitly):
M-x function

Describe Emacs function:
C-h f

Describe Emacs variable:
C-h v

Describe Emacs bindings:
C-h b

Describe Emacs key:
C-h k

Get Emacs tutorial:
C-h t

Get Info:
C-h i

Get Help:
C-h

Get Detailed Help:
C-h ?

Dismiss current operation (when emacs hangs):
C-g

Select Region (cursor position defines its end):
C-@ or C-SPC

Select all:

C-x h

Watch selected Region:
C-x-x

Go to line:
M-x goto-line

Go to end of the current line:
C-e

Go to the beginning of the current line:
C-a

Go to the beginning of the buffer (file):
M-<

Go to the end of the buffer (file):
M->

Indent line:
TAB

Indent Region:
C-M-\ or M-x indent-region

Cut from current cursor position until end of line:
C-k

Cut from current cursor position until end of sequence (including possible newlines):
M-k

Cut region:
C-w

Paste (aka Yank):
C-y

Incremental Search forward (repeat command for next match):
C-s

Incremental Search backward (repeat command for next match):
C-r

Unconditional Replace String:
M-x replace-string <ret> STRING <ret> NEWSTRING <ret>


Unconditional Replace Regular Expression:
M-x replace-regexp <ret> REGEXP <ret> NEWSTRING <ret>

Query Replace String:
M-% STRING <ret> NEWSTRING <ret><ret> or
M-x query-replace <ret> STRING <ret> NEWSTRING <ret>


Query Replace Regular Expression:
C-M-% REGEXP <ret> NEWSTRING <ret>
or
M-x query-replace-regexp <ret> REGEXP <ret> NEWSTRING <ret>

Undo:
C-x u or C-_

Split Windows:
C-x-2

Delete other windows except current one:
C-x-1

Close current Window:
C-x-0

Switch between Windows:
C-x o

Compile:
M-x compile
for erros do: C-x ` (reverse quote)

Debug:
M-x debug

Shell mode:
M-x shell

Find the differences between two files:
M-x ediff

Debug emacs itself:
M-x toggle-debug-on-error

Defining Macros:
C-x ( MACRO C-x )
replace MACRO with the combination of commands you wish to execute.

Run the last keyboard macro defined:
C-x e

Inside the .emacs file (taken from http://www.haifux.org/lectures/64/emacslec.html):
the .emacs file contains lisp code which is executed every time
you run emacs, on startup.

In the .emacs file we will put macro definitions,
variable customizations, key bindings, adding hooks
and actually any lisp code you want.

bind keys:
(global-set-key "\COMMAND" 'function)

unbind keys:
(global-unset-key "\COMMAND" 'function)

using etags:
To use etags you have you to run in the first place:
bash $ etags files
(to generate TAGS file)


See definition of any global symbol of interest (C-u M-. to find next match):
M-.

KNOW MORE (other tools and projects):
Emacs power remains mainly on its versatibility. You can easily plug in other tools and make it provide all those features you need since mail client until tetris (yes, the game!).

One of those tools is "speedbar". Speedbar is an Emacs Lisp program which allows you to create a special skinny frame with a specialized directory listing in it. This listing will have both directories and filtered files in it. You can then load files into your emacs frame, or expand the files to display all the tags that are in them and jump to those tags. You can also expand multiple directories into your speedbar frame (taken from http://cedet.sourceforge.net/speedbar.shtml).

If you code in Java other useful tool is JDE.
The Java Development Environment for Emacs is a software package that interfaces Emacs to command-line Java development tools (for example, JavaSoft's JDK) (taken from http://jdee.sunsite.dk/).

Other project is XEmacs which is a highly customizable open source text editor and application development system with modern graphical user interface support and an open software development model, similar to Linux.

To know more about other tools read the info that comes with emacs.

REFERENCES:
http://www.gnu.org/software/emacs/emacs.html
http://www.emacs.org
http://www.emacswiki.org/
http://www.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html
http://rootprompt.org/article.php3?article=359
http://www.haifux.org/lectures/64/emacslec.html
http://cedet.sourceforge.net/speedbar.shtml
http://jdee.sunsite.dk/
http://www.dotemacs.de/ (unofficial .emacs home)
http://www-h.eng.cam.ac.uk/help/tpl/emacs/node24.html (example .emacs file)
http://www.linuxjournal.com/article.php?sid=0153
http://www.xemacs.org


ABOUT:
this is a scratch written by Francisco Gama using many quotes from the references that gathers what i consider of most interest using what i consider the most powerful editor tool. This little guide is not finished since i intend to update it regularly with my new knowledge about this great tool. I plan on improving information about macros,debug and .emacs files.
Meanwhile, Good work!

Tuesday, October 26, 2004

sample Makefile

# THIS MAKEFILE IS NOT CORRECT!!
# IT WILL BE UPDATED AS SOON AS I CAN

CC = cc
FLAGS = -Wall -ansi
RM = rm -rf
SRC = *.c *.h

all: climount servxport

servxport: f_desempacotar.o f_empacotar.o servxport_codigofonte.o
${CC} -o $@ $^ ${FLAGS}

climount: f_desempacotar.o f_empacotar.o climount_codigofonte.o
${CC} -o $@ $^ ${FLAGS}

desempacotar.o: f_desempacotar.c main.c pacotes.h
${CC} -o $@ $^ ${FLAGS}

empacotar.o: empacotar.c main.c pacotes.h
${CC} -o $@ $^ ${FLAGS}

servxport.o: servxport_codigofonte.c main.c f_empacotar.c f_desempacotar.c pacotes.h
# ${CC} -o $@ $^ ${FLAGS}

climount_codigofonte.o: climount_codigofonte.c main.c f_empacotar.c f_desempacotar.c pacotes.h
# ${CC} -o $@ $^ ${FLAGS}

clean:
${RM} climount servxport *.o
tags:

etags $(SRC)
.c.o:
$(CC) -c $<

Monday, October 25, 2004

Hello, World!

Hi!

Many are the times when i needed somewhere to take notice of some idea, thought, message, memo, whatever...
However, rarely were the times when i had a paper and a pencil to do it and even if i had, i would get all my pockets filled of trash in no time. So, i understood that the solution would be on Internet where my notes become available anytime anywhere.

For long time, i used my email to do this... Now that blogs became the latest fashion i thought it could be interesting creating a blog with the same target where everyone could make use of other's notes.
You know how the system works so, if you want to share your credit card and personal information is all up to you the same way you can use other's.
The only rule you got to know when using this blog is that each person is responsible for his own posts.

The target of this blog is to share knowledge and solve the old problem of writing/reading notes anytime anywhere in the easiest and cleanest way possible.

Enjoy!