venerdì 22 marzo 2013

WhatsApp Alternatives and Similar Software

Hi All

Recently WhatsApp messaging mobile application for smartphone declare that will be introduce a little annual payment for his service.
This news sparked a search for a valid alternative free.
From "La Repubblica" article  i want underline some solutions :

Today i want report a valid alternative for ANDROID smartphone (for now), KONTALK.
It is an open source project with a great potential. It's present on Android Market.

The network infrastructure and protocol have been designed from scratch to be immune from any attempt to centralize the network. All servers inside the network will have the same power and capabilities over each other - the network will be able to maintain itself and make itself safe.

I invite you to test it on your smartphone devices.

Stay tuned.







Oracle Function to get a specific field from a String contains fields characters delimited



Hi All

Today a simple function to extract a field from a String contains characters delimited fields.
I want use regexp_substr function but there are some problems for null fields to extract, so i develop this simple function.

CREATE OR REPLACE FUNCTION
  get_field (iString IN VARCHAR2, iSeparator IN VARCHAR2, field_num IN NUMBER)
RETURN VARCHAR2
IS
   oField VARCHAR2(1024);
   position_field NUMBER;
   position_field_start NUMBER;
   position_field_end NUMBER;
BEGIN

  IF field_num = 1 THEN
     position_field :=  INSTR(iString,iSeparator);
     IF position_field > 0 THEN
        SELECT SUBSTR(iString,1,INSTR(iString,iSeparator)-1) INTO oField FROM DUAL;
     ELSE
        oField := iString;
     END IF;
  ELSE
      position_field_start :=  INSTR(iString,iSeparator,1,field_num-1);
      position_field_end :=  INSTR(iString,iSeparator,1,field_num);

      IF position_field_start > 0 THEN
      
            IF position_field_end = 0 THEN
               position_field_end := length(iString)+1;
            END IF;
           SELECT SUBSTR(iString,position_field_start+1,position_field_end-position_field_start-1) INTO oField FROM DUAL;
      ELSE
         oField := null;
      END IF; 
  END IF;

  RETURN (oField);
END;

For example you have this string '10;12;34;233;12' delimited by ';' character and you wont get third field.
You can call this oracle function in this way :

SELECT GET_FIELD('10;12;34;233;12',';',3) FROM DUAL;

Results will be : '34'.

I hope can help someone with same problem.

Stay tuned


martedì 22 gennaio 2013

An Idiot's Guide to C++

Hi

Today i want share a very good guide to C++ : An Idiot's Guide to C++.

In this guide, C + + concepts are explained very clearly, read it.

Stay tuned.

G

giovedì 3 gennaio 2013

Year 2013


Another year :-) 2013.

2013 started three day ago and it's time to cheack my 2012 objectiveSee :

  • Improve my English Level                                    : Failed (It's one year ago level)
  • Improve my Chess Level                                     : OK (In 2012 i have win my first chess tournment)
  • Improve my incomes                                           : Failed
  • Be a better Christian                                            : So and so
  • Learn at least two new programming languages    : Failed (No new language learned)

One objective over 5 very very bad.

My new objectives for 2013 are (similar to 2012) :

  • Improve my English Level      
  • Improve my Chess Level       
  • Improve my incomes        
  • Be a better Christian        
  • Learn Android or a mobile languages (QT, jme, ...) 
  • Write more posts on this blog

I hope that in January 2014 results will be better ;-)

Stay tuned.


mercoledì 19 dicembre 2012

Is it possible to pass passwords on a bash shell script?

Yes, it is possible.

One way is this :


#!/bin/bash
printf "Password please: "
stty -echo
read pass
stty echo
printf '\n'

Stay tuned.


martedì 2 ottobre 2012

Script SQL to calculate averange row size and total table size

Today an sql script to calculate averange row len and total table size (Is extracted from the Knowledge Xpert for Oracle Administration library).

REM LOCATION: Object Management\Tables\Utilities
REM FUNCTION: Display the average row size of table and total table
REM size
REM TESTED ON: 10.2.0.3, 11.1.0.6 (should work with Oracle 9iR2)
REM PLATFORM: non-specific
REM REQUIRES: dba_tables, dba_extents
REM
REM INPUTS: Owner of table and name of table to report on
REM NOTE: This report requires that the table be analyzed.
REM
REM
REM This is a part of the Knowledge Xpert for Oracle Administration library.
REM Copyright (C) 2008 Quest Software
REM All rights reserved.
REM
REM ******************** Knowledge Xpert for Oracle Administration ********************
UNDEF ENTER_OWNER_NAME
UNDEF ENTER_TABLE_NAME
SET PAGESIZE 66 HEADING ON VERIFY OFF
SET FEEDBACK OFF SQLCASE UPPER NEWPAGE 3
UNDEF ENTER_OWNER_NAME
UNDEF ENTER_TABLE_NAME
COLUMN table_name format a30 wrap
COLUMN avg_row_len format 9,999,999,999 heading "Average|Row|Length"
COLUMN actual_size_of_data format 9,999,999,999 heading "Total|Data|Size"
COLUMN total_size format 9,999,999,999 heading "Total|Size|Of|Table"
TTITLE left _date center "Table Average Row Length and Total Size Report"
WITH table_size AS
(SELECT owner, segment_name, SUM (BYTES) total_size
FROM dba_extents
WHERE segment_type = 'TABLE'
GROUP BY owner, segment_name)
SELECT table_name, avg_row_len, num_rows * avg_row_len actual_size_of_data,
b.total_size
FROM dba_tables a, table_size b
WHERE a.owner = UPPER ('&INSERT_OWNER_NAME')
AND a.table_name = UPPER ('&INSERT_TABLE_NAME')
AND a.owner = b.owner
AND a.table_name = b.segment_name;

Stay tuned.

lunedì 4 giugno 2012

Goals 2025

 Hi all Today, first day of 2025 my goals for this year : 1. ENGLISH Improve listening comprehension  See at least one or two films in Engli...