Mostrando postagens com marcador python. Mostrar todas as postagens
Mostrando postagens com marcador python. Mostrar todas as postagens

Vim: Scientific calculator using python3

A couple of years ago I have been writing a post on this blog showing how to use python on vim in order to get scientific math results. Now, a little bit overdue I am proud of show you the same solution using python3.

Maybe it will be improvements, I hope so.

Android: Nada de Airdroid ou Whatsappweb

Cabra macho que usa linux cria um http server usando python:

    $ cd /home/somedir
  $ python -m SimpleHTTPServer


Depois ele pega o ip da máquina

    ifconfig

no meu caso o ip é: 192.168.25.151

Daí basta digitar no seu celular:

    http://192.168.25.151:8000

daí no seu android da vida baixa o arquivo sem maiores problemas

Python: Pequeno script para alterar o tempo de legendas no formato SRT

Publiquei no github um pequeno script que tem como propósito retardar ou adiantar o tempo de legendas nor formato "srt". Quem desejar fazer sugestões sinta-se a vontade.OBS: Antes de rodar o script instale as bibliotecas descritas no código.

Artigo em inglês comparando o ack o grin e o grep

Neste link
http://incise.org/searching-for-a-good-grep.html

Conheça o ack um concorrente matador para o grep

http://betterthangrep.com/

Para instala-lo na sua pasta ~/bin (caso tenha) é moleza

curl http://betterthangrep.com/ack-standalone > ~/bin/ack && chmod 0755 !#:3

O parâmetro final pega o nome do executável como parâmetro do chmod

Top 10 reasons to use ack instead of grep.

  1. It's blazingly fast because it only searches the stuff you want searched.
  2. ack is pure Perl, so it runs on Windows just fine.
  3. The standalone version uses no non-standard modules, so you can put it in your ~/bin without fear.
  4. Searches recursively through directories by default, while ignoring .svn, CVS and other VCS directories.
    • Which would you rather type?
      $ grep pattern $(find . -type f | grep -v '\.svn')
      $ ack pattern
  5. ack ignores most of the crap you don't want to search
    • VCS directories
    • blib, the Perl build directory
    • backup files like foo~ and #foo#
    • binary files, core dumps, etc
  6. Ignoring .svn directories means that ack is faster than grep for searching through trees.
  7. Lets you specify file types to search, as in --perl or --nohtml.
    • Which would you rather type?
      $ grep pattern $(find . -name '*.pl' -or -name '*.pm' -or -name '*.pod' | grep -v .svn)
      $ ack --perl pattern
    Note that ack's --perl also checks the shebang lines of files without suffixes, which the find command will not.
  8. File-filtering capabilities usable without searching with ack -f. This lets you create lists of files of a given type.
    $ ack -f --perl > all-perl-files
  9. Color highlighting of search results.
  10. Uses real Perl regular expressions, not a GNU subset.
  11. Allows you to specify output using Perl's special variables
    • Example: ack '(Mr|Mr?s)\. (Smith|Jones)' --output='$&'
  12. Many command-line switches are the same as in GNU grep:
    -w does word-only searching
    -c shows counts per file of matches
    -l gives the filename instead of matching lines
    etc.
  13. Command name is 25% fewer characters to type! Save days of free-time! Heck, it's 50% shorter compared to grep -r.

Há uma ferramenta similar feita em python
http://pypi.python.org/pypi/grin

Leia mais sobre o grin aqui.

Documentação do py3k e python em formato de ajuda do vim

Ajuda para a biblioteca do python 2
http://www.vim.org/scripts/script.php?script_id=3277#1.0

Installing this help file will give you access to the Python 2.7 standard library documentation as a Vim help file (available from within Vim by typing ":help py2stdlib"). For this release I've only tagged the module names (otherwise the help tagspace becomes too cluttered).
 
install details
1. Download the file.
2. Change to your $VIMRUNTIME directory (e.g., "cd ~/.vim").
3. Unarchive the file (e.g., "unzip ~/Downloads/py2stdlib.zip").
4. Change to the "doc" subdirectory (e.g., "cd doc").
5. Rebuild the tags: "vim -c  ":helptags . | :q"


para py3k
http://www.vim.org/scripts/script.php?script_id=3278#1.0

description
Installing this help file will give you access to the Python 3.1 standard library documentation as a Vim help file (available from within Vim by typing ":help py2stdlib"). For this release I've only tagged the module names (otherwise the help tagspace becomes too cluttered).
 
install details
1. Download the file.
2. Change to your $VIMRUNTIME directory (e.g., "cd ~/.vim").
3. Unarchive the file (e.g., "unzip ~/Downloads/py3stdlib.zip").
4. Change to the "doc" subdirectory (e.g., "cd doc").
5. Rebuild the tags: "vim -c  ":helptags . | :q"

videos Python para Manipulação de Áudio e Música Experimental

O Renato Fabbri criou alguns vídeos sobre manipulação de Audio e Música em python, estou divulgando seu trabalho

Python para Manipulação de Áudio e Música Experimental

1 - Página de rosto (alguns minutos)
Infos sobre a palestra que originou o vídeo e sobre o autor.
http://ubuntuone.com/p/DBL/

2- Linhas gerais da série de videos (alguns minutos)
Sobre os tópicos abordados e sua sequencia.
http://ubuntuone.com/p/DBM/

3- Introdução (alguns minutos)
Python e interesses da linguagem para áudio e música.
http://ubuntuone.com/p/DBN/

4- Bibiotecas (uma hora e uns 20 min)
Os módulos de interesse da biblioteca padrão vistos com código e
terminal interativo IPython. Falácia rápida sobre módulos externos a
serem abordados no próximo video.
http://ubuntuone.com/p/DBO/

Conhece o "detox"?

Detox is a utility designed to clean up filenames. It replaces difficult to work with characters, such as spaces, with standard equivalents. It will also clean up filenames with UTF-8 or Latin-1 (or CP-1252) characters in them.

sudo apt-get install detox

site: http://detox.sourceforge.net/

python solution: active-state

Calculando numeros primos em python

Este post surge inicialmente à partir do Project Euler: Diversão com programação e matemática, calculando números primos. Guardei a notícia no google reader e hoje estive lendo o site do José Lopes de Oliveira Júnior mais especificamente neste link sobre calculo de numeros primos, no exemplo é citado o "Crivo de Eratóstenes".

Fuçando na web achei um código que quero melhorar com a ajuda dos nobres leitores e saber se ele se enquadra na definição do Crivo de Eratóstens. Segue o código:

Obs: Nos comentários do post original -->>; Dica: use o crivo de eratóstenes. Dá pra fazer a solução rodar em menos de 1 segundo.

Veja este post.

linux-cookbook

Grupos do Google
Participe do grupo linux-cookbook
E-mail:
Visitar este grupo