Computer Graphics 2010 Project

Well, i delivered today the final project for computer graphics class 2010.
It’s just a opportunely approximated tridimensional model of my residence surroundings.
The full description of the project, with cool screenshots and available code to download or execute is online on the computer graphics department group space here.
If that space will fail for any reason, i mirrored it up here.
The project is nothing special compared to the graphics environment modeled e.g. in gaming industry, but considering it’s done using the PyPLaSM library, a porting of the PLaSM functional langage to Python, i’m pretty satisfied of my work.
Oh, right, maybe I’m also satisfied because it worths the best grade and compliments from both course professor and some colleagues :P

computer-graphics-2010

Read more


Find me a Roof !

The last finals at university are flowing and time to choose the subject for my thesis is approaching.
Anyway, today was the turn of the presentation of the final project for the “Web Information Management” class. I and a couple of colleagues developed a search engine on the vertical domain of realties advertisement. Here are the slides sketched for the presentation.




Advanced Shell Scripting

Yesterday I delivered a lesson for the advanced Linux course arranged by LUG Roma3 at Roma Tre University on voluntary base. Here are the slides I sketched out for this occasion.




It’s not really “advanced” stuff, but sounds just better than “basics +1″ ;)


Change keyboard layout in Linux

Keybord gth There are several ways to change the keyboard layout in linux.
First, you can load a given keyboard translation tables with :

loadkeys <tablecode>

Alternatively, if you are in a X11 env, you can set the keyboard map using the X Keyboard Extension with:

setxkbmap <kbmapcode>

But if you want to permanently change the console keyboard layout, e.g. in Debian, you can reconfigure console-data and use the wizard to select the desired layout with:

dpkg-reconfigure console-data

How to open .7z files in Mac Os X

7z is a compressed archive file format that supports several data compression methods, featuring hight compression ratio, encryption and support for large files (up to 16 exabytes). Although it does not store UNIX permissions, it may be used to compress other archive formats such as tar streams, and it is often used to pack stuffs like VM appliances or other huge files. In Mac Os X, you can handle .7z archives with the 7za utility, provided by the p7zip package, a 7-Zip implementation, available via MacPorts.

port install p7zip
# ...
7za [ l | x | a | .. ] 7zarchive.7z

To be told, if you plan to use this format for backups, consider that it lacks of recovery records, that means even if just limited file corruption occur, data may be lost.


How to use XPath in Java

Need to use XPath in Java?
Here is a quick example, to get something from an XHTML file:

import javax.xml.xpath.*;
import org.w3c.dom.*;
import org.w3c.tidy.Tidy;
import java.io.File;
import java.io.FileInputStream;
 
File file = new File("/abs/path/to/file");
FileInputStream xhtml = new FileInputStream(file);
 
Tidy tidy = new Tidy();
tidy.setQuiet(true);
tidy.setShowWarnings(false);
Document doc = tidy.parseDOM(xhtml, null);
 
XPathFactory xpf = XPathFactory.newInstance();
XPath xpath = xpf.newXPath();
 
NodeList nodes = (NodeList) xpath.evaluate("XPath Expr", doc, 
                                          XPathConstants.NODESET);
 
// NodeList nodes contains now nodes.getLength() nodes, e.g.
System.out.println(nodes.item(0).getNodeValue);
System.out.println(nodes.item(1).getTextContent();
String fst_child = nodes.item(2).getChildNodes().item(0).getNodeValue();

For more, take a look at the javax.xml.xpath package javadoc and at the NodeList interface.



Return top

About me