Un'articolo interessante, che tra l'altro sottolinea con quanta facilità gli americani (e anche una buona parte degli italiani) vengono presi per il culo. Più ci penso e più mi cascano le palle...
domenica 21 settembre 2008
Misure senza precedenti per affrontare una sfida senza precedenti
Un'articolo interessante, che tra l'altro sottolinea con quanta facilità gli americani (e anche una buona parte degli italiani) vengono presi per il culo. Più ci penso e più mi cascano le palle...
mercoledì 3 settembre 2008
giovedì 17 luglio 2008
Touch the future
The iPhone has a 3,5" touch screen, an accelerometer, a proximity sensor, a light sensor... and a impressive user interface.
In the near future I expect to see some innovations in computer interface devices too; years ago Octopus and I were trying to design a user interface for computer aided software design based on a virtual glove (such as this one) with very poor results, but touch screens at a low cost and multi touch tecnology could be the real great innovation in user experience.
Right now these tecs are focused in daily use PIM apps (and devices) but we'll surely soon see innovations in technical applications too: technical modeling and designing, web navigation, and so on, but the most interesting evolution from my point of view will be in software developement tools: new user interfaces will drastically improve object oriented software design, with the result of better software produced in less time.
It could be an interesting challenge to design some innovative IDE focused on Object Oriented design, design pattern usage, GUI design, all running on a 3D environment with multitouch screen interoperability functions: and IDE focused on the structure of the software with less new and more re-used code, template/pattern based code writing assuring more quality. And far more fun.
Wanna write sw with an iPhone instead of a mouse ;)
In the near future I expect to see some innovations in computer interface devices too; years ago Octopus and I were trying to design a user interface for computer aided software design based on a virtual glove (such as this one) with very poor results, but touch screens at a low cost and multi touch tecnology could be the real great innovation in user experience.
Right now these tecs are focused in daily use PIM apps (and devices) but we'll surely soon see innovations in technical applications too: technical modeling and designing, web navigation, and so on, but the most interesting evolution from my point of view will be in software developement tools: new user interfaces will drastically improve object oriented software design, with the result of better software produced in less time.
It could be an interesting challenge to design some innovative IDE focused on Object Oriented design, design pattern usage, GUI design, all running on a 3D environment with multitouch screen interoperability functions: and IDE focused on the structure of the software with less new and more re-used code, template/pattern based code writing assuring more quality. And far more fun.
Wanna write sw with an iPhone instead of a mouse ;)
mercoledì 2 luglio 2008
Logging enter/exit into/from methods or functions
Just as easy as (and same principle of) Synchronizing in the previous post:
Very easy to use: just instance a MyMethodLogger as the first instruction in method body:
At the end of the method execution (of after an exception throw) the destructor of MyMethodLogger will trace the exit from the method.
class MyMethodLogger
{
std::string _methodName;
public:
MyMethodLogger(const char *methodName):
_methodName(methodName)
{
log << "Entering method " << _methodName << std::endl;
}
~MyMethodLogger()
{
log << "Exiting method " << _methodName << std::endl;
}
};
Very easy to use: just instance a MyMethodLogger as the first instruction in method body:
void method()
{
MyMethodLogger("method()");
...
}
At the end of the method execution (of after an exception throw) the destructor of MyMethodLogger will trace the exit from the method.
giovedì 26 giugno 2008
Synchronized in C++
Una semplice idea per implementare qualcosa di simile alla synchonized di Java in c++:
definiamo una classe base Synchronizable:
e poi una classe Synchonizer:
A questo punto, sarà possibile implementare delle classi derivate da Synchronizable, e laddove si vogliano sincronizzare le funzioni membro basterà:
All'uscita dal metodo (sia attraverso una return che a fronte dell'innalzamento di un'eccezione), il distruttore di s effettuerà l'Unlock.
Inoltre è possibile usare questa tecnica anche all'interno di scope diversi dal corpo dell'intero metodo:
Ovviamente questa tecnica non impedisce l'utilizzo "manuale" dei metodi protetti Lock() e Unlock()...
definiamo una classe base Synchronizable:
class Synchronizable
{
friend class Synchonizer;
CCriticalSection theLock;
/* O qualunque implementazione di un oggetto del genere fornito dalla libreria */
protected:
void Lock() { theLock.Lock(); }
void Unlock() { theLock.Unlock(); }
};
e poi una classe Synchonizer:
class Synchronizer
{
Synchronizable *s;
public:
Synchronizer(Synchronizable *_s): s(_s)
{ s->Lock(); }
~Synchronizer() { s->Unlock(); }
};
A questo punto, sarà possibile implementare delle classi derivate da Synchronizable, e laddove si vogliano sincronizzare le funzioni membro basterà:
void MyClass::doSomething()
{
Synchronizer s(this);
.....
}
All'uscita dal metodo (sia attraverso una return che a fronte dell'innalzamento di un'eccezione), il distruttore di s effettuerà l'Unlock.
Inoltre è possibile usare questa tecnica anche all'interno di scope diversi dal corpo dell'intero metodo:
void MyClass::doSomething()
{
...
{
Synchronizer s(this);
// questo scope è in critical section
....
}
... // qui siamo fuori dalla cs
}
Ovviamente questa tecnica non impedisce l'utilizzo "manuale" dei metodi protetti Lock() e Unlock()...
Iscriviti a:
Commenti (Atom)