Convert EPS files to PNG images

Doxygen generates collaboration diagrams in EPS format. If you want to include these graphics in a Latex document that produces PDF output, you have to convert them, for example, to PNG format. To make the conversion we’re going to use Convert. Convert provides image conversion between different formats and belongs to the ImageMagick suite of tools. Just navigate to the directory containing the EPS files and type this command:

for var in `ls|grep eps`;do convert $var ${var}.png;done

This produces PNG images with an .eps.png extension. If you want to leave just the png extension run this python script:

1
2
3
4
#!/usr/bin/python
import os
for fname in os.listdir(os.getcwd()):
        os.rename(fname, fname.replace('.eps.png','.png'))

Mac OSX Preview, merge, crop, delete, add blank PDF pages

To merge and/or remove PDF pages we need the sidebar so press the sidebar button (see first figure). You can switch from thumbnails to table of contents from the button located at the bottom right corner (see second figure).

preview1 Mac OSX Preview, merge, crop, delete, add blank PDF pages

preview2 Mac OSX Preview, merge, crop, delete, add blank PDF pages

Merge PDFs.

Open the first PDF and then just drag & drop the second PDF to the sidebar, between the pages where you want it to appear (see figure).

preview3 Mac OSX Preview, merge, crop, delete, add blank PDF pages

Delete a page.

Select the page you want to delete (in the sidebar) and type Command (The key with an apple) + Backspace.

Add a blank page.

Select Edit -> Insert Blank Page.

Crop an image or file.

First click the select tool. Then select an area of your document or image and hit Command + k.
preview4 Mac OSX Preview, merge, crop, delete, add blank PDF pages

Now you can save the cropped page or image with Command + s.

preview5 Mac OSX Preview, merge, crop, delete, add blank PDF pages


Most expensive Java Script ever

Opera SW needed new servers. Principal HW vendors sent their servers for testing. When Opera’s sysadmin booted up one of the server to test its web-based administration interface, they came across the following JavaScript code:

if (is.opera)
{
window.location.href="config/error.htm";
}

Period.

Dictionary Tooltip, on-the-fly word translations while reading web pages

Dictionary Tooltip is a Firefox Addon that displays on-the-fly word translations in a small tooltip on the same page you’re reading.

Working with Dictionary Tooltip is very easy. You just have to double-click on a word and you instantly get the definition for that word (or its translation to another language).

Dictionary Tooltip comes with many dictionaries and has the ability to add new ones. You can download it here. It works with Firefox 3.5.1.

dicttooltip Dictionary Tooltip, on the fly word translations while reading web pages

Define macros in Latex

The \def command provides macro definition in Latex. These definitions are quite useful if you need to repeat some text across the document. For instance you can define a macro containing your document’s title and then use it in the document this way:

% macro definition in the preamble
\def \doctitle {This is my document's title}
% Using the previously defined macro in the document
This document, titled \doctitle , deals with ...

Get more section levels in Latex

Sometimes you need more section levels in your Latex document. With little effort you can get up to 5 section levels (the equivalent of a \subsubsubsubsection command), just include the following command in the preamble:

1
\setcounter{secnumdepth}{5}

To get the fourth and fifth levels use \paragraph and \subparagraph respectively. The sectioning hierarchy remains as follows:

1
2
3
4
5
\section{First level}
\subsection{Second level}
\subsubsection{Third level}
\paragraph{Fourth level}
\subparagraph{Fifth level}

Visual Studio Doxygen Latex and encoding problems

Today I tried to extract documentation from source code programmed in Visual Studio using doxygen. The Latex document didn’t compile correctly because of encoding problems. Googling for a solution I’ve discovered that Visual Studio may include some strange characters in the saved files.

To fix the files I’d recommend using an Hexadecimal Editor. In my case I’ve chosen hexedit. Opening the file with Hexedit shows those unwanted characters at the beginning of the file. By removing them and saving the file the problem with Latex disappeared. Hope it helps in case someone runs into the same issue.

hex Visual Studio Doxygen Latex and encoding problems

Opening files from the command line on Mac OSX

If you need to open a file from the command line (e.g. a PDF file) you can use the open command:

open -a Preview filename.pdf

In general working from the console is fast and effective, specially if you combine it with bash scripting skills.

Microsoft publishes a paper on a multi-process browser code named “Gazelle”

Microsoft has published a research paper on a browser that uses different processes to isolate page content elements. It builds on the concept of multiprocess browsing but goes one step further and uses more fine-grained isolation to expand on the security advantages that are already included in Chrome and are being developed in Firefox. This is the paper’s abstract. The full article can be found here.

Original web browsers were applications designed to view static web content. As web sites evolved into dynamic web applications that compose content from multiple web sites, browsers have become multi-principal operating environments with resources shared among mutually distrusting web site principals. Nevertheless,no existing browsers, including new architectures like IE 8, Google Chrome, and OP, have a multi-principal operating system construction that gives a browser-based OS the exclusive control to manage the protection of all system resources among web site principals.

In this paper, we introduce Gazelle, a secure web browser constructed as a multi-principal OS. Gazelle’s browser kernel is an operating system that exclusively manages resource protection and sharing across web site principals. This construction exposes intricate design issues that no previous work has identified, such as cross-protection-domain display and events protection. We elaborate on these issues and provide comprehensive solutions.

Our prototype implementation and evaluation experience indicates that it is realistic to turn an existing browser into a multi-principal OS that yields significantly stronger security and robustness with acceptable performance.

Google announces Google Chrome OS

Google has announced its new Operating System – Google Chrome OS. According to the Official Blog:

Google Chrome OS is an open source, lightweight operating system that will initially be targeted at netbooks. Later this year we will open-source its code, and netbooks running Google Chrome OS will be available for consumers in the second half of 2010.

Google Chrome OS will run on both x86 as well as ARM chips …

The software architecture is simple — Google Chrome running within a new windowing system on top of a Linux kernel. For application developers, the web is the platform. All web-based applications will automatically work and new applications can be written using your favorite web technologies …

We hear a lot from our users and their message is clear — computers need to get better. People want to get to their email instantly, without wasting time waiting for their computers to boot and browsers to start up. They want their computers to always run as fast as when they first bought them. They want their data to be accessible to them wherever they are and not have to worry about losing their computer or forgetting to back up files. Even more importantly, they don’t want to spend hours configuring their computers to work with every new piece of hardware, or have to worry about constant software updates…

Another step further towards the Google World Domination?

chrome Google announces Google Chrome OS