Silveira’s Blog
Quidquid latine dictum sit, altum viditur…Java Calendar Examples
Posted July 1st, 2008 in Uncategorized
import java.util.Calendar;
public class Main {
public static void main(String[] args) {
Calendar today = Calendar.getInstance();
System.out.println("Today is " + today.getTime());
}
}
In this simplest example of Calendar, the output would be
Today is : Tue Jul 01 10:56:14 BRT 2008
In the next example how to get information about the day inside the year, month and week.
import java.util.Calendar;
public class Main {
public static void main(String[] args) {
Calendar today = Calendar.getInstance();
int dof = today.get(Calendar.DAY_OF_YEAR);
int dom = today.get(Calendar.DAY_OF_MONTH);
int dow = today.get(Calendar.DAY_OF_WEEK);
System.out.println("Today is the " + dof +"º day in this year,");
System.out.println("the " + dom +"º day in this month");
System.out.println("and the " + dow +"º day in this week.");
}
}
The output could be
Today is the 183º day in this year,
the 1º day in this month
and the 3º day in this week.
The next example is about how to add (and subtract) a duration from a Calendar.
import java.util.Calendar;
public class Main {
public static void main(String[] args) {
Calendar today = Calendar.getInstance();
System.out.println("Today is " + today.getTime());
Calendar yesterday = (Calendar)today.clone();
yesterday.add(Calendar.DATE, -1);
System.out.println("Yesterday was " + yesterday.getTime());
Calendar tomorow = (Calendar)today.clone();
tomorow.add(Calendar.DATE, 1);
System.out.println("Tomorow will be " + tomorow.getTime());
}
}
A typical output would be
Today is Tue Jul 01 10:44:18 BRT 2008
Yesterday was Mon Jun 30 10:44:18 BRT 2008
Tomorow will be Wed Jul 02 10:44:18 BRT 2008
Event Review: JavaDay Juazeiro do Norte
Posted June 16th, 2008 in englishRafael Carneiro, Tarso Bersa, Rafael Ponte and me, after 8 hours of bus travel, arrived in Juazeiro do Norte to talk at the first JavaDay there.
- Rafael Carneiro talked about Java Certification.
- Tarso Bersa talked about Spring Framework for JEE applications.
- I talked about NetBeans 6.
- Rafael Ponte talked about JavaServer Faces.
We answered a lot of questions and gave lot of gifts. I also showed the Sun Academic Initiative, which they are already subscribed. We also showed several opportunities they can participate with CEJUG like free vouchers or a free travel for Belgium.
Some pictures we took. These ones during the bus travel. We saw a nice sunrise through beautiful landscapes.
We playing guitar hero.
The city have their own shopping with games, restaurant and cinema.
The main atraction at Juazeiro is a statue of Padre (Priest) Cícero with 7 meters itself and more 8 meters of base. Pilgrimage to this statue takes place in his honour every November, attracting thousands of followers. The city’s economy is highly influenced by those travelers devotes.
There’s a museum with several personal objects from Padre Cicero. People go there in order to thanks for miracles. If you got your a part of your body cured, of place there a wooden replica of that part of your body. If you got a car, you place a wooden car or a photo, and so on. There is thousands, maybe millions, of objects theres.
You can see all photos at Carneiro’s album or in my album.
CEJUG, JavaMe, Domain Driven Design and CruiseControl
Posted May 18th, 2008 in Uncategorized
This saturday we had our CEJUG traditional event CCT (Café com Tapioca) done monthly, each time in a diferent university. This time we had three speakers, Vando Batista, Rafael Pontes and Luthiano Vasconcelos talking about Java ME, Domain Driven Design and Cruise Control respectively.

Rafael Carneiro opening the event.

All photos I took (just a few due to weak batteries in my camera) are hosted in this album. This was out first event recorded and streamed by TV Software Livre. Thanks also guys from ArgoHost who made it possible.
Eventos de Software Livre ainda essa semana
Posted May 15th, 2008 in UncategorizedEssa semana está cheia de eventos relacionados a Software Livre e quem está em Fortaleza não pode perder essas oportunidades. Para citar alguns:
![]()
Esse ano estão havendo várias palestras sobre Software Livre e Cultura Livre dentro da InfoBrasil e a prefeitura de Fortaleza cedeu um bom espaço para a comunidade montar um estande sobre o tema. Aproveitando o espaço nós montamos uma mini-grade de mini-palestras
14 de maio (Quarta-feira)
Tarde/Noite
16:00 - 17:00
Título: Metodologia de teste de segurança OSSTMM
Palestrante: Fernando Chucre17:00 - 18:00
Título: Conhecimento Livre e Software Livre…
Entendendo como funciona e o que é.
Palestrante: Roberto Parente é Bacharelando de Ciência da Computação da Universidade Federal do Ceará, faz parte do grupo de pesquisa “Paralelismo, Grafos e Otimização” (ParGO) e membro do Grupo de Estudo de Linux e Software Livre (GELSoL).
15 de maio (Quinta-feira)
Tarde/Noite
16:00 - 18:00
Título: Trabalhando na internet com E-groupware e WordPress MU
Palestrante: Fernando Chucre
16 de maio (Sexta-feira)
Manhã
9:00 - 12:00
Título: Novidades do BrOffice.org 3.0 com sorteio de brindes
Palestrante: Marcus de Vasconcelos Diogo da Silva (ONG BrOffice.org)Tarde/Noite
15:00 - 16:30
Título: Sistema Operacional OpenSolaris: palestra sobre as novidades e inovações do sistema operacional OpenSolaris e sobre o lançamento da distribuição OpenSolaris 2008.5.
Palestrante: Silveira Neto, é bacharelando em Computação na Universidade Federal do Ceará, Embaixador de Campus da Sun Microsystems e pesquisador no tema de Computação de Alto Desempenho no grupo de pesquisa ParGO.* Ao final da palestra haverá sorteio de brindes do OpenSolaris.
16:30 - 18:00
Título: Postgree SQL porque migrar?
Palestrante: Coutinho Nabucodonossor é participante da Comunidade Postgree.
As palestras são gratúitas e o acesso é livre. Maiores informações no site da InforBrasil. Também há a grade do congresso que também conta com mais palestras sobre o tema, mas estas são pagas. Você confere elas também no site da InforBrasil.

E para fechar com chave de ouro a semana, o CEJUG promove o já tradicional evento mensal Café com Tapioca, esse sábado.
O evento acontece na Faculdade Lourenço Filho e a grade é essa:
| Horário | Palestrante | Tema |
|---|---|---|
| 09:00 as 09:50 | Rafael Ponte | Entendendo Domain Driven Design |
| 09:55 as 10:50 | Vando Batista | Desmistificando o JavaME |
| 10:50 as 11:10 | coffee-break | - |
| 11:10 as 11:50 | Luthiano Vasconcelos | Integração Contínua com Cruise Control |
Não percam, maiores informações no site do evento.
Silveira’s Blog is proudly and spiffily powered by WordPress. Spiffty theme by Noel Cower.


































