Skip to content

Category: english

List of popular programming book acronyms

I found cool this list on reddit.

  • AIMA Artificial Intelligence a Modern Approach by Stuart Russell and Peter Norvig
  • AMOP The Art of the Meta Object Protocol by Gregor Kiczales
  • ATTAPL Advanced Topics in Types and Programming Languages by Benjamin C. Pierce
  • AWDWR Agile Web Development with Rails by by Dave Thomas and David Heinemeier Hansson
  • EOPL Essentials of Programming Languages by Daniel P. Friedman, Mitchell Wand, and Christopher T. Haynes
  • CLR Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
  • CLRS Introduction to Algorithms, 2nd Edition by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliff Stein
  • CLtL Common Lisp the Language by Guy L. Steele Jr.
  • CTM Concepts, Techniques, and Models of Computer Programming by Peter Van Roy and Seif Haridi
  • GOF Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (the Gang of Four)
  • HOP Higher-Order Perl by Mark Jason Dominus
  • HTDP How To Design Programs by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt and Shriram Krishnamurthi
  • K&R The C Programming Language by Brian Kernighan and Dennis Ritchie
  • LiSP Lisp In Small Pieces by Christian Queinnec
  • LL Lessons Learned in Software Testing by Cem Kaner, James Bach and Bret Pettichord
  • PAIP Paradigms of Artificial Intelligence Programming by Peter Norvig
  • PCL Practical Common Lisp by Peter Seibel
  • PLP Programming Language Pragmatics by Michael L. Scott
  • SICP Structure and Interpretation of Computer Programs by Hal Abelson and Gerald J. Sussman, with Julie Sussman
  • TAOCP The Art Of Computer Programming by Donald E. Knuth
  • TAPL Types And Programming Languages by Benjamin C. Pierce
  • TCPL The C++ Programming Language by Bjarne Stroustrup
  • TCS Testing Computer Software by Cem Kaner, Jack Falk, and Hung Quoc Nguyen
  • TLS The Little Schemer by Daniel P. Friedman and Matthias Felleisen
  • TSPL The Scheme Programming Language by R. Kent Dybvig
  • TSS The Seasoned Schemer by Daniel P. Friedman and Matthias Felleisen
  • TRS The Reasoned Schemer by Daniel P. Friedman, William E. Byrd and Oleg Kiselyov
  • WELC Working Effectively with Legacy Code by Michael Feathers

Graduation Party

Silveira Neto, Heraldo Carneiro and Cassiano Carvalho
Me, Heraldo Carneiro and Cassiano Fontenele.

Gorila (me) and Deborah
I’m the furry one with my girlfriend.

This year I’ll be graduated in Computer Science by UFC. We anticipate the party so we all can come. Was really a wonderful party. Thanks all made this celebration possible.

Below some photos from my graduation party.

You can see all photos on it’s album.

Pointers to functions in C++

I need to implements some codes in C++. Just remembering some concepts like pointers to functions.

A simple example:

#include <stdlib.h>
#include <iostream>

using namespace std;

double evalFunction(double (*f)(double), double param){
    return f(param);
}

double function(double x){
    return x/2;
}

int main(int argc, char** argv) {
    cout << function(5.0) << endl;
    cout << evalFunction(function, 5.0) << endl;
    return (EXIT_SUCCESS);
}

Ilex Paraguariensis

Chimarrão Gaúcho
Creative Commons image from Flickr.

From days 15 to 20 from April, I’ll be in Porto Alegre. I’ll participate on FISL (an old dream) with the presentation “Netbeans: beyond Java”. I’d like to talk about how you can use Netbeans as a great IDE for languages others than Java like Ruby, PHP, JavaFX, Javascript, Python, etc.

Probably I’ll be able to participate also on two events before FISL (about Opensolaris and Java ME). 🙂

So … how chimarrão tastes?

Simple Java Chronometer

A very simple Java chronometer code (inspired in the chronometer code in Opale project) you can use for simples measures.

In the main method there’s a example of use.

public final class Chronometer{
    private long begin, end;

    public void start(){
        begin = System.currentTimeMillis();
    }

    public void stop(){
        end = System.currentTimeMillis();
    }

    public long getTime() {
        return end-begin;
    }

    public long getMilliseconds() {
        return end-begin;
    }

    public double getSeconds() {
        return (end - begin) / 1000.0;
    }

    public double getMinutes() {
        return (end - begin) / 60000.0;
    }

    public double getHours() {
        return (end - begin) / 3600000.0;
    }

    public static void main(String[] arg) {
        Chronometer ch = new Chronometer();
        
        ch.start();
        for (int i = 1;i<10000000;i++) {}
        ch.stop();
        System.out.println(ch.getTime());
        
        ch.start();
        for (int i = 10000000;i>0;i--) {}
        ch.stop();
        System.out.println(ch.getTime());
    }
}

Compiling and running this code gives you something like:

191
12

Maybe you got surprised with this. The first loop, with 10 millions of steps is slower than the second, also with 10 millions of steps.

Why?

Some processors (like x86) have an zero-flag in their ALU. Using it is faster perform the question i≠0 than i<K (for a K≠0). In a loop with 10 millions iterations this difference can be perceptible. And this is not just for Java. You can try those loops in others language and see this behavior.

Think twice next time you write a big loop. 🙂

My first computer, CP 400 Color II

Me and my CP 400 Color
My firsts contacts with computers…

My first computer was an CP 400 Color II (CP is the shorten of Personal Computer in Portuguese). It was manufactured here in Brazil by a company called Prológica and launched in middle of 1984. It used a black & white tv and a casset reader of tapes with programs. We also had the CPU/keybord, monitor, joysticks and some cartridges and tapes.

Me and my CP 400 Color
Some years later

With this computer I did my firsts steps with command line tools and programming (BASIC).

Commercials:

CP400 Color Comercial
Original image from MCI.

Links:

Slides for Java Students Group

These are the slides for the presentation this Thursday at the first meeting of Java Students Group (JEG) at UFC. Is about Sun certifications in general and also a brief look over SCJA.

As usually, you can download the slides as ODT or PDF. 😉

See you there.

Updated: Thanks for your presence. Let’s try it again soon.

Público no encontro do JEG

You can find more photos here.

Java, listing system properties

This code prints out your system properties.

import java.util.Properties;

public class PropertiesLister{
   public static void main (String args[]){
       Properties props = System.getProperties();
       props.list(System.out);
   }
}

In the machine I’m writing right now:

— listing properties —
java.runtime.name=Java(TM) SE Runtime Environment
sun.boot.library.path=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
java.vm.version=1.6.0-b105
java.vm.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
path.separator=:
java.vm.name=Java HotSpot(TM) Server VM
file.encoding.pkg=sun.io
user.country=BR
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=unknown
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/tmp
java.runtime.version=1.6.0-b105
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.endorsed.dirs=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
os.arch=i386
java.io.tmpdir=/tmp
line.separator=

java.vm.specification.vendor=Sun Microsystems Inc.
os.name=Linux
sun.jnu.encoding=UTF-8
java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
java.specification.name=Java Platform API Specification
java.class.version=50.0
sun.management.compiler=HotSpot Server Compiler
os.version=2.6.20-16-generic
user.home=/home/export/silveira
user.timezone=
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=UTF-8
java.specification.version=1.6
user.name=silveira
java.class.path=.
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=/usr/lib/jvm/java-6-sun-1.6.0.00/jre
java.specification.vendor=Sun Microsystems Inc.
user.language=pt
java.vm.info=mixed mode
java.version=1.6.0
java.ext.dirs=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
sun.boot.class.path=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/…
java.vendor=Sun Microsystems Inc.
file.separator=/
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport…
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
sun.cpu.isalist=

Try out at your home. 🙂