Sightly Date Formatting With Javascript Use API

In this post we will show how to use the Javascript use API for date formatting

Read On →

Connect to a MySQL Database from AEM

AEM allows to connect to external RDBMs via JBDC using OSGI bundles. In this posts we will show how to connect to a mysql DB from AEM.

Read On →

Create a configurable OSGI Service

OSGI is a key technology on Adobe AEM’s stack. AEM uses Apache Felix as its OSGI container. In this post we will show how to create a Configurable OSGI Service on Apache Felix. A configurable service allows to manage its properties through Apache Felix Web Console. In this example we will use Adobe AEM 6.0, Eclipse as IDE with the AEM Developer Tools for Eclipse, it provides a wizard to create a maven project using the aem archetype. Read On →

Include AdMob Banner on Cocos2d-x Android Game

Hi, In this post we will show a piece of code that will help you to add an admob banner on your cocos2d-x game in android. Firstly, you need to setup the google play services on your app. Then you need to include on your AndroidManifest.xml the Admob activity and the required permissions. <activity android:name="" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> Then on your Activity, you need to put this piece of code on the onCreate method: Read On →

Redis SORT with Jedis

In this post we will talk about the Redis SORT command. Redis provides the SORT command that we can use to retrieve or store sorted values from a LIST, SET or ZSET. The simplest form we can use the command over a KEY like the example below: SORT numbers_list This will sort the values contained in the key and return them. The command sorts the values as numbers. So, lets say we have a list with the following values: Read On →

Simple Message Queue using Redis

In this posts we will use Redis as a simple message queue, using list commands. Let’s say we have an application that allows the users to upload a photo. Then in the application we display the photo in different sizes like Thumb, Medium and Large. In a first implementation we could have the task of processing the uploaded image in the same request. As it is an expensive task, it would make our requests slow. Read On →

Using an Embedded Tomcat with Maven tomcat plugin

When developing a java web application using the Eclipse WTP, we need to have an installation of tomcat in the machine in order to execute the application. If you are using Maven on your project, you can use the tomcat plugin to run an embedded tomcat installation and test the application. It is very simple as you can see below. OBS: To execute the steps given in this post you need to have installed in your eclipse the m2e plugin. Read On →

Simple CRUD using Servlet 3.0, Redis/Jedis and CDI – Part 2

In this post we will focus on CDI and Servlet 3.0. You can see part 1 here. Let’s start with CDI. When I started writing the post that originated this serie, I was not thinking in writing about CDI. To be sincere I’ve never used that before. The idea of the post was to create a crud using jedis and servlets. But when I was writing the application I simply hated the idea to instantiate the beans. Read On →

Simple CRUD using Servlet 3.0, Redis/Jedis and CDI - Part 1

In this post we will build a simple user crud. The data will be stored in Redis. To interact with Redis we will use Jedis library. CDI for Depedency Injection and Servlet 3.0 for the view. Let’s start with the Redis/Jedis part. You can find some overview on Redis and Jedis in these posts. Let’s start with the User class, we can see that below: public class User { private String firstName; private String lastName; private String email; private String gender; private long id; } Now let’s define the keys we will use to store the user information on Redis. Read On →

Using Redis Hash with Jedis

Redis Hashes are maps between string fields and string values, so they are the perfect data type to represent objects (eg: A User with a number of fields like name, surname, age, and so forth) That is the definition we have on redis documentation. So, lets start with a simple user class that could be seen below: public class User { private String username; private String email; private String password; private String firstName; private String lastName; } Using Jedis we are able to store an object of this class in Redis, let’s see an example: Read On →