Tools
Записки программиста, обо всем и ни о чем. Но, наверное, больше профессионального.
2015-04-30
Debian 8 Jessie
Posted by
Valentin
at
23:37
0
comments
Labels: linux
2015-04-24
Functions
Posted by
Valentin
at
01:51
0
comments
Labels: functional programming
2015-04-19
Rear Window
Posted by
Valentin
at
03:41
0
comments
Labels: movie
2015-04-16
Сколько стоит помыть автомобиль
Posted by
Valentin
at
18:33
0
comments
2015-04-15
Replace a word with yanked text
yiw
|
yank inner word (copy word under cursor, say
"first").
|
|
...
|
Move the cursor to another word (say "second").
|
viwp
|
select "second", then replace
it with "first".
|
|
...
|
Move the cursor to another word (say "third").
|
viw"0p
|
select "third", then replace
it with "first".
|
"").
Yanking text also copies the text to register 0 ("0).
So the command yiw copies the current word to ""
and to "0.
viw selects the current word,
then pressing p pastes the unnamed register over the
visual selection. The visual selection that was just replaced is then
stored in the default unnamed register.
"0
register, as in viw"0p.cw. This method has the advantage of being easily
repeatable using the . repeat command.
yiw
|
yank inner word (copy word under cursor, say
"first". Same as above).
|
|
...
|
Move the cursor to another word (say "second").
|
ciw<C-r>0
|
select "second", then replace
it with "first" If you are at the start of the
word then
cw<C-r>0 is sufficient.
|
|
...
|
Move the cursor to another word (say "third").
|
.
|
select "third", then replace
it with "first".
|
Posted by
Valentin
at
02:07
0
comments
2015-04-14
Дрист
Posted by
Valentin
at
16:46
0
comments
Labels: gov.ru
2015-04-11
Outbreak
Posted by
Valentin
at
01:52
0
comments
Labels: movie
2015-04-10
Частное облако
Posted by
Valentin
at
20:47
0
comments
Labels: cloud
2015-04-07
Towing hook / towing eye
Posted by
Valentin
at
18:06
0
comments
Labels: driving
2015-04-06
process calculi
Posted by
Valentin
at
02:13
0
comments
Labels: science
2015-04-03
3 ярда
Posted by
Valentin
at
17:03
0
comments
Labels: bigdata
Liberal arts education
Posted by
Valentin
at
16:52
0
comments
Labels: Zope(Plone)
Refactoring
Posted by
Valentin
at
01:58
0
comments
Labels: programming
The Bucket List
Posted by
Valentin
at
01:41
0
comments
Labels: movie
2015-04-01
April fools' day
Posted by
Valentin
at
23:29
2
comments
Labels: driving
simplejson.dumps
su -l wget http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.9.tar.gz#md5=af5e67a39ca3408563411d357e6d5e47 tar xzvf simplejson-2.0.9.tar.gz cd simplejson-2.0.9 /opt/python24/bin/python setup.py install
return simplejson.dumps(
data,
ensure_ascii=False,
indent=' ',
encoding=const.NAU_CP,
default=jsonify,
sort_keys=True)
TypeError: can't multiply sequence by non-int
return simplejson.dumps(
data,
ensure_ascii=False,
indent=4,
encoding=const.NAU_CP,
default=jsonify,
sort_keys=True)
simplejson.dumps
Error DateTime('2015/03/18 02:33:44.625 GMT+3') is not JSON serializable
def jsonify(obj):
if hasattr(obj, 'isoformat'):
return obj.isoformat()
elif isinstance(obj, DateTime):
return '%s' % obj.HTML4()
else:
raise TypeError(
'Object of type %s with value of %s is not JSON serializable' %
(type(obj), repr(obj)))
return simplejson.dumps(
data,
ensure_ascii=False,
indent=4,
encoding=const.NAU_CP,
default=jsonify,
sort_keys=True)
Posted by
Valentin
at
02:49
0
comments
Labels: python, Zope(Plone)
Seven Pounds
Posted by
Valentin
at
02:14
0
comments
Labels: movie


















