Август 2010

Efficient Editing With vim

22.08.2010

Efficient Editing With vim

Translations of this article are available in German (Effiziente Textbearbeitung mit Vim), French (L’�dition efficace avec vim), Italian (Vim e Gvim: usarli in modo efficiente, and Chinese (高效使用vim).


«To me, vi is Zen.
To use vi is to practice zen.
Every command is a koan.
Profound to the user,
unintelligible to the uninitiated.
You discover truth every time you use it.»
--reddy@lion.austin.com

This tutorial assumes a basic knowledge of vim — insert mode, command mode, loading and saving files, etc. It is intended to help vi novices develop their skills so that they can use vi efficiently.

In this tutorial, <C-X> means Ctrl-X — that is, hold down the Ctrl key and press X. You can get help on most of the commands used here by typing :help command in vim, where command is what you need help on.

Moving efficiently

Stay out of insert mode

In general, you want to spend as little of your time in vim’s insert mode as possible, because in that mode it acts like a dumb editor. This is why most vim novices spend so much time in insert mode — it makes vim easy to use. But vim’s real power lies in command mode! You’ll find that the better you know vim, the less time you will spend in insert mode. (далее…)

VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)

Удаление дубликатов из БД PostgreSQL

16.08.2010

Иногда бывают ситуации когда в базе одни и те же данные повторяются несколько раз. Например благодаря ошибке вашего интерна.  Ниже описан путь, как их удалить.

Предполагаем что у вас есть таблица  foo,  которая содержит текстовое поле называющееся contents и оно повторяется.

Я использовал базу с 30.000 строк, из которых 8000 были дубликаты, которые следовало удалить. (далее…)

VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.11_1134]
Rating: -2 (from 2 votes)