A motivação para se fazer Ciência, ou como parar de procrastinar e escrever a droga do artigo

Ao parar e tentar descobrir porquê não conseguia escrever o artigo que preciso terminar, com resultados do meu doutorado, e que não anda há quase um mês, me deparei com uma pergunta simples: qual é o motivo para eu escrever um artigo? Qual é o meu motivo para fazer Ciência? Comecei a pensar nas questões profundas da Ciência, sua utilidade para a sociedade, o avanço do conhecimento, mas parei novamente e me forcei a pensar, com calma: qual é o motivo para eu fazer Ciência? Ou, a questão mais prática, qual é a minha motivação para escrever um artigo científico?

Esse post pode ser considerado como um modo pelo menos tentativo de ser produtivo e procrastinar ao mesmo tempo. Esse é o ponto: tenho essa pressão em precisar ser útil, em fazer algo útil, em ter um objetivo pessoal. Grande parte da minha motivação vem disso, desse senso de utilidade, de evitar o desperdício do tempo, do fazer alguma coisa produtiva. Se isso é saudável e quais são as causas disso não sei, e esse é motivo para um outro pensamento, bem mais pessoal. Mas o fato é que isso está aqui, é imperativo, e o sentimento de culpa é enorme mesmo quando não há a necessidade de ser produtivo, ou mesmo quando essa pressão para tal é contra-producente.

Fazer qualquer coisa sem motivação é um suplício, e muitas vezes essa motivação não está clara. Então, qual a finalidade de se escrever um artigo científico? Considerando que eu cedo sem pensar ao imperativo de fazer alguma coisa útil (por mais vago que isto seja), e assumindo que o que eu produzi no frenesi Alt-Tab tem algo que possa ser publicado, um artigo científico é um dos principais jeitos de se externar esse conhecimento. Penso que se tivesse desenvolvido um programa – como fiz – e o publicasse, teria que no mínimo escrever uma documentação sobre ele, de como usá-lo, o que ele faz. Um artigo científico é semelhante, com sua linguagem bem especificada e sua aura de correteza após o peer-review. É a forma de se transmitir o conhecimento gerado, é a forma de se deixar registrado que foi você que fez aquele conhecimento, junto com os outros autores.

Será isso suficiente? Parece que não. O impacto de um artigo em específico, de um sozinho, não pode geralmente ser mensurado de forma imediata, se for mensurável – afinal, meu primeiro artigo tem, até onde eu sei, uma citação (o que me deixa com um fator h=1. Uau.). Sem esse retorno imediato, sem essa satisfação direta, escrever se torna penoso, mesmo que com uma rodada do Latex se veja o pdf.  Uma fotografia tem uma recompensa imediata, se vê o resultado e a sensação de uma foto boa ou ruim é clara.

O artigo científico é a moeda de troca corrente no meio da Ciência: é ele que define o que se produz, assim como código é o que define o que um programador produz. Da mesma forma, o número de citações do artigo é equivalente ao número de downloads do software, e da mesma forma, citação não se converte diretamente em resultados, mas é a forma mensurável de se poder obter recursos (mais dinheiro para pesquisa, posição em uma universidade – estou procurando uma… ou mais dinheiro para mais desenvolvimento do software). Um artigo também reflete prestígio, assim como um software. E ambos, na sua produção, exigem um esforço enorme de concentração e motivação. E aí está uma diferença entre o artigo e software: o software pode gerar diretamente dinheiro, enquanto um artigo, não. Um artigo, entretanto, registra um novo conhecimento gerado, e muito provavelmente usou alguma espécie de software para ser produzido, em alguma de suas várias etapas de confecção.

Acho que no final preciso é usar a modificação do shut up and code: shut up and write.

And now for something completely different… Cameras!

Hello there,

I’ve been asked lately to take pictures of some events, some art performances, in low light/indoors environments. I’ve been using a Nikon Coolpix S6000, and it’s a sturdy little camera, but it has its limitations, like low ISO and slow F. So the time has come to get a new camera!

In a very instructive conversation over Twitter, Felipe Pait (@pait) made some very pertinent suggestions. He mentioned that “@ispmarin Minha opinião: SLR é para quem trabalha na National Geographic ou ESPN. For the rest of us, mirrorless. Tem também Olympus PEN. “, or, in English, “my opinion: SLR are for who works at National Geographic or ESPN. For the rest of us, mirrorless. There’s also the Olympus PEN”. So, he made a matrix at DPReview.com with his choices of cameras. A few interesting things to note: my two best candidates, the Fujifilm X10 and my present S6000 don’t have such huge differences, apart from the type of sensor (CMOS vs CCD), F (2-2.8 vs 3.7-5.6, what is a huge difference), and movie settings (1080p vs 720p).

So, what now? Should I invest in something like a Canon EOS Rebel T3i, the National Geographic League, keep my S6000 as my primary camera, or get something in the middle, like the X10? Price matters, too…

 

 

From scratch and testing ideas: DebianGIS with Postgresql, Drupal and OpenLayers

Here we go again to try to build a server for GIS using Debian.

Downloaded the image from

http://cdimage.debian.org/debian-cd/6.0.3/amd64/iso-cd/debian-6.0.3-amd64-netinst.iso

For the basic install (I’ll be doing the install in a VM). Language: Portuguese Brazilian. All other options were kept as the defaults, choosing single filesystem and all mount points on the same partition. Other change: ext4 instead of ext3, and removed the option of the Desktop. The installation was over under 15 min.

Now, configuring the backport repositories: From here[debian backports], add this line to the /etc/apt/sources.list:

deb http://backports.debian.org/debian-backports squeeze-backports main

Do an apt-get update, and install the necessary packages. First, from main reps:

apt-get --no-install-recommends install vim make build-essential gcc g++ gfortran ssh

Done. Time to start installing the web packages:

apt-get --no-install-recommends -t squeeze-backports install apache2 postgresql-9.1 postgis php5-pgsql php5 php5-cgi php5-gd vsftpd

That’s why I _love_ Debian. Let’s proceed: now it’s time to configure the basic database for the next step, installing drupal. Following this drupal documentation, 

su - postgres
createuser --pwprompt --encrypted --no-adduser --no-createdb drupal
createdb --encoding=UNICODE --owner=drupal drupaldb

Done! User and database for drupal created. Now it’s time to dowload drupal itself. I chose to download drupal 7 from the website than from the debian repositories because of some debian particularities, like versioning. I downloaded the latest version from here[drupal.org]:

wget http://ftp.drupal.org/files/projects/drupal-7.9.tar.gz

And downloaded to /var/www. As I’m planning this server to be run exclusively as a GIS server, I extracted all drupal files to /var/www, and _not_ inside the directory drupal-7.9. After redirecting the ports from Virtualbox, we’re ready to start the drupal installation. First, changing the permission for the files to 775, user and group to www-data, and following drupal installation instructions[drupal.org]:

cp sites/default/default.settings.php sites/default/settings.php

Just remember that if there is an error with php, you have to restart apache and close your browser: google chrome kept insisting in downloading install.php instead of running it, even if phpinfo() was running ok. So let’s continue: Standard installation, English, and use the database name (drupaldb) and user (drupal) with the password that was configured before, and drupal should install. The ftp server that drupal uses for update (we installed the vsftpd) should be also configured: in the file /etc/vsftpd.conf, the local users option must be enabled:

Uncomment this to allow local users to log in.
local_enable = YES

Drupal should be running! Time to install new modules, the ones that OpenLayers [drupal.org] requests:

Views: http://ftp.drupal.org/files/projects/views-7.x-3.0-rc3.tar.gz

OpenLayershttp://ftp.drupal.org/files/projects/openlayers-7.x-2.0-beta1.tar.gz

Chaos Tools: http://ftp.drupal.org/files/projects/ctools-7.x-1.0-rc1.tar.gz

And went to the Modules administration in drupal to enable the new modules. That’s it! The webserver is working with all the necessary modules!

There is another tool that seems to be very useful in this context: drush. To make it work, php-pear must be installed. Now,

pear channel-discovery pear.drush.org
pear install drush/drush

After that, another module will be integrated: geofield, for the geographical data manipulation. Drush didn’t help, so I had to install by hand drupal libraries

http://ftp.drupal.org/files/projects/libraries-7.x-1.0.tar.gz

And after enabling it, installed the geofield module:

Geofield: http://ftp.drupal.org/files/projects/geofield-7.x-1.0-beta2.tar.gz

Enabled it, and it’s working! Server up and fully loaded. Now it’s time to start writing code…

* NOTE * I didn’t take ANY security measures to secure the server. There are several things that should be changed to secure apache, drupal, ssh, ftp…

debiangis and drupal 7.9: the fight

So here we go again: another way to install drupal. Now I wanted to install from the source file from drupal website, and that already gave me some grievance. First, after installing apache2 and libapache-mod-php5, php5 is not installed. So I had to install php5, php5-gd, and php5-cgi and php5-pgsql so the god forsaken webserver would find the drupal installation.

Created the dabatase, connected with the database, and it works! This time I pointed the drupal installation directly to /var/www, installed the vsftpd ftp server, and voilá, it works. But I still have to change all permissions to www-data:www-data so anything can be written by drupal.

After that, installing openlayers, views and ctools was easy.

Moving and creating a new drupal site in Debian

Debian has a package that installs drupal 7. But it creates an site using the data from /usr/share/drupal7, and the uses a .conf file to configure apache2 to use this as the source for apache. I’m trying to create a new site, so I copied /usr/share/drupal7 to /var/www/debiangis, and changed permissions to 775. Created a new file in /etc/apache2/conf.d called debiangis.conf, and pointed to this new directory. And it works! The database link is the same, so I removed the apache configuration file.

Stupidity: the cp created a symbolic link to the /etc/drupal/7/site, not copying the contents. Of course I removed the /etc file… now gonna have to reinstall. Well, it’s always good to start from scratch, _when you can_.

So, from scratch: purged drupal7, and reinstalled it. Copied the files from /usr/share/drupal7, and removed all the symbolic links, replacing with the contents from the files that they pointed. Give permission 775 to all files, and ran

/localhost:8888/debiangis/install.php

And it worked! Had to change the owner and group of the new directory to www-data, but now the site and the module install is working. Great!

Installed openlayers, http://drupal.org/project/openlayers

content creation kit, http://drupal.org/project/cck

views, http://drupal.org/project/views

ctools,

 

Integrating drupal and postgis

Integration of drupal and postgis is done using modules. One should be able to exchange data with the postgis and present a widget on drupal. This is accomplished with two plugins: drupal-postgis or geo:

geops: http://drupal.org/sandbox/geops/1212962

http://www.geops.de/blog/64-spatial-data-and-drupal-7

geo: http://drupal.org/project/geo

I’m testing now the integration of both on drupal, and the use of openlayers. But, as is usually happens on first deployment, some issues with the platform must be first solved. I will have to create a new drupal site, give it permissions, configure the vsftpd server, to be able to install new modules on drupal. So back to the wrench.

Building a Debian GIS server take 2

To test the reproducibility of the procedure, I’m doing a new install on a different virtual machine. Using Debian Wheezy netinstall, with Guided partitioning, LVM and encryption, standard installation. The image was downloaded from here:

http://cdimage.debian.org/debian-cd/6.0.3/amd64/iso-cd/debian-6.0.3-amd64-netinst.iso

No task was selected on installation, just the standard one. The only difference so far is that you have to type your passphrase every boot.

Packages installed:

apt-get --no-install-recommends install vim gcc g++ gfortran build-essential make

Now putting the backports in the sources.list to install postgresql, postgis, etc:

apt-get --no-install-recommends -t squeeze-backports postgresql-9.1 mapserver-bin cgi-mapserver python-mapscript apache2

Done! Installed. Now, to the configuration…

 

 

 

 

DebianGIS part 2: drupal + postgresql

To continue installation, I chose to use drupal as the CMS for my installation. This is workable, but I had to configure a bunch of stuff. For starters, had to install postgresql server, drupal 7, and the connection between php and postgre:

apt-get install drupal7 php5-pgsql
chown www-data /etc/drupal/7/sites/default/settings.php
cp /etc/drupal/7/sites/default/settings.php /etc/drupal/7/sites/default/default.settings.php
ln -s /etc/drupal/7/apache2.conf /etc/apache2/conf.d/drupal7.conf

The standard postgre and drupal documentation on the directory /usr/share/doc/ helped a lot to configure everything.Then, it’s time to configure drupal: go to localhost:8888/drupal7/install.php and start the standard installation procedure.

The other important part is to create the drupal database and configure everything. I’m using postgre, so the user and database have to be created. The debian way for postresql has some differences, so the command pg_ctl was changed to pg_ctlcluster, for some reason, so all documentation about it should be changed too.

There’s the way to create the database:

su - postgre
createuser --pwprompt --encrypted --no-adduser --no-createdb username

Note that createuser is a program. Now, the database:

createdb --encoding=UNICODE --owner=username databasename

It works! In case you type your password wrong _twice_, as I did when configuring the database, you can always change it logging in the postgre account, running psql, and inside psql, using the command

ALTER USER Postgres WITH PASSWORD '<newpassword>'

Done!

Building a Debian GIS server

Hello all,

For those who knows that now I’m between jobs (sort of), gonna post something different today. I’m building a Debian server for GIS applications, trying to find the best way to do it using only Debian stardand tools. So far, so good.

1) Installed a squeeze image from

http://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/

And configured backports (http://backports-master.debian.org/Instructions/) to get postgresql 9.1. So far, the apt.conf looks like this:

deb http://backports.debian.org/debian-backports squeeze-backports main

With the rest being the standard debian stuff. Note that the non-free and contrib reps are _not_ enabled.

2) Installed gcc, g++, gfortran, make, vim from standard reps.

3) Installed postgresql-9.1 with

apt-get --no-install-recommends install postgresql-9.1

Installed mapserver using

apt-get --no-install-recommends install mapserver-bin python-mapscript

After a few problems with the Virtualbox image – had to configure the brigde connections on the VM, then screwed the network cards, and had to put everything back working again.

Now the mapserver installation:

apt-get install cgi-mapserver python-mapscript mapserver-bin

It should go to localhost/cgi-bin/mapserv, and the server should return

No query information to decode. QUERY_STRING is set, but empty.

It works!

So first test: try to see a KML file on mapserver. So the library is installed:

apt-get install libkml0 gdal-bin

And now I need to learn how to create an mapserver map file. Is there an automatic way to do it? Let’s see.