2012-06-30

Tweets of the month

28 Jun
Completing new figures for new paper

27 Jun
Will the iPhone 5 have NFC? New iPhone prototypes have NFC chips and antenna http://9to5mac.com/2012/06/25/new-iphone-prototypes-have-nfc-chips-and-antenna/ via @9to5mac

27 Jun
IEEE RFID TA conference deadline extended to July 15th http://lcis.grenoble-inp.fr/ieee-rfid-ta-2012-465827.kjsp

22 Jun
NYT: Tracking Europe's Debt Crisis: http://nyti.ms/oY0uz0

15 Jun
Things We Forget: 884: Act as if it were impossible to fail. http://thingsweforget.blogspot.com/2012/06/884-act-as-if-it-were-impossible-to.html?spref=tw

12 Jun
INFórum - Internet das Coisas e Serviços - submissão de resumos estendida até 13 de Junho! http://inforum.org.pt/INForum2012/sessoes/internet-das-coisas-e-servicos.html

LaTeX text color

LaTeX text colors... courtesy of Joana!

{\textcolor{red} bla bla bla}

Available colors: @ 000-config.tex

% ---------------------------
%     PDF COLORS
% ---------------------------

% pdf package allow you to describe the colors you want to use for links

% -------------------
% COLORS by name (examples):

% RED:
\definecolor{red}{rgb}{1,0,0}
\definecolor{rltred}{rgb}{0.75,0,0}
\definecolor{webred}{rgb}{0.5,.25,0}
\definecolor{rltbrightred}{rgb}{1,0,0}
\definecolor{rltdarkred}{rgb}{0.5,0,0}

% GREEN:
\definecolor{green}{rgb}{0,1,0}
\definecolor{rltgreen}{rgb}{0,0.5,0}
\definecolor{webgreen}{rgb}{0,0.5,0}
\definecolor{rltbrightgreen}{rgb}{0,0.75,0}
\definecolor{rltdarkgreen}{rgb}{0,0,0.25}
% institutional
\definecolor{green-l2f}{rgb}{0.37,0.725,0.21}

% BLUE:
\definecolor{blue}{rgb}{0,0,1}
\definecolor{rltblue}{rgb}{0,0,0.75}
\definecolor{webblue}{rgb}{0,0,0.75}
\definecolor{rltbrightblue}{rgb}{0,0,1}
\definecolor{rltdarkblue}{rgb}{0,0,0.5}
% institutional
\definecolor{blue-phd}{rgb}{0.7,0.8,0.9}
\definecolor{blue-l2f}{rgb}{0,0.21,0.455}
\definecolor{blue-ist}{rgb}{0.055,0.30,0.486}
\definecolor{blue-ist-old}{rgb}{0.70,0.73,0.84}
\definecolor{blue-ist-new}{rgb}{0.25,0.333,0.39}

%% from WEB references:
\definecolor{white}{gray}{1}
\definecolor{black}{gray}{0}
\definecolor{gray}{gray}{0.5}
\definecolor{silver}{gray}{0.75}
\definecolor{lightgray}{gray}{0.97}

\definecolor{yellow}{rgb}{1,1,0}
\definecolor{orange}{rgb}{1,0.4,0}
\definecolor{pink}{rgb}{1,0,1}
\definecolor{purple}{rgb}{0.5,0,0.5}
\definecolor{teal}{rgb}{0,0.5,0.5}
\definecolor{navy}{rgb}{0,0,0.5}
\definecolor{aqua}{rgb}{0,1,1}
\definecolor{lime}{rgb}{0,1,0}
\definecolor{olive}{rgb}{0.5,0.5,0}
\definecolor{maroon}{rgb}{0.5,0,0}
\definecolor{brown}{rgb}{0.6,0.4,0.2}

2012-06-28

Saving Visio diagram as PDF

File-> Save As -> Change File Type to PDF (the actual description in Visio 2010 is "Save As Type...").

To get the size down to what you want, assuming you are using Visio 2010 - go to the Design ribbon at the top, and change "Size" to "Fit to Drawing"

Credits: DavidChenware @ superuser.com

2012-06-22

Shall I compare thee to a summer's day?

Shall I compare thee to a summer's day?
Thou art more lovely and more temperate:
Rough winds do shake the darling buds of May,
And summer's lease hath all too short a date:
Sometime too hot the eye of heaven shines,
And often is his gold complexion dimmed,
And every fair from fair sometime declines,
By chance, or nature's changing course untrimmed:
But thy eternal summer shall not fade,
Nor lose possession of that fair thou ow'st,
Nor shall death brag thou wander'st in his shade,
When in eternal lines to time thou grow'st,
   So long as men can breathe, or eyes can see,
   So long lives this, and this gives life to thee.

Shakespeare, Sonnet XVIII

2012-06-20

Java memory options

On a 32-bit Windows 7 machine running Oracle JDK 7, the default Java heap size is around 256M.

The JVM memory settings are the following:
-Xms        set initial Java heap size
-Xmx        set maximum Java heap size
-Xss        set java thread stack size

This means that we can change the initial and maximum heap size using:

java -Xms512M -Xmx1G MyMainClass

M stands for MegaByte and G for GigaByte.
There is also a "standard" way of defining these parameters using the JAVA_OPTS environment variable:

SET JAVA_OPTS=-Xms1G -Xmx1G

For instance, execution scripts created using gradle install will apply the options specified in JAVA_OPTS and in an application-specific variable (e.g. MY_APP_OPTS).

This in practice, does:

java %JAVA_OPTS% MyMainClass


The following Java program can query the memory using the Runtime object.

// credits: mike http://stackoverflow.com/a/7019624
public class MyMainClass {

    public static void main(String[] args) {
        Runtime rt = Runtime.getRuntime();
        long totalMem = rt.totalMemory();
        long maxMem = rt.maxMemory();
        long freeMem = rt.freeMemory();
        double megs = 1048576.0;

        System.out.println ("Total Memory: " + totalMem + 
" (" + (totalMem/megs) + " MiB)");
        System.out.println ("Max Memory:   " + maxMem +
" (" + (maxMem/megs) + " MiB)");
        System.out.println ("Free Memory:  " + freeMem + 
" (" + (freeMem/megs) + " MiB)");
    }

}

2012-06-06

Resize shapes in Visio UML

The shapes are intended to be used as part of a deeper UML solution, which has code behind it. This code expects shapes to behave a certain way, and to have certain attributes. If they are changed by the user too much, then the UML solution can't function properly. It's sometimes hard to know when shapes are just "pretty shapes" and when they are "solution objects". If you just need a "dumb shape" that looks like the UML shapes, sometimes you can Copy, Paste Special - as metafile, then Shape > Operations > Convert to group. You'll have a shape with all the elements of the original, and none of the smarts and locks.

Source: Why can't I resize shapes in Visio UML?