Skip to content

Instantly share code, notes, and snippets.

View besquared's full-sized avatar

Josh Ferguson besquared

View GitHub Profile
## I the userInfo object
'get_field' : info.getField,
I alias the get_field object to get platform specific stuff.
## The people/person fields
if(typeof(MyOpenSpace) != "undefined") {
fields.push(
ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?) on line #1 of news/_battled.html.erb:
1: <% collapse_battles(battle, consumer) do |collection| %>
2: <% if consumer == collection.last.winner || (consumer.is_a?(User) && collection.last.winner_ids.include?(consumer.id)) %>
3: <%= render :partial => 'news/won_battle', :locals => {:collection => collection, :useyou => useyou, :consumer => consumer} %>
4: <% else %>
HFile.dir('/sectors/integrated').each do |account|
account_id = account.split('/').last
HFile.dir(account).each do |collection|
HFile.dir(collection).each do |type|
HFile.dir(type).each do |dataset|
puts dataset
end
end
end
end
<add><doc><field name='id'>cartographer::observation:mykey</field><field name='type_s'>cartographer::observation</field><field name='pk_s'>mykey</field><field name='account_s'>my account</field><field name='application_s'>awesome gametacular</field><field name='type_s'>activities</field><field name='dataset_s'>purchases</field><field name='hour_ri'>400126</field><field name='file_s'>abcze.tab.gz2</field><field name='size_ri'>124385</field></doc></add>
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="pk_i" type="integer" indexed="true" stored="true"/>
<field name="pk_s" type="string" indexed="true" stored="true"/>
<field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_i" type="integer" indexed="true" stored="false"/>
<dynamicField name="*_t" type="text" indexed="true" stored="false"/>
obs = Cartographer::Observation.search('application:friend')
=> #<OpenStruct found=1, start=0, score=nil, max_score=0.60081923, documents=[#<Cartographer::Observation:0xca548b @attributes={:account=>"80c27664-b047-4c0a-86f3-342c0cdf36c7", :file=>"bXKLVAfGvp7R2oryH1wIT7.tab.bz2", :dataset=>"purchases", :size=>392482, :application=>"friends for sale", :created_at=>1228640870, :type=>"activities", :pk=>"mykey", :hour=>340875, :dt=>"cartographer::observation", :score=>0.60081923}, @key="mykey", @errors=[]>]>
def histogram(numbers)
hist = {}
numbers.each do |n|
hist[n] = 0 if hist[n].nil?
hist[n] += 1
end
hist
end
#
INSERT INTO `invoices`
(
`customer_po`, '',
`shipping_address_id`, NULL,
`updated_at`, NULL,
`amount_percent_discount`, NULL,
`billing_address_id`, 42,
`deleted_at`, NULL,
`created_by`, 0,
`invoice_date`, '2008-12-11 22:22:54',
0 18.18 5113
1 72.73 10003
2 100.00 10216
3 81.82 10037
4 27.27 9836
5 54.55 9966
6 45.45 9943
7 63.64 9979
8 90.91 10076
9 36.36 9865
hive> DESCRIBE EXTENDED measurements;
OK
groups string
value double
measure string
account string
application string
dataset string
hour int
span int
setupFields: function() {
var self = this;
this.form.getElements('input').each(
function(input) {
self.addInput(input);
}
);
this.form.getElements('select').each(
function(select) {