A ‘very pushed technical test’ before your hiring
Recently I’ve taken my employer’s ‘development test’. The 2009 version of this test looks a lot like the first University programming tests (optimize memory/CPU consumption, create your own data types and handling functions, avoid C++ standard libraries). The test looked like this text.
The copy of the code I have sent to the examiner, and a further copy, including the corrections of the examiner, is available on this web site.
This has been the first step of a hiring process which included a second technical test. This further test has been taken in a ’solo’ condition, which excluded the use of Internet/computers/manuals. This test included some code samples that I’ve had to correct, a couple of small programs to perform basic operations (OOP, memory allocation and developer logic are the examined subject) and some general computing knowledge questions (what certain technologies are, how to perform a typical action on an Unix system, et cetera).
(somebody calls this test, or its equivalent ten years ago, a ‘test technique assez poussé’… http://emploi.journaldunet.com/magazine/1168/)
expose yourself to ghostscript
ghostscript is a powerful, yet slightly complicated tool.
- it allows you to change the paper format or resolution of a pdf,
- it allows you to convert it to other electronic formats, among which tiff
- it allows you to change its properties, and to optimize it for different usages
in the last weeks, I’ve used gs to change the resolution of an input file, while converting it to tiff. then I’ve discovered other options, among which the one which allows me to force the output paper format. on the web you find a lot of spam about proprietary tools which allow you to do this same operation, veiling the underlying gs technology.
thus I’ve published a bash script, which supposes the existence of gs in your execution environment, and which converts any paper format to any other common paper format. I’ve named it letter2a4, since its default behavior is to change the current paper format of the input document to a4.
feel free to download it. you’ll only need to copy aligntop.ps to /usr/local/share or wherever you like. feel equally free to read the man page for gs(1).
Update: this morning I have had also the time to write a gs wrapper to merge all the files (in the given directory|passed as arguments). Download it, if you like.
Converter.jar: an electronic format converter
Converter.jar is an applet to convert every kind of file to each other format (enfin, presque…). This applet uses the Esker WebServices (thanks a lot!) to convert the input file in the pdf format (by default) or to the format you specify.
You will need an EskerOndemand account to use it, but format conversions are free (thanks again, Esker!)
Converter can as well convert all the files contained in a given folder to the wished fomat, have a look at its README
The folder where you can download its binaries and a pair of sample command lines: http://nilleb.com/pub/Converter/. If you want to have a (look at|copy of) the sources, simply ask (or have a look at the referenced webservices online help).
cmerger – a console tiff and pdf merger
features
- regular expressions to design files to be merged
- default parameters (ie. no argument is required)
- file format detection
- unit tests on command line
- online manual
Note: tiftool and pdftool are not included, since they’re proprietary software.
cxfinder – a console xpath evaluator
cxfinder was waiting in the cubby-hole since almost one year. today is getting out.
cxfinder is an XPath evaluator, a sort of grep which knows XML. you can give him a complete xpath pattern or a simple string. it will evaluate the pattern/text against the document that you pass as second argument. then it will format a report about the elements satisfaying the pattern, with their unique and reversible path.
the code is available on nilleb.com, as usual. a partially completed GTK interface is available on assembla.com, even if based on the last year code/conception. a QT based graphical interface will probably born, in the next year.
runner2 – ready to use
runner2 is ready to use.
runner2 is an engine to execute operations defined in an XML recipe.
it executes your operations according to their priority (priority is an attribute of each operation node). runner2 fires the operations at the same priority level at the same time, then waits for the completion of each operation in the same priority level before the switch to the next priority level.
no importance where your operation nodes are on the XML tree: runner2 will find them. make only sure that you’ve filled their priority.
runner2 logs all the actions taken, and it prints out a nice-to-see report. and if you don’t want to see the report, you can simply save it to an sqllite file.
it is easily extensible, and quite difficult to break. (the engine code is separated from the extension code.) the extension code can be written in python.
I could as well tell you that Runner2 is an automatic tests engine, or an installer, or a software deployer. Or all this at the same time. But that’s not me that will say that. It’s you.
GIF processing on the old and cheap home computer
(to an anonymous linux user)
so somebody sent you a huge GIF image, and when you try to print/convert/* it with eog or gimp, you’re getting a “unable to fork” or “not enough memory”? well, you should give a try to gifsicle!
http://linux.die.net/man/1/gifsicle
quick, does its work, spending practically nothing of your memory.
good luck!
(another) grub rescue CD
In a department where disks MBR[4] are reset once a day (at least) by a disk image editor which doesn’t respect standards, a GRUB rescue CD is worth the time to build it.
This kind of CD will let you boot Linux/Windows systems, perform a quick memory check, install a copy of grub to your MBR in order to be CD independent, and edit all of the above options. This copy of the CD can be used on i386 compatible systems[5].
I have followed the instructions present in the GRUB manual[1] to prepare a CD image. Then, I have uploaded it to nilleb.com[2][3], just in case. The included menu.lst took the most of the R&D time.
If you know a good, standards compliant, open source disk image editor, please let me know.
Update: Well, after a few hours, while going home by feet since the “grève générale” affected also my metro line, I have understood that GParted already contains such a grub-rescue-CD. Then, I have also realized that the “ghost”-like software is simply dd | gzip. Once arrived home, I have had the possibility to verify that other tools exist: I’m going to add them among the post references. Ubuntuforums are the usual source of knowledge
I think that the topic has been analyzed in an acceptable way, even if the Linux system is an open and exterminated vault of Parnassus
I can go back to work, once more extremely satisfied about using Linux.
a way to control a remote host behind NAT (implementation)
yep, after the problem and the theoretical solution, here is a couple of implementations.
prolunga is an user oriented solution. it is provided with a plain README file which will help you understand the concept and its implementation. with a pair of minor changes you will also be able to daemonize it. the readme file contains also ideas for further developments. I haven’t still tried to compile it on windows, but it works on gnu/linux
bidipipes is the minimal solution. a pragmatic readme is provided, and it won’t help you setting up the environment. in this case, the only help will be the image on the previous post. this software is fully tested on windows/cygwin.
Once compiled, both softwares will need as well nc(1).
so far, here are the links towards the code:
§
a way to control a remote host behind a NAT
requisites:
* the managing part can open a couple of ports on a public internet host
* the managed part can execute a process
under these circumstances, the managing part will be able to take the control of the managed part’s host.
How?
Using a little trick, based on nc (1) and pipe(2). Man is your friend, as usual.
In particular, you will have to execute two instances of nc, listening on two ports, reciprocally binded by a couple of pipes (bidirectional pipe, in the follow), on the public host of the managing part.
And you will have to execute two instances of nc, the first connecting to the port of the (managed) service you want to export, the second one connectiong to one of the ports you’ve created in the step before.
Doing so, you will have a socket binded to the managed part’s service, on a public host.
An image is worth all the words above
Continuing with the explication, you will find at least a problem: There’s no software which implements a bidirectional pipe. So I’ve made it. It’s pretty unuseful, except in this case. Then, I’ve added to it a pair of functionalities, and now it is available.
How have I thought such a thing? Somewhen ago, somebody told me that Apple’s iChat offers you the opportunity to manage a remote host. So, I’ve told myself that I was able to implement the same mechanism to manage a parent’s computer.
Will it be available in pidgin, soon?
