February 1, 2013

Natural Scrolling in Linux

This is just a quickie.

Recently I started working at a company where all the devstations are MacMinis. I never used Macs before, but so far so good.
The only thing that was annoying me was my brain farts when moving from natural scrolling (1) to the common people scrolling.

1. Natural Scrolling is how they call the mac osx scrolling, where you roll down your mouse whell to roll up the scrollbar, and roll up the mouse whell to roll down the scrollbar.

I decided to have my Linux use natural scrolling and get rid of this, and it’s quite easy!

$ echo "pointer = 1 2 3 5 4 7 6 8 9 10 11 12" >> ~/.Xmodmap
$ xmodmap ~/.Xmodmap

The synaptics driver uses the buttons 4 and 5 for up and down scrolling, and with the above xmodmap configuration we’re just swapping the two of them!

Extra: If you’d like to change this on the fly with a GUI, there’s the “NaturalScrolling” project on github. But I didn’t test it.

July 24, 2012

Spliting BibTeX references into different categories

I tend to write all my academic papers in LaTeX. I like the idea of it, I like the separation of content and style, I think the output looks good *most* of the times, and, above all, I think managing bibliography with latex is the best option so far.

This post is about managing references. Specifically, about when you want to split your latex references in different categories. Maybe you’d like to list Books and Journals apart from other references, maybe you’re writing a review, a state-of-the-art analysis, and you’d like to separate the analyzed works from others you cite along. I had to do both, and found a few different options.

So, here they are:

1. Using different .bib files for each category

Package: bibtopic
Manual: http://mirror.ctan.org/macros/latex/contrib/bibtopic/bibtopic.pdf



\section{Citing things}
\cite{somebook}. \cite{otherbook}, \cite{somepaper}.
% File books.bib is use for this listing:
\section{References from books}

% File articles.bib is used here, and the listing is in 
% plain-format instead of the standard alpha:
\section{References from articles}
\section{Articles not cited}

% Print alll entries from internet.bib:
\section{References from teh Internets}

2. Using a single .bib, and manually separating references using different citation commands

Package: multibib
Manual: http://mirror.ctan.org/macros/latex/contrib/multibib/multibib.pdf

This creates a different citation command (“citesel” in the example) for each category other than the
default one.


\newcites{sel}{Selected works}


% Selected works (refs.bib)

% Other (refs.bib)


3. Split based on reference properties

Package: biblatex
Manual: http://mirror.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf

You can use other properties than type to filter them. You should read the manual if that’s the case!





\printbibliography[title={Other References},nottype=book]

July 16, 2012

Using local jars in a maven project

Maven is great, really, but sometimes you just have to use that obscure jar library that isn’t in any maven repository. You know, not everyone uses maven.

So, how do you handle this type of dependencies? This is what I do, and you might find it useful: I create a local repository within the project. This way you can put everything in you version control system, and have maven deal with everything. Also, if you have several subprojects using the same library, you can create the local repository in the toplevel.

OK. Sounds good, right? Here’s how I do it:

  1. Create a directory under the project. I always use “lib”
  2. Install the jar libs to this directory using:
    $ mvn install:install-file -Dfile=<jar_file>  -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DlocalRepositoryPath=<path_to_lib_dir>
  3. Add the repository to you POM file:
  4. Add the dependencies for whatever jars you’ve added to your local repo
  5. Joy.

And that’s it. If you want to share a different solution, please do.

July 11, 2012

What is this about?

I find it always hard to start blogging. I’ve tried it before, several times. It always goes like this:

  1. Create blog
  2. Get really excited about it
  3. Post a few things
  4. Make a list of things to talk about when you have the time to write
  5. Get distracted by life, the universe, and everything
  6. Lost interest

So, yeah. I blog heavily for a month and then it dies.

This is it. Wish me luck, and all the best to you excelent almost non-existent readers!