Montag, 5. November 2007

Check Spatial Index

SELECT INDEX_NAME, TABLE_OWNER, TABLE_NAME, STATUS, ITYP_OWNER, ITYP_NAME, DOMIDX_STATUS, DOMIDX_OPSTATUS
FROM user_indexes
WHERE ITYP_NAME IS NOT NULL;

Funktioniert Software, die mit einem 32-bit Rechner erstellt, auf 64-bit Rechner?

Eine Version, die mit einem 32-bit Rechner erstellt wurde läuft nur deshalb auf 64-bit Systemen, da automatische ein 32-bit Kompatibilitätsmodus auf einem 64-bit System läuft. Auf einem reinem 64-bit System würde das dann nicht laufen...

Also sollte die Software unter dem System kompiliert und erstellt werden, unter dem sie auch laufen soll, sonst geht der Geschwindigkeitsvorteil eines 64-bit Systems verloren ...

Freitag, 28. September 2007

Sdo_Ordinate_Array

Here is an example to show how to use Sdo_Ordinate_Array. It is a function to cut the first and last coordinates in the old coordinates array(suppose the coordinates are two dimensional).

FUNCTION coor_copy_cut(coor_old MDSYS.Sdo_Ordinate_Array) RETURN MDSYS.Sdo_Ordinate_Array IS
coor_new MDSYS.Sdo_Ordinate_Array;
BEGIN
coor_new:= MDSYS.Sdo_Ordinate_Array();
coor_new.EXTEND(coor_old.COUNT - 4);
FOR i IN 3 .. coor_old.COUNT - 2 LOOP
coor_new(i - 2) := coor_old(i);
END LOOP;
RETURN coor_new;
END;

Freitag, 31. August 2007

Singleton pattern

Surpose the Routing Graph is used everywhere in the code, but it should only be initialized once(by calling its init_from_psf() method).

A clean solution is to use singleton pattern. Declare an instance() mehtod, which is static. In the instance() method, a flag is set to ensure only the flag has a value of zero, the method init_from_psf() will be called.


#include ".\routinggraphsingleton.h"
#include

RoutingGraphSingleton::RoutingGraphSingleton()
{
}

Routing_Graph* RoutingGraphSingleton::instance() {
if (_instance == 0) {
_instance = new Routing_Graph;
cout << "Loading routing graph... "; _instance->init_from_psf();
cout << "Done." << endl;
}
return _instance;
}

Routing_Graph* RoutingGraphSingleton::_instance =0;

---------------------------------------------------------------------------
header:

#include "routing_graph.h"

using namespace lb_dp_routing;

class RoutingGraphSingleton
{
public:
static Routing_Graph* instance();
protected:
RoutingGraphSingleton();
private:
static Routing_Graph* _instance;
};

NLS_LANG

After the new PL/SQL developer is installed, there is an error dialog "Database character set and client character set are different".

Because when my Oracle was installed, the character set parameter was set to UTF. Now the PL/SQL developer gets the NLS_LANG from system, which has a value of "GERMAN_GERMANY.WE8MSWIN1252". So this conflicts with the database setting and could cause data loss problem.

Solution: create NLS_LANG parameter in Enviroment Variables, set its value "American_America.AL32UTF8".