Skip to content

Instantly share code, notes, and snippets.

View lpradovera's full-sized avatar

Luca Pradovera lpradovera

View GitHub Profile
ahn start .
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:318:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/associations.rb:1804:in `create_has_and_belongs_to_many_reflection'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/associations.rb:1411:in `has_and_belongs_to_many'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/autosave_association.rb:137:in `has_and_belongs_to_many'
from /opt/ahn/emed/models/language.rb:4
from /h
class Language < ActiveRecord::Base
set_table_name 'tab_lingue'
set_primary_key 'id'
has_and_belongs_to_many :persons, {
:join_table => "persone_x_tab_lingue",
:foreign_key => "tab_lingue_id",
:association_foreign_key => "persone_id"
}
end
{
"filtered" : {
"query" : {
"bool" : {
"should" : [
{
"text" : {
"title" : "Programmatore",
"boost" : 2
}
def self.exec_sql(sql)
18 sql = ActiveRecord::Base.connection();
19 sql.execute "SET autocommit=0";
20 sql.begin_db_transaction
21 sql.execute(sql)
22 sql.commit_db_transaction
23 end#exec
prado@SoftSpider:~$ curl -XDELETE http://localhost:9200/twitter
{"ok":true,"acknowledged":true}prado@SoftSpider:~$ curl -XPUT http://localhost:9200/twitter
{"ok":true,"acknowledged":true}prado@SoftSpider:~$ curl -XPUT http://localhost:9200/twitter/tweet/2 -d '{
> "user": "kimchy",
> "post_date": "2009-11-15T14:12:12",
> "message": "You know, for Search"
> }'
{"ok":true,"_index":"twitter","_type":"tweet","_id":"2","_version":1}prado@SoftSpider:~$ curl -XPOST http://localhost:9200/twitter/_refresh
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}prado@SoftSpider:~$
prado@SoftSpider:~$ curl -XGET "http://localhost:9200/twitter/_search?pretty=true&q=*"
luca@luca-acer:~/Downloads$ sudo dpkg -i nautilus-dropbox_0.6.9_amd64.deb
Selecting previously deselected package nautilus-dropbox.
(Reading database ... 140671 files and directories currently installed.)
Unpacking nautilus-dropbox (from nautilus-dropbox_0.6.9_amd64.deb) ...
dpkg: dependency problems prevent configuration of nautilus-dropbox:
nautilus-dropbox depends on libnautilus-extension1 (>= 1:2.22.2); however:
Version of libnautilus-extension1 on system is 2.30.1-2squeeze1.
dpkg: error processing nautilus-dropbox (--install):
dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils ...
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=================================-=================================-==================================================================================
pc nautilus-dropbox 0.6.9 Dropbox integration for Nautilus
[general]
;realm=127.0.0.1
context=incoming
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
allowguest=no
disallow=all
allow=ulaw
require 'active_support/core_ext/class/inheritable_attributes'
module RubySpeech
module SSML
class Element < Niceogiri::XML::Node
@@registrations = {}
class_inheritable_accessor :registered_ns, :registered_name
# Register a new stanza class to a name and/or namespace
it "should allow nested SSML elements" do
doc = RubySpeech::SSML.draw do
voice :gender => :male, :name => 'fred' do
string "Hi, I'm Fred. The time is currently "
say_as :interpret_as => 'date', :format => 'dmy' do
"01/02/1960"
end
end
end
voice = SSML::Voice.new(:gender => :male, :name => 'fred', :content => "Hi, I'm Fred. The time is currently ")