Marco Monacelli
TIps of the day: NetBeans 6.1 where is my jsf component? 
Saturday, July 26, 2008, 02:20 PM
Posted by Administrator
SO: Java
Type: Tips
Language: Java
Title: NetBeans 6.1 where is my jsf component?

Yesterday i have upgraded some project from NetBeans 6 to NetBeans 6.1.

Question:
When i insert a new component in a jsf page with the visual web plugin the new component is not automatically declared in the page bean. Where is my jsf component?

Solution:
With NetBeans 6.1 the "automatic" binding of component with page bean is not really automatic. This improves the performances of the page and allows the programmer to create bindings only if they are necessary for the business logic. It is also possible to click on the component with the rigth button and automatically enable\disable the binding attribute for the component.
add comment   |  permalink   |   ( 3.2 / 592 )
Snippets of the day: Random Number in C++ 
Tuesday, July 22, 2008, 12:08 PM
Posted by Administrator
SO: Microsoft Windows\Posix
Type: Random Number
Language: C++
Title: Random Number in C++

To generate random number in C\C++ we can use the functions rand() and srand().

The first function generate a pseudo\random number and srand set the start of random generation, this information are a integer.

WARNING: if you use only rand function the result of the function are predictable. A good example are this.

#include <stdio.h>
#include <strlib.h>
#include <time.h>

int main()
{
srand(time(0));
int rand1 = rand() % 10; //random number da 0 - 9
return 0;
}

add comment   |  permalink   |   ( 3 / 536 )
Snippets of the day: Convert from BSTR to CHAR array 
Monday, July 14, 2008, 09:12 PM
Posted by Administrator
SO: Microsoft Windows
Type: String Manipulation
Language: C++
Title: Convert from BSTR to CHAR array

BSTR is a unicode COM string, All the COM objects uses only this type of unicode string.
To convert this incompatibile string to standard ANSI C you can use this simple utils function.

char* strValue = _com_util::ConvertBSTRToString(bstrValue)

Where bstrValue are a BSTR string, and strValue are return value.

exists also the Char to BSTR utils function...

BSTR bstrValue = _com_util::ConvertStringToBSTR(strValue)
add comment ( 4 views )   |  permalink   |   ( 2.8 / 432 )
Snippets of the day: PL/SQL add a day to oracle date 
Monday, July 14, 2008, 06:40 AM
Posted by Administrator
With this little snippets i start the series of code snippets. For each snippest i reports the portability, type and languages.

SO: All support from Oracle
Type: DataBase
Language: PL\SQL
Title: add a day to oracle date

For add a day to oracle date you must simple add a interger to date for example.

select sysdate + 1 from dual;

increments one day the current system date.

To incremente a month you can use a function ADD_MONTHS

select ADD_MONTHS(sysdate,1) from dual;

this increments one months the system date are useful because add a day number of next month.

To add a year you can also use this

select sysdate + 365 from dual;



add comment ( 1 view )   |  permalink   |   ( 3 / 607 )
Come back from holiday 
Monday, July 7, 2008, 04:37 PM
Posted by Administrator
I'm glad to announce the imminent creation of c programming guide in collaboration with fsugitalia. The project requide 3/6 months of development....

I hope to announce soon the start of the work...
add comment   |  permalink   |   ( 3.9 / 247 )

<Back | 1 | 2 | 3 | Next> Last>>