Pages

Tuesday, September 18, 2007

Segmentation fault during g_thread_init(NULL);

A possible solution for Segmentation fault during g_thread_init(NULL); is you to change
gthread to gthread-2.0 during your configuration
e.g. AC_CHECK_LIB(gthread-2.0, g_thread_init)
or to use -lgthread-2.0 instead -lgthread as parameter to the compiler.

undefined reference to `g_thread_init'

If you get this error message
"undefined reference to `g_thread_init'"
during the compilation of your code, that use GLib.

Solution 1 - Using configure.in
insert the follow code line in your configure.in
AC_CHECK_LIB(gthread-2.0, g_thread_init)

Solution 2 - Compiler command line
add the parameter
-lgthread-2.0
to the compiler.

Thursday, September 13, 2007

2D Barcode - Código de barra 2D


Olá pessoal,
Hoje vou falar um pouco sobre código de barra em 2D.
Nada aprofundado, pois o objetivo aqui é só fazer você conhecer a tecnologia e apontar um caminho onde você pode encontrar mais informações.

Você pode ver ao lado um código de barra 2D que contém o meu nome como informação, "Ragner Magalhaes".

Para saber um pouco mais sobre isso, "Google é meu amigo ... [:P]", ou aqui http://mobilecodes.nokia.com/index.htm.

Bem eu testei essa tecnologia no meu N80 [:P] e funciona!!

Para saber sobre softwares para celular que reconhecem 2D barcode visite esse link http://mobilecodes.nokia.com/scan.htm eu recomento o "I-nigma reader" - www.i-nigma.com

incluse nesse site tem como você criar os seus próprios códigos 2D http://www.i-nigma.com/personal/Create.asp.

Acho que a idéia é que no futuro os produtos vão vir com esse tipo de código e você vai lá com o seu celular, faz um scan do código, e ler as informações ... [:D]

Ou você pode usar isso para mandar mensagens "secretas" ... :P
Aproveita que pouca gente sabe sobre o assunto ...

Thanks,

God bless you!

References

http://mobilecodes.nokia.com/learn.htm
http://www.i-nigma.com/personal/Default.asp

Wednesday, August 29, 2007

GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed

GLib message error:

---

(process:4016): GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use IA__g_type_init() prior to this function

(process:4016): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed


A possible resolution for this error is to insert the method "g_type_init()" in your main source code, as below.


----
gint
main (gint argc, gchar *argv[])
{
FooExample *foo;

g_type_init();

foo = g_object_new(FOO_TYPE_EXAMPLE, NULL);

g_message("Great success !!\n");

return 0;
}

---
This example is to a simple GLib code, you will use gtk_init() to a GTK code.

Friday, August 17, 2007

Debian Day in Manaus

Hi all,
Tomorrow, saturday, I am going to do a apresentation about "Installing really Debian dist into a PenDrive".

Portuguese:

Dia-D em Manaus
==============

Neste dia 18 de Agosto será realizado em Manaus, e nas principais cidades do Mundo, o Dia-D.
O evento será realizado nas instalações da UEA, unidade Escola Superior de Tecnologia(antiga UTAM), Av. Darcy Vargas 1200.

O Dia-D é um evento sem fins lucrativos que visa atingir a sociedade, de todas as áreas técnicas e sociais, levando o conhecimento a respeito da comunidade Open Source. Com várias atividades voltado para o tema de Software Livre, Linux e Debian(uma distribuição Linux).

Esse evento tem também um papel social importante, além da integração tecnológica, todo o recurso arrecado, alimento não perecível 2k p/ pessoa, será doado à Instituição Casa Andréa do Amazonas.

E eu vou estar contribuindo também [:D] ... com uma apresentação, ensinando como instalar uma distribuição Debian em em PenDrive ...

Para mais informações sobre o Debian Day em Manaus
http://www.gudam.org

Tuesday, August 7, 2007

Debian Ad Hoc Wireless Networking

The following example uses eth1 for the wifi interface though this may be wlan0, ath0 or something else in your case.
Preparation

Ensure that network manager has been stopped and then bring the interface down.

sudo /etc/dbus-1/event.d/25NetworkManager stop
sudo ifdown eth1
Configuration
  1. Switch the card into ad hoc mode

  • sudo iwconfig eth1 mode ad-hoc
  1. Set the channel/frequency that you want to use.

  • sudo iwconfig eth1 channel 11
  1. Add the name (ssid) for the network you want to create/join. Use single quotes if there is a space in the name.

  • sudo iwconfig eth1 essid 'name'
  1. Add a WEP encryption key

  • sudo iwconfig eth1 key 1234567890
Activation
  1. Bring the interface back up

  • sudo ifconfig eth1 up
  1. Start dhclient to get an address

  • sudo dhclient eth1
  1. If you want to do it manually, you will have to make up an IP address.

  • sudo ifconfig eth1 10.0.0.1 netmask 255.255.255.0
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Reference

https://help.ubuntu.com/community/WifiDocs/Adhoc

Friday, August 3, 2007

Bison Lisp Grammar

My LP's home work about Lisp syntax parse.

Save it like lisp-grammar.y and run

# bison lisp-grammar.y

it will create the file lisp-grammar.tab.c with the code of the Lisp parse.

So, run ...
# gcc lisp-grammar.y -o parse


--- cut here ---

/*
* lisp-grammar.y - Lisp Grammar
*
* Copyright (C) 2007 Ragner Magalhaes
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License only.
*/


%{
#define YYSTYPE double
%}


%token NUMBER SYMBOL STRING SHARP_QUOTE
%start input

%%

input : /* empty */
| input line
;

line : '\n'
| s_exp '\n' { printf( "%g\n", $1 ); }
;

s_exp : atom
| list
;

atom : NUMBER
| SYMBOL
| STRING
;

list : '(' ')'
| '(' s_exp_list ')'
| '(' s_exp_list '.' s_exp ')'
| '\'' s_exp
| SHARP_QUOTE s_exp
;

s_exp_list : s_exp
| s_exp_list s_exp
;

%%

#include
#include

main()
{
yyparse();
}

yyerror( char * str )
{
printf( "lisp: PUUUUUU %s\n", str );
}

int yylex( void )
{
int ic;

while (ic = getchar(), ic == ' ' || ic == '\t') { ; }
if (ic == EOF)
return 0;
else if (isalpha(ic))
return STRING;
else if ( isdigit( ic ) )
return NUMBER;
else if ( ic == '\'')
return SHARP_QUOTE;
else switch (ic) {
case '+':
case '-':
case '*':
case '/':
return SYMBOL;
}
return ic;
}

---

Wednesday, August 1, 2007

Hillsong United's Show in São Paulo


Hi all,
finally I had a time to write about Hillsong United's Show in São Paulo.

To go was very still, fly on the time, I arrived in São Paulo friday, 27th 8pm.

On the show, saturday 28th, I arrived 4pm, the line already was enormous ... I waited a lot until 7pm to enter ...
But when the song started was Grace of God only ... [:D]
It was a true Grace ... very amazing and Awesome ...

Without more comments ... take a look at my movies ...

Good bless

Portuguese Language:

Olá a todos,
Finalmente tive um tempinho para escrever sobre o Show do Hillsong United em São Paulo.

Para ir foi tranquilo, vôo no horário, cheguei em São Paulo dia 27 na sexta 20:40 hs ...

No show, dia 28 no sábado, cheguei eram umas 16 hs, a fila já tava enorme ... esperei um tempão até as 19 hs para entrar, para variar o show atrasou, tiveram algums problemas por parte da organização, ocorreram algumas coisas chatas mas são coisas do diabo para tentar nos desanimar e desistir da Benção maior ... hehe
Quando o som começou a tocar foi só Graça ... hehe
Foi uma verdadeira Benção de Deus, aproveitei cada minuto ... foi D+

Sem mais comentários, é só ver os meu vídeos.

Em São Paulo nenhum problema!

Na volta, a viajem foi super tranquila, no avião deu até para deitar e dormir, não tinha ninguém nas poltronas do meu lado! Fiz o casaco de travisseiro e as poltronas de cama ... hehe

Paz ...

Friday, July 27, 2007

Travel to Hillsong United's Show


Hi all,
Today I am going for Hillsong United's Show, in São Paulo on this day 28.
A little anxious, mainly for the condition of our air transportation (Brazil), but with the Favour of God goes to occur all well.
All musics "All of Above" album learned [:D ]... now only to go for Favour [:)].

Peace

Portuguese language:

Viajem para o Show do Hillsong United.

Olá,
Hoje estou indo para o Show do Hillsong United, em São Paulo neste dia 28.
Um pouco ansioso, principalmente pela condição do nosso transporte aéreo, mas com a Graça de Deus vai dar tudo certo.

Todas as músicas do album "All of Above" decoradas [:D] ... agora é só ir para Graça [:)].

Paz.

Wednesday, July 18, 2007

Acidente Avião da TAM em Congonhas dia 17 de Julho


Portuguese language:

No fim deste mês, dia 27 de Julho, estou indo para o show do Hillsong United em São Paulo.
Hillsong United é uma banda Australiana muito boa, estilo Rock Pop com algumas músicas de puro louvor ao Senhor.
Tenho certeza que será uma grande noite, dia 28 de Julho, de celebração a Jesus Cristo uma grande experiência de intimidade com o Senhor nosso Deus.

Eu já estava bastante ansioso, mas ontem, dia 17 de Julho, deu um friozinho na barriga, o acidente com o avião da TAM no Aeroporto de Congonhas me deixou um pouco pensativo.
Esse acidente me deixou bastante triste, pode acontecer com qualquer um, amigo, familiar é para se pensar um pouco sobre a situação da aviação no nosso Brasil.

Mas tenho certeza que vai dar tudo certo na minha viajem, o meu vôo é para Guarulhos, é mais tranquilo a pista é bem maior.

Graça e Paz.