Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Wednesday, September 22, 2010

Python: how to start learning?

Many (most?) people that want to start learning Python are confused about where to start. So many options! Motivated by this, I list in this post the references that I used to learn Python (and object-oriented programming as well), which can serve as a starting point for other people. I had scientists in mind when I wrote this post.

Beginner material

Learned the basic syntax and capabilities of the language with the official Python tutorial. You can download all of this as PDF files. I suggest this for people with previous programming experience. For absolute beginners, have a look at the Think Python book below.

Introductory lecture about Python, its syntax and science applications. It shows what Python is capable of for data analysis and plotting. Inspiring. The audio is also available for download as a MP3 file.

Tutorial on using Python for data analysis! How to on how to replace IDL/Matlab with Python, essentially. Includes: plotting, FITS files, signal processing.

I learned object-oriented programming using this material. Very clear and "application-oriented" approach. You don't need to be a biologist to understand this.

Longer introduction for people with no previous extensive programming experience.

Quick reference


Migrating from IDL/Matlab to Python.

If you are going to do serious stuff with Python, I suggest using the enhanced interactive Python terminal IPython.

Longer introductory books

Learning Python, Mark Lutz

A primer on scientific programming with Python, Hans Petter Langtangen

Longer reference books

Python essential reference, David Beazley

Wednesday, September 15, 2010

Switching from Windows/PC to Mac

OK, you got your shiny new Mac machine and switched from Windows to Mac OS X. What now? It happens that a friend of mine is going through that process and I assembled a list of links which might be useful for Mac newbies, which you can find below.

Switching from windows to mac, several tips and advice.

Several video tutorials made by Apple. Quick and simple.

My collection of mac-related links. Be sure to check out the following links:
- AlternativeTo.net: find alternative free software to commercial ones
- Mac OS X for scientists: Mac tutorial for scientists
- Best Mac software

Advice on your first Mac.

Sunday, April 18, 2010

Seminários de AstroProgramação

Ás vezes queremos aprender novas linguagens de programação, mas pela falta de tempo acabamos não conseguindo. Para acelerar o processo de aprendizado, está acontecendo no Departamento de Astronomia da UFRGS os Seminários de AstroProgramação: uma série de palestras informais, cada uma devotada a uma linguagem de programação diferente, com foco nos astrônomos.

A proposta é que a cada semana, um voluntário dê uma palestra a respeito das virtudes da linguagem de programação de sua escolha. Cada palestra deve apresentar um exemplo simples de programa (tipo "hello world"), bem como alguns códigos-fontes um pouco mais sofisticados que demonstrem a sintaxe básica etc. A duração das palestras é semelhante a de um seminário de grupo.

As linguagens abordadas foram: IDL, Perl, Python, C, Fortran 90, PHP, programação orientada a objetos com C++, paralelização (MPI) e Tcl/Tk.

Os slides apresentados nas palestras, bem como material adicional (códigos-fontes etc) estão disponíveis nesta página.



Changelog:
  • 23 Abr 2010: adicionei Tcl/Tk à lista.
  • 11 Jul 2010: removi OpenMP da lista.

Wednesday, November 11, 2009

Recovering deleted pictures from a memory card

A friend of mine recently deleted by accident around 700 pictures from a memory card in her Sony digital camera. She asked for my help and I thought that it would be an easy task to recover the pictures. I played with different programs aimed at data recovery, some of them tuned specifically for photo recovery. Here is a description of the different programs that I used and the results.

I've got several suggestions from colleagues of recovery software to try in linux and windows. I also found that this list of free data recovery programs at lifehacker was very useful.

This tutorial assumes that the memory card is formatted with the filesystem FAT16 (default filesystem in memory cards). The first thing you need to avoid is to write any data to the device where the deleted files were stored.

You should create an image of the device as soon as possible, in case anything goes wrong. In Linux that is pretty easy. Assuming that the memory card is mounted as /dev/sdb1, you need to issue the command
sudo dd if=/dev/sdb1 of=backupcard.img

I tried the following free software (ordered according to my taste): Recuva (win), recoverjpeg (linux/mac) and PhotoRec (win/linux/mac) (recoverjpeg and PhotoRec are available in Ubuntu via Synaptic). I also tried the commercial alternatives Stellar Phoenix Recovery (win) and Nucleus Kernel FAT (win). The latter two programs gave the same results as the three free programs listed above, so no need to pay for them.

The first program I tried was Recuva. It immediately recovered all the deleted files. Unfortunately most of the recovered pictures were corrupted or broken. By corrupted I mean that the pictures have one or more of the following "features":
  • Pictures split in two or more parts
  • In between a picture there is part of another photo
  • Colors changed
I would say that only 1/7 of the deleted pictures were successfully restored, and the rest had the problems specified above. I tried to fix these problems using JPEG Recovery (win), which allegedly would fix the corrupted pictures but got no success.

recoverjpeg gave the same results as Recuva: restored all the photos, but only ~1/7 of the original files were successfully recovered with no problems.

PhotoRec only recovered the ~1/7 pictures that had no problems, ignoring the other corrupted files.

My conclusion: if you use windows try Recuva. If you are a Linux user, try recoverjpeg. And please check this list of Five best free data recovery tools.

Thursday, October 15, 2009

Tutoriais sobre linux

Este post contém um material que enviei para algumas pessoas que estão iniciando no uso do linux. Pode ser útil aos usuários iniciantes.

Alguns comandos muito úteis no terminal do linux

TAB auto-completa comandos ou nomes de arquivos/diretórios
~ apelido para o caminho da tua home (exemplo: "cd ~" volta para a home)
whatis comando explica sucintamente pra que serve o comando
man comando manual do comando
whereis comando caminho onde está o programa responsável por comando
pwd mostra o caminho completo do diretório corrente

Tabelas de consulta rápida aos comandos

Printable beginner's guide to the terminal

Practical reference of linux commands

Páginas de referência (mais longas)

Guia Foca de Linux

Ubuntu pocket guide and reference (livro completo, grátis)

Linux tutorial for beginners

Alguém tem sugestões sobre bons livros para usuários iniciantes do linux/ubuntu? Escrevam nos comentários.
 
Locations of visitors to this page