2012-12-28

Turtle power and other RDF serialized formats

RDF triples specify statements with 3 parts: subject, predicate, object.

To store triples in a file there are several alternatives:

The first is RDF/XML.

The others are text based and are easier to read and use:
N3, TURTLE (TTL) and N-TRIPLE are plain text serializations of RDF.

N3 is a superset of TTL, and TTL is a superset of N-TRIPLE.

The most basic representation is N-TRIPLE but it is very verbose.

My personal favorite is TURTLE (TTL) because it provides some very nice shorcuts while maintaining the overall simplicity. Read more about it in the guide, section 2.

How to install Jena command line tools?

Apache Jena is an open-source library for building Semantic Web applications using the Java programming language.
At the core of the library is a RDF implementation.
The SPARQL query language can be used to query RDF models.

The distribution includes a set of command line tools that can be very useful.
To install them, follow the next steps:

1. Download Jena binaries from http://www.apache.org/dist/jena/

2. Unzip file to an installation folder

3. Define the environment variable JENAROOT

4. Add %JENAROOT%\bat to the PATH environment variable

At the present moment, the following tools are available:

qtest
query
rdfcat
rdfcompare
rdfcopy
rdfparse
rset
RuleMap
schemagen
sparql
turtle
version

Consult the javadoc (jena package) for more details.

2012-12-10

Your next boss could be a computer

Your next boss could be a computer - tech - 06 December 2012 - New Scientist: "I'D RATHER have a computer as my boss than a jerk," says Daniel Barowy. To that end he has created AutoMan, the first fully automatic system that can delegate tasks to human workers via crowdsourcing platforms such as Amazon's Mechanical Turk. Barowy and colleagues designed AutoMan to send out jobs, manage workers, accept or reject work and make payments. "You're replacing people's bosses with a computer," he says.

2012-12-01

Niall Ferguson - West less good at being West

Niall Ferguson: 'West less good at being West' (CNN)

"
(CNN) -- The speed at which the global economy has pivoted from the West to emerging economies like China is astounding, says author Niall Ferguson.

"If you think back to 1978 when I was a teenager, the average American was 22 times richer than the average Chinese. And today it's less than five times," said Ferguson, a Harvard history professor and a former adviser to 2008 Republican Party presidential candidate John McCain. "That's an amazing reduction in the global imbalance and it's happen in the space really of 30 years."

"The West is at a different phase of development -- economically, demographically -- and it's also at a different place culturally from these countries that are emerging from various forms of economic control -- whether the bureaucratic system of post-Raj India or the communist system that was gradually dismantled economically in China after 1978," he said. This is bringing back one of the most remarkable shifts in the global balance of economic power."

Ferguson sat down last week with CNN's Andrew Stevens in detailed talk on the global economy.

What are the underlying reasons for the decline of the West?

In our lifetime Western ascendancy is coming to an end, after 500 years, when the story was the great divergence -- when the west got much richer than everybody else. And it's extraordinary that really since the 1970s, this historical tide has turned.
New age of U.S. prosperity?
Are central banks doing enough?
Niall Ferguson: The West and the Rest
Sharing the wealth of ideas

I think there are two processes at work here. One is the rest of the world -- led by China -- have been downloading our killer applications. They have been imitating the things that work well in the West, particularly in the realm of business. And this is to be celebrated. It's great to see countries like China and India lifting hundreds of millions of people out of poverty by essentially copying Western ways of doing things.

But I think there is another process at work, which is in some ways independent -- the West is becoming less good at being the West. The things that worked well in the West for over half a millennia don't work so well now. And one way of looking at it is to say: Why is it that the Western economies have malfunctioned? It's not just that there ways a financial crisis and bankers are terrible people. It's much more profound than that.

Why are Western economies performing so badly?

One way of thinking about this is to ask why so many economies, most of them Western -- Japan is the exception -- are currently crushed by debt, which in some cases exceed 100% of GDP? And these debts are forecast to rise even further in the U.S. The simple answer is to say there is a terrible problem of government extravagancy, but I don't think that's the right answer. One way of thinking about this is to say that debt represents a tax on the future. And the big accumulation of debt that we've seen over the last 20 or 30 years in the Western world reflects a breach of contract between the current generation and the next generations. And these debts represent a big burden on the future. And that is one reason I think we've seen a slowdown in the Western world because these burdens of debt act as a major check on economic dynamism.

Why has this generation decided to ignore future generations? Why have we become so selfish?

At some level I think it's a cultural shift. We've moved a long way from our ideals of self-sacrifice for the future that characterized the West during its hay days of industrialization, overseas expansion -- not to mention large-scale warfare. So there's partly been a cultural shift towards the 'me generation' -- consume now, live in the present. But I think it's slightly more than that.

I think what happened after World War II was that it was decided in most Western countries to create pretty generous welfare states that were going to exist to transfer resources from the rich to the poor. And that worked pretty well. It did reduce inequality in those countries when these systems were introduced. But over time the welfare state has become dysfunctional in a surprising way. But in a way it became a victim of its own success: It became so successful at prolonging life, that it becomes financially unsustainable, unless you make major changes to things like retirement ages. And everywhere you see the same basic story, whether you're looking at northern Europe, southern Europe, or north America -- welfare states become harder and harder to finance, and structural budget deficits emerge.

That's to say deficits that are there even when the economy is growing well. And I think these are symptoms of a more profound problem that is causing the Western slowdown. Contrast that with the story in Asia, where welfare states, let's say in China, are much less well developed.

Is it going to take something like a fiscal cliff -- a sovereign debt crisis -- to bring this period to an end?

The European experience suggests nothing gets done until there is a crisis. And this crisis has begun in countries like Spain, Greece, Ireland, and I think soon it will spread to France, as people begin to realize that the French position is actually no better than the other Latin European countries. At some point one can imagine a crisis like that happening in the most developed Asian economy, Japan. And I think sooner or later it may end up happening in the U.S. Although I must say I'm becoming less and less sure that will happen soon. There are things happening in the U.S. that make it quite different, in the sense for example that the demographics are not so bad -- partly because of immigration -- and also interestingly the U.S. is about to have the most amazing free lunch on the back of shale gas and shale oil. The US economy is going to get a really big shot in the arm.

What then is the restructuring that needs to happen at an economic level in the West?

Well, I think the most important thing to recognize is that it's not just about taxing and spending. If you define this too narrowly in fiscal terms then you end up in the mess that southern Europe is in -- trying to balance the budget, even as your economy is shrinking. It's better I think to ask questions of a more profound nature about the institutional framework within which society operates. To me one of the most profound contrasts between the West and the rest is that things like the rule of law -- regulation, bureaucracy -- are becoming more burdensome in Western countries, even as they are becoming less burdensome in emerging markets.

You mean they are getting in the way of development?

They really are. I mean one of the main arguments that I make in my new book, "The Great Degeneration," is that the rule of law in the US is becoming the rule of lawyers. The legal profession has become a very major source of cost for business. You have very complex regulation and a very parasitic legal profession, and it battens off the private sector. It's almost impossible for any major organization to function without a huge compliance department and teams of lawyers. And that is all just dead cost. It doesn't really add to the productivity of the economy.

And I think that's one of the things that I am trying to focus on: Why is our regulation so over-complicated? Why does the tax code occupy shelves, rather than just a few pages? And why is it that if you want to regulate the financial sector, you need a bill that is 2000-plus pages long? If we could aspire for greater simplicity and transparency in the tax code and most regulation, I think there would be real benefits.

As China cherry picks the best of the West, do you think they may also fall into Western excesses as well: Is this an evolutionary likelihood?

It's possible. They have some way to go. Short-term, I think the biggest problem facing the Chinese is the rule of law question. It's not the democracy question. It's more -- can China transition to a system in which the rule of law really works? That matters a lot for China's rapidly growing middle class. They want security for their property. They do not want to feel that they could have their property confiscated by an all powerful party at the drop of a hat.

It's not difficult to see what China needs to do, but whether it can do it politically, whether it can override the vested interests, or not, I really don't know.

If you think about it China is acquiring this huge middle class that's one of the direct consequences of rapid growth. And historically if you look at the Western experience it's the middle class that starts to push for rule of law and representative government and freedom of the press -- those are middle class things to want. You really don't worry about those things if you're a peasant or an industrial worker. It's inevitable I think that as this class grows in China, it will start to behave in the ways that middle classes always behave. And the Communist Party is not well set-up to meet those demands.
"

2012-11-30

Tweets of the month

29 Nov
RT Tim Berners-Lee @timberners_lee Whups ... Power out for all #MIT. So that's what that big switch does ...

28 Nov
The HDMA provides some interesting data about the US pharmaceutical supply chain http://www.healthcaredistribution.org/about_hdma/about_hdma.asp …

23 Nov
Just made my two latest papers available at my home page: http://web.ist.utl.pt/miguel.pardal/www/pubs/Miguel-Pardal-Publications.html …

19 Nov
Interesting analysis of U.S. Pharma Supply Chain connections complexity http://www.rxtrace.com/2011/05/u-s-pharma-supply-chain-complexity.html/ …

19 Nov
@nokia When will the new Lumia phones with Windows Phone 8 be available in Portugal? I really want one for Christmas! :)

14 Nov
@nokiaportugal Quero muito comprar um Lumia com Windows Phone 8 para este Natal... Quando é que vão estar à venda em Portugal?

7 Nov
IBM Tech advances http://news.bbc.co.uk/2/hi/programmes/click_online/9768132.stm …

7 Nov
Presentation of my #IEEERFID TA paper is now available at http://www.slideshare.net/MiguelLPardal

7 Nov
Something every technology worker should know about: Gartner technology hype cycle http://www.gartner.com/technology/research/methodologies/hype-cycle.jsp …

7 Nov
#IEEERFID Smart Cities merge innovation economy with digital layers over city space. Awareness -> Empowerment -> Saving + Environment

6 Nov
RFID meets the Semantic Web: RFID as universal entry point to enterprise linked data cloud, by Jens Ziegler TU Dresden #IEEERFID

6 Nov
Great talk about wirelessly powered sensor systems and computational RFID by Joshua R. Smith UW #IEEERFID

6 Nov
Attending #IEEERFID TA

How to install Groovy on Windows?

Groovy is a great scripting language for the Java platform.

The first step to install it is to download the archive (ZIP).
http://groovy.codehaus.org/Download?nc

The second step is to unzip to a folder.
For example, C:\Java\groovy\2.0.5

Set GROOVY_HOME to the installation folder.

Then, edit the PATH variable, to add, in the beginning:
%GROOVY_HOME%\bin;

Finally, open a new console and execute the following command that should print the installed Groovy version:
groovy -version

How to install the Java Developer Kit on Windows?

The first step is to download the installation package.
The file to get is the Java Developer Kit (JDK)
http://www.oracle.com/technetwork/java/javase/downloads/index.html

The second step is to execute the installer.

To compile and execute Java programs in the console, a few environment variables must be set.

Set JAVA_HOME to the installation folder.
For example, C:\Java\jdk\1.7.0_09

Then, edit the PATH variable, to add, in the beginning:
%JAVA_HOME%\bin;

Finally, to check if everything is OK, open a new console and execute the following commands that should print the installed Java version number:
javac -version
java -version 

That's it! Happy coding!

How to set environment variables in Windows?

Environment variables are values that, once set, become available to all programs running in the computer.

The value of an environment variable can be used like this: %name%. Typically, environment variables are used to specify program paths and settings.

Some environment variables are set by Windows.
%ProgramFiles% holds the value of the program folder (english Windows: C:\Program Files; portuguese Windows: C:\Programas).
%UserName% holds the user name of the user in session.
%UserProfile% holds the home folder of the user in session.

One of the most used environment variables is PATH, that specifies where the operating system looks for programs.
Folders are separated by the ; character.

To see the value of PATH, execute ECHO %PATH% in the console.
Also, the SET command can print and set environment variables.


To set environment variables permanently on Windows, go to Computer System Properties, Advanced, Environment Variables. The following screen-shots illustrate this procedure for Windows 7.




Environment variables can be defined for the current user (user) or for all users (system).


The new settings only take effect for new consoles.

2012-10-31

Tweets of the month

29 Oct
Great blog about pharma traceability http://www.rxtrace.com/

26 Oct
You can download the GS1 Healthcare Conference presentations here: http://www.gs1.org/healthcare/news_events/231012/post … #GS1Healthcare

25 Oct
Yesterday I attended the Pedigree sessions of GS1 Healthcare conference in Lisbon http://www.gs1.org/healthcare/news_events/231012 … Very interesting!

15 Oct
http://trakchain.net is now available in English and Portuguese. All information was also updated with the latest project developments.

15 Oct
Updated my web page. Check it out! http://web.ist.utl.pt/miguel.pardal/ My publications are now easier to find! My social networks too!

9 Oct
Revising background chapters of my PhD thesis

4 Oct
Java evolution roadmap http://www.oracle.com/us/corporate/press/1854982 …

3 Oct
@IngoKegel JProfiler is amazingl! It would be even better if CPU export used session name by default and saved both html and xml w 1 click

2012-10-18

How to add watermarks to your PDF files

You probably have seen documents with background watermarks stating something like:

Draft
Proof
Final
Urgent
Priority
Do Not Copy
Copy
For Your Eyes Only
Review Copy
Confidential
Top Secret
Duplicate
... you get the idea :)

There are free tools that can do it for you. I recommend PDFill Tools or Pdftk (command-line alternative).

2012-10-15

How to check SVN repository version

cat svn-repo/format/db
If the file contents lists 3 on the first line, it stands for SVN 1.5, 4 for SVN 1.6
Credits: http://stackoverflow.com/a/282484/129497

The repository can be upgraded with:
svnadmin upgrade svn-repo
This can be important because SVN 1.5 and 1.6 introduced many improvements to branch operations including the svn mergeinfo command. If the repository is in an older version there is not enough metadata to ease the branch synchronizations.

How to set permissions for Linux personal web site

Let's suppose that we have a user account located at ~ and a web site at ~/www

We need to set the directory permissions to 755 allow every

We need to set the files to 644 (owner can r/w, everybody else can r)
    u g w
0 - 0 0 0
1 - 0 0 1
2 - 0 1 0
3 - 0 1 1
4 - 1 0 0
5 - 1 0 1
6 - 1 1 0
7 - 1 1 1
u stands for 'user', g for 'group' and w for 'world'.
These are the classic Unix file permissions.

However, if AFS is being used, we also need to provide permissions in the access control lists (ACL).

The following command gives access to the web folder to anyone:

fs sa www system:anyuser rl

The following lists the existing permissions:

fs la www

More help on AFS
"
There are seven standard AFS permissions, each referred to by one of the letters r, l, i, d, w, k and a. The lida permissions apply to directories and the rwk permissions apply to files.
Directory permissions

l (lookup)
Allows one to list the contents of a directory. It does not allow the reading of files.
i (insert)
Allows one to create new files in a directory or copy new files to a directory.
d (delete)
Allows one to remove files and sub-directories from a directory.
a (administer)
Allows one to change a directory's ACL. The owner of a directory can always change the ACL of a directory that s/he owns, along with the ACLs of any subdirectories in that directory.

File permissions

r (read)
Allows one to read the contents of file in the directory.
w (write)
Allows one to modify the contents of files in a directory and use chmod on them.
k (lock)
Allows programs to lock files in a directory.

"

2012-10-06

Google Virtual Brain

Google Puts Its Virtual Brain Technology to Work - Technology Review: This summer Google set a new landmark in the field of artificial intelligence with software that learned how to recognize cats, people, and other things simply by watching YouTube videos (see "Self-Taught Software"). That technology, modeled on how brain cells operate, is now being put to work making Google's products smarter, with speech recognition being the first service to benefit.

Google's learning software is based on simulating groups of connected brain cells that communicate and influence one another. When such a neural network, as it's called, is exposed to data, the relationships between different neurons can change. That causes the network to develop the ability to react in certain ways to incoming data of a particular kind—and the network is said to have learned something.

2012-10-05

How to backup and restore Subversion repository

Backing up and Restoring Your Subversion Repository - OCS Support Wiki: Using the Console

Establish an SSH connection to your designated SVN / Trac server and login with the same username and password you use to obtain access to the SVN / Trac control panel. Once in, run:

svnadmin dump ~/svn/repo_name > repo_name.svn.dump

Replace repo_name with your repository name. This will backup your repository into a file called repo_name.svn.dump. You can then restore a Subversion backup with:

svnadmin load ~/svn/repo_name < repo_name.svn.dump

How to change paper size for IEEE LaTeX template

(La)TeX Support for manuscript preparation: Guide to use ieeeconf.cls (based on IEEEtrans.cls) IEEEtran_HOWTO.pdf

The document sample_new.tex may be configured for US Letter paper or A4. Please note the following four important lines:

\documentclass[letterpaper, 10 pt, conference]{ieeeconf} % use above line letter sized paper

\documentclass[a4paper, 10pt, conference]{ieeeconf} % Use this line for a4 paper

\IEEEoverridecommandlockouts % Needed if you want to use the \thanks command

\overrideIEEEmargins % Needed to meet printer requirements.

Groovy Date Format one-liner

new Date().format("yyyy-MM-dd")

This method has been added to java.util.Date




Current date (mm/dd/yyyy) (Groovy forum at JavaRanch)
:

import org.codehaus.groovy.runtime.*;

class Run{
static void main(def args){
def dateTime = new Date()
println DateGroovyMethods.format(dateTime, 'MM/dd/yyyy')
}
}

Groovy File One Liners

Groovy Scripting and Programming: Groovy File One Liners

One of the nice things about Groovy if you are a Java programmer is the ease that you can manipulate files with just one like of code.

Create or replace a file and write a line of text to it:
new File("myfile.txt").write("Here is a line: \"whats a nice programmer like you doing at a blog like this\" \n");

Append to a file (creates the if it doesn't exist)
new File("myfile.txt").append("\"Looking for a some code like this\"\n");

Read the second line (First line is line 0) of the file
println new File("myfile.txt").readLines()[1] //what was the response

2012-10-04

2012-10-03

How to paste text to multiple columns in Excel

Learn Microsoft Excel: Smart Paste: Pasting text into different Excel cells can be done by making use of the TAB key in the text editor. Pressing Tab represents a new cell in Excel when pasting the contents into Microsoft Excel. To create a four column layout in Excel one would simply write down the name of the first column, press tab, write down the name of the second column, press tab and so on.

How to pipe command output to Windows clipboard

Use clip.exe!

Copy Command Line Output to Windows Clipboard Directly:

dir /h | clip – Copy the help manual for DIR command to the clipboard

tracert www.labnol.org | clip – Trace the path from your computer to another website – the output is automatically copied to the clipboard and not displayed on the screen.

netstat | clip - Check if your computer is connecting to websites without your knowledge.

 The clip.exe utility can also be used to copy contents of text files to clipboard directly from the command line.
 clip < C:\AUTOEXEC.bat – this will copy all the text from autoexec.bat to your Windows Clipboard.

2012-09-30

Tweets of the month

29 Sep
You can subscribe to the free Java magazine from Oracle here: http://www.oracle.com/technetwork/java/javamagazine/index.html

25 Sep
The 2012 updated ACM Computing Classification System (CCS) http://dl.acm.org/ccs.cfm

20 Sep
RT Joana Paulo Pardal @joanappardal DI-FCT-UNL Distinguished Lecture Series: 1st with Barbara Liskov, MIT, Oct 3, 2012, 14h30 http://www.di.fct.unl.pt/difctunl-distinguished-lecture-series

19 Sep
Unified Eclipse update site for simultaneous releases, in this case, Juno http://download.eclipse.org/releases/juno

17 Sep
Minority report for science http://www.northwestern.edu/newscenter/stories/2012/09/kording-scientist-predictions.html

7 Sep
Finished major overhaul of my research bibliography work system inspired by iAnnotate and with Google Scholar help http://googlescholar.blogspot.pt/2012/08/scholar-updates-making-new-connections.html

2012-09-26

How Computerized Tutors Are Learning to Teach Humans

How Computerized Tutors Are Learning to Teach Humans - NYTimes.com: The Machines Are Taking Over Education...

NASA Funds Advanced Robotics Projects

NASA Funds 8 Advanced Robotics Projects - Government - Information Management - Informationweek: NASA is investing $2.7 million to kick off eight advanced robotics projects aimed at improving robot technology as part of its long-term goal of putting a human on Mars. The projects, part of the White House's National Robotics Initiative, are tied to NASA's plans for an asteroid mission in 2025 and human exploration of Mars around 2035. The National Science Foundation managed the solicitation for the project proposals, each of which will receive between $150,000 and $1 million in funding.

2012-09-25

Data Centers Waste Vast Amounts of Energy

Data Centers Waste Vast Amounts of Energy - NYTimes.com: A yearlong examination by The New York Times has revealed that this foundation of the information industry is sharply at odds with its image of sleek efficiency and environmental friendliness. Most data centers, by design, consume vast amounts of energy in an incongruously wasteful manner, interviews and documents show. Online companies typically run their facilities at maximum capacity around the clock, whatever the demand. As a result, data centers can waste 90 percent or more of the electricity they pull off the grid, The Times found.

2012-09-21

You code, you learn - flat Java files

"I don't need to keep my java files in all those boring package name folders (e.g. /net/proj/...). I'll just keep them all in a single folder then let the compiler worry about it"

The above statement is true, but you should known that the IDEs like Eclipse, Netbeans, IntelliJ, assume that the java files are stored in folders according to the package structure.

The IDEs will report errors when you try to open the project in them. And sooner or later, you or someone on your team will want to do it.

The renaming process can be eased using the Eclipse refactor-move functionality, but it will be a pain, especially if your are using version control.

I wasted 2 days to rearrange the Java files to the standard structure using Eclipse and SVN.

You code, you learn!

2012-09-20

You code, you learn - Groovy to Java

Here is one mistake you might end up doing:

"I'll code in Groovy first and then convert to Java. It should be a piece of cake!"

Be prepared for a bitter and hard to chew cake!

Groovy is very loose on typing so you'll end up doing all sorts of accidental programming errors, for instance, you can easily use methods that are not accessible on a static context. Generics are also a pain.

To convert the code you will have to do major refactoring with redesign of the class hierarchies.

I wasted 2 weeks on a project when I had to convert a 200 class application from Groovy to Java.

You code, you learn!

2012-09-17

Removing accented characters

Here are two ways to replace accented characters by their equivalents in Java:

A basic solution with probably bad performance:
public static String removeAccents(String s) {
    s = s.replaceAll("[áàâãä]","a");
    s = s.replaceAll("[éèêë]","e");
    s = s.replaceAll("[íìîï]","i");
    s = s.replaceAll("[óòôõö]","o");
    s = s.replaceAll("[úùûü]","u");
    s = s.replaceAll("ç","c");

    s = s.replaceAll("[ÁÀÂÃÄ]","A");
    s = s.replaceAll("[ÉÈÊË]","E");
    s = s.replaceAll("[ÍÌÎÏ]","I");
    s = s.replaceAll("[ÓÒÔÕÖ]","O");
    s = s.replaceAll("[ÚÙÛÜ]","U");
    s = s.replaceAll("Ç","C");

    return s;
}

Another one, with JDK support that does not appear to work properly on the Mac implementation. Test carefully first.

public static String removeAccentsAlt(String s) {
    String temp = java.text.Normalizer.normalize(s, java.text.Normalizer.Form.NFD);
    return temp.replaceAll("[^\\p{ASCII}]","");
}
credits: http://www.rgagnon.com/javadetails/java-0456.html

For comparing text, there is java.text.Collator:

Collator collator = Collator.getInstance(locale);
        collator.setStrength(Collator.PRIMARY);
        collator.setDecomposition(Collator.FULL_DECOMPOSITION);

2012-09-13

John Swales' 3 moves formula for paper introduction and background

"
Move 1: Establishing a territory
1.Claiming centrality and/or
2.Making topic generalizations and/or
3.Reviewing items of previous research

Move 2: Establishing a niche
1.Counter-claiming or
2.Indicating a gap or
3.Question-raising or
4.Continuing a tradition

Move 3: Occupying the niche
1.Outlining purposes or
2.Announcing present research
3.Announcing principle findings
4.Indicating Research article structure
"

http://www.wikihow.com/Write-a-Swalesian-Introduction

via Joana, via Luísa C. Thanks! :)

2012-09-10

Data Discovery Applications

Data Discovery Applications - The TEC Blog: Data discovery tools are specifically aimed at connecting users to a wide variety of data source types (structured, semi-structured, and non-structured) and enabling users to freely explore the data within. There are no predefined data drill paths, so users can interact with data the way they want to and easily create visualizations that suit their own purposes. As such, they boast a flexibility and freshness that traditional BI solutions might find hard to match.
...

letting users explore data and discover insight without having formed a specific question
...

For now, some organizations (especially large ones) rely on full-fledged traditional BI applications to cover all their BI needs, but data discovery tools are gaining presence in the small to medium business (SMB) market.
...

Data discovery is akin to a spreadsheet on steroids

2012-09-07

Google Scholar making new connections

Scholar Updates: Making New Connections - Google Scholar Blog: We analyze your articles (as identified in your Scholar profile), scan the entire web looking for new articles relevant to your research, and then show you the most relevant articles when you visit Scholar. We determine relevance using a statistical model that incorporates what your work is about, the citation graph between articles, the fact that interests can change over time, and the authors you work with and cite.

Estonia First Graders will learn Web Coding

Estonia Reprograms First Graders as Web Coders | Wired Enterprise | Wired.com: Public schools in Estonia will soon have a curriculum for teaching web and mobile application development to students as early as first grade.

According to an article published by UbuntuLife, the program begins this month with training for primary-school teachers. This will be followed by pilot programs. Eventually, the curriculum will be available to all public schools, with educational materials for all levels from grades 1 through 12.

(...)

Back in May, Mozilla executive director Mark Surman told Wired that kids start deciding whether to be content makers or mere consumers sometime around the age of 8 to 10 years old. “If we want kids to be makers rather than consumers (our goal), this is a critical age,” he said.

2012-08-31

Tweets of the month

28 Aug
Texmaker - great (free) tool http://www.xm1math.net/texmaker/

28 Aug
Thanks for the Lembas @joanappardal

27 Aug
Fight to get it back again!

22 Aug
@joanappardal just won the Put Tiago to Sleep Badge! Congratulations! ;)

14 Aug
Committed revision 200.

14 Aug
DoubleRobotics telepresence http://venturebeat.com/2012/08/13/doublerobotics-telepresence-gets-sexy-and-made-in-the-usa/

7 Aug
Well, enough geek jokes for one day. Back to work! I've been using Semantic Web technologies and it has been intriguing...

7 Aug
There's also an I in TIMMY http://www.userlogos.org/files/logos/PaparazziPulse/Think%20Geek%20(Logo%202).png

7 Aug
There's no I in TEAM (but there is one in TIM ;)

7 Aug
Great job Tim! The best work is always Tim's work ;)

3 Aug
Future of RFID, visual.ly http://visual.ly/future-rfid Thanks @joanappardal !

2 Aug
Critical analysis of open access scholarly/academic publishing http://scholarlyoa.com/ Recommended by CACM's editor M. Vardi

1 Aug
What 'svn merge' actually does is diff and patch on the local copy http://blog.eleutian.com/2008/04/02/HowToBranchProperly.aspx

2012-08-19

Khan Academy Programming

Coders Get Instant Gratification With Khan Academy Programming | Wired Enterprise | Wired.com: The tutorials are interactive and live entirely in the browser. Instead of a video, each lesson contains a pane on the left side for students to enter code and a pane on the right that displays the output. The first lesson walks students through the process of writing code that will draw a face in the right pane. After learning to generate graphics, students work up to animation and eventually to games, such as a Pac-Man clone.

2012-08-16

Brave

Brave


For Joana:

Your wit is as sharp as her arrows!
Your smile as fiery as her hair!
Your heart fills the room as her eyes!

It takes real courage to make right what would be wrong...
Keep fighting and be humble, be smart, be Brave!

2012-08-11

Eddie Vedder - Ukulele songs

Eddie Vedder - Ukulele songs


The album is very good (although the Ukulele sound can be a little tiresome after a while).

Also, check out this amazing illustration by Mark Frudd

2012-08-09

Gradle introspection

I've been using the Gradle build tool for a while now, and it has been a very good experience. Not so much with Groovy beyond scripts, but that is another story... :)

Today I had a dependency problem caused by two alternative libraries being loaded at the same time (see SLF4J Multiple Binding).

To diagnose the problem I used the following Gradle inspection commands:
gradle dependencies

gradle properties

gradle tasks
(see user guide, chapter 11)

Here the excerpt from the dependencies command:
------------------------------------------------------------
Project :Util
------------------------------------------------------------

compile - Classpath for compiling the main sources.
+--- junit:junit:4.10 [default]
|    \--- org.hamcrest:hamcrest-core:1.1 [compile,master,runtime]
+--- org.apache.jena:jena-core:2.7.2 [default]
|    +--- org.apache.jena:jena-iri:0.9.2 [compile,master,runtime]
|    |    +--- org.slf4j:slf4j-api:1.6.4 [compile,master,runtime]
|    |    +--- org.slf4j:slf4j-log4j12:1.6.4 [compile,master,runtime]
|    |    |    +--- org.slf4j:slf4j-api:1.6.4 [compile,master,runtime] (*)
|    |    |    \--- log4j:log4j:1.2.16 [compile,master,runtime]
|    |    \--- log4j:log4j:1.2.16 [compile,master,runtime] (*)
|    +--- xerces:xercesImpl:2.10.0 [compile,master,runtime]
|    |    \--- xml-apis:xml-apis:1.4.01 [compile,master,runtime]
|    +--- org.slf4j:slf4j-api:1.6.4 [compile,master,runtime] (*)
|    +--- org.slf4j:slf4j-log4j12:1.6.4 [compile,master,runtime] (*)
|    \--- log4j:log4j:1.2.16 [compile,master,runtime] (*)
\--- javax.mail:mail:1.4.5 [default]
     \--- javax.activation:activation:1.1 [compile,master,runtime]

...
(*) - dependencies omitted (listed previously)

To exclude the log4j binding dependency, I added the following to build.gradle:
configurations {
    all*.exclude(group: 'org.slf4j', module: 'slf4j-log4j12')
    all*.exclude(group: 'log4j', module: 'log4j')
}
(see user guide 43.4.7. Excluding transitive dependencies
)

The new dependency tree now excludes the troublesome dependency:
compile - Classpath for compiling the main sources.
+--- org.apache.jena:jena-core:2.7.2 [default]
|    +--- org.apache.jena:jena-iri:0.9.2 [compile,master,runtime]
|    |    \--- org.slf4j:slf4j-api:1.6.4 [compile,master,runtime]
|    +--- xerces:xercesImpl:2.10.0 [compile,master,runtime]
|    |    \--- xml-apis:xml-apis:1.4.01 [compile,master,runtime]
|    \--- org.slf4j:slf4j-api:1.6.4 [compile,master,runtime] (*)
\--- javax.mail:mail:1.4.5 [default]
     \--- javax.activation:activation:1.1 [compile,master,runtime]

...

2012-08-05

Louis de Wohl ebooks

Louis de Wohl ebooks are now available from Ignatius Press.

My first suggestion? The Last Crusader, the story of Don Juan of Austria, one of history’s most triumphant and inspiring heroes, reborn in this novel by Louis de Wohl.

Enjoy your summer!
Happy reading! ;)

2012-08-01

Lessons learned from MITx’s prototype course

Lessons learned from MITx’s prototype course - MIT News Office

Last December, MIT announced the creation of MITx, an ambitious project to recreate the MIT classroom experience online; in March, the MITx prototype course — “Circuits and Electronics,” or 6.002x in MIT’s course-numbering system — debuted. In May, MIT and Harvard University jointly announced the creation of edX, an organization that will further develop the MITx platform and enable other universities to use it as well. As MIT and Harvard gear up to offer new edX courses in the fall, the edX team is taking stock of its experience with 6.002x and beginning to incorporate what it learned into the system’s design.

(...)

Students preferred the hand-drawn diagrams by a substantial margin. “It lets you pace yourself,” Agarwal says. “The PowerPoint is going to flash a picture on the screen, and you don’t develop the idea in the same way that you develop the idea by drawing a picture on the chalkboard.”

Similarly, Agarwal says, several weeks into the course, after canvassing student responses to the course, the MITx team begin posting videos in which the course teachers worked problems out onscreen, rather than just presenting students with completed solutions — a feature that is certain to become a staple of future edX courses. “We learned a lot about how to do a course like this,” Agarwal says. “Clearly, that is influencing us a lot in where we go from here.”

2012-07-31

Tweets of the month

25 Jul
I love Dropbox because It is multi-platform, has simple and easy-to-use interface, and it's free! http://db.tt/PEouAYM4

20 Jul
After the bad experience with #iBooks on the #iPad I can only recommend #iAnnotate - great app! http://www.branchfire.com/iannotate/

19 Jul
Great book about the Semantic Web http://workingontologist.org/ The 2nd edition is even better than the 1st

19 Jul
The Internet of Things http://share.cisco.com/internet-of-things.html via @CiscoSystems

13 Jul
Foxit reader 5 is a major improvement especially because it remembers the current page and has a ribbon interface http://www.foxitsoftware.com/Secure_PDF_Reader/

12 Jul
Amazed by how *bad* #Apple #iPad #iBooks can handle a PDF with 300 pages http://pgfplots.sourceforge.net/pgfplots.pdf It crashes after just a few minutes reading...

9 Jul
Interesting plot tool, especially if you write papers with LaTeX http://pgfplots.sourceforge.net/

3 Jul
Major rewriting in progress. Pieces are falling into place. :)

Poison Attacks Against Machine Learning

Poison Attacks Against Machine Learning: With AI systems becoming more common, we have to start worrying about security. A network intrusion may be all the more serious if it is a neural net that is affected. New results indicate that it may be easier than we thought to provide data to a learning program that causes it to learn the wrong things.

2012-07-30

Mapping the uncanny valley

Robots and psychology: Mapping the uncanny valley | The Economist: Dr Gray and Dr Wegner speculated that experience in particular was playing a crucial role in generating the uncanny-valley effect. They theorised that adding human-like eyes and facial expressions to robots conveys emotion where viewers do not expect emotion to be present. The resulting clash of expectations, they thought, might be where the unease was coming from.

2012-07-25

My City of Ruins - lyrics

There's a blood red circle
on a cold dark ground
and the rain is falling down
The church doors thrown open
I can hear the organ's song
But the congregation's gone

My city of ruins
My city of ruins

Now the sweet veils of mercy
drifting through the evening trees
Young men on the corner
like scattered leaves
The boarded up windows
The empty streets
While my brother's down on his knees

My city of ruins
My city of ruins

Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!

Now there's tears on the pillow
darling where we slept
and you took my heart when you left
without your sweet kiss
my soul, is lost my friend
Now tell me how do I begin again?

My city's in ruin
My city's in ruin

Now with these hands
with these hands
oh with these hands
with these hands
I pray Lord
with these hands
pray for the strength Lord
with these hands
pray for the love Lord
with these hands
pray for the lost Lord
with these hands
pray for the strength Lord
with these hands
pray for the strength Lord
with these hands

I
Come on Come on Come on Come on
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!
Come on rise up!

Come on Rise up

Song by Bruce Springsteen, cover by Eddie Vedder

2012-07-24

Stanford researchers produce first complete computer model of an organism

Stanford researchers produce first complete computer model of an organism: Stanford researchers produce first complete computer model of an organism A mammoth effort has produced a complete computational model of the bacterium Mycoplasma genitalium, opening the door for biological computer-aided design.

2012-07-16

Getting to the Bottom of Statistics

Getting to the Bottom of Statistics – Technische Universitat Darmstadt: Computer scientists at the TU Darmstadt have developed software that, aided by linked open data, i.e., enormous collections of semantically linked data accessible on the Internet, discovers correlations and regularities in statistics and formulates hypotheses regarding its interpretation

2012-07-13

How to change Epson Scan software language

solveXP: Epson V33 scanner change language

Even after choosing the English language during installation of the Epson software it ignored the choice and default to a different language.

To fix: check the folder: C:\Windows\twain_32\escndv\... and from there remove the folders containing the languages I would never use. English is 0809.

Just open the .chm file belonging to the above mentioned folders to find which number corresponds to which language.

2012-07-09

Teach Computing to Everyone

The Call to Teach Computing to Everyone | blog@CACM | Communications of the ACM: Wow--the interest in teaching computer science to everyone has really become visible in the last month! It's great to see that people are realizing what we've been saying for years: Computer science is key to understanding the 21st century world.

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?

2012-05-31

Tweets of the month

31 May
Could Germany save eurozone by leaving it? http://edition.cnn.com/2012/05/30/opinion/prestowitz-prout-germany-eurozone

29 May
Carminho ao vivo no Facebook (via SAPO) https://apps.facebook.com/carminholive/

29 May
Diving into SCM software world!

25 May
Converting Groovy to Java code is hell! But it's done now.

19 May
Family 2012 theme http://www.youtube.com/watch?v=MOrO_dYA7JE

19 May
gnuplotting... :)

18 May
Na próxima segunda-feira, às 11h na sala F4 do ISTécnico Alameda vou dar uma aula convidada sobre o tema "RFID para Informáticos" #RFID #IST

15 May
@filcab Started the repo last month, and I make medium sized commits. But I just have this thing for round, even numbers :)

15 May
Committed revision 100.

15 May
Interesting article (via @pedrocustodio) http://blogmaverick.com/2012/05/13/the-coming-meltdown-in-college-education-why-the-economy-wont-get-better-any-time-soon/

15 May
Blast from the past: *nix session management using screen http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

11 May
Amazing pictures delivered to your desktop every day with Bing Desktop http://www.microsoft.com/en-us/download/details.aspx?id=29281

2012-05-03

How to reset UltraEdit to factory settings?

In Windows Explorer in the address bar at top of the window enter following

%appdata%\IDMComp\UltraEdit\

and press Return or Enter to open this directory.

You will see some files, delete all of them while UltraEdit is not running.

Credits: Mofi at UltraEdit forums

Java String print tip

Are you getting confused with all the substring() indices during a debug session?
Try the following code:
System.err.println(myStr);
for (int i=0; i < myStr.length(); i++)
    System.err.print(i % 10);

You will get the following output:
my string value
012345678901234

% performs a division remainder operation, giving, in this case, always a number between 0 and 9.
And the numbers in the next line make it so much easier to see the string indices! :)

2012-04-30

Tweets of the month

27 Apr
Arduino’s Playmate http://bit.ly/JMbOO6

20 Apr
@joanappardal The new versions usually come full of bugs... Nothing like tried and tested but recent technology ;)

20 Apr
Just heard the term 'Sky computing' for a collection of 'Clouds'... I do recall that in Terminator 2 the world ended because of Skynet :/ :)

17 Apr
http://apod.nasa.gov/apod/astropix.html

17 Apr
Between releases... advancing groundwork

12 Apr
RT Marcus L Endicott @mendicot Wow, great list of .. "Available Open Source Dialogue Systems Frameworks" http://bit.ly/IzI84j .. by the 'Lady Doctor Bug' @joanappardal ...

2012-04-23

Is the University paradigm changing?

There are many signs that the way we learn and teach at the University level may be approaching a paradigm shift.
What is your opinion on this subject?

The Stanford Education Experiment Could Change Higher Learning Forever | Wired Science | Wired.com CS221: Introduction to Artificial Intelligence, a graduate- level course taught by Stanford professors Sebastian Thrun and Peter Norvig - Last fall, the university in the heart of Silicon Valley did something it had never done before: It opened up three classes, including CS221, to anyone with a web connection. Lectures and assignments—the same ones administered in the regular on-campus class—would be posted and auto-graded online each week. Midterms and finals would have strict deadlines. Stanford wouldn’t issue course credit to the non-matriculated students. But at the end of the term, students who completed a course would be awarded an official Statement of Accomplishment.

University of Florida Eliminates Computer Science Department, Increases Athletic Budgets. Hmm. - Forbes: The University of Florida announced this past week that it was dropping its computer science department, which will allow it to save about $1.7 million. The school is eliminating all funding for teaching assistants in computer science, cutting the graduate and research programs entirely, and moving the tattered remnants into other departments.

PayPal Co-Founder Hands Out $100,000 Fellowships To Not Go To College : The Two-Way : NPR: Peter Thiel, the PayPal co-founder and one of the first investors in Facebook, is proposing a controversial path toward more rapid innovation. Today his Thiel Foundation announced that it was giving 24 people under 20 $100,000 fellowships to drop out of school for two years to start a their own companies.

More:

Udacity/

Coursera

MITx

iTunes U

2012-04-22

Notes on Sleep, Diet and more...

(via Joana)

Foods containing the amino acid tryptophan are sleep-inducing (Sleepers)
and foods that contain the amino acid tyrosine delay sleep (Wakers).

-> INDUCE SLEEP
Egg yolk, cashew, beef, almonds, bananas and potatoes

Some foods like bananas, figs, dates, milk, whole grain crackers and yogurt
contain tryptophan, so eating them in the evening may also help promote rest.

-> DELAY SLEEP
peanuts, coffee, sandwiches, protein shakes, soy products and apples

• Watch what you eat in the evenings.
A huge dinner meal with a carb-laden dessert or snack later might make you feel sleepy, but it really doesn’t do your sleeping schedule any good. Sugar will give you a serious hit of energy before you crash, and the sleep that you get once you’re anesthetized by the food will most likely be more restless and maybe even interrupted through the night.

• Avoid caffeine as much as possible.
If you must have that morning coffee, cut yourself off in the afternoon. At the very least, stop consuming anything containing caffeine anywhere from 3 to 5 hours before you’d like to go to sleep—the longer, the better. Don’t forget that those fancy coffee drinks that taste more like a dessert than coffee are still packed with an ample amount of caffeine. Don’t forget caffeine related soft drinks those contain enough caffeine to keep you awake, as well. Try an herbal tea designed to promote sleepiness an hour or so before bed.

• Offer yourself to some comfort
Try to create an atmosphere that facilitates sleep.
Firstly try to keep your place cool and quiet.
Visualization techniques can be effective;
either in your mind or on the walls around you,
so try to imagine something peaceful or
use posters of calming imagery on the wall.
Lastly your bed and pillow to have to be comfortable enough
for you to get good sleep.

• Use your bed for nothing but sleep.
If you like to watch TV in bed,
spend your evening TV watching time in the living room instead.
Don’t work, pay bills or do anything potentially stressful in bed, either.
This makes it harder for your mind to associate your bed with sleep and rest.

• Remove work.
If you have a desk overflowing with work and things to be done in your bedroom,
consider moving it so you’re not subconsciously aware of all that’s left to do
every time you try to go to sleep.

• Take a warm shower before bedtime.
Taking a hot bath or shower an hour or two before bed,
this can help open up your pores and relax your body.

• Set a routine.
Focus on going to bed and getting up at the same time each day,
and establish a bedtime routine that starts an hour or two
before your bedtime to train your body to start winding things down.

Routines
Another great way to prepare yourself for a good night’s sleep is to keep to routines. If you like a cup of milk or chamomile tea before you head to bed then that’s fine – keep doing that – it tells your mind and body that you are beginning to wind down and get ready for bed.
Part of the skill is in training your mind and your body to know when you want to sleep – you don’t want your mind racing about all kinds of things when you want to be settling down for the night.
Keeping to a routine with your sleep and wake times will also help with this. Try to get up around the same time each day and go to bed at around the same time too. Your body will appreciate the natural rhythm this brings to your day.

• Watch your naps.
Be smart with your naps during the day,
Naps are a great way to recharge your system,
but they can also affect your sleep cycle in a negative way.

• Make your room black.
Turn off all lights and ambient noise in your room.
Extra light and loud noises can cause the body to stir and stay up
into the long hours of the night.

• Take out the clock.
A clock facing you can sometimes cause you to stare at it
in the most stressful of circumstances causing you to stay away
and stress over what time it is.

Exercise
Exercising has many benefits for keeping a healthy body – one of the side benefits is that it will also help good rest. Try to exercise regularly at least 4 or 5 times a week and you should notice your quality and duration of rest improving over time.
Above are just 5 ways you can help promote better sleep – you see how diverse they are? From the right mattress and environment for the bedroom, to diet and exercise and psychological factors – sleep doesn’t always come easily to people…..some may need a little help!

Aerobic exercise is a great way to release stress from the body. Since stress can hinder sleep, you can fall asleep more quickly by getting 30 minutes of aerobic exercise at least three days a week.
Some examples of mild to moderate aerobic exercise are: mowing the lawn, taking the stairs instead of the elevator, active playtime with children, and taking a short walk around the block.
Forms of high intensity aerobic exercise include: jogging, skating, swimming, biking, walking on a treadmill, and taking a brisk walk.
Because aerobic exercise stimulates the body, be sure there are at least three hours between the time you exercise and bedtime.

Avoid Brainstorming
Does it not happen that while you watch a horror movie or a murder mystery, you find it difficult to sleep? Your brain is then too excited and exhilarated to be able to calm down and thus- the sleeplessness. Therefore, avoid unnecessary brainstorming after a sleepless night. This also entails not thinking about complex issues or taking too much of stress on your mind when you plan to get sleep. The best way to achieve peace of mind in case your mind is perturbed is to meditate. Meditation calms your mind, while attending to your sleep requirements largely.

Exercise Everyday
You must be reluctant to get up from your bed after those sleepless nights. A small stimulation of the whole body can make you forget the drowsiness. Make it a routine regime to exercise in moderate amounts after getting up and keep your body and mind healthy. After all a healthy mind lies in a healthy body.

Eating Healthy
Did you know, what you eat affects your sleep and activity to a great extent? Gorging on a heavy meal will mean pushing all your accumulated energy in digesting those bulky stuffs and therefore lead to blood sugar fluctuations. Therefore, in order to perform well after a bad night’s sleep, it is essential to keep your food light and hop into your bed early.

Sources:
http://www.hivehealthmedia.com/10-tips-good-nights-sleep/
http://www.ehow.com/how_5054058_choose-foods-cure-insomnia.html
http://slimmersexpert.com/how-to-curb-appetite
http://www.jarretmorrow.com/fat-burning-tips/
http://www.hivehealthmedia.com/study-sleep-dieting-lose-fat/

2012-04-17

How to reset UltraEdit settings?

In Windows Explorer in the address bar at top of the window enter following

%appdata%\IDMComp\UltraEdit\

and press Return or Enter to open this directory.

You will see some files, delete all of them when UltraEdit is not running.

Source: IDM Forum

2012-04-13

Java vs Groovy on overriden method call

In Java, suppose we have the following class:

public class Do {
    public void doSomething(Object arg) {
        System.out.println("Do " + arg.toString());
    }
}

We then extend it in the following class:

public class DoDifferently extends Do {
    public void doSomething(Object arg) {
        System.out.println("Do different " + arg.toString());
    }
    public void doSomething(String arg) {
        System.out.println("Do different string " + arg.toString());
    }
}

Now let's use these classes in our program:

Do o = new Do();
o.doSomething("x");

executes the Object method.

DoDifferently o2 = new DoDifferently();
o2.doSomething("x");

executes the String method because it is more specific.

What about the following code?

Do o3 = new DoDifferently();
o3.doSomething("x");

It will execute the Object method, because Java uses the reference type to determine which method to call.

What about Groovy?

The code above is also valid in Groovy.

The String method is always executed when available, because Groovy uses the most specific method for the argument type, determined dynamically at run-time.

2012-04-06

Excruciating

Edith Stein wrote the following during her Doctoral Studies:

This excruciating struggle to attain clarity was waged unceasingly inside me, depriving me of rest, day and night.
Little by little I worked myself to a state of veritable despair.

Now you know that a PhD can drive even a saint crazy! ;)

2012-03-31

Tweets of the month

30 Mar
IEEE RFID TA 2012 will be held in France http://lcis.grenoble-inp.fr/le-laboratoire/ieee-rfid-ta-2012-453132.kjsp ... Paper deadline: June 18th

29 Mar
SS: embodied curiosity

28 Mar
"Welcome home" :)

19 Mar
Congratulations Dr. B!

19 Mar
Decisive week ahead!

17 Mar
@pedrocustodio Great news Pedro. Happy for you!

16 Mar
@UltraEdit @idmcomp Good job on UltraEdit 18! But have you checked Sublime Text 2's minimap? It's so cool...

15 Mar
RT @VeryFieldsRFID A Conversation With Sanjay Sarma, cofounder of the Auto-ID Center - http://bit.ly/ymp56s - #RFID via RFID Journal

14 Mar
Dear Internet savvy friends - What is my best option for registering a domain name (probably .net)? I have a tight budget :)

13 Mar
Combo IV - Gravity - John Mayer http://youtu.be/GkVNDHuu8oI - drums! drums! ;) If you like the song, you can vote for it on YouTube. Thanks!

13 Mar
Combo IV - Gravity - John Mayer http://youtu.be/GkVNDHuu8oI - drums! drums! ;)

13 Mar
Preparing a talk and a poster for the upcoming IEEE RFID 2012

12 Mar
Facebook and Google Plus - see you next weekend! I've got work to do! :)

9 Mar
RT @josetribolet A nova edição do POSI-E3 vai iniciar-se em Abril. Aproveita e vem construir o futuro no meio da crise. http://posi.ist.utl.pt/

9 Mar
@nfma Olá Nuno. Os teus tweets gourmet são um achado! :)

8 Mar
Re-reading papers and it feels like I'm reading something else - it's amazing how perception plays tricks on you!

6 Mar
Drafting a new paper

6 Mar
@filcab De facto, é preciso paciência para a ignorância. E só nos deixarmos chatear com aquilo que queremos e não com o que outros querem...

6 Mar
@filcab Why so angry?

2012-03-29

STEP back

Recently I was asked to do a small demo of the STEP Framework.
I picked the last version I worked on: STEP Tough, instrumented for performance monitoring.

1. I checked out the source code from SourceForge:

svn co https://stepframework.svn.sourceforge.net/svnroot/stepframework/branches/1_4_toughstep_maintenance toughstep

2. I installed stepcat 1.4-6.0.14, meaning that it contains the libraries for STEP 1.4 and runs Apache Tomcat 6.0.14

Here is stepcat's readme:
"

*********************
*** Tomcat for STEP ***
*********************

This file summarizes the installation procedure and describes the
configuration changes made to prepare the package.

The package version number refers to the supported STEP Framework version and
to the Apache Tomcat version.

Please refer to webapps/ROOT/index.html for the listing of other included and
recommended software versions.

--

Installation guide:

1 - Install recommended JDK

2 - Install recommended database

3 - Unzip package

4 - Define environment variables

JAVA_HOME C:\java\jdk\1.6.0_18
CATALINA_HOME C:\temp\stepcat-1.x-6.0.14
ANT_HOME C:\temp\stepcat-1.x-6.0.14\apache-ant
STEP_HOME C:\temp\stepcat-1.x-6.0.14

5 - Extend PATH environment variable to include:
%JAVA_HOME%\bin;%ANT_HOME%\bin;%CATALINA_HOME%\bin;

6 - Open new console and test command line tools:

java -version
javac -version
wsimport -version
xjc -version

ant -version
catalina version

7 - The server comes configured to run in C:\temp\stepcat-1.x-6.0.14.
To change configuration to a different location
execute 'ant -f bin\relocate.xml' in the new location.

8 - Start server

catalina start
browse http://localhost:8080

--

This is a replicable server version.

To change the server ports, replace all occurrences of the following numbers:
8080 - HTTP Port
8005 - Admin Port
8443 - HTTPS Port

The most important changes to make are in the conf folder.

These changes can be automated using Ant.
Refer to 'bin\replicate-server.xml' for more information.


--

Package preparation steps:

Unzipped apache-tomcat-6.0.14.zip to stepcat-1.x-6.0.14

Unzipped apache-ant-1.7.1.zip to stepcat-1.x-6.0.14/apache-ant

Copied tail.exe (win32 binary) to stepcat-1.x-6.0.14/bin

Copied servlet-api.jar and jsp-api.jar to STEP lib

Copied all stepframework/lib jar files to stepcat-1.x-6.0.14/lib

stepframework/src/lib/stepframework.jar is NOT included.
(Applications will have to include this JAR themselves.
The rationale is to give developers more visibility of the framework's source code
and to allow easier modification and experimentation.)

Copied junit-4.5 to stepcat-1.x-6.0.14/apache-ant/lib/junit.jar and
to stepcat-1.x-6.0.14/lib/junit.jar

Deleted all stepcat-1.x-6.0.14/webapps except ROOT and manager.

Renamed stepcat-1.x-6.0.14/webapps/ROOT/index.html to
stepcat-1.x-6.0.14/webapps/ROOT/index-tomcat.html
Added new index.html to stepcat-1.x-6.0.14/webapps/ROOT
(added STEP logo, quick link to manager)

Added new user with the role manager to
stepcat-1.x-6.0.14/conf/tomcat-users.xml:



Documentations were moved to stepcat-1.x-6.0.14_docs
Added index.html to stepcat-1.x-6.0.14_docs.

created Eclipse User Library named 'STEP dependencies' including all
STEP framework dependency libraries, but not STEP itself.

Saved user library export file in 'eclipse/stepdeps.userlibraries'.

--

Acknowledgements:

Apache Software Foundation and
all other authors of used open-source software packages.

--

"

3. Next I installed/started MySQL 5.1

I created the databases 'flight' and 'mediator' and the user 'step' without password.
I then granted all rights for these databases to the user.


4. Next I compiled and deployed the Trip Planner demo application

I did everything except the test.

Here is stepframework\src readme:
"

STEP Framework Demo: Trip Planner

Table of contents
==============================

1. Introduction
2. Structure
3. Compiling
4. Installing
5. Deploying
6. Running
7. Testing
8. Extensions


1. Introduction
==============================

The Trip Planner is a system for selling trip packages via a web interface.
It is composed by several distributed systems, which act together through a
mediator that interacts with the clients.

This demonstration version of the Trip Planner supports booking a flight
and uses 3 demonstration Framework Extensions:
- hello - just says hi when it intercepts the services or web services
- trace - prints tracing data
- errors - allows creating test errors

Extensions enable the programmer to add code around the services layer
and around the Web Services layer, orthogonally to the application code.
Each extension can be enabled or disabled simply by editing the
extensions.properties configuration file.



2. Structure
==============================

The Trip Planner system is composed by 2 separate domains: flight and
mediator. The flight domain manages flight reservations. The mediator domain
mediates the interaction between client and the other reservation domains
(only the flight in this demonstration).

Conceptually, each application consists of 4 layers:

+--------------+
| Presentation |
+--------------+
| Services |
+--------------+
| Domain model |
+--------------+
| Data access |
+--------------+

These layers are developed in sub-sub-projects of the flight and the mediator
sub-projects. The entire project' structure is as follows:

.
|-- flight
| |-- core
| `-- view
`-- mediator
|-- core
|-- view
`-- web

Both 'core' sub-sub-projects implement all the layers from the bottom up to
the services layer. The 'view' sub-sub-projects implement the classes that
can be returned from the services to the presentation layer; this also
includes any exceptions that can be thrown. The 'web' sub-sub-project
implements the presentation layer of the mediator. There are no presentation
layers implemented for the flight domain.


3. Compiling
==============================

The project uses Apache Ant and the ImportAnt library. At each level there is
a build file that takes care of building the project at that specific level.
Thus, the entire project can be built simply by invoking at the top level:

$ ant

Note that Ant and JWSDP should be properly installed for this command to work.


4. Installing
==============================

Two databases must be configured before running the distributed applications.
By default these are:

- For flight:

database.host=localhost
database.name=flight
database.username=step
database.password=

- For mediator:

database.host=localhost
database.name=mediator
database.username=step
database.password=

Therefore, either:

- create the default databases on the localhost's mysql server with the
configured username and password access, or;

- change in the hibernate.cfg.xml and dbunit.properties files the database information
(flight-ws/src/hibernate.cfg.xml, flight-ws/tests/dbunit.properties, and
mediator-web/src/hibernate.cfg.xml, mediator-web/src/dbunit.properties).

Note: after making changes to the configuration propertied you should rebuild
you applications to ensure that the new values have been correctly propagated
to the packed jars. ("ant clean build" at the top level ensures that)

After the database locations are configured, we need to create the databases.

To create the tables execute at the top level:

$ ant hibernatetool

When executing creating the tables for the first time, some errors like the
following may appear:

"[hibernatetool] Error #1: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table mediator.Client' doesn't exist"

They should all be ignored.

Then check that the tables have been correctly created in each database.


5. Deploying
==============================

It is now possible to deploy the flight and mediator applications. Each
application can be deployed by its own build.xml file, but for convenience
there is a top level ant target to do that. Execute:

$ ant deploy

If any of these application is already deployed use the corresponding
"redeploy" target instead.


6. Running
==============================

Point your favourite web browser to http://localhost:8080/mediator-web to start
using the application. Try booking a flight from Lisbon to New York!



7. Testing
==============================

Running tests in a distributed system requires all the tables to be stored
in the same database.
This is necessary because of the way that DBUnit populates data before each
test method.

The data populated for the tests can then be used for user testing the application.

To run tests for the distributed application, edit flight-ws/tests/dbunit.properties and
mediator-web/tests/dbunit.properties and set the same database in both.

Then, at the top level rebuild the applications and create the tables.

$ ant clean build hibernatetool

Then, redeploy the flight web service and mediator web application

$ ant redeploy


To run tests for one domain at a time:

$ ant run-tests-flight
$ ant run-tests-mediator

To run all tests:

$ ant run-tests


8. Extensions
==============================

To see output from the extension engine and from the extensions themselves,
look at the application server's log file.

Feel free to experiment with the extensions configuration files and source code.

The flight extensions configuration is located in flight-ws/src.
The mediator extensions configuration is located in mediator-web/src.

The logging produced by the extensions engine can be adjusted in the
log4j.properties files, for each component and application.

"

5. I used flight-perf's DomainDataGenerator to populate the database


6. Then I tested the application.

http://localhost:8080/mediator-web/

Before:

After:

--

It had been a long time since I had seen these screens.
There a lot of loose ends in the code and documentation, but they are mostly small things.
Most of all, I think you can still learn a lot from the source code.

Who knows what the future holds for the STEP Framework? :)

2012-03-21

English Dictionary and Thesaurus

TheSage English Dictionary and Thesaurus is a free software application that, through a multi-tool interface, integrates a complete dictionary and a multifaceted thesaurus of the English language together into a unique language reference system.

It works off-line and you can install it in 'portable' mode, so it's a very handy tool, so that you don't have to rely on the web all the time.

Download: TheSage's English Dictionary and Thesaurus

2012-03-17

Life Browser

A Microsoft Builds prototype software called Lifebrowser uses artificial intelligence to help you revisit important events, photos, and e-mails from your own life.

Source: Technology Review

2012-03-09

Data compression and archiving

An archive file is a file containing several files and directories.

bzip2 -d filename
decompress archive file

tar -xvf filename
extract

tar -cvf filename dir ...
create

tar -zcvf filename dir ...
create a zipped tar file

2012-03-08

Disk Usage (du)

du -h
human readable option - displaying output in kilobytes (K), megabytes (M) and gigabytes (G) rather than just in the default kilobytes

du -sh
summary option - report only the total disk space occupied by a directory tree and to suppress individual reports for its subdirectories

The China Price

Once the contract is signed, the manufacturers look for ways to reduce costs and turn a profit. Typically, this results in short-cutting processes, reducing size or volume of the product and using cheaper ingredients or materials.

Over time, Western buyers expect the learning curve to improve production quality. But this is not the way a typical Chinese manufacturer would think. Instead of continuous process improvement and learning curve efficiencies, emphasis is placed on cutting costs.

The China Price - Article from Supply Chain Management Review

2012-03-07

Arduino

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.


I am following a work that will use Arduino for building a small robot. I look forward to sharing some of the experiences here on the blog.

2012-03-05

REST in Java

Most of my work with Web Services has been with SOAP-based Web Services. However, there is an alternative, called REST.

There is Java library for RESTful Web Services, called JAX-RS.

JAX-RS RESTful principles are:
- assign everything an ID
- link things together
- use common set of methods
- allow multiple representations
- stateless communications

Classes and methods are annotated to generate REST service.
Here is an example:

@Path("/atm")
public class AtmService {

    @GET @PATH("/balance")
    @Produces("text/plain")
    public String balance(@QueryParam("card") String card,
                          @QueryParam("pin") String pin) {

        ...
    }

...

There also annotations for using HTTP POST (@POST) and specifying the data type that is consumes (@Consumes).

This example was taken from a Java ONE presentation.

2012-03-02

Groovy properties

Groovy generates getters and setters for the public fields of a class.
These default methods can be overridden as usual.
If a field is final, then Groovy generates only the getter method.

Groovy provides a special operator, called the field operator .@, that bypasses the generated accessor methods.

2012-03-01

Groovy DSL

One of the selling points for Groovy is writing Domain Specific Languages (DSL).
I have to admit that I am not fully convinced. There are many limitations to the syntax.
The basic idea is that Nouns in the DSL are implemented as Objects and Verbs in the DSL as Functions.

Someday I would like to read the following books on DSLs:
Martin Fowler, 2010
Debasish Ghosh, 2010

2012-02-29

Tweets of the month

29 Feb
Attended Richard Stallman's lecture at @sinfo_ist

28 Feb
Two development tasks completed. The next task requires help from Dr. Whiteboard :)

28 Feb
news Vatican - Pope Benedict XVI: Schedule for Meeting of Families in Milan §RV rv.va/ohb3dW
Retweeted by Miguel Pardal

28 Feb
Good morning! Rise and shine! :)

25 Feb
Pedro Custódio - Don't Make Me Steal bit.ly/x80hkv

24 Feb
Very focused SCRUM meeting today. Thanks SCRUM Master!

24 Feb
Adopted single backpack policy to help simplify my everyday life :)

23 Feb
12 Key Zen Habits poster pinterest.com/pin/2121618324…

4 Dec
William Morgan - "runners can only run full speed for short distances. we fix that problem by firing the pistol every 100 yards and calling it a new sprint."

22 Nov
Steven Mak - Quote of the day: "If you think test-first is expensive, try debug-later"

22 Feb
Surprisingly productive today (Ash Wednesday)

22 Feb
Voz da Verdade - Vídeo: Patriarca de Lisboa antecipa primeira catequese dirigida a catecúmenos bit.ly/yr0EAh

21 Feb
Feels good to be back developing...

20 Feb
Pedro Custódio - [Video] 29 WAYS TO STAY CREATIVE bit.ly/w6N2LW

9 Feb
MITx - MIT's new free courses online chronicle.com/blogs/wiredcam…

7 Feb
Listening to Spirto Gentil... clonline.org/elenco_cd.asp inspiring!

Groovy

I have been using Groovy for almost 2 years now, and it has been a great experience.

I have a preference for typed languages, but there is no doubt that scripting languages have enormous utility too. Groovy is very flexible in this aspect. You can program using types - in this case Groovy is just Java with some nice syntax sugar - or you can program without types - in this case Groovy is a scripting language with an incredible set of libraries: anything that runs on the Java Virtual Machine.

I read that the Groovy team is considering adding more features to allow better performance in the type-based programs. This is expected for the 2.0 release.

Even Java is becoming easier to use with the Project Coin language changes.
By the way, Groovy 1.9 will include JDK 7 support including project coin language changes and invokeDynamic to improve performance.