Skip to content

Instantly share code, notes, and snippets.

@talaj
talaj / test.png
Last active August 29, 2015 14:05
parameter binding
test.png
@talaj
talaj / bitshift.cpp
Created August 26, 2014 09:08
integral promotion
#include <iostream>
union TileId_t
{
uint64_t packed;
struct {
uint64_t y : 28;
uint64_t x : 28;
uint8_t z : 8;
@talaj
talaj / diff
Last active August 29, 2015 14:05
profiling: text rendering with line placement on corners in 3.x
This file has been truncated, but you can view the full file.
CPU: Intel Ivy Bridge microarchitecture, speed 2101 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
samples % diff % image name symbol name
1470396 22.5499 -5.9453 libfreetype.so.6.11.1 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.11.1
1111698 17.0489 -0.4756 ld-2.19.so do_lookup_x
908036 13.9256 +1.5524 libz.so.1.2.8 /lib/x86_64-linux-gnu/libz.so.1.2.8
650209 9.9716 -0.0209 no-vmlinux /no-vmlinux
550562 8.4434 +18.0841 libmapnik.so.3.0.0 mapnik::hextree<mapnik::rgba, mapnik::RGBAPolicy>::quantize(unsigned int) const
431761 6.6215 +0.2471 libmapnik.so.3.0.0 void mapnik::save_as_png8_hex<std::ostream, mapnik::ImageData<unsigned int> >(std::ostream&, mapnik::ImageData<unsigned int> const&, mapnik::png_options const&)
169181 2.5945 +4.8197 libmapnik.so.3.0.0 void mapnik::save_as_png8<std::ostream, mapnik::ImageDa
@talaj
talaj / fix_filemask
Last active August 29, 2015 14:06
fix filemask
update panorama set filemask = regexp_replace(filemask, '^00_', 'zz_') where source='topgis';
@talaj
talaj / mapnik-2.3-text-top-800-800-1.0-agg.png
Last active August 29, 2015 14:06
mapnik test vertical-alignment=top
mapnik-2.3-text-top-800-800-1.0-agg.png
@talaj
talaj / multiline.png
Last active August 29, 2015 14:09
Line height
multiline.png
@talaj
talaj / pocet_nasnapovanych.sql
Created January 16, 2015 11:49
Kontrola křižovatek
select count(*) from import.pm_junction_pt j
where (select 1 from import.pm_road_ln r
where routing is not null and
r.geometrie && j.geometrie and
(j.geometrie && ST_StartPoint(r.geometrie) or
j.geometrie && ST_EndPoint(r.geometrie)) limit 1) is not null;
@talaj
talaj / fix_kappa.sql
Created February 9, 2015 09:23
fix kappa
update panorama p1 set kappa=(180.0 / pi()) * st_azimuth(p1.the_geom, (select p2.the_geom from panorama p2 where p2.timestamp > p1.timestamp order by timestamp limit 1)) where filepath like '/topgis/Vltava20112012%';
@talaj
talaj / tv-rip
Last active November 28, 2015 06:03
mencoder
mplayer tv:// -tv driver=v4l2:width=720:height=576:device=/dev/video1:input=0:fps=25:alsa:amode=1:forcechan=2:audiorate=48000:adevice=hw.2,0:forceaudio:immediatemode=0
mencoder tv:// -tv driver=v4l2:width=720:height=576:device=/dev/video1:input=0:fps=25:alsa:amode=1:forcechan=2:audiorate=48000:adevice=hw.2,0:forceaudio:immediatemode=0 -ovc lavc -lavcopts vcodec=mpeg4 -oac mp3lame -o o.avi
mencoder tv:// -tv driver=v4l2:width=720:height=576:device=/dev/video1:input=0:fps=25:alsa:amode=1:forcechan=2:audiorate=48000:adevice=hw.2,0:forceaudio:immediatemode=0 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:v4mv:last_pred=2:dia=-1:vmax_b_frames=2:vb_strategy=1:cmp=3:subcmp=3:precmp=0:vqcomp=0.6:turbo -oac mp3lame -o x.avi
mencoder tv:// -tv driver=v4l2:width=720:height=576:device=/dev/video1:input=0:fps=25:alsa:amode=1:forcechan=2:audiorate=48000:adevice=hw.2,0:forceaudio:immediatemode=0 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:v4mv:last_pred=2:dia=-1:vmax_b_frames=2:vb_strategy=1:cmp=3:subcmp=3:precmp=0:vqcomp