RSS
 

Archive for the ‘Development’ Category

Oracle BIEE-like reporting tool by using low cost web technologies

06 Jun

1. Introduction

In this interesting post we will see how to mount an OBIEE-like reporting tool by using low cost web technologies.

In the example we are going to see how to combinate PHP Analytics and WordPress templates to get close to that objective.

2. The idea

PHP Analytics is a plugin that transform your WordPress platform in a reporting tool. It allows you to build views (tables and chart) that you can publish in a WordPress page/post.

Once we have our defined reports (see the offical documentation to use PHP Analytics), we just need to modify a WordPress template to give to our platform the OBIEE look&feel.
Moreover we have to play a little bit with the code in order to emulate the OBIEE frontend main logic.

Read the rest of this entry »

 

Oracle Database Tips #2: How to replace the occurrence of two or more spaces with a single space using REGEXP_REPLACE

17 Dec

The REGEXP_REPLACE is an Oracle PLSQL function that works almost in the same way of the REPLACE function but extends its functionalities by using regular expression pattern.

In the following example I show you how to replace in a given string each occurrence of two or more spaces with a single space.

SQL> SELECT REGEXP_REPLACE('Too        Many       Spaces','( ){2,}', ' ') REPLACED_STRING FROM DUAL;

REPLACED_STRING
----------------
Too Many Spaces
 

Understand and optimize Android’s ListView usage

25 Oct

1 – Introduction

The Android ListView object is meant to build scrollable items lists; is one of the most used user interfaces in the mobile applications. An Android ListView corresponds to an iPhone TableView.

Bare in mind that the code examples I will use in this post refear to the Android SDK 1.5; at the time I am writing the latest SDK version is the 2.2 and some methods/classes could be now deprecated. Moreover, all the import statements are omitted for semplicity.

This post will try to clarify how to setup a ListView in your Android v1.5 application; I spent time to understand it and now I personally feel that it could be improved cause the steps you need to take in order to build a ListView, even if few, need to be repeated for all the ListView objects you have in your application.

In the following paragraphs we will see how to setup these objects and later we will see a solution I’ve found during the development of Scanean to reduce this steps and use the same ListView object to implement different ListViews.

2 – Create a ListView

A ListView is a set of scrollable items; these items are a set of graphic objects (Images, TextViews…) disposed in a particular way that is described by an xml file stored in the /res/layout folder.
According with the explanation above, in order to setup a ListView we have to perform te following steps:

  • Create an xml layout template for the single ListView item (e.g. tpl_menu_item.xml)
  • Create an xml layout template for the page that will host our ListView component (e.g. menu.xml)
  • Create a bean that describes the single item (e.g. MenuItem.java); basically it’s a set of setter/getter methods used to assign a proper values to the item subcomponent (e.g. TextView content is “Products” and the related image is “Product.gif”)
  • Create a wrapper java class that populate the single item template with the right values (e.g. MenuItemWrapper.java).
  • Create an adapter JAVA class that will populate the ListView template (e.g. MenuItemAdapter.java)
  • Create the activity class associated to the ListView (e.g. A_MENU.java)

Total number of object to create in order to setup a single ListView: 6

Read the rest of this entry »

 
 

Natively compiled Java stored procedures using NCOMP

24 Oct

1 – Introduction

Few years ago I had the chance to make an integration between the Oracle Database and a rating engine (“WARP4“) developed by ERIS4 company.
The goal was to rate telephone traffic records stored in the database, by sending them to the rating engine.

WARP4 provided some API to allow external application to send records and rate them; this comunication was made via socket layer. In order to increase the performances I had to make several trials and one of my test cases was about the native compilation.

I personally think that Java stored procedure native compilation it’s not worthy, especially when your Java classes need to open frequently a socket connection.
Because the native compilation is a really rare activity, I thought that this post could be useful for those who want to test the ncomp benefits.

Read the rest of this entry »