original post http://vasnake.blogspot.com/2013/05/blog-post_7.html
Tools
Записки программиста, обо всем и ни о чем. Но, наверное, больше профессионального.
2013-05-07
Смешной перевод
original post http://vasnake.blogspot.com/2013/05/blog-post_7.html
Posted by
Valentin
at
16:55
0
comments
2013-05-06
Они о нас позаботятся
Posted by
Valentin
at
19:21
0
comments
2013-04-30
Intersect or not Disjoint
select *, st_asgeojson(1, st_transform(geom::geometry, 3857)) shape
from seisprof
where geom::geometry && ST_transform(
ST_GeomFromText(
'POLYGON((6593024.93074 10538006.4152, 6641944.62884 10538006.4152, 6641944.62884 10569039.8487, 6593024.93074 10569039.8487, 6593024.93074 10538006.4152))'
, 3857)
, st_srid(geom::geometry) );
select *, st_asgeojson(1, st_transform(geom::geometry, 3857)) shape
from seisprof
where not st_disjoint(
geom::geometry
,ST_transform(
ST_GeomFromText(
'POLYGON((6593024.93074 10538006.4152, 6641944.62884 10538006.4152, 6641944.62884 10569039.8487, 6593024.93074 10569039.8487, 6593024.93074 10538006.4152))'
, 3857)
, st_srid(geom::geometry) ) );
http://postgis.refractions.net/docs/reference.html#Spatial_Relationships_Measurements
original post http://vasnake.blogspot.com/2013/04/intersect-or-not-disjoint.html
Posted by
Valentin
at
18:26
0
comments
2013-04-29
Python Decimal & json.dumps/loads
File "c:\d\Python27\lib\json\encoder.py", line 178, in default
TypeError: Decimal('0E-11') is not JSON serializable
data = {'a': 'b', 'c': decimal.Decimal(3.14), 'd': decimal.Decimal('0E-11')}
text = simplejson.dumps(data, ensure_ascii=False, sort_keys=True, indent=2, use_decimal=True)
print text.encode(CP)
{
"a": "b",
"c": 3.140000000000000124344978758017532527446746826171875,
"d": 0E-11
}
data = {'a': 'b', 'c': decimal.Decimal(3.14), 'd': decimal.Decimal('0E-11')}
def jsonify(obj):
if isinstance(obj, decimal.Decimal):
return float(obj)
raise TypeError(repr(obj) + " is not JSON serializable")
text = simplejson.dumps(data, ensure_ascii=False, sort_keys=True, indent=2, default=jsonify, use_decimal=False)
print text.encode(CP)
{
"a": "b",
"c": 3.14,
"d": 0.0
}
Posted by
Valentin
at
17:45
0
comments
2013-04-26
Перенести вычисления к данным
original post http://vasnake.blogspot.com/2013/04/blog-post_26.html
Posted by
Valentin
at
13:33
0
comments
Labels: frameworks, HTML, JS
2013-04-25
Выравнивание
Posted by
Valentin
at
16:48
0
comments
2013-04-24
Crate.io
pip install yolk
$ pip install --index-url=https://simple.crate.io yolk
$ pip install --log=my-pip-debug.log --index-url=https://simple.crate.io yolk
Posted by
Valentin
at
15:24
0
comments
Labels: python
2013-04-23
CIA BigData
Posted by
Valentin
at
18:26
0
comments
2013-04-22
Internet Census 2012
Posted by
Valentin
at
17:17
0
comments
Labels: citation
2013-04-19
Python и анализ данных
Posted by
Valentin
at
17:28
0
comments
2013-04-18
Flask & DB connections
Posted by
Valentin
at
19:20
0
comments
Labels: DBMS, opensource, web-develop
2013-04-17
Eclipse autosave & word highlighting
Posted by
Valentin
at
16:05
0
comments
2013-04-16
Autocomplete, calltips for Python
def testFunc(lyrconf):
if 0: lyrconf = layermeta.LayerInfo()
def testFunc(lyrconf):
assert isinstance(lyrconf, layermeta.LayerInfo)
Posted by
Valentin
at
17:51
0
comments
Labels: IDE, programming, python
2013-04-15
XMPP bot for rus transliteration
- py trans https://github.com/zzzsochi/trans
- ALA-LC
- BGN/PCGN (1944)
- ISO 9:1995, ГОСТ 7.79-2000 система А
- ISO 9:1995, ГОСТ 7.79-2000 система Б
- ISO/R 9 (1968), ГОСТ 16876-71, СТ СЭВ 1362-78, ООН (1987) таблица 1
- ISO/R 9 (1968), ГОСТ 16876-71, СТ СЭВ 1362-78, ООН (1987) таблица 2
- Британский стандарт (1958)
- Водительское удостоверение (2000)
- ГОСТ Р 52535.1-2006
- Загранпаспорт (1997—2010)
- Международные телеграммы
- Научная
Posted by
Valentin
at
16:53
0
comments
Labels: im, opensource, python
2013-04-12
Komodo Edit & autosave
window.addEventListener("blur", function() {
ko.commands.doCommand("cmd_saveAll");
}, false);
|
Posted by
Valentin
at
16:30
0
comments
Labels: SciTE
2013-04-11
Komodo Edit & word highlighting
Posted by
Valentin
at
17:21
0
comments
Labels: SciTE
2013-04-10
SciTE and UTF-8
В интернетах много рекомендаций, как включить в SciTE кодировку UTF-8 по умолчанию:
#/home/valik/.SciTEUser.properties ext.lua.directory=$(SciteUserHome)/lua/scite_lua ext.lua.startup.script=$(SciteUserHome)/lua/extman.lua |
#/home/valik/lua/scite_lua/valik_cmd.lua function ToggleEncoding() if buffer and not buffer["MadeUTF8"] then scite.MenuCommand(IDM_ENCODING_UCOOKIE) buffer["MadeUTF8"] = true end return false end scite_OnOpen(ToggleEncoding) |
original post http://vasnake.blogspot.com/2013/04/scite-and-utf-8.html
Posted by
Valentin
at
16:08
2
comments
Labels: SciTE
2013-04-09
Слоупочта ускоряется
Posted by
Valentin
at
16:42
0
comments
Labels: бытовуха
2013-04-08
Github on premises
Posted by
Valentin
at
16:28
0
comments
Labels: opensource, VCS
2013-04-05
a2enmod ssl
aptitude install openssl mkdir -p /etc/ssl/localcerts openssl req -new -x509 -days 3650 -nodes -out /etc/ssl/localcerts/apache.pem -keyout /etc/ssl/localcerts/apache.key ls -la /etc/ssl/localcerts/ chmod 600 /etc/ssl/localcerts/apache* a2enmod ssl nano /etc/apache2/ports.conf nano /etc/apache2/sites-available/alwaysglum /etc/init.d/apache2 restart |
cat /etc/apache2/sites-available/alwaysglum
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/ssl/localcerts/apache.pem
SSLCertificateKeyFile /etc/ssl/localcerts/apache.key
Alias "/torr/" "/mnt/sams640/data/"
<Directory /mnt/sams640/data/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AuthType Basic
AuthUserFile /home/valik/.htpasswd
AuthName "Alwaysglum restricted services"
Require valid-user
</Directory>
</VirtualHost>
|
Posted by
Valentin
at
20:25
0
comments
Labels: HTTP. Apache, HTTPD, sysadm
2013-04-04
apache2-mpm-itk
nano /etc/apache2/sites-available/alwaysglum
<VirtualHost *:80>
AssignUserId valik root
...
|
aptitude install apache2-mpm-itk |
cat /etc/apache2/sites-available/alwaysglum <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName alwaysgloom.sytes.net ServerAlias alwaysgloom.sytes.net AssignUserId valik root DocumentRoot /var/www/ <Directory /> Options None AllowOverride None Order allow,deny </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> <Directory /var/www/files/> Options FollowSymLinks AuthType Basic AuthUserFile /home/valik/.htpasswd AuthName "Alwaysglum restricted services" Require valid-user </Directory> Alias "/torr/" "/mnt/sams640/data/" <Directory /mnt/sams640/data/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all AuthType Basic AuthUserFile /home/valik/.htpasswd AuthName "Alwaysglum restricted services" Require valid-user </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> |
Posted by
Valentin
at
16:33
0
comments
Labels: HTTP. Apache, sysadm
2013-04-03
CTK-3200
original post http://vasnake.blogspot.com/2013/04/ctk-3200.html
Posted by
Valentin
at
15:31
0
comments
2013-04-02
Duke Nukem
Posted by
Valentin
at
16:18
0
comments
Labels: game, opensource
2013-04-01
BIND 10
Posted by
Valentin
at
16:52
0
comments
Labels: DNS













