18 March, 2010 - 12:00 am
Tags: Android, branch, cmd, git, programming
Posted in english | No comments
Getting the Android’s AlarmClock application source from official repositories:
git clone git://android.git.kernel.org/platform/packages/apps/AlarmClock.git
To get the head version for an old platform like the 1.4 (codename donut), choose the correspondent branch using -o or –origin:
git clone git://android.git.kernel.org/platform/packages/apps/AlarmClock.git –origin donut
This is a simple program I wrote called Who Am I that shows informations about the device which it is running. Which can be useful for developers and maybe advanced users.
Download:
WhoAmI.tar.bz2 – Eclipse project. It’s configured for Android platform 4 (1.6) but should work without problems in newer Android platform versions.
WhoAmI.apk – Application installation Android [...]
27 February, 2010 - 9:39 pm
Tags: caps lock, Java, programming, socket, upcase
Posted in english | No comments
Here is a simple server for those who are starting studying sockets or just needs a simple socket server example for reuse while writing your own behavior.
Features:
A client should enter a string and the server would answer the same string, with each symbol in up case, when possible.
Default port at 8080.
One client at time.
No multi [...]
22 February, 2010 - 5:16 pm
Tags: development, i18n, Java, JUnit, locale, programming, String, teste unitário, toString, unit testing
Posted in english | No comments
Today I was programming a toString method for a class widely used in a application, using the very useful String.format that provides a C’s like printf formatter.
@Override
public String toString() {
return String.format("VO[a: %.1f, b: %.1f, c: %.1f]", a, b, a+b);
}
%.1f means a float with one digit precision after the dot separator. The code [...]
O pre-requisito é o notify-send, um utilitário de linha de comando do libnotify. No Ubuntu:
sudo aptitude install libnotify-bin
E aqui o script em si:
sleep 5m; notify-send “aviso” “tirar o miojo do fogo”
Pronto, depois de cinco minutos isso vai aparecer:
20 January, 2010 - 10:55 pm
Tags: date, datetime, ISO 8601, Jochen Voss, Markus Kuhn, programming, Python, representation, sort, sorting, time
Posted in english | No comments
I was looking for a date and time representation useful for registering stock quotes in a simple plain file.
I found that the standard ISO 8601 is just the answer for this, it’s called “Data elements and interchange formats — Information interchange — Representation of dates and times”. Here is a example:
2010-01-20 22:14:38
There’s this good article from [...]
5 January, 2010 - 6:10 pm
Tags: AWT, fonts, Java, JVM, Larabie, Larabie Fonts, programming
Posted in english | Comments Off
Here’s a program that lists fonts available in your JVM. You can also set the environment variable JAVA_FONTS to specify the font directory.
import java.awt.GraphicsEnvironment;
public class ListFonts {
public static void main(String args[]){
GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
for(String font:e.getAvailableFontFamilyNames()){
System.out.println(font);
}
}
}
By using pipes you can count how many fonts you have:
java ListFonts|wc -l
On my Ubuntu machine here I got 556 because [...]
25 December, 2009 - 3:04 pm
Tags: dtd, expat, game, programming, pygame, Python, sax, schema, urllib, XML
Posted in english | 1 comment
Here is a useful tip on Python XML decoding.
I was extending xml.sax.ContentHandler class in a example to decode maps for a Pygame application when my connection went down and I noticed that the program stop working raising a exception regarded a call to urlib (a module for retrieve resources by url). I noticed that the [...]
Now I’m calling this set of free and open art for my and others games I draw just by Openpixels. And to celebrate this and Christmas, here’s a pixel art game style Santa Claus. I hope he bring a lot a pixels in his bag.
Download: open_chars.xcf
11 December, 2009 - 7:47 am
Tags: game, orc, Pixelart, programming, pygame, Python
Posted in english | No comments
Here is a Pygame Sprite animation using the approach presented by Joe Wreschnig and Nicolas Crovatti. It’s not yet exactly what I need but is very suitable.
import pygame, random
from pygame.locals import *
class Char(pygame.sprite.Sprite):
x,y = (100,0)
def __init__(self, img, frames=1, modes=1, w=32, h=32, fps=3):
pygame.sprite.Sprite.__init__(self)
original_width, original_height = img.get_size()
self._w = w
self._h = h
self._framelist = []
for i in xrange(int(original_width/w)):
self._framelist.append(img.subsurface((i*w,0,w,h)))
self.image = [...]
11 June, 2008 - 10:16 am
Error in syntactic analysis in temp.fx:
java.lang.ArrayIndexOutOfBoundsException: -1
at org.antlr.runtime.Parser.getMissingSymbol(Parser.java:62)
at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:624)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:117)
at com.sun.tools.javafx.antlr.v3Parser.module(v3Parser.java:289)
at com.sun.tools.javafx.antlr.JavafxSyntacticAnalysis.parse(JavafxSyntacticAnalysis.java:70)
at com.sun.tools.javafx.main.JavafxCompiler.parse(JavafxCompiler.java:478)
at com.sun.tools.javafx.main.JavafxCompiler.parse(JavafxCompiler.java:519)
at com.sun.tools.javafx.main.JavafxCompiler.parseFiles(JavafxCompiler.java:825)
at com.sun.tools.javafx.main.JavafxCompiler.compile(JavafxCompiler.java:665)
at com.sun.tools.javafx.main.Main.compile(Main.java:597)
at com.sun.tools.javafx.main.Main.compile(Main.java:304)
at com.sun.tools.javafx.Main.compile(Main.java:84)
at com.sun.tools.javafx.Main.main(Main.java:69)
11 June, 2008 - 2:37 pm
@Vinay right is this moment JavaFX language are passing by some changes and getting better. Unfortunately this made mostly of my codes posted here not parseable using NetBeans JavaFX plugin.
For running them you should find out the JavaFX Pad and past this code there.
30 July, 2008 - 5:38 am
wow,so clean code and so effective~
16 September, 2008 - 9:22 am
toyv xmsodt enoswiv
16 September, 2008 - 11:06 am
jyrs
18 September, 2008 - 8:34 am
nzdy
20 September, 2008 - 1:09 pm
gzsexu sqtyw umsd ivkwha
6 December, 2008 - 3:25 am
JavaFX 1.0 is released, do you have a plan to rewrite your code to the latest syntax? That will be very helpful for people. Thanks.
19 March, 2009 - 2:12 am
opa ! estou com uma nova versao dos cabecudinhos,
muitas novidades !!!
http://www.athanazio.com/2009/03/19/javafx-os-cabecudinhos-preview-2009-03-18/
abs