Posts
The Boy Crisis - Why our boys are struggling and what we can do about it
During these holidays I’m reading the book by Warren Farrell “The Boy Crisis - Why our boys are struggling and what can we do about it”.
As both the father of a little girl and as an educator I often question myself about gender roles and gender equality. I care to provide my pupils equal opportunities as they grow, and to show respect and help them on their own unique path.
Changing slide background for Jupyter + RevealJS presentations
I am experimenting writing slides and lecture notes with Jupyter for the security class I’m teaching. So far it’s been awesome: I can format text in Markdown like this blog, inject LaTeX formulas to write math with MathJax, and run Python code, which plays wonderfully with presenting cryptography on the slides.
A point where it lacks a bit at the moment is on presentation options. At the moment of writing I found no way to change the background of a specific slide, so here is my hack (works with Reveal.JS):
Solving a Crossword in Answer Set Programming
Last week we had to prepare a crossword for a custom crossword for a special occasion, and so I took upon the challenge of writing my own crossword generator (crossword compiler, as they seem to be called on the internet). Generating a crossword is clearly a constraint satisfaction problem, so I thought that using Answer Set Programming for this would be a good fit. Here is what I came up with:
Sony Reader Notes to SVG or PDF
I recently bought a Sony PRS-T1 ebook reader and it turns out it has a very nice feature: it's possible to sketch notes and little drawings using the touch screen. Then you can export them using the "take a snapshot" feature, which creates an image from the canvas.
What if you wanted to have them exported to any vector based format? It turns out that the format of the note files is a wrapped SVG with a container element and a couple of namespaces. To get an SVG file we just need to unwrap them. And you don't even have to bother XML processing, you just need a simple sed command in any Unix-like (Linux, OS-X etc) environment:
Unity Tracker Lens
A friend of mine was looking around for a decent file indexer for Ubuntu since he's relying on this approach to manage his files on OS X (and Windows 7 does it too). I got interested in the topic, and personally I agree with him and think it's such a shame that no indexing software is present and integrated in recent linux distributions by default, especially since this has been in past (with Tracker and Ubuntu, but also with Beagle and openSUSE) with good success and reception.
Breeze, Tim and the Jewish Co-Op
Second time! Vi sto scrivendo dalla biblioteca dell'universita', un edificio "huge" (tanto per rimanere in tema col post precedente), quattro piani di libri, good couches, tavoli, mac e terrazze dove si puo' leggere in pace un libro dando di tanto in tanto uno sguardo alla foresta che ci circonda. Qui e' pieno di scoiattoli e venendo su in autobus ho pure visto un cerbiatto che attraversava la strada.
Huge!
Ciao ragazzi, come promesso è ora di raccontare un po' di impressioni di questi primi giorni in California, prima che anche le sensazioni e i ricordi svaniscano nella routine giornaliera che inizierà a breve anche per me.
Il primo impatto che ho avuto quando sono arrivato qui è che tutto è HUGE. Non c'è altra parola che descriva meglio questa sensazione: grande o enorme non rendono il senso di grandezza che si ha guidando su un'autostrada a 5 corsie con una berlina che, tra le macchine da queste parti, è la più piccola. "Hey dude, that's HUGE!" Così come sono sterminati i paesaggi, le bellissime foreste e l'oceano da queste parti, allo stesso modo lo sono le strade e altrettanto grande è ogni cosa che mi circonda qua. Chiedi un gelato piccolo e ti danno una botta di calorie che fai fatica a finire, il cibo e tutto è sproporzionato per un europeo. Posso capire i loro problemi alimentari, non sono problemi di cattiva alimentazione per la maggior parte - almeno qui in California
Computer Graphics project.. Released!
Hello world, this is my project for the computer graphics exham I just attended! It's a simple videogame modelled like a first person shooter where you can't shoot ;-) but must reach the jellow flag before the red balls - likewise said the enemies - reach you!
Here are the tech specs:
- Language: c++
- Libraries: OpenGL & GLUT
- Memory footprint: 54MB on a 64bit machine, at least 32MB of video ram required.
If you are on a linux (Ubuntu I suppose) machine you must in order:
Off-screen rendering with Qt/Jambi & JOGL
Have you ever wondered how to make images at runtime (given that you know OpenGL)? Here's a solution (and a the same, stupid triangle example) using Java and Qt!
The trick is simple:
- Create a QGLWidget with the scene you want to draw;
- once you made your pixel perfect rendering - you can test it by running the app showing the new widget - render it to a pixel buffer
- Qt provides a nice way to save content from a GLWidget:
QPixmap pixmap = glWidget.renderToPixmap() renders the scene and copies it in RAM to a QPixmap - now you can do what you want with the newly created image, for
example, save it to a file:
pixmap.toImage().save(filename, format) where format is a java String representing the format (e.g.: "PNG", "JPEG", "BMP" etc)
Now: "Give me the code, Luke!"
Cleaning up your CCD, the easy way
Qualcuno suggerisce metodi abbastanza complessi, complicati e potenzialmente pericolosi per pulire il sensore ottico (CCD o CMOS) di una reflex che, soggetta a normale utilizzo, abbia accumulato qualche granellino di polvere.. non sono certo un esperto in materia, ma mi pare che con una semplice soffiata di..
..si possano ottenere risultati più che accettabili.
E infatti prima di tentare uno di questi due complicati procedimenti (che comunque penso che proverò prima o poi) ho provato la classica ed intramontabile spruzzatina d'aria sul sensore della mia D50, così: