Using Sorted Sets with Jedis API

Sorted Sets and Jedis In the previous post we started looking into Jedis API a Java Redis Client. In this post we will look into the Sorted Set(zsets). Sorted Set works like a Set in the way it doesn’t allow duplicated values. The big difference is that in Sorted Set each element has a score in order to keep the elements sorted. We can see some commands below: import java.util.HashMap; import java. Read On →

Getting Started With Jedis

Hi, These days I started looking into Redis. I’ve heard a lot about it so I decided to have a try. Redis is defined in its websites as “an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets”. We can find very good examples on where Redis is a good fit on the Shades of Gray blog. Read On →

Objetos e classes em javascript

Olá Pessoal, Este é o meu primeiro screencast e estarei falando um pouco a respeito de criação de classes e objetos com javascript. Por se tratar do primeiro, então temos muitos pontos a melhorar :), por isso sugestões são muito bem vindas para que possamos melhorar os próximos screencasts. Segue o vídeo abaixo: [vimeo w=400&h=300] Objetos e classes com javascript from Francisco Junior on Vimeo.

Batch Insert with JDBC

Hi, In the current project I’m working on, we had a requirement to import some data from an Excel Spreadsheet and import them into the database. So, bascially we need to read from the spreadsheet and insert into the database. Initally we started using single insert statements, but we realized that wouldn’t be a good choice, for performance reasons. If we have a spreadsheet with too much data, we could decrease the database performance with so many single statements executed. Read On →

Private variables in javascript

In OOP we learned the importance of the encapsulation. In java we could encapsulate a variable through the keyword private, that says that variable is visible only in that object. In javascript we don’t have a specific keyword like that, but there are different ways to accomplish this behavior. In this post I’ll talk about two ways of doing that: 1- Declaring function scoped variables using var: Let’s say we have an contructor function called User, and this function defines that an user object will have the following properties: Read On →

Playing with classes and objects in Javascript

So, let’s play a little bit with classes and objects in Javascript. If you come from the class based languages like Java and C++, the way we handle classes in javascript looks a little bit strange. First, javascript is not class based, so, it doesn’t have the entity class. A class in javascript is a function. So we can see a simple class in the example below: MyClass = function(){ }; var instance = new MyClass(); So, to create a new class in javascript we only need to define a new function. Read On →

Dicas para conseguir o primeiro emprego em desenvolvimento de software

Eu não sou um super especialista nesse assunto, mas aqui vão dicas que no meu ponto de vista me ajudaram a conseguir meu primeiro estágio, além de outras dicas que teriam me ajudado se soubesse na época ;) Basicamente a lista se resume a um ponto: Ganhe experiência com trabalho voluntário Muitas das vagas de estágio pedem candidatos com experiência. Mas aí você se pergunta,_ “se é um estágio por que pedem experiência? Read On →

Starting With EJB 3

I’m currently studying to take SCEA, so, even after so long time after the EJB3 specification was released I took my first look into it only now. For sure, one of the most important change was the simple way to develop our EJB components, now POJO based with annotations, so, we can be away from the XML configuration as maximum as possible. To run this example I used: - Glassfish V2 Read On →

Scriptless JSPs

In the last 2 years I’ve been working with CMS solutions. Actually creating Templates to display the content retrieved from the CMS. So, basically we need to retrieve the content from the System. And having this content we need to apply some business logic to then diplay the content. For presentation we use JSPs. In the basic archtecture we have the JSP as presentation, the classes with the business logic and the classes to access the data (via SQL or CMS API). Read On →

Creating XML Using JAXB

Hi, In this post we will show a simple example on how we can create XML using JAXB. JAXB _“constitutes a convenient framework for processing XML documents, providing significant benefits as compared to previously available methods such as the one following the Document Object Model (DOM). In the DOM approach, the parser creates a tree of objects that represents the content and organization of data in the document. The application can then navigate through the tree in memory to access the data it needs. Read On →