Skip to content

Instantly share code, notes, and snippets.

View gist:6390369
#!/usr/bin/env ruby
class Test
def self.hello(name)
puts "hello #{name}"
end
def hello2(name)
puts "hello #{name}"
end
@pedrocr
pedrocr / sax-machine_xmlcodec_comparison.rb
Last active Dec 22, 2015
Comparing sax-machine and xmlcodec to parse an Atom feed
View sax-machine_xmlcodec_comparison.rb
#!/usr/bin/env ruby
ONGOING_URL="https://www.tbray.org/ongoing/ongoing.atom"
# For some reason net/http can't download the feed properly
XML_TEXT = IO.popen("curl -s #{ONGOING_URL}").read
## First with sax-machine
require 'sax-machine'
class SM_AtomContent
include SAXMachine
@pedrocr
pedrocr / gstlog.txt
Created Dec 28, 2013
gstreamer pipeline problem
View gstlog.txt
0:00:00.229955611 6344 0xb640c630 WARN rtpjitterbuffer rtpjitterbuffer.c:185:rtp_jitter_buffer_set_clock_rate: Clock rate changed from 0 to 90000
0:00:00.221349753 6344 0xb642a230 INFO GST_ELEMENT_PADS gstelement.c:894:gst_element_get_static_pad: no such pad 'sink' in element "fakesrc0"
0:00:00.231708351 6344 0xb642a230 FIXME default gstutils.c:3625:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.263849644 6344 0xb642a230 INFO GST_EVENT gstevent.c:709:gst_event_new_segment: creating segment event bytes segment start=0, stop=-1, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0, base=0, position 0, duration -1
0:00:00.264007764 6344 0xb642a230 INFO basesrc gstbasesrc.c:2778:gst_base_src_loop:<fakesrc0> marking pending DISCONT
0:00:00.264625162 6344 0xb642a230 INFO basesrc gstbasesrc.c:2674:gst_base_src_loop:<fakesrc0> paus
@pedrocr
pedrocr / gist:9650800
Created Mar 19, 2014
Initializer to change the database
View gist:9650800
BASESPEC = {adapter: "sqlite3",
database: "db/production.sqlite3",
pool: 5,
timeout: 5000}
if Camerasink::BASEDIR
$stderr.puts "Starting the app on #{Camerasink::BASEDIR}"
dbfile = File.expand_path(BASESPEC[:database], Camerasink::BASEDIR)
ActiveRecord::Base.establish_connection BASESPEC.merge(database: dbfile)
ActiveRecord::Migrator.migrate("db/migrate/")
View gist:fe76fef75ffd48d6b739
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff49b97700 (LWP 15419)]
__memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:35
35 ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory.
(gdb) bt
#0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:35
#1 0x00007ffff79e0eb9 in _default_process_tiling_roi._omp_fn.1 ()
at /usr/include/x86_64-linux-gnu/bits/string3.h:51
#2 0x00007ffff2a2034a in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#3 0x00007ffff6d75182 in start_thread (arg=0x7fff49b97700) at pthread_create.c:312
View gist:25bbf96494a8540c171e
/opt/darktable/bin/darktable-cli X100SFAR2I00200.RAF test.jpg --core -d perf
[export] creating pixelpipe took 0,179 secs (0,213 CPU)
[dev_pixelpipe] took 0,122 secs (0,015 CPU) initing base buffer [export]
[dev_pixelpipe] took 0,003 secs (0,010 CPU) processing `let's go float!' on CPU, blending on CPU [export]
[dev_pixelpipe] took 0,003 secs (0,010 CPU) processing `white balance' on CPU, blending on CPU [export]
[dev_pixelpipe] took 0,004 secs (0,012 CPU) processing `highlight reconstruction' on CPU, blending on CPU [export]
[dev_pixelpipe] took 0,007 secs (0,013 CPU) processing `demosaic' on CPU, blending on CPU [export]
[dev_pixelpipe] took 1,987 secs (4,624 CPU) processing `scale pixels' on CPU with tiling, blending on CPU [export]
Segmentation fault (core dumped)
View gist:6adcc662c18af74343d2
$ /opt/darktable/bin/darktable-cli X100SFAR2I00200.RAF test.jpg --core -d dev -d perf
[export] creating pixelpipe took 0,181 secs (0,222 CPU)
pixelpipe cacheline 0 used 0 by 18446744073709551615
pixelpipe cacheline 1 used 0 by 18446744073709551615
cache hit rate so far: -nan
[dev_pixelpipe] took 0,184 secs (0,024 CPU) initing base buffer [export]
[dev_pixelpipe] took 0,004 secs (0,008 CPU) processing `let's go float!' on CPU, blending on CPU [export]
[dev_pixelpipe] took 0,004 secs (0,012 CPU) processing `white balance' on CPU, blending on CPU [export]
[dev_pixelpipe] took 0,004 secs (0,012 CPU) processing `highlight reconstruction' on CPU, blending on CPU [export]
[dev_pixelpipe] took 0,006 secs (0,014 CPU) processing `demosaic' on CPU, blending on CPU [export]
@pedrocr
pedrocr / gist:073a47d220875247a595
Last active Aug 29, 2015
Test run of dt with the 699 hanatos branch
View gist:073a47d220875247a595
$ rm -f *.xmp && ../rundt
[mipmap_cache] cache is empty, file `cache//mipmaps-d2a987c9a21006c6c529327a4b925b649166fcc3' doesn't exist
# Opened darkroom on a D1x NEF
3 Running reload_defaults for colorin
3 Running reload_defaults for colorin
3 Running gui_update for colorin
3 Running gui_update for colorin
# Pressed space and moved to a JPG
@pedrocr
pedrocr / gist:37790485eeb84fb000ec
Last active Aug 29, 2015
New cameras in rawspeed in darktable 1.6.0
View gist:37790485eeb84fb000ec
Canon EOS 10D
Canon EOS 300D DIGITAL
Canon EOS 7D Mark II
Canon EOS D30
Canon EOS D60
Canon PowerShot A610
Canon PowerShot A620
Canon PowerShot A640
Canon PowerShot A650
Canon PowerShot A720 IS
@pedrocr
pedrocr / gist:c2f6c4364f08cdf6feae
Last active Aug 29, 2015
XMP diff in broken UTF8 file
View gist:c2f6c4364f08cdf6feae
--- RAW_PENTAX_K20D.PEF.1.4 2014-12-30 14:46:57.206753991 +0000
+++ RAW_PENTAX_K20D.PEF.1.6 2014-12-30 14:47:16.738804006 +0000
@@ -62,9 +62,7 @@
</darktable:multi_name>
<dc:subject>
<rdf:Seq>
- <rdf:li>4</rdf:li>
<rdf:li>Bayern</rdf:li>
- <rdf:li>DEU</rdf:li>
<rdf:li>Deutschland</rdf:li>