Clicca qui per iscriverti.
Ho appena finito di vedere uno dei tipici servizi in cui staffelli consegna un tapiro. Questa volta il simpatico ed efficace (ed anche un pò politico) premio doveva essere consegnato all’ex presidente della repubblica Scalfaro.
Come spesso succede Staffelli, insieme alla troupe, viene spintonato e a volte anche malmenato dai diretti interessati o dalle loro scorte, e cosi è accaduto anche questa volta.
La cosa schifosa è però un’altra, ossia che gli autori del pestaggio erano poliziotti e carabinieri, che si sono accaniti anche contro la cameraman (donna) di staffelli. Il tutto sotto gli occhi del,menomale, non più presidente e dei passanti scandalizzati dal comportamento dei poliziotti. Un signore con la giacca dell FS è dovuto intervenire per togliere un ragazzo della troupe dalle mani dei poliziotti. Sono state delle scene davvero agghiaccianti, come se i cittadini debbano sperare nell’aiuto dei passanti per salvarsi dai poliziotti! Gente normale, pensionati che urlavano alla polizia di lasciarli stare, ma che scene…
La casta che protegge il suo potere si è rivelata, questa volta con la violenza dei poliziotti addestrati a non chiedersi perchè picchiare un loro concittadino sia giusto, con la precezione che qualcosa nella divisa li giustifichi nel picchiare dei liberi cittadini. Qui non è più antipolitica, qui si tratta di classe politica incrostata che si difende dal popolo tutto.
Non venitemi a raccontare che il servizio anti-scalfaro è stato voluto da Berlusconi perchè anche se cosi fosse non potrebbe certamente giustificare il vergognoso comportamento tenuto dalle forze dell’ordine di fronte ad un ex presidente.
Incredibile che ce ne fossere di tutti i gradi, ho visto poliziotti semplici e non, carabinieri semplici ed ufficiali, tutti impegnati a tenere lontano un solo uomo la cui non pericolosità è risaputa da tutto il paese, una cameraman con la forza bruta di una donna e qualche altro onesto lavoratore. Vergogna.
I have a few news that i reserve for later.. You can already see something on github.com/admiral0
Aggirandomi per ebay in cerca di un modo per dare una rinfrescata al mio fedele dell4 mi sono imbattuto in questo simpatico annuncio, che racchiude l’essenza dell’informatizzazione e dell’istruzione media…
Come potete vedere dalla scritta blu l’inserzionista sta vendendo un processore intel core 2 duo, e sa fare le moltiplicazioni! :p
UPDATE: L’articolo che spiega come fare è qui
Ho appena trovato il metodo per aggirare il firewall/nat di fastweb ed avere un indirizzo ip pubblico senza comprarlo.
Il metodo funziona su qualsiasi piattaforma e necessita di un piccolo upgrade tecnologico supportato sia da Linux che Windows (dall’xp in poi) che Mac os x.
In questo momento non ho tempo per fare un articolo dettagliato. Presto pubblicherò una guida.
PASTA FROLLA
Ingredienti
500g farina 00
250/300g di burro
200/250g di zucchero
2 uova intere e 1 tuorlo (oppure 5 tuorli) (oppure 3 uova)
baccello di vaniglia
scorza di limone grattigiata
sale qb
Preparazione
Fare la fontana di farina (ben setacciata) e metterci dentro fiocchetti di burro a temperatura ambiente, un pizzico di sale, la scorza di limone grattugiata, la vaniglia e lo zucchero, quindi impastare delicatamente cercando di lasciare un po di farina sotto.
A parte sbattere le uova ed unirle al composto.
Continuare ad impastare velocemente con le mani per non far riscaldare troppo l’impasto avendo la cura di non lasciare pezzettini “troppo vecchi”, fino ad ottenere una pasta omogenea e compatta.
Far riposare il panetto nella pellicola in frigorifero per 20 – 30 minuti.
LA CREMA
Ingredienti
1 uovo o 2 turli
500ml di latte
150g di zucchero
75g di farina
1 buccia di limone
1 bustina di vaniglina
Preparazione
UOVA + ZUCCHERO + FARINA + LATTE
Beh, che dire, come prima impressione non c’è male. Il restyling della Cocca di Canonical cade proprio al momento giusto, in concomitanza con un rilascio LTS.
A livello estetico hanno centrato in pieno il punto della situazione, cioè portare i 12 milioni di utenti ubuntu ad un numero considerevolmente più alto, e bisogna ammettere che nell’irretire i niubbi Ubuntu ne sa qualcosa.
Direi anche che le migliorie approntate per rendere veramente utilizzabile il software preinstallato rendono la polemica dei bottoni a sinistra una mera cazzata da bar.
In generale mi piaccioni anche i colori violacei, su cui mi pare che Apple non abbia nessuna esclusiva. Discorso diverso per il logo, per il quale non c’è stato sostanzialmente nulla di notevole, anzi il simbolo di ubuntu lì dove andrebbe la © stona un pò.
Nella sostanza mi pare ben rivisitato anche l’ubuntu software center e la possibilità di ritirare tutti i privilegi cliccando sull’apposito applet.
Le cose sono migliorate notevolmente nella direzione naturale di ubuntu, cioè sul largo pubblico, certo che i duri e puri si sentiranno un pò più soli, ma secondo me è un prezzo abbastanza equo in cambio di una attenzione maggiore delle case produttrici per quanto concerne i drivers.
Il contro è che le novità sono arrivate con una LTS e quando fai una cazzata LTS poi tela porti avanti per due anni.
Ed oggi, 25 Aprile, sessantacinquesima festa della Liberazione, l’ultimo uomo in grado di garantire al nostro paese un barlume di legalità è il delfino di Almirante. Minchia.
This is intended to be a small add-on to the article I’ve posted on my website which explains how to use boost’s asio library to interface with serial ports from C++ code. This blog post focuses on a topic not covered in the article: using serial ports in Qt GUI applications.
Since serial ports are used primarily to interface a computer with a microcontroller, we’ll focus on this case.
The additional problem that occurs when the application has a GUI is the result of two restrictions that GUI applications have:
Now, if the microcontroller never sends data to the serial port unless the computer sends a command to it, and replies are always fast there is no problem.
Let’s show a basic protocol of this kind:
As said, in this case there is no problem. A possible GUI would have a button to read the value, and a label to show the result.
Such an application can easily use the TimeoutSerial class, with code to write the letter “A” in the callback of the button, immediately followed by a read from the serial port to get the result and show it on the GUI. The timeout, set to an appropriate value (such as 500ms) would ensure that the GUI won’t freeze even if something goes wrong, and the programmer can catch the TimeoutException to show an error message to the user.
But what to do if the command takes much time to complete, say 10 seconds? In this case this simple approach won’t work, because the GUI will freeze for ten seconds with the main thread waiting for the response from the serial port.
And what to do with a protocol like this?
In this case the PC application should always listen on the serial port for incoming data.
Well, who has read my article will probably think of using the AsyncSerial class, which allows to register a callback that will be called every time some data arrives from the serial port.
But also this approach won’t work, because of the constraint that the GUI code can be called only from the main thread, but AsyncSerial calls the callback from a separate thread.
To show how to solve this problem I’ve written a class, called QAsyncSerial which is a wrapper class for AsyncSerial that uses Qt’s system of signals and slots. It basically emits a signal every time a line is received from the serial port, and because signals and slots are thread safe, the code works as expected.
To show everything in practice, this is a simple GUI that uses QAsyncSerial running on Linux:
This simple GUI allows to select a serial port and open it (the baud rate is fixed to 115200, 8N1 format). Once it is opened, there is a line where to write text to send to the serial port while received text is showed below.
The code of the QAsyncSerial class and of the GUI example is posted at the end of the original article (here). It is meant to be compiled with QtCreator. If you try to compile it don’t forget to edit the line “-L/usr/local/lib” in the SerialGUI.pro file to point to where you have the boost libraries installed.
Last note, since the Qt libraries are cross platform, here’s the same application running on a Mac:
Nota: se volete solamente accedere a piratebay.org basta cliccare su questo link. Se volete capire come funziona questo metodo per bypassare siti bloccati continuate a leggere l’articolo.
Da qualche paio di giorni anche il proxy (un proxy è un server “replica” di un altro) italiano ufficiale a thepiratebay.org, ovvero labaia.it, è stato bloccato dalla guardia di finanza. La risposta del celebre sito svedese, già quando il sito ufficiale era stato bloccato a livello nazionale, aveva risposto in maniera secca che lo stato italiano è uno stato fascista.
Una cosa fondamentale ha reso questi nuovi blocchi differenti sai precendenti. Prima le autorità giudiziarie che dovevano bloccare un sito internet imponevano ai provider internet nazionali (gli operatori telefonici) di non tradurre correttamente gli indirizzi internet dei siti web. Facciamo un esempio: se digito www.google.com nel mio browser, il mio browser contatterà uno speciale server, chiamato server dns, che non farà altro che rispondermi che www.google.com è identificato dal computer nella rete internet con l’indirizzo (o numero identificativo di rete) 74.125.39.103. Il mio browser quindi contatterà il server 74.125.39.103 che spedirà la nota pagina di google che verrà visualizzata nel browser.
Quando un sito doveva essere bloccato, i server dns che sono solitamente gestiti dalle compagnie telefoniche che vi forniscono l’adsl o in generale la connettività, rispondevano con degli indirizzi sbagliati. In questo modo il vostro browser non riusciva a contattare il server giusto e non riusciva a visualizzare il sito web che quindi risultava bloccato.
Questa tecnica però veniva semplicemente bypassata usando come server dns opendns.org. Questi server dns essendo internazionali non rispondono alle leggi nazionali e quindi non applicavano i blocchi stabiliti dal fascist state.
I nuovi blocchi sono più insidiosi… Non solo NON forniscono più nessun indirizzo per i siti che sono stati bloccati dalla guardia di finanza o dalla polizia postale ma anche chi usa i server dns di opendns.org non può più accedere ai siti bloccati perchè, adesso, è proprio l’indirizzo dei server (ad es 74.125.39.103) che risulta irragiungibile.
Appena ho notato due giorni fa con un amico questa cosa ho iniziato a pensare ad un metodo per eludere questi tipi di blocchi… L’idea di base è quella di usare un sito non bloccato che ci permetta però di “visualizzare” altri siti internet. Ci sono vari siti online che offrono questo servizio. Quello che ho trovato e provato io è anonymouse.org
Ebbene, come potete vedere in photo, basta inserire il sito piratebay.org e cliccare su surf anonymously per visualizzare la seguente pagina
Potete fermarne uno… ma non potete fermarci tutti…
Normalmente non sarebbe necessario ma in alcuni casi, come quello dello sviluppo di siti internet, diventa fondamentale avere queste tre versioni del browser di casa Micro$oft per fare dei test su come un sito viene visualizzato.
Ho dovuto utilizzare questi tre browser durante lo sviluppo di un sito per una compagnia, la DeusTechnology e quindi vi faccio vedere come avere i tre browser sulla stessa macchina.
Per prima cosa, installate Internet Explorer 8 come browser nel vostro pc Windows. Dopo di ciò installate la versione standalone (ovvero che non ha dipendenze esterne) di Internet Explorer 7 utilizzando questo link e quindi installare Internet Explorer 6 o precedenti versioni utilizzando MultipleIE, un programma che permette di installare facilmente tutte le versioni di Internet Explorer dalla 3 alla 6 senza intaccare la versione di Internet Explorer installata nel sistema che sarà a questo punto alla versione 8.
As they took his soul they stole his pride
As he faced the sun he cast no shadow
E’ strano, ma a volte alcuni singoli versi ci rubano la mente
sono un pò come gli oroscopi
ci appaiono come fatti su misura per noi.
…ed è un dato di fatto che alla sinistra sono rimaste tutte le regioni più sfigate d’Italia, e tra poco non gli resteranno neanche quelle.
Over time, I find myself more and more interested in CMake. That’s because I write many little programs, and those that use makefiles routinely break as I switch OS.
The last one was a program that depended on libpng. When I tried to compile it on Mac OS X, it failed to find the library. That’s because on Linux libpng.so is simply in /usr/lib and png.h is in /usr/include, both of which are in the compiler’s search path, so that all you need to do is add “-lpng” when linking.
But on a Mac libpng.dylib (yes, shared libraries on a Mac have .dylib extension) is in /usr/X11/lib and png.h is in /usr/X11/include that are not in the compiler’s search path, so that when compiling you need to add “-I/usr/X11/include” and when linking “-L/usr/X11/lib -lpng”.
The solution was not to keep two separate makefiles, but rather to throw away the makefile and replace it with a CMakeLists.txt
Which brings us to the question: how to link with libraries using CMake?
There are two ways, the first is the find_package command, the other is the find_library command.
Let’s start with find_package. CMake “knows” about many widely used libraries. For them, there is a script to find them in all supported platforms. So, to use a library all you need to do is find it with the find_package command. Here is a simple example of a program that uses threads and so depends on “-lpthread”, main.cpp:
#include <iostream> using namespace std; void *thread(void *argv) { cout<<"Into a spawned thread"<<endl; } int main() { pthread_t t; pthread_create(&t,NULL,thread,NULL); pthread_join(t,NULL); cout<<"Back in main thread"<<endl; }and here is the CMakeLists.txt file:
cmake_minimum_required(VERSION 2.6) project(TEST) ## Target set(TEST_SRCS main.cpp) add_executable(test ${TEST_SRCS}) ## Link libraries find_package(Threads REQUIRED) target_link_libraries(test ${CMAKE_THREAD_LIBS_INIT})As can be seen, the first parameter passed to find_package is the name of the package, the second is “REQUIRED” and means that if the library could not be found, CMake should stop and print an error message.
Once the library is found, you have to say which executable needs it (because a single CMakeLists.txt can be used to produce many executable by just using more add_executable commands). This is achieved with the target_link_libraries command that appends a library to the list of libraries an executable needs. The first parameter is the executable name, the second is the library. Note that find_library generates a variable that contains the name of the library, in this case the name is CMAKE_THREAD_LIBS_INIT. This strange name is an exception, usually all find_package scripts create a variable with the name <libraryname>_LIBRARY.
Now a more complex example: the libpng issue I talked about earlier. It is more complex because you don’t just need to add a library when linking, you also need to tell the compiler where is the png.h file when compiling. Luckily, CMake has a package for libpng that does all that, and here is the CMakeLists.txt example:
cmake_minimum_required(VERSION 2.6) project(TEST) ## Targets set(TEST_SRCS test.cpp) add_executable(test ${TEST_SRCS}) ## Link libraries find_package(PNG REQUIRED) include_directories(${PNG_INCLUDE_DIR}) target_link_libraries(test ${PNG_LIBRARY})The find_package command finds the PNG library, target_link_libraries adds the library to the list of libraries the executable needs, and include_directories adds the directory where the .h file is when compiling.
But this isn’t the end. Other than libraries there are collections of libraries. And CMake supports them too. One example are the boost libraries. There is no single libboost.so to link to; instead every sub-library has its .so file. So there should be a way to link only with the desired sub-libraries. This is an example CMakeLists.txt that does that:
cmake_minimum_required(VERSION 2.6) project(TEST) ## Target set(TEST_SRCS main.cpp) add_executable(test ${TEST_SRCS}) ## Link libraries set(BOOST_LIBS thread date_time system) find_package(Boost COMPONENTS ${BOOST_LIBS} REQUIRED) target_link_libraries(test ${Boost_LIBRARIES}) find_package(Threads REQUIRED) target_link_libraries(test ${CMAKE_THREAD_LIBS_INIT})In this case we initialize a variable with the sub-libraries we want (boost.thread, boost.date_time and boost.system). Then we call find_package with the library name (Boost), the word COMPONENTS followed by the list of sub-libraries and as usual the REQUIRED word. Since boost.thread depends on the system’s thread library, we also use another find_package command to link with threads.
This ends the examples of find_package, but there is one last issue: what if we need a library for which there isn’t a package script? The solution is to use the find_library command. It will search in the system paths for the needed library. Here is an example that uses the command to find the Poco libraries:
cmake_minimum_required(VERSION 2.6) project(TEST) ## Target set(TEST_SRCS main.cpp) add_executable(test ${TEST_SRCS}) ## Link libraries find_library(POCO_FOUNDATION PocoFoundation) find_library(POCO_NET PocoNet) target_link_libraries(test ${POCO_FOUNDATION} ${POCO_NET}) find_package(Threads REQUIRED) target_link_libraries(test ${CMAKE_THREAD_LIBS_INIT})The find_library command takes two parameters, the first is the variable where the found library will be stored, and the second is the library name (the name is camelcase in this example because Poco libraries are camelcase, the library name is really libPocoFoundation.so).
References: CMake wiki
Febbraio è troppo corto, ed ecco che ricominciano le lezioni.
Domani Fisica ed Elettrotecnica, che Dio ci salvi!
Ed eccoci qua nell'Italietta dei geronti. Ennesima sentenza dettata dall'ignoranza degli analfabeti del terzo millennio…
Dopo un breve training autogeno di git(come ho fatto a vivere senza fin'ora?), ho dato il mio primo contributo di codice alla comunità opensource, fixando il bug delle lettere accentate che affliggeva l'engine di questo blog…
Giochiamo al tiro al bersaglio con i bambini down devo ammettere che è il classico esempio di humour nero che generalmente apprezzo…
Bellissimo sapere che il proprio blog è su un cluster on the cloud a costo zero. Consiglio inoltre a tutti i ruby-fags di dare un'occhiata a toto, un ottimo blog engine super personalizzabile…
Chi me ne spiega l'utilità per noi aspiranti ing. informatici?