Kiba-Dock on Slackware 12

February 20, 2008 by tresloukadu

Install kiba-dock on Slackware 12 is easy, but we have to attempt in some details. This installation will be on KDE.

Ok, let’s do it.

1 - DOWNLOAD

Go in your menu K -> Run Command and type konsole –ls <enter>

In the window konsole type cd <enter> and after mkdir kiba <enter> (Just to create a folder to put kiba files). Now open the new folder cd kiba <enter>

Copy and the paste the following command:

svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk kiba <enter>

(This command will download all kiba stuffs, just wait the download finish. I think you made a full installation of slackware, if you don’t and don’t have svn program go on linuxpackages and take it ).

2 - DEPENDENCIES

Most of the dependencies come together with Slackware 12 (If you did a full installation hehe).

To build Akamaru physics engine you need the following:

Legend: [come with slackware, and is ok]

automake
autoconf
gcc
libtool
intltool >= 0.35.0
gettext

To build kiba-dock itself you will need the following ones:

glib2 >= 2.12
gtk+2 >= 2.10
cairo >= 1.0.0
libxml-2.0
pango >= 1.10.0

(I’m not sure, but I think all of them come with slackware).

Optional Depends:

librsvg > 2.14.4 (for SVG support)
glitz >= 0.5.3
akamaru (for physics, we will build this one together).

To build kiba plugins we need these ones:

Dbus plugin
- dbus
- pygtk2-devel (to build the actual Dbus plugins, located in the kiba-dbus-plugins directory)

Gnome Stuffs

Gnome stuffs don’t come with slackware 12 because an obvious reason. So I didn’t install any gnome stuff. Is up to you, I will list here with anyone want…

Gmenu plugin
- libgnome-menu
Stack plugin
- libgnomeui-2.0 > 2.0.0
- libgnomevfs > 2.0.0
Sysinfo plugin
- libgtop > 2.0.0
Trash plugin
- libgnomevfs > 2.0.0

Runtime dependencies

To run, Kiba-dock requires:

X.org (>= 7.2) with Composite Extension enabled
(I will explain here, about xorg)

A composite window manager (eg - beryl, compiz, comiz-fusion, kcompmgr, xcompmgr)
(Don’t worry too much about these memory eater (but is cool :P) , I will explain here an easy way).

For (optional) SVG support: cairo compiled with –enable-svg
For (optional) GLITZ support: cairo compiled with –enable-glitz

The optional ones I didn’t istall.

3 - PREPARING XORG

This is easy. First of all in the konsole window type su - ( to get all root power, don’t forget the “-” in the command, this one is to set all root environment).

Run all the following commands as root user:

cd

mkdir backup

cp /etc/X11/xorg.conf /root/backup/xorg.conf_genuine

mcedit /etc/X11/xorg.conf

Midnight editor will open, go to the end of the file and paste the following lines:

Section “Extensions”
Option “Composite” “true”
EndSection

Hit <F10> to quit and save the file.

To make effect you do have to restart your X.

If you use gdm go in konsole and type: telinit 4 <enter>

If you don’t use gdm ( slackware default setting ): Go on K menu -> Logout user… and end your session, and in bash type: startx <enter> To start kde again.

Now the things are working awesome. At first all the thing seems the same.

The easy way is to use xcompmgr rather than beryl or compiz. You can take the source of xcompmgr on http://freedesktop.org/xapps/release/

This program do some cool stuff like transparent windows etc… and don’t eat too much memory ;). My tip here is to download too this other program transset-df
http://www.forchheimer.se/transset-df/
witch is a kind of manager to composite. Go on google and find how it works because I my objective here is kiba-dock.

To install xcompmgr transset-df from the source is easy like “next” “next” “next” “finish”. unntar them with tar -zxvf go on directory hit an ./configure , make, make install.

JavaScript: A Menos Entendida Linguagem de Programação do Globo!

October 20, 2007 by tresloukadu

I will be publishing here articles from the guru Douglas Crockford page in Portuguese with the aim to help people who don’t know English. The translation to Portuguese is not so good, I have to improve the technical information and other things. The version of this translation could be 0.1 hehe. But is understandable though :)

Eu estarei publicando aqui uma série de artigos da página do Douglas Crockford com o objetivo de ajudar o pessoal que não sabe muito bem o português. A tradução não está totalmente boa, mas dá pra entender :). Com o tempo eu vou melhorando. Essa versão poderia ser considerada a 0.1 hehe.


JavaScript também conhecido por “Mocha”, “LiveScript”, “JScript” e “ECMAScript”, é uma das linguagens de programação mais populares do mundo. Praticamente todos os computadores pessoais do ao redor do globo, têm pelo menos um interpretador JavaScript instalado e em uso. Essa popularidade é devida inteiramente ao seu papel como “linguagem de script para o ambiente Web”.

Fora todo esse sucesso, poucas pessoas sabem que o JavaScript é uma linguagem excelente de programação, dinâmica, orientada a objetos e também para usos gerais (fora do ambiente Web). Mas umas dúvidas surgem na mente: Como isso pode ser um segredo? Porque essa linguagem é tão mal compreendida?

O Nome

O prefixo “Java” sugere que o JavaScript possui de alguma forma uma relação com o Java da Sun, isto é, uma sub-linguagem ou uma versão menos capaz do Java. Java é simplesmente Java interpretado. JavaScript é uma linguagem totalmente diferente.

JavaScript tem uma similaridade sintática com o Java, mas do que com o Java tem com o C. Mas não é uma sub-linguagem do Java, assim como o Java não é uma sub-linguagem do C. É muito melhor do que o Java em aplicações em que o próprio Java (chamado Oak antigamente) fora originalmente projetado para poder implementá-las.

Além do mais, o JavaScript não foi desenvolvido na Sun Microsystems, a casa do Java. Mas sim pela Netscape. Esta linguagem foi originalmente chamada de “LiveScript”, mas este nome não era confuso o bastante.

O sufixo “Script” sugere que não é uma linguagem de programação real, que uma linguagem de script é menos capaz do que uma linguagem de programação. Mas isso é realmente um assunto de profissionalismo. Comparado com o C, o JavaScript consegue um expressivo poder de performance e dinamismo.

Lisp vestido de C

A sintaxe do JavaScript é parecida com a do C, incluindo as chaves “{}”, e o suporte para a declaração “for”, com essas semelhanças o JavaScript parece ser mais uma linguagem de programação procedural comum. É óbvio que isso é um equívoco porque o JavaScript tem muito mais a ver com uma linguagem funcional como o Lisp ou Scheme do que com o C ou o próprio Java. O JavaScript tem arrays ao invés de listas e objetos ao invés de listas de propriedades. Funções são primeiramente classes. Ele tem closures. Você pode utilizar os lambdas (ou funções anônimas (sem nomes) , veja o exeplo abaixo) sem ter a necessidade de utilizar todos aqueles parênteses.

1 alert(function(){return “oi”;}());

Typecasting (Conversão de Tipos)

O JavaScript foi projetado pra rodar no navegador Netscape. O seu sucesso o conduziu para se tornar uma característica padrão em praticamente todos os navegadores. O resultado disso foi a necessidade de typecasting. JavaScript é o George Reeves das linguagens de programação. Pois se adequa bem para classes de grande porte em aplicações não relacionadas com o mundo Web.

Mudando o Objetivo

As primeiras versões do JavaScript eram muito fracas e careciam de muitas funcionalidades. Faltavam nelas manipuladores de exceção, funções privadas, e herança. Mas o JavaScript no seu formato atual remete sim, a uma linguagem orientada a objetos. Embora muitas das opções da linguagem são baseados em formatos não muito bem desenvolvidos.

Alguns Probleminhas

Nenhuma linguagem de programação é perfeita. O JavaScript tem as suas próprias falhas, como sobrecargas (overloading) de “+” pra representar operações matemáticas de adição e também para concatenação como um tipo de coerção (é decidido na hora se o código está somando ou concatenando), e o erro consciente do uso da expressão “with” deve ser evitado. Aliado a isto tem as políticas de palavras reservadas que são muito rígidas. E o acréscimo de ponto-e-vírgula é uma grande falha, assim como era o uso da notação de expressões regulares. Esses erros deviam conduzir a erros de programação, e a colocar em cheque a estrutura da linguagem. Ainda bem que muitos desses problemas podem ser minimizados com um bom programa lint (curativo).

A estrutura da linguagem como um todo é bastante sólido e completo. De um modo surpreendente o comitê ECMAScript não parece muito interessado em corrigir esses problemas (talvez eles estão interessados em crias novos).

Aplicações Não Bem Projetadas

Algumas das aplicações mais antigas do JavaScript eram um tanto bugadas. Isso repercutiu negativamente na linguagem. Misturado com tudo isso essas aplicações eram adicionadas em navegadores horríveis e propensos a falhas.

Livros de Má Qualidade

Quase todos os livros de JavaScript são horríveis. Eles possuem erros, exemplos pobres e promovem más práticas de programação. As características importantes da linguagem são explicadas de uma maneira pobre e vazia, ou então são simplesmente deixadas de lado. Eu tenho examinado vários livros de JavaScript, e um eu posso recomendar é: JavaScript: The Definitive Guide (5th Edition) de David Flanagan. (Atenção autores: Se vocês escreveram algum livro bom sobre o assunto, por favor, me envie uma cópia de avaliação).

Sub-Norma da Norma

A ECMA é o órgão que publica a especificação oficial da linguagem. Mas como era de se esperar esta especificação não possui muita qualidade e é extremamente pobre. Ela é difícil de ler e de ser entendida. Isso tem sido uma contribuição para o problema dos livros ruins, porque os autores tem sido incapazes de utilizar os documentos com as normas e melhorar com a sua própria compreensão da linguagem. ECMA e o TC39 devem estar muito envergonhados.

Amadores

A maioria das pessoas que programam em JavaScript não são programadores. Faltam nessas pessoas treinamento, e disciplina para escrever um bom programa. Com o poder expressivo que o JavaScript possui essas pessoas podem ser capazes de fazer coisas surpreendentes com essa linguagem, de qualquer forma… Isso tem dado ao JavaScript a reputação de estar limitado a amadores, que não é adequada a programadores profissionais. É claro que isso não é simplesmente o caso.

Orientação a Objetos

O JavaScript é orientado à objetos? Bem, ele contém objetos que podem conter dados e métodos que agem sobre esses dados. Objetos podem conter outros objetos. O JavaScript não possui classes, mas possui construtores que são capazes de fazer o que as classes fazem, incluindo agir como contêineres para classes de variáveis e métodos. Ele não possui herança orientada a classe, mas tem herança orientada a protótipo.

Os dois modos de se fazer sistema de objetos são por herança (é-a) e por agregação (tem-a). O JavaScript tem a capacidade de fazer os dois modos mas por sua natureza dinâmica, ele permite o uso de agregação. Alguns debatem que o JavaScript não é verdadeiramente orientado à objetos porque ele não provê um modo para esconder informações. Isto é, objetos não podem possuir variáveis e métodos privados: Todos os membros são públicos. Mas isso não é de todo verdade, pois os objetos do JavaScript podem possuir variáveis e métodos privados (Clique aqui, e veja como é possível). Mas é claro, poucos sabem disso, pois o JavaScript é a linguagem de programação pior entendida no mundo.

Alguns argumentam que o JavaScript não é verdadeiramente orientado à objetos porque não possui herança. Mas na verdade essa linguagem não somente aceita herança como também outros modelos de reuso de código.

Artigo Original em Inglês em javascript.crockford.com/javascript.html por Douglas Crockford.

É isso por enquanto :)

Brazilian Portuguese for Dummies ( Lesson 1 )

October 12, 2007 by tresloukadu

Is always hard to learn a new language… But is sooo cool. I always try to learn at least the basics of languages… step-by-step i will improving … For this reason im letting here some tips about Brazilian portuguese… ( Brazilan portuguese is almost the same of the all the portuguese speakers around the world, in countries like Angola, Portugal, Açores, Madeira, Timor Leste and Macau… The major difference in Brazilian Portuguese is the accent which is more calm and light (soft) is not soo strong and fast like the other countries mentioned here).

Oi - Hi
Olá - Hello
Daê - (Brazilian slang for “hi” or “hello”, kinda like “hey” in English).
Daê bróther - (Brazilian slang for “hi mate”, or “hello brother”).

Bom Dia - Good Morning
Boa Tarde - Good Afternoon
Boa Noite - Good Night / Good Evening ( Both )

Como vai? ( literally means “How go?” is a contraction of Como vai você? ) How are you?
Tudo Bem? ( “Everything Good??” the same for How are you )
Como você está? - How are you?
Qual é o seu nome? - What is your name?
Como você se chama? - (literally mean “How u call you?” means too What is your name? )
Qual é o seu sobrenome? - What is your last name?
Prazer - ( literally means “Pleasure” but in the context hes sayin means “Nice too meet you.)
Muito prazer em conhecêlo. - Nice to meet you ( The extended way of “Prazer” ).
Beleza? - (literally means “beauty”, the itention here is asking if the things in our life is beautiful or good).
Tudo Beleza? - (literally means “everything beauty”, the itention here is asking if all the things in our life is all beautiful or all good).

De onde você é? - Where are you from? (both male and female).
Você é brasileiro? - Are you brazilian? (Asking for a guy).
Você é brasileira? - Are you brazilian? (Asking for a lady).
Você é americano? - Are you american? (Asking for a guy).
Você é americana? - Are you american? (Asking for a lady).
Onde você mora? - Where you live? (both male and female).

Qual é a sua idade? - (literally means “What is your age?” means How old are you? )
Quantos anos você tem? - ( literraly mean “How much age you have?” means How old are you? )

Até logo - See you later (literally means up (until) later)
Até mais - See you later (literally means up (until) more )
Tchau - Bye
Falou - (literally means “said” … is a brazilian slang to say “bye” broadly used by youngs).

Preamble (Intendend Application and Limitations on Use)

August 4, 2007 by tresloukadu

The NMEA 0183 standard is intendend to support one-way serial data transmission from a SINGLE TALKER to one or more LISTENERS. The data transmited is human readable because is in ASCII and the data includes information such as: position, speed, depth, frequency, allocation, altitude, course, etc… And the instruments which can “speak” in NMEA can be GPS, Weather, Sounder, Heading, Velocity, Randar and others. A typical message in ACII mode might be 11 to a maximum of 79 characters in length and generally require transmission no more often than once per 20 mili-seconds.

The eletronical definitions in this standard are intended to operate at 38.4K-baud, a higher data rate than 4800-baud NMEA 0183.

IMPORTANT: Since there is no provision of guaranteed delivery of messages and only limited error-checking capability, this standard should be used with caution in crtical applications.

Just to understand:

1 - TALKER: Is any device that sends data to other devices within NMEA standard. We can indentify the type of talker by the 2-character mnemonic.

Some of these 2-character mnemonic can be for example:

Heading Track Controller (Autopilot) General AG*
Magnetic AP
Automatic Indentification System AI
COMUNICATIONS: Digital Selective Calling (DSC) CD*
Data Receiver CR
Satellite CS*
Radio-Telephone (MF/HF) CT*
Radio-Telephone (VHF) CV*
Scanning Receiver CX*

DECCA Navigator DE
Direction Finder DF*
Eletronic Chart System (ECS) EC
Eletronic Chart Display & Information System (ECDIS) EI
Emergency Position Indicating Beacon (EPIRB) EP*
Engine room Monitoring Systems ER
GLONASS Receiver GL
Global Navigation Satellite System (GNSS) GN
Global Positioning System (GPS) GP
HEADING SENSORS: Compass, Magnetic HC*
Gyro, North Seeking HE*
Gyro, Non-North Seeking HN

Integrated Instrumetation II
Integrated Navigation IN
Loran C LC
Propietary Code P
Radar and/or Radar Plotting RA*
Sounder, depth SD*
Eletronic Positioning System, other/general SN
Sounder, scanning SS
Turn Rater Indicator TI*
VELOCITY SENSORS: Doppler, onther/general VD*
Speed Log, Water, Magnetic VM
Speed Log, Water, Mechanical VW
Voyage Data Recorder VR
Transducer YX
TIMEKEEPERS, TIME/DATE: Atomic Clock ZA
Chronometer ZC
Quartz ZQ
Radio Update ZV
Weather Instruments WI

*Designated by IEC for use with IMO maritime eletronic devices. This is the minimum requirement for equipment that is required by IMO in the SOLAS Convention (1974, as amended).

2 - LISTENER: is any device that receives data from another device within the NMEA standard.

Thats it, for now.
References:

Nmea Publications, NMEA 0183-HS 38.4 K Baud Serial Data Standard For Interfacing Marine Eletronic Devices, Version 1.01, November 1, 2002

Nmea 0183 Standard For Interfacing Marine Eletronics Devices, Version 3.01, January 1, 2002

What is NMEA?

August 3, 2007 by tresloukadu

According to NMEA website www.nmea.org : “The National Marine Electronics Association (NMEA) is the unifying force behind the entire marine electronics industry, bringing together all aspects of the industry for the betterment of all in our business“. We can take a close look in the following sentence “unifying force behind the entire marine eletronics industry“, yeah is a standard.

The aim of NMEA standard is to facilitate the interconnection and interchangeability between different equipments minimizing misunderstanding and confusion between manufactures and assisting purchasers in selecting compatible equipment.

If I have an antenna or a receiver which respects the NMEA standard protocol, is possible send information from it to Radar or Sounder or any other stuff that can understand NMEA protocol.

Nowadays some applications largely used is to take a GPS which transmits the information by NMEA protocol and develop programs that interpret all the information from GPS and do many richest stuffs. Like showing the position in a web map, do a tracker or any other stuff really interesting and useful.

I will show here a lot of things about NMEA, because is not so easy find this kind of information on internet. We can find on internet some tables/schemes showing what is some kind of protocol but any other information besides it. I will put here too, some parts of NMEA publications because these publications is really expensive. (But I won’t put the entire publications because I should respect copyright laws, but some citation, examples, parts and references I will put ;) ). I want do this to help the people who hasn’t enough money to buy the documents.

Well I think that for my first article is ok. I’m accepting feedback too correct some wrong information that I wrote or some advice.

Thats it. Seeya!

References

www.nmea.org

Nmea Publications, NMEA 0183 Standard for Interfacing Marine Eletronic Devices, Version 3.01, January 1, 2002.